/* Echo Cards: letterpress card table. Deep teal felt, cream cards, brass accents. */
:root{--bg:#0b1417;--felt:#0d1b1f;--ink:#efe6cf;--mute:#9fb3b0;--gold:#f5c542;--red:#ff6b5b}
*{box-sizing:border-box;margin:0;padding:0}
html,body{background:var(--bg);color:var(--ink)}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-text-size-adjust:100%;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
.game-header{display:flex;justify-content:space-between;align-items:center;padding:.7rem 1rem;padding-top:calc(.7rem + env(safe-area-inset-top));border-bottom:1px solid #1d3238}
.game-header a{color:var(--gold);text-decoration:none;font-weight:700;min-height:44px;display:inline-flex;align-items:center}
.game-tag{color:var(--mute);font-size:.8rem;letter-spacing:.08em;text-transform:uppercase}
.game-wrap{max-width:420px;margin:0 auto;padding:1rem}
.ec{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.ec button{font-family:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.ec-hud{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:.6rem}
.ec-hud div{background:var(--felt);border:1px solid #22393f;border-radius:8px;padding:.35rem .5rem;text-align:center}
.ec-hud small{display:block;font-size:.62rem;letter-spacing:.1em;text-transform:uppercase;color:var(--mute)}
.ec-hud b{font:700 1.05rem ui-monospace,Menlo,Consolas,monospace;color:var(--ink)}
#hud-lives{display:flex;gap:5px;justify-content:center;height:1.45rem;align-items:center}
#hud-lives i{width:12px;height:12px;border:2px solid var(--red);transform:rotate(45deg);display:block}
#hud-lives i.on{background:var(--red)}
.ec-rule{background:var(--felt);border:1px solid #22393f;border-radius:10px;padding:.55rem .7rem;margin-bottom:.6rem;min-height:5.6rem}
#rule-chips{display:flex;gap:8px;flex-wrap:wrap;min-height:36px;margin-bottom:.3rem}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--gold);border-radius:999px;padding:2px 12px 2px 6px;animation:pop .28s ease-out}
.chip b{font-family:Georgia,"Times New Roman",serif;font-size:1rem;color:var(--gold);letter-spacing:.04em}
#rule-text{font-size:.9rem;line-height:1.35;color:var(--ink)}
.ec-stage{position:relative;width:100%;border-radius:14px;overflow:hidden;border:2px solid #22393f;background:var(--felt)}
#board{display:block;touch-action:none;cursor:pointer}
.ec-overlay{position:absolute;inset:0;background:radial-gradient(ellipse at center,rgba(8,16,18,.82),rgba(4,9,10,.95));overflow-y:auto;overscroll-behavior:contain;display:flex;padding:.8rem;text-align:center;animation:fade .25s ease-out}
.ec-card{margin:auto;width:100%;display:flex;flex-direction:column;align-items:center;gap:.5rem}
.ec-overlay[hidden]{display:none}
.ec-overlay h2{font-family:Georgia,"Times New Roman",serif;font-size:2rem;letter-spacing:.03em;color:var(--gold)}
.ec-line{color:var(--ink);font-size:.95rem;line-height:1.35}
.ec-btns{display:flex;flex-direction:column;gap:8px;width:100%;max-width:280px;margin-top:.5rem}
.ec-btn{min-height:48px;border-radius:10px;border:2px solid var(--ink);background:transparent;color:var(--ink);font-size:1rem;font-weight:700;padding:.4rem 1rem;cursor:pointer}
.ec-btn.primary{background:var(--gold);border-color:var(--gold);color:#17202a}
.ec-btn.ghost{border-color:#3b565c;color:var(--mute);font-weight:600;font-size:.9rem}
.ec-btn:active{transform:scale(.97)}
.ec-btn:focus-visible,.ec-small:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
#pips{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;min-height:20px;margin:.7rem 0 .3rem}
#pips i{width:14px;height:14px;border:2px solid #3b565c;border-radius:3px;display:block;transition:background .15s,transform .15s}
#pips i.on{background:var(--gold);border-color:var(--gold);transform:scale(1.1)}
.ec-bar{display:flex;gap:8px;justify-content:space-between}
.ec-small{min-height:44px;min-width:96px;border-radius:10px;border:1px solid #3b565c;background:var(--felt);color:var(--ink);font-size:.9rem;font-weight:600;padding:0 1rem;cursor:pointer}
.ec-status{color:var(--mute);font-size:.82rem;text-align:center;margin-top:.5rem;min-height:1.2rem}
.ec-keys{color:#6f8784;font-size:.74rem;text-align:center;margin-top:.3rem}
@keyframes pop{from{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}
footer{max-width:420px;margin:0 auto;padding:1rem;color:var(--mute);font-size:.8rem;text-align:center}
footer a{color:var(--gold)}
#similar-games{max-width:420px;margin:0 auto;padding:0 1rem}
@media (prefers-reduced-motion:reduce){.chip,.ec-overlay{animation:none}#pips i,.ec-btn:active{transition:none;transform:none}}

.ec-overlay h2{text-shadow:0 2px 0 #000}
.ec-stats{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:6px;width:100%;max-width:300px}
.ec-stats div{border:1px solid #2b474e;border-radius:8px;padding:.3rem .2rem;background:rgba(13,27,31,.8)}
.ec-stats div.hot{border-color:var(--gold)}
.ec-stats b{display:block;font:700 1.15rem ui-monospace,Menlo,Consolas,monospace;color:var(--ink)}
.ec-stats .hot b{color:var(--gold)}
.ec-stats small{font-size:.6rem;letter-spacing:.08em;text-transform:uppercase;color:var(--mute)}
.ec-meter{width:100%;max-width:300px}
.ec-meter-bar{height:8px;border-radius:99px;background:#1b3036;overflow:hidden}
.ec-meter-bar i{display:block;height:100%;background:var(--gold);border-radius:99px}
.ec-note{color:var(--mute);font-size:.8rem;line-height:1.35;margin-top:.2rem}
.ec-small:disabled{opacity:.4;cursor:default}
.ec-bar .ec-small{flex:1}
@media (pointer:coarse){.ec-keys{display:none}}
@media (max-height:700px){.ec-overlay h2{font-size:1.6rem}}

/* Full screen (shell stage = #app). Board fills the stage; side panel in landscape. */
html.pip-immersive .game-header,html.pip-immersive .ad-well,html.pip-immersive footer,html.pip-immersive #similar-games,html.pip-native .game-header,html.pip-native .ad-well,html.pip-native footer,html.pip-native #similar-games{display:none}
html.pip-immersive #app,html.pip-native #app{max-width:none;margin:0;display:flex;flex-direction:column;gap:6px;padding:8px 10px;padding-bottom:calc(8px + env(safe-area-inset-bottom));overflow:hidden}
html.pip-immersive .ec-hud,html.pip-native .ec-hud{margin-bottom:0;flex:none}
html.pip-immersive .ec-rule,html.pip-native .ec-rule{margin-bottom:0;min-height:0;flex:none;padding:.4rem .6rem}
html.pip-immersive #rule-chips,html.pip-native #rule-chips{min-height:0;margin-bottom:.15rem}
html.pip-immersive #rule-text,html.pip-native #rule-text{font-size:.85rem}
html.pip-immersive .ec-stage,html.pip-native .ec-stage{flex:1 1 auto;min-height:0;height:auto!important}
html.pip-immersive #board,html.pip-native #board{position:absolute;left:0;top:0}
html.pip-immersive #pips,html.pip-native #pips{margin:0;flex:none;min-height:14px}
html.pip-immersive .ec-bar,html.pip-native .ec-bar{flex:none}
html.pip-immersive .ec-status,html.pip-native .ec-status{margin-top:0;flex:none;min-height:1rem}
html.pip-immersive .ec-keys,html.pip-native .ec-keys{display:none}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive #app,html.pip-native #app{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,34%);grid-template-rows:auto auto auto auto 1fr;gap:6px 10px;align-content:stretch}
  html.pip-immersive .ec-stage,html.pip-native .ec-stage{grid-column:1;grid-row:1 / -1}
  html.pip-immersive .ec-hud,html.pip-native .ec-hud,html.pip-immersive .ec-rule,html.pip-native .ec-rule,html.pip-immersive #pips,html.pip-native #pips,html.pip-immersive .ec-bar,html.pip-native .ec-bar,html.pip-immersive .ec-status,html.pip-native .ec-status{grid-column:2}
  html.pip-immersive .ec-bar,html.pip-native .ec-bar{flex-wrap:wrap}
  html.pip-immersive .ec-small,html.pip-native .ec-small{min-width:0}
  html.pip-immersive .ec-overlay h2,html.pip-native .ec-overlay h2{font-size:1.4rem}
  html.pip-immersive .ec-btn,html.pip-native .ec-btn{min-height:44px}
}
