/* THE ISLE OF WITNESS — cabinet styling (Batch #229)
   Canonical #227 tokens (gold #c9a227, void #060409) + a drowned-teal accent.
   The cabinet is CSS only — the play field (canvas) pays nothing for it. */
:root {
  --void: #060409; --gold: #c9a227; --gold-lt: #e8c35a; --gold-dim: #a8873a;
  --parch: #cbbd97; --mist: #877da1;
  --sea: #0a2e3a; --sea-lt: #7fd4c9; --blood: #8b1a1a;
  --ff-title: 'Cinzel Decorative', serif; --ff-head: 'Cinzel', serif; --ff-body: 'IM Fell English', serif;
  --r: 8px;
}
/* ---------- page frame: the house header/footer (Batch #246 fix) ----------
   The Isle page borrowed the .ka-* frame markup from the kids-art pages but
   never loaded their stylesheet — its header nav rendered as raw unstyled
   blue links. The house standard lives here now, in the Isle's own tokens. */
.ka-head {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0.7rem 1rem; background: rgba(3,2,6,0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(201,162,39,0.3);
}
.ka-brand { font-family: var(--ff-title); color: var(--gold-lt); text-decoration: none; font-size: 1rem; }
.ka-nav { display: flex; gap: 8px; }
.ka-nav a {
  color: var(--parch); text-decoration: none; font-family: var(--ff-head); font-weight: 700; font-size: 0.9rem;
  border: 1px solid rgba(201,162,39,0.45); border-radius: 8px; padding: 8px 12px; background: rgba(201,162,39,0.08);
}
.ka-nav a:hover { background: rgba(201,162,39,0.22); }
.ka-nav a:focus-visible, .ka-brand:focus-visible { outline: 3px solid #ffd454; outline-offset: 2px; }
.ka-foot { border-top: 1px solid rgba(201,162,39,0.25); text-align: center; padding: 18px 12px 26px; color: var(--mist); font-family: var(--ff-body); }
.ka-foot a { color: var(--gold-lt); }
.ka-foot-small { font-size: 0.9rem; margin-top: 6px; }

.isle-main { max-width: 1060px; margin: 0 auto; padding: 1.2rem 1rem 2.5rem; }

/* ---------- cabinet shell ---------- */
.cabinet {
  background: linear-gradient(168deg, #17110a 0%, #0c0910 46%, #070510 100%);
  border: 2px solid rgba(201,162,39,.4);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.75), inset 0 1px 0 rgba(232,195,90,.25), inset 0 -14px 34px rgba(0,0,0,.6);
  padding: clamp(10px, 2.4vw, 22px);
}
.cab-marquee {
  display: flex; align-items: center; gap: 1rem;
  background: radial-gradient(120% 160% at 50% 0%, rgba(127,212,201,.13), rgba(0,0,0,0) 60%), linear-gradient(180deg, #0a1a20, #050d12);
  border: 1px solid rgba(127,212,201,.28); border-radius: 14px;
  padding: .7rem 1rem; margin-bottom: 14px;
  box-shadow: inset 0 0 34px rgba(10,46,58,.65);
}
.cab-poster { height: 92px; width: auto; border-radius: 4px; border: 1px solid rgba(201,162,39,.45); box-shadow: 0 4px 18px rgba(0,0,0,.6); }
.cab-marquee-text { flex: 1 1 auto; min-width: 0; }
.cab-kicker { font-family: var(--ff-head); font-size: .68rem; letter-spacing: .34em; color: var(--sea-lt); margin: 0 0 .2rem; }
.cab-title { font-family: var(--ff-title); font-weight: 900; font-size: clamp(1.45rem, 4.6vw, 2.6rem); line-height: 1.02; color: var(--gold-lt); margin: 0; text-shadow: 0 0 22px rgba(201,162,39,.35), 0 2px 0 #000; }
.cab-tag { font-family: var(--ff-body); font-style: italic; color: var(--parch); margin: .3rem 0 0; font-size: clamp(.86rem, 2.4vw, 1rem); }
.cab-tag strong { color: #f0e6c8; }
.cab-coin { text-align: center; flex: 0 0 auto; }
.cab-coin-slot { display: block; width: 7px; height: 44px; margin: 0 auto 4px; background: #000; border: 1px solid rgba(232,195,90,.5); border-radius: 4px; box-shadow: inset 0 0 6px #000, 0 0 10px rgba(201,162,39,.25); }
.cab-coin-text { font-family: var(--ff-head); font-size: .9rem; letter-spacing: .14em; color: var(--gold-dim); }

/* ---------- screen ---------- */
.cab-screen-frame {
  background: #000; border-radius: 16px; padding: clamp(8px, 1.8vw, 14px);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 2px #17130d, inset 0 0 44px rgba(0,0,0,.9);
}
.isle-screen { position: relative; border-radius: 10px; overflow: hidden; background: #020608; }
#isle-canvas { display: block; width: 100%; aspect-ratio: 8 / 5; touch-action: none; cursor: crosshair; }
.cab-glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px),
    radial-gradient(115% 90% at 50% 42%, transparent 58%, rgba(0,0,0,.42) 100%);
  mix-blend-mode: multiply;
}

/* ---------- HUD ---------- */
.isle-hud { position: absolute; inset: 0; pointer-events: none; z-index: 6; font-family: var(--ff-head); }
.hud-box { position: absolute; top: 8px; background: rgba(2,6,8,.55); border: 1px solid rgba(201,162,39,.35); border-radius: 6px; padding: 3px 10px 5px; }
.hud-left { left: 8px; } .hud-right { right: 8px; text-align: right; }
.hud-center { left: 50%; transform: translateX(-50%); background: none; border: none; }
.hud-label { display: block; font-size: .58rem; letter-spacing: .3em; color: var(--gold-dim); }
.hud-value { font-size: clamp(.95rem, 2.6vw, 1.25rem); font-weight: 700; color: #f4e9c8; text-shadow: 0 0 10px rgba(201,162,39,.35); }
.hud-dist { font-size: clamp(.78rem, 2.2vw, 1rem); letter-spacing: .12em; color: var(--sea-lt); text-shadow: 0 1px 3px #000; }
.hud-mult { color: #ffb347; font-weight: 700; margin-left: .35em; }
.hud-bottom { position: absolute; bottom: 8px; background: rgba(2,6,8,.55); border: 1px solid rgba(201,162,39,.28); border-radius: 6px; padding: 3px 10px 6px; }
.hud-bottom-left { left: 8px; } .hud-bottom-right { right: 8px; text-align: right; }
.hud-bottom-mid { left: 50%; transform: translateX(-50%); width: min(240px, 34%); }
.hud-nerve { color: #e0655f; letter-spacing: .18em; font-size: 1rem; text-shadow: 0 0 8px rgba(139,26,26,.6); }
.hud-ammo { color: #f4e9c8; font-size: .9rem; letter-spacing: .1em; }
.hud-bar { display: block; height: 9px; background: rgba(255,255,255,.09); border-radius: 5px; overflow: hidden; margin-top: 3px; }
.hud-bar-fill { display: block; height: 100%; width: 100%; transition: width .25s linear; }
.hud-oil-fill { background: linear-gradient(90deg, #8a5a10, #ffbf00); }
.isle-oil-low .hud-oil-fill { background: linear-gradient(90deg, #6e1414, #c22e2e); }
.hud-pursuit { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); width: min(340px, 62%); text-align: center; }
.hud-pursuit-label { font-size: .66rem; letter-spacing: .42em; color: #ff7a6b; text-shadow: 0 0 12px rgba(139,26,26,.8); }
.hud-bar-pursuit { background: rgba(139,26,26,.25); height: 11px; }
.hud-pursuit-fill { background: linear-gradient(90deg, #571313, #c22e2e, #ff5a3c); }
.hud-msg-wrap { position: absolute; top: 21%; left: 0; right: 0; text-align: center; }
.hud-msg { font-family: var(--ff-title); font-weight: 700; font-size: clamp(1.2rem, 4.6vw, 2.2rem); letter-spacing: .06em; color: #f4e9c8; text-shadow: 0 0 24px rgba(201,162,39,.5), 0 3px 0 #000; opacity: 0; transition: opacity .3s; margin: 0; }
.hud-sub { font-family: var(--ff-body); font-style: italic; font-size: clamp(.86rem, 2.6vw, 1.05rem); color: var(--sea-lt); text-shadow: 0 2px 4px #000; opacity: 0; transition: opacity .3s; margin: .2rem 0 0; }

/* ---------- overlays ---------- */
.isle-overlay {
  position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 1rem;
  background: radial-gradient(90% 90% at 50% 45%, rgba(2,8,10,.42), rgba(2,6,8,.86));
}
.ov-kicker { font-family: var(--ff-head); font-size: .64rem; letter-spacing: .4em; color: var(--sea-lt); margin: 0 0 .4rem; }
.ov-title { font-family: var(--ff-title); font-weight: 900; font-size: clamp(1.9rem, 7.4vw, 3.6rem); line-height: 1.04; color: var(--gold-lt); margin: 0; text-shadow: 0 0 30px rgba(201,162,39,.4), 0 3px 0 #000; }
.ov-title-sm { font-size: clamp(1.5rem, 5.6vw, 2.6rem); }
.ov-blink { font-family: var(--ff-head); letter-spacing: .3em; color: #ffb347; margin: .8rem 0; animation: isleBlink 1.15s steps(2, start) infinite; }
@keyframes isleBlink { to { visibility: hidden; } }
.ov-howto { font-family: var(--ff-body); color: var(--parch); font-size: clamp(.8rem, 2.3vw, .95rem); line-height: 1.55; max-width: 560px; margin: .8rem 0 0; }
.ov-howto strong { color: var(--gold-lt); font-family: var(--ff-head); font-size: .82em; letter-spacing: .06em; }
.ov-count { font-family: var(--ff-title); font-size: clamp(2.6rem, 9vw, 4.4rem); color: #ff7a6b; margin: .2rem 0 .4rem; text-shadow: 0 0 26px rgba(139,26,26,.7); }
.ov-score { font-family: var(--ff-title); font-weight: 900; font-size: clamp(2rem, 8vw, 3.8rem); color: #f4e9c8; margin: 0; text-shadow: 0 0 26px rgba(201,162,39,.45); }
.ov-line { font-family: var(--ff-body); font-style: italic; color: var(--parch); margin: .2rem 0 .6rem; }
.ov-row { display: flex; gap: .6rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: .55rem; }
.ov-init-label { font-family: var(--ff-head); font-size: .9rem; letter-spacing: .3em; color: var(--gold-dim); display: flex; align-items: center; gap: .5rem; }
.ov-init { font-family: var(--ff-head); font-weight: 700; font-size: 1.2rem; letter-spacing: .3em; text-transform: uppercase; text-align: center; width: 4.6em; background: #0a0f14; color: #ffd97a; border: 1px solid rgba(201,162,39,.55); border-radius: 6px; padding: .3rem .2rem; }
.isle-scores { border-collapse: collapse; margin: .7rem auto 0; font-family: var(--ff-head); font-size: clamp(.74rem, 2.4vw, .92rem); color: var(--parch); }
.isle-scores th { color: var(--gold-dim); letter-spacing: .22em; font-size: .66rem; padding: 2px 12px; border-bottom: 1px solid rgba(201,162,39,.35); }
.isle-scores td { padding: 3px 12px; text-align: left; }
.isle-scores td:nth-child(3) { color: #f4e9c8; font-weight: 700; }
.isle-noscore { font-family: var(--ff-body); font-style: italic; color: var(--mist); }

/* ---------- buttons + deck ---------- */
.isle-btn {
  font-family: var(--ff-head); font-weight: 700; letter-spacing: .12em; font-size: .9rem;
  color: var(--gold-lt); background: linear-gradient(180deg, #221a10, #14100a);
  border: 1px solid rgba(201,162,39,.55); border-radius: 8px; padding: .62rem 1.15rem;
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 4px 0 #000, inset 0 1px 0 rgba(232,195,90,.25);
}
.isle-btn:hover { background: linear-gradient(180deg, #2c2113, #191208); box-shadow: 0 4px 0 #000, 0 0 18px rgba(201,162,39,.3); }
.isle-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.isle-btn:disabled { opacity: .45; cursor: default; transform: none; }
.isle-btn-main { color: #0d0a05; background: linear-gradient(180deg, #e8c35a, #c9a227); border-color: #e8c35a; text-shadow: none; }
.isle-btn-main:hover { background: linear-gradient(180deg, #f4d67c, #d9b23a); }
.cab-deck { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.cab-deck-note { flex: 1 1 260px; font-family: var(--ff-body); font-style: italic; color: var(--mist); font-size: .92rem; margin: 0; }

/* ---------- book section ---------- */
.isle-book { display: flex; gap: 1.2rem; align-items: flex-start; margin: 2rem auto 0; max-width: 860px; background: linear-gradient(160deg, #12101c, #0a0810); border: 1px solid rgba(201,162,39,.25); border-radius: var(--r); padding: 1.2rem; }
.isle-book-cover { width: 130px; height: auto; border-radius: 4px; border: 1px solid rgba(201,162,39,.4); flex: 0 0 auto; }
.isle-h2 { font-family: var(--ff-head); color: var(--gold-lt); margin: 0 0 .5rem; font-size: 1.3rem; }
.isle-book p { font-family: var(--ff-body); color: var(--parch); line-height: 1.65; margin: 0 0 .6rem; }
.isle-book-link { color: var(--gold-lt); }
@media (max-width: 620px) {
  .cab-poster { display: none; }
  .isle-book { flex-direction: column; }
  .isle-book-cover { width: 104px; }
  .hud-center { display: none; }
  .hud-bottom-mid { width: 30%; }
  /* Batch #287: on a phone the 8:5 screen is short, and the overlays are
     taller than it — the attract how-to and the 10-row score table were
     clipped by the screen's overflow, title first, with the buttons
     stranded off the bottom edge. Top-align and scroll them instead. */
  .isle-overlay { justify-content: flex-start; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-blink { animation: none; }
  .hud-bar-fill { transition: none; }
}
