/* ══════════════════════════════════════════════════════════════════════════════
   KelRaid — standalone base-raid game (kelraid.bymw.de)
   Base page + landing + auth shell, followed by the in-game .cok-* rules.
   ══════════════════════════════════════════════════════════════════════════════ */
:root {
    --kr-bg: #070b16; --kr-bg2: #0d1424; --kr-card: #131c30; --kr-line: rgba(255,255,255,.10);
    --kr-ink: #eaf2ff; --kr-mut: #9db0d0; --kr-mag: #e04fe0; --kr-teal: #37f2a3; --kr-gold: #ffd23f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: radial-gradient(1200px 700px at 50% -10%, #1a1140 0%, var(--kr-bg) 55%) fixed, var(--kr-bg);
    color: var(--kr-ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%; overflow-x: hidden; min-height: 100dvh;
}
a { color: #7fc0ff; }
img { max-width: 100%; }

/* ── landing ─────────────────────────────────────────────────────────────── */
/* parallax background layers (soft brand blobs + faint iso grid) */
.kr-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.kr-blob { position: absolute; border-radius: 50%; filter: blur(64px); opacity: .5; will-change: transform; }
.kr-blob.b1 { width: 62vw; height: 62vw; left: -18vw; top: -14vw; background: radial-gradient(circle, rgba(224,79,224,.55), transparent 70%); }
.kr-blob.b2 { width: 56vw; height: 56vw; right: -18vw; top: 36vh; background: radial-gradient(circle, rgba(55,242,163,.30), transparent 70%); }
.kr-blob.b3 { width: 48vw; height: 48vw; left: 22vw; bottom: -18vw; background: radial-gradient(circle, rgba(63,120,255,.28), transparent 70%); }
.kr-grid-bg { position: absolute; inset: -12%; opacity: .05; will-change: transform;
    background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 18%, #000 0%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 18%, #000 0%, transparent 72%); }

.kr-wrap { max-width: 900px; margin: 0 auto; position: relative; z-index: 1; padding: calc(env(safe-area-inset-top,0px) + 24px) 20px calc(env(safe-area-inset-bottom,0px) + 48px); }
.kr-brand { display: flex; align-items: center; gap: 13px; font-weight: 900; font-size: 22px; letter-spacing: -.02em; }
.kr-brand .logo { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 6px 16px rgba(224,79,224,.4)); }
.kr-brand b { color: var(--kr-mag); }
.kr-hero { text-align: center; padding: 42px 0 6px; }
.kr-hero .badge { display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--kr-teal); background: rgba(55,242,163,.10); border: 1px solid rgba(55,242,163,.28); padding: 5px 13px; border-radius: 999px; }
.kr-hero h1 { font-size: clamp(33px, 8.4vw, 58px); line-height: 1.03; margin: 20px 0 14px; letter-spacing: -.035em; font-weight: 900; }
.kr-hero h1 em { font-style: normal; background: linear-gradient(115deg, #ff6bc1, #c79bff 60%, #7fd0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kr-hero p.lead { font-size: 17.5px; line-height: 1.55; color: #c3d0e6; max-width: 600px; margin: 0 auto 28px; }
.kr-hero p.lead b { color: var(--kr-ink); }
.kr-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.kr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 16px; padding: 15px 26px; border-radius: 15px; border: 0; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.kr-btn.primary { background: linear-gradient(180deg, #ff5db1, var(--kr-mag)); color: #fff; box-shadow: 0 6px 0 rgba(120,20,110,.5), 0 10px 26px -10px rgba(224,79,224,.7); }
.kr-btn.ghost { background: rgba(255,255,255,.05); color: var(--kr-ink); border: 1.5px solid var(--kr-line); }
@media (hover: hover) { .kr-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(120,20,110,.5), 0 16px 34px -10px rgba(224,79,224,.8); } .kr-btn.ghost:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); } }
.kr-btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(120,20,110,.5); }
.kr-shot { position: relative; margin: 46px auto 0; max-width: 780px; border-radius: 22px; border: 1px solid var(--kr-line);
    overflow: hidden; background: #0a1120; box-shadow: 0 44px 100px -34px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.04); }
.kr-shot img { display: block; width: 100%; height: auto; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .kr-shot { animation: kr-float 6.5s ease-in-out infinite; } }
@keyframes kr-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.kr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; margin: 48px 0; }
.kr-feat { background: linear-gradient(180deg, rgba(19,28,48,.86), rgba(13,20,36,.86)); border: 1px solid var(--kr-line); border-radius: 18px; padding: 22px; transition: transform .15s, border-color .15s; }
@media (hover: hover) { .kr-feat:hover { transform: translateY(-3px); border-color: rgba(224,79,224,.38); } }
.kr-feat .ic { font-size: 32px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
.kr-feat h3 { margin: 12px 0 6px; font-size: 17px; }
.kr-feat p { margin: 0; color: var(--kr-mut); font-size: 14px; line-height: 1.55; }

.kr-card { background: var(--kr-card); border: 1px solid var(--kr-line); border-radius: 18px; padding: 24px; margin: 24px 0; }
.kr-card h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.02em; }
.kr-card > p.sub { margin: 0 0 16px; color: var(--kr-mut); font-size: 14.5px; }
.kr-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
/* Normal block li with an absolutely-positioned number badge — so the inline text (incl. <b>)
   flows naturally. (A grid li turns every <b> into its own cell → words stack vertically.) */
.kr-steps li { counter-increment: s; position: relative; padding-left: 42px; min-height: 28px; font-size: 15px; line-height: 1.55; }
.kr-steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(224,79,224,.16); color: #f7b6f7; font-weight: 900; font-size: 14px; }
.kr-steps li b { color: var(--kr-ink); }
.kr-plat { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kr-plat span { font-size: 13px; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--kr-line); }

.kr-foot { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--kr-line); text-align: center; color: var(--kr-mut); font-size: 13.5px; line-height: 1.9; }
.kr-foot a { color: var(--kr-mut); text-decoration: none; margin: 0 9px; }
.kr-foot a:hover { color: var(--kr-ink); text-decoration: underline; }

/* ── auth (register / login) ─────────────────────────────────────────────── */
.kr-auth-back { position: fixed; inset: 0; z-index: 300; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: radial-gradient(900px 600px at 50% -10%, #1a1140 0%, var(--kr-bg) 60%) fixed, var(--kr-bg);
    padding: calc(env(safe-area-inset-top,0px) + 24px) 18px calc(env(safe-area-inset-bottom,0px) + 24px); }
.kr-auth { max-width: 420px; margin: 0 auto; }
.kr-auth .kr-brand { justify-content: center; margin-bottom: 18px; }
.kr-auth-card { background: var(--kr-card); border: 1px solid var(--kr-line); border-radius: 20px; padding: 26px 22px; box-shadow: 0 24px 60px -24px rgba(0,0,0,.7); }
.kr-auth-card h2 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.kr-auth-card .sub { text-align: center; color: var(--kr-mut); font-size: 14px; margin: 0 0 20px; }
.kr-field { margin-bottom: 14px; }
.kr-field label { display: block; font-size: 13px; font-weight: 700; color: var(--kr-mut); margin-bottom: 6px; }
.kr-field input { width: 100%; padding: 13px 14px; font-size: 16px; border-radius: 12px; border: 1.5px solid var(--kr-line); background: #0b1220; color: var(--kr-ink); }
.kr-field input:focus { outline: none; border-color: var(--kr-mag); }
.kr-hint { font-size: 12.5px; line-height: 1.5; color: #d9c2f0; background: rgba(224,79,224,.10);
    border: 1px solid rgba(224,79,224,.24); border-radius: 12px; padding: 10px 12px; margin: -2px 0 14px; }
.kr-pass-wrap { position: relative; }
.kr-pass-wrap input { width: 100%; padding-right: 46px; }
.kr-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    border: 0; background: transparent; color: #9db0d0; cursor: pointer; font-size: 17px; border-radius: 10px; line-height: 1; }
.kr-eye:hover { background: rgba(255,255,255,.06); color: #eaf2ff; }
.kr-switch + .kr-switch { margin-top: 8px; }
.kr-auth-card .kr-btn { width: 100%; margin-top: 6px; }
.kr-msg { font-size: 14px; padding: 11px 14px; border-radius: 11px; margin-bottom: 14px; display: none; }
.kr-msg.err { display: block; background: rgba(255,80,96,.12); border: 1px solid rgba(255,80,96,.35); color: #ffb0b8; }
.kr-msg.ok { display: block; background: rgba(55,242,163,.12); border: 1px solid rgba(55,242,163,.35); color: #9affce; }
.kr-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--kr-mut); }
.kr-switch a { cursor: pointer; color: #7fc0ff; font-weight: 700; }
.kr-auth-legal { text-align: center; font-size: 12px; color: var(--kr-mut); margin-top: 16px; line-height: 1.7; }
.kr-auth-legal a { color: var(--kr-mut); }
.kr-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: kr-spin .7s linear infinite; }
@keyframes kr-spin { to { transform: rotate(360deg); } }

/* the game itself replaces the auth/landing view; a small "boot" splash while loading */
.kr-boot { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: var(--kr-bg); }
.kr-boot .logo { width: 84px; height: 84px; animation: kr-pulse 1.4s ease-in-out infinite; }
@keyframes kr-pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }

/* ══════════════════════════════════════════════════════════════════════════════
   KelRaid in-game overlay (namespaced .cok-*, dark canvas game)
   ══════════════════════════════════════════════════════════════════════════════ */
body.kk-cok-open { overflow: hidden; }
.cok-root { position: fixed; inset: 0; z-index: 200; background: #060a15; color: #eaf2ff;
    font-family: system-ui, -apple-system, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
.cok-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cok-hud { position: absolute; inset: 0; pointer-events: none; z-index: 2;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 8px) calc(env(safe-area-inset-bottom, 0px) + 10px) calc(env(safe-area-inset-left, 0px) + 8px);
    display: flex; flex-direction: column; }
.cok-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cok-top > * { pointer-events: auto; }
.cok-hq { background: rgba(63,107,255,.22); border: 1px solid rgba(120,150,255,.45); color: #cfe0ff;
    font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.cok-res { display: flex; align-items: center; gap: 6px; background: rgba(10,18,34,.72); border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px; padding: 4px 9px 4px 7px; min-width: 108px; }
.cok-res .i { font-size: 15px; }
.cok-res .col { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.cok-res .t { font: 700 11px/1 ui-monospace, monospace; color: #eaf2ff; }
.cok-res .bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.cok-res.dc .fill { background: #42b6ff; } .cok-res.en .fill { background: #ffcf3f; }
.cok-res .fill { height: 100%; width: 0; border-radius: 3px; transition: width .3s; }
.cok-trophy { margin-left: auto; background: rgba(255,210,63,.16); border: 1px solid rgba(255,210,63,.4); color: #ffe08a;
    font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.cok-back { pointer-events: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16);
    background: rgba(10,18,34,.8); color: #eaf2ff; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.cok-actions { margin-top: auto; display: flex; gap: 10px; justify-content: center; }
.cok-actions > * { pointer-events: auto; }
.cok-banner { pointer-events: none; align-self: center; margin: 10px auto 0; background: rgba(10,18,34,.85);
    border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 7px 15px; font-size: 12.5px; font-weight: 600; color: #cfe0ff; }
.cok-banner.hidden, .cok-btn.hidden { display: none; }

.cok-btn { pointer-events: auto; border: 1px solid rgba(255,255,255,.16); background: rgba(20,30,52,.92); color: #eaf2ff;
    font: 700 15px/1 system-ui; padding: 13px 22px; border-radius: 14px; cursor: pointer; }
.cok-btn.primary { background: linear-gradient(180deg,#2f7fe0,#2566c4); border-color: #3f8bff; }
.cok-btn.gold { background: linear-gradient(180deg,#ffd23f,#f0a91e); border-color: #ffdf6b; color: #1a1206; }
.cok-btn.ghost { background: rgba(20,30,52,.7); }
.cok-btn.block { display: block; width: 100%; margin-top: 8px; }
.cok-btn.sm { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.cok-btn.off { opacity: .45; }
.cok-btn:active { transform: translateY(1px); }

/* overlay sheets (shop / building / matchmaking / result) */
.cok-overlay { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.cok-scrim { position: absolute; inset: 0; background: rgba(3,6,14,.6); pointer-events: auto; }
.cok-sheet-wrap { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: min(520px, calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    pointer-events: auto; padding: 0 10px calc(env(safe-area-inset-bottom, 0px) + 12px); }
/* Both content types share ONE card look: .cok-sheet = full menus, .cok-pop = short action popups
   (building tap menu). Keeping them identical means every KelRaid page behaves the same everywhere. */
.cok-sheet, .cok-pop { background: #0e1a30; border: 1px solid rgba(255,255,255,.12); border-radius: 18px 18px 14px 14px;
    padding: 15px; box-shadow: 0 -8px 40px rgba(0,0,0,.5); max-height: 78vh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; animation: cok-up .22s ease; }
.cok-sheet::-webkit-scrollbar, .cok-pop::-webkit-scrollbar { width: 7px; }
.cok-sheet::-webkit-scrollbar-thumb, .cok-pop::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }
@keyframes cok-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
/* Floating close button — hidden on desktop (the scrim closes there), shown on phones. */
.cok-sheet-x { display: none; position: absolute; z-index: 3; top: 8px; right: 12px; width: 40px; height: 40px;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.16); background: rgba(12,20,38,.92); color: #eaf2ff;
    font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; }
.cok-sheet-x:active { transform: scale(.94); }

/* Desktop: present as a proper CENTERED modal dialog (not glued to the bottom edge). */
@media (hover: hover) and (pointer: fine) {
    .cok-sheet-wrap { top: 50%; bottom: auto; transform: translate(-50%, -50%); }
    .cok-sheet, .cok-pop { max-height: 86vh; animation: cok-pop .2s ease; }
    @keyframes cok-pop { from { transform: scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }
}

/* Mobile (touch): a BOTTOM SHEET — slides up from the bottom (thumb-reachable), spans the safe
   width, grows to fit content up to nearly full height, and never crosses the notch (top-inset cap)
   or the home indicator (bottom-inset padding). A grabber handle + ✕ make it read as a sheet.
   This applies to EVERY KelRaid page (both .cok-sheet and .cok-pop). */
@media (hover: none) and (pointer: coarse) {
    /* position:fixed anchors to the VISUAL viewport, not .cok-overlay (which can be taller than
       the screen) — so the bottom sheet always sits on the real screen bottom, never pushed off. */
    .cok-sheet-wrap { position: fixed; left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); bottom: 0; top: auto;
        width: auto; transform: none; padding: 0 8px calc(env(safe-area-inset-bottom, 0px) + 8px); }
    .cok-sheet-wrap::before { content: ""; position: absolute; z-index: 4; top: 9px; left: 50%; transform: translateX(-50%);
        width: 42px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); pointer-events: none; }
    .cok-sheet, .cok-pop { max-width: none; width: 100%; border-radius: 22px 22px 12px 12px;
        /* The sheet is anchored at the BOTTOM, so the height cap must subtract BOTH the bottom
           offset (inset-bottom + the wrap's 8px pad) AND the top clearance — otherwise a full
           sheet's top overshoots past the notch. max(inset-top, 44px) also covers LANDSCAPE,
           where the notch is on the side (inset-top ~0) but the status bar still shows. */
        max-height: calc(100vh - max(env(safe-area-inset-top, 0px), 44px) - env(safe-area-inset-bottom, 0px) - 20px);
        max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 44px) - env(safe-area-inset-bottom, 0px) - 20px);
        padding: 24px 16px 16px; animation: cok-slideup .24s cubic-bezier(.2,.8,.3,1); }
    @keyframes cok-slideup { from { transform: translateY(16%); opacity: .5; } to { transform: none; opacity: 1; } }
    .cok-sheet-x { display: block; top: 15px; right: 13px; }
    .cok-sheet-h, .cok-pop-h { padding-right: 46px; }   /* keep the title/level badge clear of the ✕ */
}
.cok-sheet-h { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 18px; margin: 0 0 12px; }
.cok-sheet-h .sub { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #93a6c4; }

/* weekly event banner (menu) — this week's active modifier */
.cok-event { display: flex; align-items: center; gap: 11px; margin: 2px 0 12px; padding: 11px 13px; border-radius: 14px;
    background: linear-gradient(180deg, rgba(120,90,255,.22), rgba(60,45,140,.24)); border: 1px solid rgba(180,150,255,.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 18px rgba(140,110,255,.18); }
.cok-event .ic { font-size: 26px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.cok-event .nm { font-weight: 800; font-size: 14px; color: #eae2ff; }
.cok-event .sub { font-size: 12px; color: #c6b8ee; margin-top: 2px; }

.cok-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; margin-bottom: 10px; }
.cok-shop-sec { margin-bottom: 4px; }
.cok-shop-cat { font-size: 11.5px; font-weight: 800; color: #9fb0cf; text-transform: uppercase; letter-spacing: .06em; margin: 14px 2px 8px; display: flex; align-items: center; gap: 6px; }
.cok-shop-cat::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.cok-card { position: relative; background: linear-gradient(180deg,#1a2a48,#132139); border: 1px solid rgba(255,255,255,.11); border-radius: 15px; padding: 12px 8px 11px; text-align: center; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06); transition: transform .08s, border-color .12s; }
.cok-card:not(.off):hover { border-color: rgba(130,160,255,.4); }
.cok-card:not(.off):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.cok-card.off { opacity: .5; cursor: default; }
.cok-card.hq { border-color: rgba(130,160,255,.55); background: linear-gradient(180deg,#213256,#182848); }
.cok-card .ic { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; font-size: 31px; line-height: 1; border-radius: 15px; background: radial-gradient(circle at 50% 36%, rgba(255,255,255,.15), rgba(255,255,255,.03)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.cok-card .nm { font-size: 12.5px; font-weight: 800; margin: 8px 0 2px; }
.cok-card .eff { font-size: 10px; color: #8fa2c4; line-height: 1.2; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cok-card .sub { display: inline-block; font-size: 11.5px; font-weight: 800; color: #eaf2ff; line-height: 1; background: rgba(0,0,0,.30); border: 1px solid rgba(255,255,255,.09); padding: 5px 10px; border-radius: 999px; }
.cok-card.hq .sub { color: #cfe0ff; }
.cok-card.locked { opacity: .84; cursor: default; border-style: dashed; }
.cok-card.locked .ic { filter: grayscale(.4); }
.cok-card.locked .sub { color: #ffcf6a; background: rgba(120,90,20,.22); border-color: rgba(255,207,106,.3); }
/* shop switch: Verfügbar / Bald */
.cok-seg { display: flex; gap: 6px; background: #0e1830; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.cok-segb { flex: 1; border: 0; background: transparent; color: #9db0cc; font: 800 13px/1 system-ui; padding: 9px 6px; border-radius: 9px; cursor: pointer; }
.cok-segb.on { background: linear-gradient(180deg,#3a5bd0,#2b46a8); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.3); }

.cok-pop-h { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.cok-pop-h .lv { margin-left: auto; font-size: 12px; color: #ffd23f; font-weight: 700; }
.cok-pop-info { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: #cfe0ff; margin-bottom: 10px; }
.cok-pop-hint { font-size: 12px; color: #93a6c4; margin: 6px 0; line-height: 1.4; }

.cok-rivals { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cok-rival { display: flex; align-items: center; gap: 10px; background: #14233f; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 9px 11px; flex-wrap: wrap; }
.cok-rival .av { font-size: 24px; } .cok-rival .meta { flex: 1; min-width: 90px; }
.cok-rival .nm { font-weight: 700; font-size: 14px; } .cok-rival .sub { font-size: 11.5px; color: #93a6c4; }
.cok-rival .loot { font: 700 11.5px/1.5 ui-monospace, monospace; color: #cfe0ff; width: 100%; }
@media (min-width: 420px) { .cok-rival .loot { width: auto; text-align: right; } }
/* season pass */
.cok-season-top { background: linear-gradient(180deg,#2a1e3f,#1c1430); border: 1px solid rgba(200,150,255,.25); border-radius: 14px; padding: 11px 13px; margin-bottom: 6px; }
.cok-season-top .pts { font: 900 17px/1 system-ui; color: #ffd23f; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cok-season-bar { position: relative; height: 12px; border-radius: 7px; background: #120b20; border: 1px solid rgba(255,255,255,.08); overflow: hidden; margin: 8px 0 5px; }
.cok-season-bar .fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg,#c79bff,#ffd23f); box-shadow: 0 0 10px rgba(255,210,63,.5); }
.cok-season-top .nxt { font-size: 11.5px; color: #b9a7dd; }
.cok-season .cok-rival.locked { opacity: .5; filter: grayscale(.5); }
.cok-season .cok-rival.ready { border-color: rgba(255,210,63,.6); box-shadow: 0 0 0 1px rgba(255,210,63,.3), 0 0 14px rgba(255,210,63,.2); }
.cok-season .cok-rival.done { opacity: .72; }
/* quests */
.cok-quests .cok-rival.ready, .cok-boosts .cok-rival.on { border-color: rgba(255,210,63,.6); box-shadow: 0 0 0 1px rgba(255,210,63,.3), 0 0 14px rgba(255,210,63,.2); }
.cok-quests .cok-rival.done, .cok-season .cok-rival.done { opacity: .7; }
.cok-q-bar { position: relative; height: 7px; border-radius: 5px; background: #0e1830; border: 1px solid rgba(255,255,255,.08); overflow: hidden; margin: 5px 0 3px; width: 100%; }
.cok-q-bar .fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg,#37f2a3,#ffd23f); }
.cok-quests .qp { font: 700 11px/1.4 ui-monospace, monospace; color: #9fd9c0; }
/* boosts */
.cok-boosts .cok-rival.on .av { filter: drop-shadow(0 0 6px rgba(255,210,63,.7)); }
/* records / stats grid */
.cok-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cok-stat { background: #14233f; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; padding: 11px 6px; text-align: center; }
.cok-stat .ic { font-size: 20px; } .cok-stat .v { font: 900 18px/1.1 system-ui; color: #eaf2ff; margin-top: 3px; }
.cok-stat .l { font-size: 10.5px; color: #93a6c4; margin-top: 2px; }
/* progress path (HQ unlock roadmap) */
.cok-path { display: flex; flex-direction: column; }
.cok-pnode { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.cok-pnode:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 34px; bottom: -2px; width: 3px; background: rgba(255,255,255,.12); border-radius: 2px; }
.cok-pnode.done:not(:last-child)::before { background: linear-gradient(180deg,#37f2a3,#2bd18b); }
.cok-pnode .dot { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 900 15px/1 system-ui; z-index: 1; border: 2px solid rgba(255,255,255,.14); background: #16233d; color: #cfe0ff; }
.cok-pnode.done .dot { background: linear-gradient(180deg,#37f2a3,#22b877); color: #05130c; border-color: #6effc0; }
.cok-pnode.cur .dot { background: linear-gradient(180deg,#ffe07a,#f0a91e); color: #4a2f04; border-color: #fff; box-shadow: 0 0 0 3px rgba(255,210,63,.35), 0 0 14px rgba(255,210,63,.5); }
.cok-pnode.next .dot { border-color: rgba(255,210,63,.6); color: #ffe07a; }
.cok-pnode.lock { opacity: .6; }
.cok-pnode .pbody { flex: 1; min-width: 0; padding-top: 2px; }
.cok-pnode .ph { font: 800 13px/1.2 system-ui; color: #eaf2ff; margin-bottom: 5px; }
.cok-pnode.cur .ph { color: #ffd23f; }
.pchips { display: flex; flex-wrap: wrap; gap: 5px; }
.pchip { font: 700 11px/1.3 system-ui; padding: 3px 8px; border-radius: 9px; background: #14233f; border: 1px solid rgba(255,255,255,.1); color: #cfe0ff; white-space: nowrap; }
.pchip.build { border-color: rgba(74,144,226,.5); } .pchip.troop { border-color: rgba(55,242,163,.5); } .pchip.spell { border-color: rgba(200,150,255,.5); }
.pchip.perk { background: rgba(255,210,63,.14); border-color: rgba(255,210,63,.4); color: #ffe07a; }
.pchip.muted { opacity: .7; }
.cok-pnode.lock .pchip { filter: grayscale(.6); }
/* while any sheet/overlay is open, hide the bottom action bar + battle deck so
   they don't peek through or sit behind the sheet's own buttons */
.cok-root.veil .cok-actions, .cok-root.veil .cok-deck { display: none !important; }
/* sound toggles in the ☰ menu */
.cok-toggrow { display: flex; gap: 8px; margin-top: 10px; }
.cok-tog { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 8px; border-radius: 13px; background: #14233f; border: 2px solid rgba(255,255,255,.12); color: #cfe0ff; font: 800 13px/1 system-ui; cursor: pointer; }
.cok-tog .ti { font-size: 17px; }
.cok-tog .ts { font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 8px; background: rgba(255,255,255,.1); color: #9fb0cc; }
.cok-tog.on { border-color: rgba(55,242,163,.6); box-shadow: 0 0 12px rgba(55,242,163,.18); color: #eafff5; }
.cok-tog.on .ts { background: linear-gradient(180deg,#37f2a3,#22b877); color: #05130c; }
/* milestone celebration confetti */
.cok-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.cok-confetti span { position: absolute; top: -24px; width: 9px; height: 13px; opacity: 0; animation: cok-fall linear forwards; }
@keyframes cok-fall { 0% { transform: translateY(-24px) rotate(0deg); opacity: 0; } 8% { opacity: 1; } 100% { transform: translateY(112vh) rotate(680deg); opacity: .9; } }
.cok-intro.cele .ic { animation: cok-pop .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes cok-pop { 0% { transform: scale(0) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }
.cele-chips { justify-content: center; margin-top: 10px; }
/* onboarding tutorial (centered card) */
.cok-intro-holder { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) calc(env(safe-area-inset-right, 0px) + 18px) calc(env(safe-area-inset-bottom, 0px) + 18px) calc(env(safe-area-inset-left, 0px) + 18px); }
.cok-intro { width: min(400px, 94%); max-height: 100%; overflow-y: auto; background: linear-gradient(180deg,#1c2942,#141d31); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 24px 20px 18px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.55); position: relative; }
.cok-intro .ic { font-size: 46px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
.cok-intro .t { font: 900 20px/1.2 system-ui; color: #fff; margin: 12px 0 8px; }
.cok-intro .x { font-size: 13.5px; line-height: 1.5; color: #b7c6e2; }
.cok-intro .dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 14px; }
.cok-intro .dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); }
.cok-intro .dots span.on { background: #ffd23f; box-shadow: 0 0 8px rgba(255,210,63,.6); }
.cok-intro-btns { display: flex; gap: 8px; }
.cok-intro-btns .cok-btn { flex: 1; }
.cok-intro-skip { display: block; margin: 10px auto 0; background: none; border: none; color: #8296b6; font-size: 12px; cursor: pointer; text-decoration: underline; }
/* campaign ladder rows */
.cok-camp .cok-rival.locked { opacity: .55; filter: grayscale(.5); }
.cok-camp .cok-rival.mastered { border-color: rgba(255,210,63,.55); box-shadow: 0 0 0 1px rgba(255,210,63,.3), 0 0 14px rgba(255,210,63,.18); }
.cok-camp .cstars { font-size: 13px; letter-spacing: 1px; color: #ffce4a; margin-top: 2px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

.cok-troops { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.cok-troop { display: flex; align-items: center; gap: 9px; background: #14233f; border: 1px solid rgba(255,255,255,.1); border-left: 3px solid var(--tint, #37f2a3); border-radius: 11px; padding: 8px 10px; }
.cok-troop .av { font-size: 22px; } .cok-troop .meta { flex: 1; }
.cok-troop .nm { font-weight: 700; font-size: 13.5px; } .cok-troop .sub { font-size: 11px; color: #93a6c4; }
.cok-troop .cnt { min-width: 30px; text-align: center; font-weight: 800; font-size: 15px; }
.cok-troop .cok-btn.sm { min-width: 38px; padding: 8px 0; }

.cok-tray { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); transform: translateX(-50%);
    display: flex; gap: 7px; pointer-events: auto; flex-wrap: wrap; justify-content: center;
    max-width: calc(96% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
.cok-trooptray { display: flex; align-items: center; gap: 5px; background: rgba(14,26,48,.94); border: 2px solid var(--tint, #37f2a3);
    border-radius: 12px; padding: 7px 11px; cursor: pointer; color: #eaf2ff; }
.cok-trooptray.on { box-shadow: 0 0 0 2px #fff inset; }
.cok-trooptray .ic { font-size: 18px; } .cok-trooptray .n { font-weight: 800; font-size: 13px; }
.cok-btn.end { border-color: rgba(255,93,108,.5); color: #ffb0b8; }

.cok-toast { position: absolute; left: 50%; top: 72px; transform: translate(-50%, -8px); background: #14352a; color: #baffdd;
    border: 1px solid rgba(55,242,163,.4); border-radius: 12px; padding: 9px 15px; font-size: 13px; font-weight: 600;
    opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 9; white-space: nowrap; }
.cok-toast.bad { background: #3a1620; color: #ffc2c8; border-color: rgba(255,93,108,.45); }
.cok-toast.show { opacity: 1; transform: translate(-50%, 0); }

.cok-stars { text-align: center; font-size: 40px; letter-spacing: 6px; color: #ffd23f; margin-bottom: 4px; }
.cok-loot { text-align: center; font: 800 16px/1.4 ui-monospace, monospace; color: #baffdd; margin: 6px 0 4px; }
.cok-sheet.result { text-align: center; }

/* ── KelRaid — base-builder / card-battler visual polish (overrides) ── */
.cok-top { gap: 8px; }
.cok-hq { background: linear-gradient(180deg,#3f66a6,#2b4879); border: 2px solid #f2c14e; border-radius: 14px; padding: 7px 12px; font-weight: 900; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.45); box-shadow: 0 3px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.cok-res { background: linear-gradient(180deg,#2c2118,#1b140d); border: 2px solid #6b4f2a; border-radius: 16px; padding: 4px 12px 4px 8px; box-shadow: 0 3px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08); }
.cok-res .i { font-size: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.cok-res .t { font-weight: 800; color: #ffe9c2; text-shadow: 0 1px 1px rgba(0,0,0,.5); }
.cok-res .bar { background: rgba(0,0,0,.45); }
.cok-trophy { border-radius: 16px; border-width: 2px; font-weight: 900; text-shadow: 0 1px 1px rgba(0,0,0,.4); box-shadow: 0 3px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.cok-trophy { background: linear-gradient(180deg,#dcab34,#b07d1a); border-color: #ffe08a; color: #3a2606; }
.cok-back { border: 2px solid #f2c14e; background: linear-gradient(180deg,#c8495f,#98283f); color: #fff; font-weight: 900; border-radius: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2); }
.cok-banner { border: 2px solid #f2c14e; background: linear-gradient(180deg,rgba(20,30,52,.94),rgba(12,18,34,.94)); font-weight: 800; color: #ffe9c2; box-shadow: 0 3px 0 rgba(0,0,0,.28); }

.cok-actions { gap: 16px; }
.cok-actions .cok-btn { border-radius: 22px; border: 2px solid rgba(0,0,0,.22); font-weight: 900; font-size: 17px; padding: 16px 30px; text-shadow: 0 1px 1px rgba(0,0,0,.35); box-shadow: 0 5px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.35); }
.cok-actions .cok-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.35); }
.cok-actions .cok-btn.primary { background: linear-gradient(180deg,#54c254,#2f8b34); border-color: #86e086; }
.cok-actions .cok-btn.gold { background: linear-gradient(180deg,#ffcf3f,#e89a1e); border-color: #ffe58a; color: #3a2606; }

/* card-battler battle deck: elixir bar + troop cards */
/* Sit within the safe area on both sides (landscape notch/home-indicator): set left+right to
   the insets and centre with margin:auto, so the edge buttons (Kel-Ruf / Aufgeben) never hide
   under the notch. */
.cok-deck { position: absolute; left: calc(env(safe-area-inset-left,0px) + 6px); right: calc(env(safe-area-inset-right,0px) + 6px); bottom: calc(env(safe-area-inset-bottom,0px) + 8px); margin: 0 auto; width: auto; max-width: 900px; pointer-events: auto; display: flex; flex-direction: column; gap: 8px; }
.cok-deck .end { position: absolute; top: -44px; right: 2px; border: 2px solid rgba(255,93,108,.6); background: rgba(20,10,16,.9); color: #ffb0b8; font-weight: 800; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.cok-deck .ability { position: absolute; top: -44px; left: 2px; border: 2px solid rgba(255,210,63,.7); background: rgba(30,22,6,.92); color: #ffe07a; font-weight: 800; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3), 0 0 12px rgba(255,210,63,.3); }
.cok-deck .ability.off { opacity: .5; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.cok-elixir .fill.dbl { background: linear-gradient(180deg,#ffd23f,#ff88d9); box-shadow: 0 0 14px rgba(255,210,63,.7); }
.cok-army .cok-rival.locked { opacity: .55; filter: grayscale(.4); }
.cok-elixir { position: relative; height: 22px; border-radius: 12px; background: #2a1533; border: 2px solid #120818; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.55); }
.cok-elixir .fill { position: absolute; inset: 0; width: 0; background: linear-gradient(180deg,#ff88d9,#c22bd6); box-shadow: 0 0 10px rgba(220,60,214,.6); transition: width .12s linear; }
.cok-elixir .ticks { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, rgba(0,0,0,.42) 0 2px, transparent 2px 10%); }
.cok-elixir .lb { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font: 900 11px/1 system-ui; color: #fff; opacity: .92; text-shadow: 0 1px 2px rgba(0,0,0,.75); pointer-events: none; }
.cok-elixir .n { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 900 12px/1 system-ui; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.cok-cards { display: flex; gap: 6px; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 6px 14px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    /* fade the ends so a partially-scrolled card fades out instead of being hard-cut */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 16px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 16px), transparent 100%); }
.cok-cards::-webkit-scrollbar { display: none; }
.cok-cards.few { justify-content: center; }
.cok-card2 { flex: 0 0 auto; width: 70px; max-width: 96px; min-width: 0; scroll-snap-align: center; background: linear-gradient(180deg,#28395480,#1a2740); border: 2px solid var(--tint,#37f2a3); border-radius: 13px; padding: 9px 4px 6px; cursor: pointer; color: #eaf2ff; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 4px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.cok-card2.spell { background: linear-gradient(180deg,#3a2450cc,#241338); box-shadow: 0 4px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.14), 0 0 12px color-mix(in srgb, var(--tint) 45%, transparent); }
.cok-card2.spell::before { content: "✨"; position: absolute; top: -7px; right: -4px; font-size: 11px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.cok-card2.on { box-shadow: 0 0 0 2px #fff, 0 4px 0 rgba(0,0,0,.3); transform: translateY(-4px); }
.cok-card2.off { opacity: .42; }
.cok-card2 .cost { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg,#e04fe0,#a81fb0); border: 1.5px solid #fff; border-radius: 10px; font: 900 10px/1 system-ui; padding: 2px 6px; color: #fff; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.cok-card2 .ic { font-size: 28px; margin-top: 1px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
/* World map: AI neighbour bases (Boom-Beach-style) */
.cok-map { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 12px; }
.cok-base-node { background: linear-gradient(180deg,#16273f,#0e1a2e); border: 2px solid rgba(255,255,255,.1); border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06); transition: transform .1s; }
.cok-base-node:active { transform: scale(.98); }
.cok-base-node.diff-leicht { border-color: rgba(63,224,120,.5); }
.cok-base-node.diff-mittel { border-color: rgba(255,210,63,.5); }
.cok-base-node.diff-schwer { border-color: rgba(255,93,108,.55); }
.cok-mini { display: block; width: 100%; height: auto; background: #5aa64d; border-bottom: 1px solid rgba(0,0,0,.25); }
.cok-mini.big { width: 100%; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; margin-bottom: 12px; box-shadow: 0 6px 20px -10px rgba(0,0,0,.6); }
.bn-head { display: flex; align-items: center; gap: 6px; padding: 8px 9px 2px; font-weight: 800; font-size: 13px; }
.bn-head .av { font-size: 16px; flex: none; }
.bn-head .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-head .diff { flex: none; font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.diff-leicht .bn-head .diff { background: rgba(63,224,120,.18); color: #7cf0a0; }
.diff-mittel .bn-head .diff { background: rgba(255,210,63,.18); color: #ffdf8a; }
.diff-schwer .bn-head .diff { background: rgba(255,93,108,.18); color: #ffb0b8; }
.bn-meta { padding: 0 9px; font-size: 11.5px; font-weight: 700; color: #93a6c4; }
.bn-loot { padding: 3px 9px 0; font-size: 12px; font-weight: 800; color: #cfe0ff; }
.bn-btns { display: flex; gap: 6px; padding: 8px; }
.bn-btns .cok-btn { flex: 1; padding: 9px 6px; }
.bn-btns .cok-btn:first-child { flex: 0 0 auto; min-width: 44px; }
.cok-base-node { position: relative; }
.cok-base-node.beaten { opacity: .72; }
.cok-base-node.beaten .cok-mini { filter: grayscale(.5) brightness(.82); }
.bn-flag { position: absolute; top: 8px; left: 8px; background: rgba(10,20,14,.86); color: #7cf0a0; border: 1px solid rgba(63,224,120,.5); font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.bn-flag.boss { color: #ffe07a; border-color: rgba(255,210,63,.6); background: rgba(40,28,4,.9); }
.bn-flag.pvp { color: #f7b6f7; border-color: rgba(224,79,224,.6); background: rgba(40,10,44,.9); }
.cok-base-node.diff-boss { border-color: rgba(255,210,63,.75); box-shadow: 0 4px 0 rgba(0,0,0,.28), 0 0 16px -2px rgba(255,200,60,.35), inset 0 1px 0 rgba(255,255,255,.08); }
.diff-boss .bn-head .diff { background: linear-gradient(180deg,#ffe07a,#f0a91e); color: #4a2f04; }
.cok-daily { margin: 2px 0 10px; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 800; color: #4a2f04; background: linear-gradient(180deg,#ffe07a,#f4b731); box-shadow: 0 3px 0 rgba(0,0,0,.22); }
.cok-bonus { margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 800; text-align: center; color: #4a2f04; background: linear-gradient(180deg,#ffe6a0,#f6c34a); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }

.cok-card2 .cn { font-size: 9.5px; font-weight: 800; line-height: 1.08; text-align: center; max-width: 100%; opacity: .92;
    white-space: normal; overflow-wrap: anywhere; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* per-card combat stats (⚔️ dmg ❤️ hp, or a spell's effect) + squad-size badge */
.cok-card2 .st { margin-top: 2px; font-size: 9px; font-weight: 900; line-height: 1; letter-spacing: -.02em; color: #fff; opacity: .95; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.55); }
.cok-card2.spell .st { color: #ffe6a0; }
.cok-card2 .sq { position: absolute; top: -8px; right: -5px; background: linear-gradient(180deg,#2b3d5c,#18263f); border: 1.5px solid var(--tint,#37f2a3); color: #eaf2ff; font: 900 9px/1 system-ui; padding: 2px 5px; border-radius: 9px; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
/* battle "?" — reopens the how-to; sits centred on the top row between Kel + Give-up */
.cok-deck .help { position: absolute; top: -44px; left: 50%; transform: translateX(-50%); min-width: 40px; padding: 8px 10px; border: 2px solid rgba(150,180,255,.5); background: rgba(16,22,38,.9); color: #cfe0ff; font-weight: 900; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
/* battle how-to sheet: one icon-led tip per line */
.cok-tips { display: flex; flex-direction: column; gap: 11px; margin: 4px 0 14px; }
.cok-tip { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; line-height: 1.34; color: #dbe6f7; }
.cok-tip .ti { flex: none; font-size: 19px; width: 32px; text-align: center; }
.cok-tip .tx { flex: 1; min-width: 0; }
.cok-actions .cok-btn.collect { background: linear-gradient(180deg,#ffe07a,#f0b21e); border-color: #fff0b0; color: #3a2606; padding: 16px 20px; }
.cok-builders { background: linear-gradient(180deg,#6d4f2e,#4a3419); border: 2px solid #caa96f; color: #ffe9c2; font-weight: 900; font-size: 12.5px; padding: 6px 10px; border-radius: 14px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.18); }
.cok-builders.busy { border-color: #ff8f3f; color: #ffd0a8; }
/* KelRaid — "More" menu, achievements, leagues, menu-button alert */
.cok-menu-btn { font-size: 20px; }
.cok-back.alert { animation: cokglow 1.2s ease-in-out infinite; border-color: #ffd23f; }
@keyframes cokglow { 0%,100% { box-shadow: 0 0 0 2px rgba(255,210,63,.4), 0 3px 0 rgba(0,0,0,.3); } 50% { box-shadow: 0 0 0 3px rgba(255,210,63,.9), 0 3px 0 rgba(0,0,0,.3); } }
.cok-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.cok-card.glow { border-color: #ffd23f; animation: cokglow 1.2s ease-in-out infinite; }
.cok-achs { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.cok-ach { display: flex; align-items: center; gap: 9px; background: #14233f; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; padding: 8px 10px; }
.cok-ach.done { border-color: rgba(255,210,63,.55); }
.cok-ach.claimed { opacity: .55; }
.cok-ach .av { font-size: 22px; flex: 0 0 auto; }
.cok-ach .meta { flex: 1; min-width: 0; }
.cok-ach .nm { font-weight: 700; font-size: 13.5px; }
.cok-ach .sub { font-size: 11px; color: #93a6c4; }
.cok-ach .pbar { height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); margin-top: 5px; overflow: hidden; }
.cok-ach .pfill { height: 100%; background: #5fd06a; border-radius: 3px; }
.cok-ach-tag { font: 800 11px/1.3 ui-monospace, monospace; color: #cfe0ff; text-align: right; white-space: nowrap; flex: 0 0 auto; }
.cok-ach-tag.done { color: #5fd06a; font-size: 17px; }
.cok-rival.on { border-color: #ffd23f; background: color-mix(in srgb, #ffd23f 10%, #14233f); }

/* ── PvP leaderboard (🏆 Bestenliste) ── */
.cok-lb-you { margin: 2px 0 10px; padding: 10px 13px; border-radius: 13px; font-weight: 800; font-size: 13px; color: #4a2f04;
    background: linear-gradient(180deg,#ffe07a,#f4b731); box-shadow: 0 3px 0 rgba(0,0,0,.22); text-align: center; }
.cok-lb-list { display: flex; flex-direction: column; gap: 5px; }
.cok-lb-row { display: flex; align-items: center; gap: 9px; background: #14233f; border: 1px solid rgba(255,255,255,.1);
    border-radius: 11px; padding: 8px 11px; }
.cok-lb-row .rk { flex: 0 0 auto; min-width: 30px; text-align: center; font: 900 14px/1 system-ui; color: #cfe0ff; }
.cok-lb-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13.5px; }
.cok-lb-row .hq { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: #93a6c4; }
.cok-lb-row .tr { flex: 0 0 auto; font: 800 12.5px/1 ui-monospace, monospace; color: #ffe08a; }
.cok-lb-row.me { border-color: rgba(255,210,63,.65); background: color-mix(in srgb, #ffd23f 12%, #14233f);
    box-shadow: 0 0 0 1px rgba(255,210,63,.3), 0 0 14px rgba(255,210,63,.18); }

/* ── 👥 Friends: add-by-name row ── */
.cok-friend-add { display: flex; gap: 8px; margin: 4px 0 12px; }
.cok-friend-inp { flex: 1; min-width: 0; padding: 12px 13px; font-size: 15px; border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,.14); background: #0b1220; color: #eaf2ff; }
.cok-friend-inp:focus { outline: none; border-color: var(--kr-mag, #e04fe0); }
.cok-friend-add .cok-btn { flex: 0 0 auto; padding: 12px 18px; }
.cok-friend-add .cok-btn:disabled { opacity: .5; cursor: default; }
/* friend rows reuse .cok-rival; keep the action buttons compact + tidy on small screens */
.cok-rival .cok-btn.sm { min-width: 40px; padding: 8px 10px; }
/* my-code panel */
.cok-mycode { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 8px; padding: 12px 14px;
    border-radius: 14px; background: linear-gradient(180deg, rgba(224,79,224,.16), rgba(90,40,140,.14));
    border: 1px solid rgba(224,79,224,.34); }
.cok-mycode .l { flex: 1 0 100%; font: 800 12px/1 system-ui; color: #e9c7ff; }
.cok-mycode .v { font: 900 26px/1 ui-monospace, "SF Mono", monospace; letter-spacing: .18em; color: #fff; text-shadow: 0 1px 6px rgba(224,79,224,.5); }
.cok-mycode .s { flex: 1; font-size: 11.5px; color: #c6b3e6; }
.cok-mycode .cok-btn.sm { margin-left: auto; }
/* add-friend: name + code + button */
.cok-friend-add2 { display: flex; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.cok-friend-add2 .cok-friend-inp { flex: 1 1 130px; min-width: 0; }
.cok-friend-add2 .cok-friend-inp.code { flex: 0 1 110px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; text-align: center; }
.cok-friend-add2 .cok-btn { flex: 0 0 auto; padding: 12px 18px; }

/* ── narrow phones: keep the top HUD on ONE compact row (no wrap over the canvas) ── */
@media (max-width: 400px) {
    .cok-top { gap: 5px; flex-wrap: nowrap; }
    .cok-hq, .cok-trophy { font-size: 12px; padding: 6px 8px; border-radius: 12px; }
    .cok-builders { font-size: 11.5px; padding: 6px 7px; }
    .cok-res { min-width: 0; padding: 4px 8px 4px 6px; }
    .cok-res .col { min-width: 42px; }
    .cok-back { width: 36px; height: 36px; font-size: 16px; }
}
@media (max-width: 340px) {
    .cok-res .i { font-size: 15px; } .cok-res .t { font-size: 10px; }
}
