*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;color:#173b64;background:#f4f9fd;background-image:radial-gradient(circle at 4% 18%,#e21f2f55 0 5px,transparent 6px),radial-gradient(circle at 96% 30%,#f5bd1677 0 6px,transparent 7px),radial-gradient(circle at 7% 78%,#1695d355 0 5px,transparent 6px)}
.leaderboard-page{max-width:1120px;margin:auto;padding:20px}.leaderboard-page header{display:flex;align-items:center;justify-content:space-between;gap:15px}.leaderboard-page header img{object-fit:contain;max-width:35%;height:auto}.leaderboard-page .memo-online{margin:20px 0;max-width:none;background:rgba(255,255,255,.5)}
.ranking-controls{display:flex;flex-wrap:wrap;gap:12px;margin:18px 0}.ranking-controls label{flex:1 1 220px;min-width:0}.ranking-controls [hidden]{display:none!important}.leaderboard-page .memory-round{text-align:center;margin-top:12px}.leaderboard-page .memory-round h2{font-size:clamp(1.7rem,5vw,2.6rem)}#ranking-status{min-height:1.5em}
@media(max-width:420px){.leaderboard-page{padding:12px}.leaderboard-page header{flex-wrap:wrap}.ranking-controls{gap:0}}

/* Seitenhintergrund wie auf der Anleitung: Luftschlangen und Konfetti */
body{position:relative;overflow-x:hidden;background:#fff}
body::before,body::after{
 content:"";position:fixed;top:0;bottom:0;z-index:0;pointer-events:none;
 width:min(23vw,320px);opacity:.72;background-repeat:repeat-y;background-size:100% 720px;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='720' viewBox='0 0 300 720'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M18 20 C130 85 18 155 122 220 S42 360 142 425 S35 565 125 650' stroke='%23e33b46' stroke-width='12'/%3E%3Cpath d='M252 55 C155 120 270 195 174 270 S260 410 160 485 S245 610 170 690' stroke='%231b78c4' stroke-width='11'/%3E%3Cpath d='M75 0 C165 70 55 130 154 205 S65 335 165 400' stroke='%23f2c431' stroke-width='10'/%3E%3C/g%3E%3Cg opacity='.85'%3E%3Ccircle cx='42' cy='285' r='5' fill='%231b78c4'/%3E%3Ccircle cx='245' cy='340' r='5' fill='%23e33b46'/%3E%3Ccircle cx='80' cy='525' r='5' fill='%23f2c431'/%3E%3Crect x='205' y='160' width='8' height='18' rx='2' fill='%23f2c431' transform='rotate(28 209 169)'/%3E%3Crect x='32' y='440' width='8' height='18' rx='2' fill='%23e33b46' transform='rotate(-25 36 449)'/%3E%3Crect x='232' y='575' width='8' height='18' rx='2' fill='%231b78c4' transform='rotate(30 236 584)'/%3E%3C/g%3E%3C/svg%3E");
}
body::before{left:0}
body::after{right:0;transform:scaleX(-1)}
.game-shell,.leaderboard-page{position:relative;z-index:1}
@media(max-width:700px){body::before,body::after{width:34vw;opacity:.38;background-size:100% 620px}}

/* Eigener Bestenlisten-Eintrag */
#ranking-rows tr.is-current-player{font-weight:900;outline:0}
#ranking-rows tr.is-current-player td:first-child::after{content:' · Du';font-size:.72em;font-weight:900}

/* Aktionen unter der Bestenliste */
.ranking-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px}
.ranking-actions button,.ranking-actions .memo-nav-button{margin:0}
@media(max-width:420px){.ranking-actions>*{flex:1 1 auto}.ranking-actions .memo-nav-button{min-width:140px}}

/* Podiumsfarben: Platz 1 gelb, Platz 2 blau, Platz 3 rot */
#ranking-rows tr:nth-child(1) td{background:#f5bd16;color:#173b64;font-weight:900}
#ranking-rows tr:nth-child(2) td{background:#1695d3;color:#fff;font-weight:900}
#ranking-rows tr:nth-child(3) td{background:#e21f2f;color:#fff;font-weight:900}

/* Top 10 ohne Rahmen/Trennlinien */
#ranking-rows td{border:0!important}

/* Bestenliste – CI-Farbfolge: 1 Rot, 2 Weiß, 3 Blau, 4 Gelb, 5–10 dezent grau; alles ohne Rahmen */
#ranking-rows tr:nth-child(1) td{background:#e21f2f;color:#fff;font-weight:900}
#ranking-rows tr:nth-child(2) td{background:#fff;color:#173b64;font-weight:900}
#ranking-rows tr:nth-child(3) td{background:#1695d3;color:#fff;font-weight:900}
#ranking-rows tr:nth-child(4) td{background:#f5bd16;color:#173b64;font-weight:900}
#ranking-rows tr:nth-child(n+5):nth-child(-n+10) td{background:#f4f4f4;color:#173b64}
#ranking-rows tr,#ranking-rows td{border:0!important;outline:0!important;box-shadow:none!important}

/* Beide Bestenlisten-Aktionen bewusst identisch */
.ranking-actions #ranking-refresh,.ranking-actions #ranking-continue{
 display:inline-flex;align-items:center;justify-content:center;
 min-height:44px;padding:11px 18px;margin:0;
 border:0;border-radius:999px;
 background:#164f8b;color:#fff;
 text-decoration:none;font:inherit;font-weight:700;line-height:1.3;text-align:center;
 cursor:pointer;box-shadow:none;
}
.ranking-actions #ranking-refresh:hover,.ranking-actions #ranking-continue:hover{background:#103b60;color:#fff}
.ranking-actions #ranking-refresh:focus-visible,.ranking-actions #ranking-continue:focus-visible{outline:3px solid #e21f2f;outline-offset:3px}

/* SKTC: Links ohne Unterstreichung in allen Zuständen. */
a:any-link,a:any-link:hover,a:any-link:focus,a:any-link:focus-visible,a:any-link:active,a:any-link *{text-decoration:none!important}

/* SKTC: Flache Formularfelder ohne native 3D-Raender. */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="color"]),textarea,select){
 appearance:none;-webkit-appearance:none;box-shadow:none!important;background-image:none;border:1px solid #8b96a3!important;border-radius:8px;background-color:rgba(255,255,255,.8);color:inherit;font:inherit;box-sizing:border-box;
}
:where(input,textarea,select):focus-visible{outline:2px solid #224579;outline-offset:2px;box-shadow:none!important}
select{padding-right:2rem!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2330343b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right .65rem center!important;background-size:16px!important}
select[multiple],select[size]:not([size="1"]){background-image:none!important;padding-right:.65rem!important}
input[type="file"]::file-selector-button{border:1px solid #8b96a3;border-radius:8px;background:#f2f5f9;color:#30343b;box-shadow:none;font:inherit;padding:.5rem .8rem}

/* SKTC: Aktionsbuttons in Modal-Fenstern linksbuendig. */
:is(dialog,[role="dialog"],.modal-content) :is(button,input[type="submit"],input[type="button"],input[type="reset"],a.button,a.btn):not(.modal-close):not(.story-close):not(.close):not(.btn-close):not([aria-label][data-close]:empty){margin-left:0!important;margin-right:auto!important;align-self:flex-start!important}
:is(dialog,[role="dialog"],.modal-content) :is(.modal-footer,.dialog-actions,.modal-actions,.form-actions,.actions,.button-row){justify-content:flex-start!important;text-align:left!important}
:is(dialog,[role="dialog"],.modal-content) :is(form,.button-group,.buttons){text-align:left}
