/* ══════════════════════════════════════════════════════════════════════════════
   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: var(--cok-mut); --kr-mag: #e04fe0; --kr-teal: #37f2a3; --kr-gold: #ffd23f;
    /* ── in-game (.cok-*) design tokens — one coherent, contrast-checked palette so every
         dialog/card/label relates to the same system on both mobile and desktop ── */
    --cok-surface: #1b1526;                 /* sheet / dialog base */
    --cok-row: #241f37;                     /* list rows & inset tiles (lifted, cooler) */
    --cok-ink: #eef4ff;                      /* primary text */
    --cok-ink2: #d6e3fb;                     /* secondary text (on rows/cards) */
    --cok-mut: #a8b9d8;                      /* muted text — AA-legible on the dark surfaces */
    --cok-line: rgba(255,255,255,.12);       /* hairline borders */
    --cok-line-soft: rgba(255,255,255,.08);
    --kr-sat: env(safe-area-inset-top, 0px); /* notch inset, readable from JS for canvas overlays */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--kr-bg); }   /* safety: never let a bare white area peek behind the shells */
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 40%, #7fd0ff 60%, #ff6bc1 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-reduced-motion: no-preference) { .kr-hero h1 em { animation: kr-shimmer 6s linear infinite; } }
@keyframes kr-shimmer { to { background-position: 220% 0; } }
.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); }
.kr-btn.danger { background: rgba(255,90,110,.10); color: #ff9aa6; border: 1.5px solid rgba(255,90,110,.4); }
@media (hover: hover) { .kr-btn.danger:hover { background: rgba(255,90,110,.16); border-color: rgba(255,90,110,.6); } }
@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); } }

/* screenshot gallery — three portrait phone shots showing base / raid / clan */
.kr-gallery { margin: 54px auto 0; max-width: 1000px; text-align: center; }
.kr-gallery h2 { font-size: clamp(22px, 5vw, 30px); font-weight: 900; letter-spacing: -.02em; margin: 0 0 8px; }
.kr-gallery .sub { color: var(--kr-mut); font-size: 15px; line-height: 1.5; max-width: 620px; margin: 0 auto 26px; }
.kr-gal-h { font-size: 15px; font-weight: 800; color: var(--kr-mut); margin: 26px 0 12px; letter-spacing: .01em; }
.kr-gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.kr-gal-grid.kr-gal-wide { grid-template-columns: repeat(2, 1fr); max-width: 900px; margin: 0 auto; }
.kr-gal { margin: 0; }
.kr-gal img { display: block; width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--kr-line);
    background: #0a1120; box-shadow: 0 30px 70px -32px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.04); }
.kr-gal figcaption { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--kr-ink); line-height: 1.4; }
@media (max-width: 720px) { .kr-gal-grid, .kr-gal-grid.kr-gal-wide { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; gap: 22px; } }

/* stats band — quick social-proof numbers under the hero */
.kr-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 30px auto 4px; max-width: 780px;
    padding: 16px 14px; border-radius: 18px; border: 1px solid var(--kr-line);
    background: linear-gradient(180deg, rgba(19,28,48,.7), rgba(13,20,36,.55)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kr-stat { flex: 1 1 90px; text-align: center; min-width: 84px; }
.kr-stat b { display: block; font-size: clamp(22px, 6vw, 30px); font-weight: 900; letter-spacing: -.02em; line-height: 1;
    background: linear-gradient(120deg, #ff6bc1, #c79bff 55%, #7fd0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kr-stat span { display: block; margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--kr-mut); }

.kr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; margin: 40px 0 48px; }
.kr-feat { position: relative; overflow: hidden; 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, box-shadow .15s; }
.kr-feat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--ac, #e04fe0); opacity: .55; }
@media (hover: hover) { .kr-feat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ac, #e04fe0) 45%, transparent); box-shadow: 0 18px 40px -22px var(--ac, #e04fe0); } .kr-feat:hover::before { opacity: 1; } }
.kr-feat .ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 27px; background: rgba(255,255,255,.05); border: 1px solid var(--kr-line); }
@supports (background: color-mix(in srgb, red, blue)) {
    .kr-feat::before { background: linear-gradient(90deg, var(--ac, #e04fe0), transparent 85%); opacity: .85; }
    .kr-feat .ic { background: color-mix(in srgb, var(--ac, #e04fe0) 15%, transparent); border-color: color-mix(in srgb, var(--ac, #e04fe0) 40%, transparent); }
}
.kr-feat h3 { margin: 14px 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); }

/* final CTA band — a bold, glowing close before the footer */
.kr-final { position: relative; margin: 40px 0 8px; border-radius: 24px; padding: 44px 26px; text-align: center; overflow: hidden;
    border: 1px solid rgba(224,79,224,.32);
    background: radial-gradient(120% 140% at 50% 0%, rgba(224,79,224,.22), rgba(63,120,255,.10) 55%, rgba(13,20,36,.6) 100%), var(--kr-card);
    box-shadow: 0 30px 80px -40px rgba(224,79,224,.6), inset 0 1px 0 rgba(255,255,255,.06); }
.kr-final::after { content: ""; position: absolute; inset: -1px; border-radius: 24px; pointer-events: none;
    background: radial-gradient(60% 80% at 50% -10%, rgba(55,242,163,.16), transparent 70%); }
.kr-final-inner { position: relative; z-index: 1; }
.kr-final h2 { margin: 0 0 8px; font-size: clamp(24px, 6vw, 34px); letter-spacing: -.03em; font-weight: 900; }
.kr-final p { margin: 0 auto 22px; max-width: 500px; color: #d3def2; font-size: 15.5px; line-height: 1.55; }

/* proper multi-column footer */
.kr-foot { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--kr-line); color: var(--kr-mut); }
.kr-foot-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px 20px; }
.kr-foot-brand p { margin: 12px 0 0; font-size: 13.5px; line-height: 1.6; max-width: 320px; color: var(--kr-mut); }
.kr-foot-logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; letter-spacing: -.02em; color: var(--kr-ink); }
.kr-foot-logo b { color: var(--kr-mag); }
.kr-foot-col { display: flex; flex-direction: column; gap: 9px; }
.kr-foot-col h4 { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #cdd9ee; }
.kr-foot-col a, .kr-foot-col span { color: var(--kr-mut); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.kr-foot-col a { cursor: pointer; transition: color .12s; }
@media (hover: hover) { .kr-foot-col a:hover { color: var(--kr-ink); } }
.kr-foot-bot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--kr-line); font-size: 12.5px; }
.kr-foot-bot b { color: #cdd9ee; }
.kr-foot-bot a { color: var(--kr-mut); text-decoration: none; }
@media (hover: hover) { .kr-foot-bot a:hover { color: var(--kr-ink); text-decoration: underline; } }
@media (max-width: 640px) {
    .kr-foot-top { grid-template-columns: 1fr 1fr; }
    .kr-foot-brand { grid-column: 1 / -1; }
    .kr-foot-bot { justify-content: center; text-align: center; }
}

/* ── 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; }
/* blocked / suspended screen (moderation) */
.kr-blocked { text-align: center; border-color: rgba(255,90,110,.32); }
.kr-blocked-ic { font-size: 46px; line-height: 1; margin: 2px 0 8px; }
.kr-blocked-lead { color: var(--kr-ink); font-size: 14.5px; line-height: 1.55; margin: 0 0 14px; }
.kr-blocked-reason { font-size: 13.5px; line-height: 1.4; color: #ffd7db; background: rgba(255,90,110,.10);
    border: 1px solid rgba(255,90,110,.28); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.kr-blocked-when-l { font-size: 12px; color: var(--kr-mut); margin: 6px 0 2px; text-transform: uppercase; letter-spacing: .5px; }
.kr-blocked-when { font-size: 18px; font-weight: 900; color: var(--kr-ink); margin: 0 0 18px; }
.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: var(--cok-mut); 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); }
/* home (returning player): a live snapshot of the empire above the CTA so it feels alive */
.kr-home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 4px 0 20px; }
.kr-home-stat { background: rgba(255,255,255,.04); border: 1px solid var(--kr-line); border-radius: 14px; padding: 12px 6px; text-align: center; }
.kr-home-stat .v { font-weight: 900; font-size: 19px; color: var(--kr-ink); line-height: 1.1; }
.kr-home-stat .l { font-size: 11px; color: var(--kr-mut); margin-top: 3px; }
.kr-home-avatar { width: 74px; height: 74px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center;
    font-size: 38px; background: linear-gradient(150deg, rgba(224,79,224,.28), rgba(55,242,163,.18)); border: 1px solid var(--kr-line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
.kr-home-card .kr-switch 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; } }

/* Boot gate: a single loading screen shown BEFORE paint (html.kr-preboot, set by the inline head
   script) while app.js verifies the session, so a returning player never flashes the landing or
   flips logged-in→out. A first-time visitor never gets .kr-preboot → the landing shows instantly. */
#kr-preboot { display: none; }
html.kr-preboot #kr-preboot { display: grid; position: fixed; inset: 0; z-index: 400; place-items: center; background: var(--kr-bg, #070b16); }
html.kr-preboot #kr-landing, html.kr-preboot .kr-bg { display: none !important; }
.kr-preboot-ring { width: 52px; height: 52px; border-radius: 50%; border: 4px solid rgba(255,255,255,.12); border-top-color: #e04fe0; animation: krSpin .8s linear infinite; }
@keyframes krSpin { to { transform: rotate(360deg); } }

/* Respect a reduced-motion preference: stop decorative, looping animations (brand blobs, medallion
   sparkle, flowing road dashes, confetti, pulses) and instant-close transitions. The loading spinner
   stays — it's essential "we're working" feedback — just calmer. Canvas gameplay is unaffected. */
@media (prefers-reduced-motion: reduce) {
    .kr-boot .logo, .kr-bg, .kr-bg *, .cok-pmap .road-done, .cok-pnode2 .medal::before,
    .cok-pnode2.cur .medal::after, .cok-confetti, .cok-event.big .ic, .cok-chest.ready {
        animation: none !important;
    }
    .kr-preboot-ring { animation-duration: 1.5s; }
    html { scroll-behavior: auto !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   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; }

/* ── iOS standalone cold-start viewport fix (same bug + fix as the Kellerkind game) ──
   In an installed PWA iOS reports the height used by position:fixed / inset:0 / dvh
   SHORT at cold start (it excludes a safe-area strip) until a device ROTATION forces a
   recompute — which left the canvas too short and the dark root showing through at the
   bottom as a black band. `100lvh` (large-viewport-height) reports the FULL screen
   height correctly even on cold start, so in standalone we size the shells by 100lvh
   (with bottom:auto so the height, not inset:0, drives). This makes clientHeight correct
   from the first frame, so the canvas fills to the bottom without needing a rotation. */
@media (display-mode: standalone) {
    html, body { height: 100lvh; }
    .cok-root, .kr-auth-back, .kr-boot { height: 100lvh; bottom: auto; }
    html.kr-preboot #kr-preboot { height: 100lvh; bottom: auto; }
}
.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: var(--cok-ink2);
    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: var(--cok-ink2); }
.cok-banner.hidden, .cok-btn.hidden { display: none; }
/* ⚔️ attack alert — prominent, tappable banner on the base screen while raids against you are unseen */
.cok-attackalert { pointer-events: auto; cursor: pointer; align-self: stretch; margin: 9px 6px 0; display: flex;
    align-items: center; gap: 10px; padding: 9px 13px; border-radius: 14px; color: #ffe7ea;
    background: linear-gradient(180deg, rgba(196,58,74,.96), rgba(150,32,48,.96));
    border: 1px solid rgba(255,140,150,.55); box-shadow: 0 6px 20px rgba(150,20,35,.42), 0 0 0 1px rgba(255,120,130,.18) inset;
    animation: cok-aa-pulse 1.9s ease-in-out infinite; }
.cok-attackalert.hidden { display: none; }
.cok-attackalert .ic { font-size: 23px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.cok-attackalert .tx { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; }
.cok-attackalert .tx b { font-weight: 900; }
.cok-attackalert .go { font-weight: 800; font-size: 12px; opacity: .92; white-space: nowrap; }
.cok-attackalert:active { transform: translateY(1px); }
@keyframes cok-aa-pulse { 0%,100% { box-shadow: 0 6px 20px rgba(150,20,35,.42), 0 0 0 1px rgba(255,120,130,.18) inset; }
    50% { box-shadow: 0 6px 26px rgba(210,40,60,.6), 0 0 0 2px rgba(255,150,160,.4) inset; } }
@media (prefers-reduced-motion: reduce) { .cok-attackalert { animation: none; } }
/* defense report: outcome summary + NEU markers on unseen entries */
/* vertical stat list — each line on its own row with clear breathing room (Defense status etc.) */
.cok-statrows { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; line-height: 1.4; color: #dbe7ff; margin: 2px 0 14px; }
.cok-defsum { gap: 6px; margin: 6px 0 16px; padding: 12px 14px; border-radius: 14px; color: #ffe4e8;
    background: rgba(255,90,110,.09); border: 1px solid rgba(255,120,138,.28); border-left: 3px solid #ff7a8a; }
.cok-defsum-new { color: #ffd23f; font-weight: 800; }
.cok-rival.cok-def-new { border-color: rgba(255,122,138,.6); box-shadow: 0 0 0 1px rgba(255,122,138,.32), 0 0 14px rgba(255,60,80,.18); }
.cok-newtag { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; font: 900 10px/1.6 system-ui;
    background: linear-gradient(180deg,#ff5d6c,#d6293c); color: #fff; vertical-align: middle; letter-spacing: .5px; }
/* compact toggle/action button pushed to the right edge of a list row (deck, barracks, research) */
.cok-rival .cok-tgl { margin-left: auto; align-self: center; flex: 0 0 auto; }
/* narrow phones: keep the attack alert tight and never let it clip */
@media (max-width: 360px) {
    .cok-attackalert { gap: 8px; padding: 8px 11px; }
    .cok-attackalert .tx { font-size: 11.5px; }
    .cok-attackalert .go { font-size: 11px; }
}
/* 🏰 Clan (Klan) screen: header, description, reinforcement banner, chat wall, create gate */
.cok-clan-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; padding: 12px 14px; border-radius: 14px;
    background: linear-gradient(180deg, rgba(94,150,255,.14), rgba(60,90,150,.10)); border: 1px solid rgba(120,165,255,.30); }
.cok-clan-head .badge { font-size: 34px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.cok-clan-head .info { min-width: 0; flex: 1; }
.cok-clan-head .nm { font: 900 17px/1.15 system-ui; color: var(--cok-ink); }
.cok-clan-head .tag { font: 800 12px/1.3 system-ui; color: #bcd0ff; margin-top: 2px; letter-spacing: .3px; }
.cok-clan-head .sub { font-size: 12px; color: var(--cok-mut); margin-top: 3px; }
/* ⭐ clan level badge (inline in a header title) + XP progress + perks line */
.cok-lvl-badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; font: 900 11px/1.7 system-ui; vertical-align: middle;
    letter-spacing: .3px; color: #241701; background: linear-gradient(180deg,#ffe07a,#f4b731); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.cok-clan-xp { margin: 0 2px 10px; }
.cok-clan-xp .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cok-clan-xp .hd .l { font: 800 12px/1.2 system-ui; color: var(--cok-ink2, #d6e3fb); }
.cok-clan-xp .hd .v { font: 800 11.5px/1 ui-monospace, monospace; color: #ffd98a; }
.cok-clan-xp .track { height: 11px; border-radius: 999px; background: rgba(12,18,34,.6); border: 1px solid var(--cok-line-soft); overflow: hidden; }
.cok-clan-xp .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#e0a41b,var(--kr-gold,#ffd23f)); transition: width .4s ease; }
.cok-clan-perks { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 2px 12px; padding: 9px 12px; border-radius: 12px;
    font: 800 12px/1.4 system-ui; color: #ffe8bf; background: rgba(255,210,63,.09); border: 1px solid rgba(255,210,63,.26); }
.cok-clan-desc { font-size: 12.5px; line-height: 1.4; color: var(--cok-ink2, #d6e3fb); margin: 0 2px 12px; opacity: .92; }
.cok-clan-reinf { margin: 2px 0 14px; padding: 11px 13px; border-radius: 13px; font: 800 13px/1.35 system-ui; color: #d7ffe9;
    background: rgba(55,242,163,.11); border: 1px solid rgba(55,242,163,.30); border-left: 3px solid var(--kr-teal,#37f2a3); }
.cok-clan-reinf .s { font-weight: 600; font-size: 11.5px; color: #a9e8cc; margin-top: 3px; }
.cok-clan-gate { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 6px 0; }
.cok-clan-gate .l { font: 800 12px/1 system-ui; color: var(--cok-mut); }
.cok-clan-gate input[type=number] { width: 78px; text-align: center; }
.cok-clan-open { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--cok-ink); cursor: pointer; }
.cok-clan-wall { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; margin: 2px 0 8px; padding: 10px 12px;
    border-radius: 12px; background: rgba(12,18,34,.5); border: 1px solid var(--cok-line-soft); }
.cok-clan-wall .sys { font-size: 11.5px; color: var(--cok-mut); text-align: center; font-style: italic; padding: 1px 0; }
.cok-clan-wall .msg { font-size: 13px; line-height: 1.35; color: var(--cok-ink); word-break: break-word; }
.cok-clan-wall .msg { position: relative; padding-right: 22px; }
.cok-clan-wall .msg .au { font-weight: 800; color: #8fb7ff; }
.cok-clan-wall .msg.mine .au { color: var(--kr-teal,#37f2a3); }
/* ⚑ report button on a clanmate's chat line */
.cok-report { position: absolute; top: 0; right: 0; border: 0; background: transparent; color: var(--cok-mut); cursor: pointer;
    font-size: 13px; line-height: 1; padding: 2px 3px; border-radius: 6px; opacity: .55; transition: opacity .12s, color .12s; }
.cok-report:hover, .cok-report:focus-visible { opacity: 1; color: #ff7a8a; background: rgba(255,90,110,.14); }
.cok-report-reasons { flex-wrap: wrap; }
.cok-card2.reinf { border-color: var(--kr-gold,#ffd23f); box-shadow: 0 4px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12), 0 0 12px rgba(255,210,63,.28); }
.cok-card2.reinf .cost { background: linear-gradient(180deg,#ffd23f,#e0a41b); color: #241701; border-color: #fff2c4; }

/* ⚔️ Clan war (Klankrieg): stars race header, progress bars, target rows, result sheet */
.cok-war-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,122,138,.13), rgba(120,60,90,.08)); border: 1px solid rgba(255,140,150,.28); }
.cok-war-head .side { flex: 1; min-width: 0; text-align: center; }
.cok-war-head .side .sc { font: 900 22px/1 system-ui; color: var(--cok-ink); }
.cok-war-head .side .nm { font-size: 11.5px; font-weight: 700; color: var(--cok-mut); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cok-war-head .side.me .sc { color: var(--kr-teal,#37f2a3); }
.cok-war-head .side.op .sc { color: #ff9aa6; }
.cok-war-head .x { flex: 0 0 auto; font-size: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.cok-war-race { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.cok-war-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; }
.cok-war-bar .l { font: 800 11.5px/1 system-ui; color: var(--cok-mut); min-width: 64px; }
.cok-war-bar .v { font: 800 11.5px/1 ui-monospace, monospace; color: var(--cok-ink2); min-width: 44px; text-align: right; }
.cok-war-bar .track { height: 12px; border-radius: 999px; background: rgba(12,18,34,.6); border: 1px solid var(--cok-line-soft); overflow: hidden; }
.cok-war-bar .fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.cok-war-bar.me .fill { background: linear-gradient(90deg,#2bbd7e,var(--kr-teal,#37f2a3)); }
.cok-war-bar.op .fill { background: linear-gradient(90deg,#c74a58,#ff8f9b); }
.cok-war-stat { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 0 2px 12px; font: 800 13px/1.3 system-ui; }
.cok-war-stat .cd { color: #ffd98a; }
.cok-war-stat .atk { color: var(--cok-ink2); }
.cok-war-stat .res { padding: 4px 12px; border-radius: 999px; font-weight: 900; }
.cok-war-stat .res.win { color: #072; background: rgba(55,242,163,.18); border: 1px solid rgba(55,242,163,.4); color: #baffdd; }
.cok-war-stat .res.lose { color: #ff9aa6; background: rgba(255,90,110,.14); border: 1px solid rgba(255,120,130,.34); }
.cok-war-stat .res.draw { color: #cfe0ff; background: rgba(120,160,255,.14); border: 1px solid rgba(140,170,255,.34); }
.cok-rival.cok-war-tgt.done { opacity: .78; border-color: rgba(255,210,63,.4); }
.cok-war-res .cok-war-resline { text-align: center; font: 700 13.5px/1.5 system-ui; color: var(--cok-ink2); margin: 4px 0 8px; }
.cok-war-res .cok-war-resline b { color: var(--kr-gold,#ffd23f); font-weight: 900; }

/* 🎯 Clan games (Klan-Spiele): shared weekly progress bar, tier rows, contribution line */
.cok-games-prog { margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px;
    background: linear-gradient(180deg, rgba(94,150,255,.12), rgba(60,90,150,.08)); border: 1px solid rgba(120,165,255,.28); }
.cok-games-prog .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; font: 800 13px/1.2 system-ui; }
.cok-games-prog .hd .pts { color: var(--kr-gold,#ffd23f); }
.cok-games-prog .hd .cd { color: #ffd98a; }
.cok-games-prog .track { height: 15px; border-radius: 999px; background: rgba(12,18,34,.6); border: 1px solid var(--cok-line-soft); overflow: hidden; }
.cok-games-prog .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#3a5bd0,var(--kr-teal,#37f2a3)); transition: width .4s ease; }
.cok-games-tiers .cok-rival.done { opacity: .82; border-color: rgba(255,210,63,.45); box-shadow: 0 0 0 1px rgba(255,210,63,.22); }
.cok-games-mine { margin: 6px 0 6px; padding: 11px 13px; border-radius: 13px; font: 800 13px/1.35 system-ui; color: #d7ffe9;
    background: rgba(55,242,163,.11); border: 1px solid rgba(55,242,163,.30); border-left: 3px solid var(--kr-teal,#37f2a3); }

/* 🏰 Clan capital (Hauptstadt): header + shared gold chip, district rows, contribute, raid, result */
.cok-cap-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,210,63,.13), rgba(180,130,40,.08)); border: 1px solid rgba(255,210,63,.30); }
.cok-cap-head .badge { font-size: 32px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.cok-cap-head .info { min-width: 0; flex: 1; }
.cok-cap-head .info .nm { font: 900 16px/1.15 system-ui; color: var(--cok-ink); }
.cok-cap-head .info .sub { font-size: 12px; color: var(--cok-mut); margin-top: 3px; }
.cok-gold-chip { flex: 0 0 auto; align-self: center; padding: 7px 12px; border-radius: 999px; font: 900 14px/1 ui-monospace, monospace;
    color: #241701; background: linear-gradient(180deg,#ffe07a,#f4b731); box-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; }
.cok-rival.cok-cap-dist.done { opacity: .78; border-color: rgba(255,210,63,.4); box-shadow: 0 0 0 1px rgba(255,210,63,.2); }
.cok-cap-give-note { font: 700 12px/1.4 system-ui; color: var(--cok-ink2, #d6e3fb); margin: 2px 2px 9px; }
.cok-cap-give { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 4px; }
.cok-cap-give .cok-btn { flex: 1 1 auto; min-width: 92px; }
.cok-cap-give .cok-btn:disabled { opacity: .45; cursor: default; }
.cok-war-stat.cok-cap-stat .gold { color: var(--kr-gold,#ffd23f); font-weight: 900; }
.cok-cap-res .cok-sheet-h { justify-content: center; }
/* 🏆 clan leaderboard rows reuse .cok-lb-row; the meta column holds level + members */
.cok-clan-lb-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cok-clan-lb-row .hq { white-space: nowrap; }

/* ❓ In-game help: sticky live search + accordion (grouped topics) */
.cok-help-search { position: sticky; top: calc(env(safe-area-inset-top, 0px) - 15px); z-index: 4; display: flex; align-items: center; gap: 8px;
    margin: -4px -3px 8px; padding: 8px 11px; border-radius: 12px; background: rgba(20,15,32,.96);
    border: 1px solid var(--cok-line); box-shadow: 0 4px 14px rgba(0,0,0,.35); backdrop-filter: blur(4px); }
.cok-help-search .ic { font-size: 15px; opacity: .85; flex: 0 0 auto; }
.cok-help-inp { flex: 1; min-width: 0; background: rgba(12,18,34,.7); border: 1px solid var(--cok-line-soft); border-radius: 9px;
    color: var(--cok-ink); font: 600 14px/1.2 system-ui; padding: 9px 11px; -webkit-appearance: none; appearance: none; }
.cok-help-inp::placeholder { color: var(--cok-mut); }
.cok-help-inp:focus { outline: none; border-color: rgba(130,160,255,.55); box-shadow: 0 0 0 2px rgba(90,120,220,.25); }
.cok-help-cat { font: 800 12px/1.2 system-ui; text-transform: uppercase; letter-spacing: .05em; color: #9fb0cf;
    margin: 14px 2px 7px; display: flex; align-items: center; gap: 8px; }
.cok-help-cat::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.cok-help-item { margin: 0 0 7px; border: 1px solid var(--cok-line); border-radius: 12px; background: var(--cok-row); overflow: hidden; }
.cok-help-item.open { border-color: rgba(130,160,255,.4); }
.cok-help-q { width: 100%; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; cursor: pointer;
    text-align: left; color: var(--cok-ink); font: 700 13.5px/1.35 system-ui; padding: 12px 13px; }
.cok-help-q .tx { flex: 1; min-width: 0; }
.cok-help-q .chev { flex: 0 0 auto; color: var(--cok-mut); font-size: 12px; transition: transform .16s ease; }
.cok-help-item.open .cok-help-q .chev { transform: rotate(180deg); }
.cok-help-a { display: none; padding: 0 13px 13px; font: 400 13px/1.55 system-ui; color: var(--cok-ink2); }
.cok-help-item.open .cok-help-a { display: block; }
.cok-help-empty { text-align: center; font-weight: 700; color: #ffd98a; }

/* build toolbar (📏 Reihe + ✓ Fertig) — floats just under the build banner while placing */
.cok-placebar { align-self: center; margin: 7px auto 0; display: flex; gap: 8px; pointer-events: none; }
.cok-placebar.hidden { display: none; }
.cok-linebtn, .cok-donebtn { pointer-events: auto; cursor: pointer; border-radius: 999px;
    padding: 8px 17px; font-size: 12.5px; font-weight: 800; box-shadow: 0 2px 0 rgba(0,0,0,.3); border: 1.5px solid rgba(255,255,255,.18); }
.cok-linebtn { background: rgba(10,18,34,.85); color: var(--cok-ink2); }
.cok-linebtn.on { background: linear-gradient(180deg,#37f2a3,#1f9e6a); border-color: #bfffe4; color: #04241a; }
.cok-linebtn.hidden { display: none; }
.cok-donebtn { background: linear-gradient(180deg,#f2c14e,#d69a1e); border-color: #ffe9c2; color: #2a1c06; }
.cok-donebtn:active, .cok-linebtn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }

/* Chunky, glossy "game" buttons: a solid bottom edge (3D depth) + inset top sheen (gloss),
   press-down on tap. Applies everywhere; the bottom action bar keeps its bigger override. */
.cok-btn { pointer-events: auto; border: 2px solid rgba(255,255,255,.14); background: linear-gradient(180deg,#27375b,#1a2942); color: #eaf2ff;
    font: 800 15px/1 system-ui; padding: 13px 22px; border-radius: 16px; cursor: pointer; text-shadow: 0 1px 1px rgba(0,0,0,.35);
    box-shadow: 0 4px 0 rgba(0,0,0,.32), inset 0 2px 0 rgba(255,255,255,.16); transition: transform .06s ease, box-shadow .06s ease; }
.cok-btn.primary { background: linear-gradient(180deg,#4098ee,#2566c4); border-color: #74b2ff; }
.cok-btn.gold { background: linear-gradient(180deg,#ffdd63,#f0a91e); border-color: #ffe98a; color: #4a2f04; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.cok-btn.ghost { background: linear-gradient(180deg,#243652,#2b2138); box-shadow: 0 3px 0 rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.1); }
.cok-btn.block { display: block; width: 100%; margin-top: 9px; }
.cok-btn.sm { font-size: 13px; font-weight: 800; padding: 8px 13px; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.14); }
.cok-btn.off { opacity: .45; }
.cok-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.32), inset 0 2px 0 rgba(255,255,255,.16); }
.cok-btn.sm:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.14); }

/* 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: linear-gradient(180deg, #1e1730, var(--cok-surface) 42%); color: var(--cok-ink);
    border: 1px solid var(--cok-line); border-radius: 18px 18px 14px 14px;
    padding: 15px; box-shadow: 0 -8px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); 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). On wide
   screens the old 520px cap wasted most of the viewport — use the space: a roomy dialog whose
   auto-fill grids (shop/menu) flow into many columns, and list dialogs go multi-column. */
@media (hover: hover) and (pointer: fine) {
    /* Width is CONTENT-AWARE: a comfortable default for menus/forms/rewards, and a roomy `.wide`
       (set by _sheet when the content is a big grid/list: shop, campaign, world-map, leaderboard,
       barracks) so those actually use the desktop space instead of a thin ribbon. */
    .cok-sheet-wrap { top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(700px, 92vw); }
    .cok-sheet-wrap.wide { width: min(1040px, 92vw); }
    .cok-sheet, .cok-pop { max-height: 88vh; animation: cok-pop .2s ease; padding: 20px 24px; }
    @keyframes cok-pop { from { transform: scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }
    /* .cok-sheet-prefix raises specificity above the later base .cok-menu/.cok-shop rules so these
       desktop overrides actually win (media queries don't add specificity; source order would). */
    /* Shop/menu cards stay compact so more fit per row (safe at any desktop width). */
    .cok-sheet .cok-menu { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 9px; }
    .cok-sheet .cok-shop { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    /* short action popups (single building menu) stay compact — they have little content */
    .cok-pop { max-width: 480px; margin: 0 auto; }
    /* Full-width block buttons look stretched & ugly on a wide dialog — cap them and centre. */
    .cok-sheet .cok-btn.block, .cok-sheet .cok-toggrow { max-width: 440px; margin-left: auto; margin-right: auto; }
    .cok-sheet .cok-toggrow { max-width: 460px; }
}
/* Re-render (claim in a dialog → rebuild in place): no open animation → no visible blink. */
.cok-sheet-wrap.noanim .cok-sheet, .cok-sheet-wrap.noanim .cok-pop { animation: none !important; }
/* It's a game: no text selection / drag-highlight anywhere in the game shell (inputs stay usable). */
.cok-root { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cok-root input, .cok-root textarea, .cok-root [contenteditable], .cok-root .v, .cok-mycode .v, .cok-code { -webkit-user-select: text; user-select: text; }
/* ONLY when there's real width to use (≥760px): flow the menu groups into 2 columns and turn
   single-column lists into a 2-column grid — so a big screen shows MORE at once (less scrolling).
   Below this, a narrow desktop window stays single-column and never gets cramped. */
@media (hover: hover) and (pointer: fine) and (min-width: 760px) {
    .cok-menu-groups { column-count: 2; column-gap: 26px; }
    .cok-menu-group { break-inside: avoid; margin-bottom: 4px; }
    .cok-menu-group .cok-menu-sec { margin-top: 4px; }
    .cok-sheet .cok-rivals, .cok-sheet .cok-army, .cok-sheet .cok-achs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
    /* Raid map: neighbour/opponent cards flow 3-wide so the 6 bases fill the roomy dialog. */
    .cok-sheet .cok-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* Shop categories flow into columns too, so few-item categories don't waste the width. */
    .cok-shop-groups { column-count: 2; column-gap: 24px; }
    .cok-shop-groups .cok-shop-sec { break-inside: avoid; margin-bottom: 6px; }
    .cok-sheet .cok-shop { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}
/* very wide screens: pack even more per view — 3 menu-group columns and 3 list columns */
@media (hover: hover) and (pointer: fine) and (min-width: 1360px) {
    .cok-sheet-wrap.wide { width: min(1260px, 90vw); }
    .cok-shop-groups { column-count: 3; }
    .cok-menu-groups { column-count: 3; }
    .cok-sheet .cok-rivals, .cok-sheet .cok-army, .cok-sheet .cok-achs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cok-sheet .cok-map { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 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; }
/* a section header that isn't the sheet's title gets clear separation from the content above it */
.cok-sheet-h:not(:first-child) { margin-top: 18px; }
/* ‹ back-to-menu chevron on submenus opened from the ☰ menu */
.cok-sheet-back { align-self: center; flex: none; width: 30px; height: 30px; margin: -2px 2px -2px -2px; border-radius: 9px;
    border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: var(--cok-ink2); font: 900 20px/1 system-ui;
    cursor: pointer; display: grid; place-items: center; padding: 0; }
.cok-sheet-back:hover { background: rgba(255,255,255,.12); color: #fff; }
.cok-sheet-back:active { transform: scale(.94); }
.cok-sheet-h .sub { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--cok-mut); }

/* 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-event.tappable { cursor: pointer; transition: transform .06s, filter .1s; }
.cok-event.tappable:active { transform: translateY(1px); }
.cok-event .chev { margin-left: auto; font-size: 22px; font-weight: 900; color: #c6b8ee; opacity: .8; }
.cok-event.big { margin: 4px 0 10px; padding: 14px 15px; } .cok-event.big .ic { font-size: 34px; }

.cok-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; margin-bottom: 10px; }
.cok-shop-sec { margin-bottom: 4px; }
/* 🐾 mascot picker tiles */
.cok-mascot { background: linear-gradient(180deg,var(--cok-row),#1b1526); border: 1px solid rgba(255,255,255,.11); border-radius: 15px; padding: 12px 6px 10px; 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-mascot:hover { border-color: rgba(200,160,255,.4); }
.cok-mascot:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.cok-mascot.sel { border-color: rgba(120,255,206,.6); background: linear-gradient(180deg,#1f3a30,#152a24); box-shadow: 0 0 0 1px rgba(120,255,206,.35), 0 3px 0 rgba(0,0,0,.28); }
.cok-mascot.locked { opacity: .86; }
.cok-mascot .mg { font-size: 34px; line-height: 1.1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.cok-mascot .ml { font-size: 12px; font-weight: 800; color: #c6b8ee; margin-top: 4px; }
.cok-mascot .ml.cost { color: #ffd23f; }
.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; max-width: 100%; overflow-wrap: break-word; hyphens: auto; }
.cok-card .eff { font-size: 10px; color: var(--cok-mut); line-height: 1.2; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cok-card .sub { display: inline-block; max-width: 100%; box-sizing: border-box; font-size: 11.5px; font-weight: 800; color: #eaf2ff; line-height: 1.2; background: rgba(0,0,0,.30); border: 1px solid rgba(255,255,255,.09); padding: 4px 9px; border-radius: 12px; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
.cok-card.hq .sub { color: var(--cok-ink2); }
.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: #1b1526; 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: var(--cok-mut); 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: 9px 16px; font-size: 13px; color: #dbe7ff; margin-bottom: 12px; line-height: 1.4; }
.cok-pop-info .nx { color: #8affce; font-weight: 900; }   /* upgrade-preview "next" value */
.cok-pop-hint { font-size: 12.5px; color: #aab9d6; margin: 8px 0; line-height: 1.5; }
/* offline hint inside dialogs — amber, a touch more prominent so the "you need a connection" reads clearly */
.cok-pop-hint.off { color: #ffd98a; background: rgba(60,42,12,.5); border: 1px solid rgba(255,200,80,.28); border-radius: 12px; padding: 10px 12px; font-weight: 700; }
/* raid dialog — "your army" strip: hoverable troop chips so you gauge your force pre-attack */
.cok-army-strip { margin: 4px 0 10px; padding: 8px 10px; border-radius: 13px; background: rgba(255,255,255,.04); border: 1.5px solid rgba(255,255,255,.08); }
.cok-army-strip .l { font-size: 12px; font-weight: 800; color: #bcd0ff; margin-bottom: 7px; opacity: .95; }
.cok-army-strip .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cok-army-strip .chip { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(180deg,#28395480,#2b2138); border: 2px solid var(--tint,#37f2a3); cursor: default; }
.cok-army-strip .chip .i { font-size: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
/* weekly battle-mutator chip on the raid screen — surfaces the rule that changes THIS fight */
.cok-mutchip { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; padding: 9px 12px; border-radius: 13px; cursor: pointer;
    background: linear-gradient(180deg, rgba(120,90,255,.2), rgba(60,45,140,.22)); border: 1px solid rgba(180,150,255,.38);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07); transition: transform .06s, filter .1s; }
.cok-mutchip:active { transform: translateY(1px); }
.cok-mutchip .ic { font-size: 20px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.cok-mutchip .tx { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: #e6ddff; line-height: 1.35; }
.cok-mutchip .chev { flex: none; font-size: 19px; font-weight: 900; color: #c6b8ee; opacity: .8; }
.cok-army-strip .chip .x { position: absolute; right: -5px; top: -6px; background: linear-gradient(180deg,#2b3d5c,#292036); border: 1.5px solid var(--tint,#37f2a3); color: #eaf2ff; font: 900 9px/1 system-ui; padding: 2px 4px; border-radius: 8px; }

.cok-rivals { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.cok-rival { display: flex; align-items: center; gap: 11px; background: var(--cok-row); border: 1px solid var(--cok-line); border-radius: 13px; padding: 11px 13px; flex-wrap: wrap; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.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: 12px; color: var(--cok-mut); line-height: 1.4; margin-top: 2px; }
.cok-rival .loot { font: 700 11.5px/1.5 ui-monospace, monospace; color: var(--cok-ink2); 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: #1b1526; 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: var(--cok-row); 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: var(--cok-mut); 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: var(--cok-row); color: var(--cok-ink2); }
.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: var(--cok-row); border: 1px solid rgba(255,255,255,.1); color: var(--cok-ink2); 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); }
/* 🧭 progress MAP — a winding level-map: medallions on a curving road (done / current / locked) */
/* Path dialogs (Pfad/Feldzug/Saison/Ligen): header + close stay pinned, only the winding path
   scrolls INSIDE its own pane — works at any screen size; on touch you drag the path to scroll. */
.cok-sheet.mapsheet { display: flex; flex-direction: column; overflow: hidden; }
.cok-sheet.mapsheet > * { flex: 0 0 auto; }
.cok-sheet.mapsheet > .cok-mapscroll { flex: 1 1 auto; min-height: 120px; }
.cok-mapscroll { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: 16px; }
.cok-mapscroll .cok-pmap { margin: 0; }
.cok-mapscroll::-webkit-scrollbar { width: 7px; }
.cok-mapscroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }
.cok-pmap { position: relative; width: 100%; margin: 6px 0 10px; border-radius: 16px; overflow: hidden;
    background:
        radial-gradient(120% 55% at 50% -8%, rgba(255,210,120,.16), transparent 60%),   /* warm summit glow */
        radial-gradient(1.5px 1.5px at 20% 12%, rgba(255,255,255,.5), transparent 60%),
        radial-gradient(1.5px 1.5px at 72% 22%, rgba(255,255,255,.4), transparent 60%),
        radial-gradient(1.5px 1.5px at 40% 34%, rgba(255,255,255,.35), transparent 60%),
        linear-gradient(180deg, #24305e 0%, #203a5c 45%, #16414f 100%);
    border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 2px 22px rgba(0,0,0,.4); }
.cok-pmap::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    box-shadow: inset 0 0 60px rgba(0,0,0,.4); }   /* soft vignette */
.cok-pmap .road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cok-pmap .road-base { fill: none; stroke: rgba(8,14,26,.6); stroke-width: 22px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cok-pmap .road-done { fill: none; stroke: #ffcf3f; stroke-width: 9px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 7px rgba(255,207,63,.65)); stroke-dasharray: 3 11; animation: cokRoadFlow 1s linear infinite; }
@keyframes cokRoadFlow { to { stroke-dashoffset: -14; } }   /* dashes flow toward the goal */
.cok-pnode2 { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 116px; cursor: pointer; z-index: 2; }
.cok-pnode2 .medal { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 900 22px/1 system-ui;
    border: 3px solid rgba(255,255,255,.3); background: radial-gradient(circle at 35% 26%, #3a4c72, #18273f); color: var(--cok-ink2);
    box-shadow: 0 5px 0 rgba(0,0,0,.42), inset 0 2px 0 rgba(255,255,255,.22); }
.cok-pnode2 .medal::after { content: ""; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); width: 40px; height: 9px; border-radius: 50%; background: rgba(0,0,0,.4); filter: blur(2px); z-index: -1; }
.cok-pnode2 .plabel { margin-top: 9px; text-align: center; }
.cok-pnode2 .pt { font: 900 12px/1.1 system-ui; color: #eaf2ff; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cok-pnode2 .ps { font: 700 10.5px/1.2 system-ui; color: #cdddff; margin-top: 2px; max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cok-pnode2 .pflag { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 17px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); pointer-events: none; }
.cok-pnode2.done .medal { background: linear-gradient(180deg,#4dffb0,#22b877); color: #05130c; border-color: #8dffd2; }
.cok-pnode2.done .medal::before { content: "✨"; position: absolute; top: -9px; right: -9px; font-size: 13px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.cok-pnode2.cur .medal { background: linear-gradient(180deg,#ffe488,#f0a91e); color: #4a2f04; border-color: #fff;
    box-shadow: 0 0 0 4px rgba(255,210,63,.32), 0 5px 0 rgba(0,0,0,.42), 0 0 26px rgba(255,210,63,.7); animation: cokMedalPulse 1.5s ease-in-out infinite; }
.cok-pnode2.cur .medal::before { content: "▼"; position: absolute; top: -23px; left: 50%; transform: translateX(-50%); color: #ffd23f; font-size: 15px; text-shadow: 0 1px 2px rgba(0,0,0,.6); animation: cokBob .9s ease-in-out infinite; }
@keyframes cokBob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(4px); } }
.cok-pnode2.cur .pt { color: #ffd23f; }
.cok-pnode2.mastered .medal { background: linear-gradient(180deg,#ffe07a,#f0a91e); color: #4a2f04; border-color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.25), 0 0 12px rgba(255,210,63,.45); }
.cok-pnode2.next .medal { border-color: rgba(255,210,63,.65); color: #ffe07a; }
.cok-pnode2 .ps { letter-spacing: .5px; }
.cok-pnode2.lock { opacity: .6; } .cok-pnode2.lock .medal { filter: grayscale(.35); }
@keyframes cokMedalPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); } }
/* 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: var(--cok-row); border: 2px solid rgba(255,255,255,.12); color: var(--cok-ink2); 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,#231b2e); 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: var(--cok-row); 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: var(--cok-mut); }
.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; }

/* cloud-sync status chip — top-left under the resource bar, unobtrusive, never blocks input */
.cok-sync { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 50px); left: calc(env(safe-area-inset-left, 0px) + 8px);
    z-index: 8; pointer-events: none; display: inline-flex; align-items: center; gap: 5px; max-width: 62vw;
    font-size: 11px; font-weight: 800; line-height: 1; padding: 5px 9px; border-radius: 999px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; color: var(--cok-ink2); background: rgba(16,26,46,.72);
    border: 1px solid rgba(255,255,255,.12); box-shadow: 0 2px 8px rgba(0,0,0,.34);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 1; transition: opacity .3s; }
.cok-sync.hidden { opacity: 0; }
.cok-sync.off { color: #ffd98a; background: rgba(60,42,12,.82); border-color: rgba(255,200,80,.4); }
.cok-sync.ok { color: #baffdd; background: rgba(16,50,36,.82); border-color: rgba(120,255,206,.32); }

.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: calc(env(safe-area-inset-top, 0px) + 60px); 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: 40;
    /* Long messages (e.g. an HQ's whole unlock list) must WRAP and stay inside the screen instead of
       being clipped left+right — never cut a message off on a narrow phone. */
    max-width: min(92vw, 440px); white-space: normal; text-align: center; line-height: 1.35; overflow-wrap: anywhere; }
.cok-toast.bad { background: #3a1620; color: #ffc2c8; border-color: rgba(255,93,108,.45); }
.cok-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* star-earned celebration — a compact polished pill just UNDER the progress banner (never over
   the battlefield centre); brief scale-in + settle + fade, reserved for real milestones */
.cok-battle-flash { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 112px); transform: translate(-50%, -6px) scale(.7); pointer-events: none; z-index: 12;
    font-size: clamp(15px, 3.4vw, 22px); font-weight: 900; color: #ffe9a8; letter-spacing: .01em; white-space: nowrap;
    padding: 8px 20px; border-radius: 999px; background: linear-gradient(180deg, rgba(58,42,10,.95), rgba(34,24,6,.95));
    border: 1.5px solid rgba(255,210,63,.6); box-shadow: 0 8px 26px rgba(0,0,0,.5), 0 0 22px rgba(255,210,63,.35), inset 0 1px 0 rgba(255,255,255,.14);
    text-shadow: 0 1px 2px rgba(0,0,0,.6); opacity: 0; }
.cok-battle-flash.show { animation: cokBattleFlash 1.3s cubic-bezier(.2,1.1,.3,1) forwards; }
@keyframes cokBattleFlash {
    0% { opacity: 0; transform: translate(-50%, 4px) scale(.7); }
    20% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
    36% { transform: translate(-50%, 0) scale(1); }
    78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -10px) scale(.98); } }
/* on very short landscape phones nudge it a touch higher so it clears the deck */
@media (max-height: 500px) { .cok-battle-flash { top: calc(env(safe-area-inset-top, 0px) + 92px); } }

.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,#e2b23a,#bd871d); border-color: #ffe08a; color: #241701; }
.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); }
/* not-enough-elixir feedback: a short red pulse so it's clear WHY the deploy did nothing */
.cok-elixir.flash { animation: cokElixFlash .5s ease; }
@keyframes cokElixFlash { 0%,100% { border-color: #120818; } 25%,75% { border-color: #ff5d6c; box-shadow: inset 0 2px 4px rgba(0,0,0,.55), 0 0 12px rgba(255,93,108,.7); } }
.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); }
/* padding-top clears the floating badges (cost/×N/role sit at top:-9/-8px); because
   overflow-x:auto forces overflow-y to clip, too little top room shaves the badge tops off */
.cok-cards { display: flex; gap: 6px; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 15px 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,#2b2138); 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; }
/* A text hint dropped into the map grid (e.g. "no fair opponent") must span all columns —
   otherwise it lands in one grid cell and wraps at half width with ugly line breaks. */
.cok-map > .cok-pop-hint { grid-column: 1 / -1; }
.cok-base-node { background: linear-gradient(180deg,#271f35,#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-wrap: anywhere; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Difficulty / trophy chip: sits in the preview's top-right corner (not the name row) so the
   rival name always has the full card width and never gets ellipsised down to a single letter. */
.bn-tag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; background: rgba(10,20,30,.86); border: 1px solid rgba(255,255,255,.18); color: #dfe8f5; z-index: 1; }
.diff-leicht .bn-tag { color: #7cf0a0; border-color: rgba(63,224,120,.5); }
.diff-mittel .bn-tag { color: #ffdf8a; border-color: rgba(255,210,63,.5); }
.diff-schwer .bn-tag { color: #ffb0b8; border-color: rgba(255,93,108,.55); }
.bn-meta { padding: 0 9px; font-size: 11.5px; font-weight: 700; color: var(--cok-mut); }
.bn-loot { padding: 3px 9px 0; font-size: 12px; font-weight: 800; color: var(--cok-ink2); }
.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; }
/* 🎡 daily fortune wheel */
.cok-wheel-wrap { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 8px auto 14px; }
.cok-wheel { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #2b2138; box-shadow: 0 8px 26px rgba(0,0,0,.5), inset 0 0 0 3px rgba(255,255,255,.12); transform: rotate(0deg); will-change: transform; }
.cok-wheel .seg { position: absolute; transform: translate(-50%, -50%); font-size: clamp(18px, 5vw, 26px); filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); pointer-events: none; }
.cok-wheel-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24%; height: 24%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2a3a5c, #131d30); border: 3px solid #ffd23f; display: flex; align-items: center; justify-content: center; font-size: clamp(16px, 4.5vw, 24px); box-shadow: 0 3px 10px rgba(0,0,0,.5); z-index: 3; }
.cok-wheel-ptr { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 22px solid #ffd23f; filter: drop-shadow(0 2px 2px rgba(0,0,0,.55)); z-index: 4; }
.cok-wheel-out { text-align: center; min-height: 8px; margin: 2px 0 8px; }
.cok-wheel-leg { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; margin: 10px 0 4px; font-size: 12px; color: #bcd0ff; }
.cok-wheel-leg .it { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 999px; padding: 4px 10px; font-weight: 700; }
/* 📦 free-chest hero icon — sits still while locked, bounces + glows when ready to open */
.cok-chest { font-size: clamp(52px, 15vw, 80px); text-align: center; margin: 6px 0 4px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); opacity: .55; }
.cok-chest.ready { opacity: 1; animation: cokChestBounce 1.1s ease-in-out infinite; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)) drop-shadow(0 0 18px rgba(255,210,63,.6)); }
@keyframes cokChestBounce { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-8px) scale(1.06); } 55% { transform: translateY(0) scale(.98); } }
.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-tag { background: linear-gradient(180deg,#ffe07a,#f0a91e); color: #4a2f04; border-color: rgba(255,210,63,.6); }
.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,#292036); 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); }
/* troop role cue (🛡️ tank / 💰 raider) — top-left corner, opposite the ×N squad badge */
.cok-card2 .role { position: absolute; top: -8px; left: -5px; background: rgba(12,18,34,.92); border: 1.5px solid rgba(255,255,255,.25); font-size: 10px; line-height: 1; padding: 2px 3px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cok-army .sub.role { color: #bcd0ff; font-size: 11px; margin-top: 1px; opacity: .95; }
/* desktop hover tooltip (data-tip): anchored above/below the hovered item, never on touch */
.cok-hovertip { position: absolute; z-index: 60; max-width: 240px; pointer-events: none; background: linear-gradient(180deg,#1b2740f2,#191320f2); color: #eaf2ff; border: 1.5px solid rgba(120,150,210,.4); border-radius: 12px; padding: 8px 11px; font-size: 12.5px; line-height: 1.4; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: cokTipIn .12s ease; }
.cok-hovertip b { color: #8affce; font-weight: 900; }
.cok-hovertip.hidden { display: none; }
.cok-hovertip::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background: #191320f2; border-right: 1.5px solid rgba(120,150,210,.4); border-bottom: 1.5px solid rgba(120,150,210,.4); }
.cok-hovertip.below::after { bottom: auto; top: -6px; border: none; border-left: 1.5px solid rgba(120,150,210,.4); border-top: 1.5px solid rgba(120,150,210,.4); background: #1b2740f2; }
@keyframes cokTipIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
/* daily login-streak track: 7 day-cells, past filled, today pulsing, day 7 the milestone */
.cok-streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 6px 0 12px; }
.cok-streak .day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border-radius: 11px; border: 1.5px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); }
.cok-streak .day .dn { font: 800 9.5px/1 system-ui; color: var(--cok-mut); }
.cok-streak .day .dic { font-size: 15px; line-height: 1; }
.cok-streak .day .dr { font: 900 9px/1 ui-monospace, monospace; color: #eaf2ff; opacity: .85; white-space: nowrap; }
.cok-streak .day.done { background: linear-gradient(180deg,#1f6b3a,#164e2b); border-color: #37f2a380; }
.cok-streak .day.done .dn { color: #a9f0c4; }
.cok-streak .day.today { background: linear-gradient(180deg,#e0a83f,#b8791f); border-color: #ffe9c2; box-shadow: 0 0 0 2px rgba(255,210,63,.35); animation: cok-pulse 1.4s ease-in-out infinite; }
.cok-streak .day.today .dn, .cok-streak .day.today .dr { color: #2a1c06; }
.cok-streak .day.future { opacity: .6; }
@keyframes cok-pulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
/* 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: var(--cok-ink2); 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-menu-sec { font-size: 12px; font-weight: 800; color: #9fb0cf; text-transform: uppercase; letter-spacing: .05em; margin: 12px 2px 8px; display: flex; align-items: center; gap: 7px; }
.cok-menu-sec::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.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: var(--cok-row); 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: var(--cok-mut); }
.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: var(--cok-ink2); text-align: right; white-space: nowrap; flex: 0 0 auto; }
.cok-ach-tag.done { color: #5fd06a; font-size: 17px; }
/* treasure track: overall header + per-achievement chest */
.cok-ach-top { margin: 2px 0 12px; padding: 10px 13px; border-radius: 13px; background: linear-gradient(180deg, rgba(255,210,63,.16), rgba(255,210,63,.06)); border: 1px solid rgba(255,210,63,.35); }
.cok-ach-top .l { font: 900 13px/1.2 system-ui; color: #ffe07a; margin-bottom: 8px; text-align: center; }
.cok-ach-topbar { height: 10px; border-radius: 6px; background: rgba(0,0,0,.4); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.cok-ach-topbar .fill { height: 100%; background: linear-gradient(90deg,#ffd23f,#ffb03f); border-radius: 6px; box-shadow: 0 0 8px rgba(255,210,63,.5); }
.cok-ach { padding: 9px 11px; border-radius: 13px; box-shadow: 0 2px 0 rgba(0,0,0,.22); }
.cok-ach.done { border-color: rgba(255,210,63,.6); background: linear-gradient(180deg,#1c2b48,var(--cok-row)); }
.cok-chestcol { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 46px; }
.cok-chestcol .cbox { font-size: 24px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.cok-chestcol .cbox.opened { opacity: .6; }
.cok-chestcol .clbl { font: 800 9.5px/1.15 ui-monospace, monospace; color: var(--cok-mut); text-align: center; white-space: nowrap; }
.cok-chestcol .clbl.ready { color: #ffe07a; } .cok-chestcol .clbl.done { color: #5fd06a; font-size: 14px; }
.cok-chestcol .chestbtn { font-size: 20px; padding: 6px 12px; animation: cokChestReady 1.2s ease-in-out infinite; }
@keyframes cokChestReady { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-3px); } }
.cok-rival.on { border-color: #ffd23f; background: color-mix(in srgb, #ffd23f 10%, var(--cok-row)); }

/* ── PvP leaderboard (🏆 Bestenliste) ── */
.cok-lb-week { margin: 2px 0 8px; padding: 8px 12px; border-radius: 11px; font-weight: 800; font-size: 12.5px; text-align: center; color: var(--cok-ink2); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); }
.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: var(--cok-row); 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: var(--cok-ink2); }
.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: var(--cok-mut); }
.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%, var(--cok-row));
    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 150px; min-width: 120px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; text-align: center; }
/* the placeholder ("CODE") sits tighter than the entered 6-char code so it never clips */
.cok-friend-add2 .cok-friend-inp.code::placeholder { letter-spacing: .04em; }
.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) {
    /* Compact one-row HUD, but allow a graceful wrap to a 2nd row on very narrow phones
       instead of collapsing the resource pills and letting their numbers spill outside. */
    .cok-top { gap: 5px; flex-wrap: wrap; }
    .cok-hq, .cok-trophy { font-size: 12px; padding: 6px 8px; border-radius: 12px; }
    .cok-builders { font-size: 11.5px; padding: 6px 7px; }
    .cok-res { flex: 0 0 auto; min-width: 0; padding: 4px 8px 4px 6px; }
    .cok-res .col { min-width: 30px; }   /* room for "100k" — pill never shrinks below its number */
    .cok-res .cap { display: none; }   /* show only the current amount — the fill bar shows cap% */
    .cok-res .t { white-space: nowrap; overflow: visible; }
    .cok-back { width: 36px; height: 36px; font-size: 16px; }
}
@media (max-width: 340px) {
    .cok-top { gap: 4px; }
    .cok-hq, .cok-trophy { font-size: 11.5px; padding: 5px 7px; }
    .cok-res .i { font-size: 15px; } .cok-res .t { font-size: 10px; }
    .cok-res .col { min-width: 28px; }
}
