@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
:root { --bg: #17452f; --fg: #fff; --muted: #cfe3d6; --gold: #f2c14e; --red: #d6334a; --card: rgba(14, 30, 24, .9); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body { font-family: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif; }
#app { position: fixed; inset: 0; }
#board { position: absolute; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#hudTop { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 8px) 10px 6px; display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0)); pointer-events: auto; }
#bMenu { width: 44px; height: 44px; border-radius: 14px; border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.3); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
#hudTop .mid { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 0; }
#hudTop .mid b { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#hudTop .mid span { font-size: 22px; font-variant-numeric: tabular-nums; }
#hPen { font-style: normal; font-size: 14px; color: var(--gold); }
#hudTop .right { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; line-height: 1.3; color: var(--muted); flex: none; }
#hMoves.warn { color: var(--gold); }
#hudBot { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px calc(env(safe-area-inset-bottom) + 8px); display: flex; justify-content: center; gap: 8px; background: linear-gradient(0deg, rgba(0,0,0,.45), rgba(0,0,0,0)); pointer-events: auto; }
#hudBot button { flex: 1; max-width: 120px; min-height: 56px; border-radius: 14px; border: 2px solid rgba(255,255,255,.3); background: rgba(10,25,18,.72); color: #fff; font: 700 14px "Space Grotesk", sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; touch-action: manipulation; }
#hudBot button svg { width: 24px; height: 24px; }
#hudBot button:active { transform: translateY(2px); }
#bZoom.on { background: rgba(242,193,78,.35); border-color: var(--gold); }
@media (orientation: landscape) and (max-height: 560px) {
  #hudBot { left: auto; top: 0; bottom: 0; width: 84px; flex-direction: column; justify-content: center; padding: 60px calc(env(safe-area-inset-right) + 8px) 8px 8px; background: linear-gradient(270deg, rgba(0,0,0,.45), rgba(0,0,0,0)); }
  #hudBot button { flex: none; min-height: 58px; max-width: none; }
  #hudTop { padding-top: 6px; right: 84px; }
}
#stuck { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 86px); transform: translateX(-50%); width: min(92vw, 420px); z-index: 8; background: var(--card); border: 2px solid var(--gold); border-radius: 18px; padding: 14px 16px; text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
#stuck b { font-size: 20px; color: var(--gold); }
#stuck p { margin: 6px 0 10px; font-size: 15px; color: var(--muted); }
#toast { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 74px); transform: translateX(-50%); max-width: min(92vw, 460px); width: max-content; padding: 10px 16px; border-radius: 16px; background: rgba(10,20,16,.92); border: 1.5px solid rgba(255,255,255,.25); font-size: 15px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
#toast.show { opacity: 1; }

/* ---------- Bildschirme ---------- */
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.scr { pointer-events: auto; position: absolute; inset: 0; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 60px) 16px calc(env(safe-area-inset-bottom) + 64px); display: flex; flex-direction: column; align-items: center; gap: 12px; touch-action: pan-y; }
.scr > * { width: 100%; max-width: 560px; }
.scr.title { justify-content: flex-end; background: linear-gradient(180deg, rgba(5,15,10,0) 25%, rgba(5,15,10,.82) 62%); }
.scr.layouts, .scr.optionen, .scr.hilfe { background: rgba(6,18,12,.88); }
.scr.pause, .scr.ende { justify-content: center; background: rgba(6,18,12,.55); }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .9; letter-spacing: .02em; margin-bottom: 4px; }
.logo span { font-size: clamp(42px, 13vw, 76px); color: #fffaf0; text-shadow: 0 3px 0 #a8885a, 0 6px 0 #6b5230, 0 10px 18px rgba(0,0,0,.45); }
.logo span + span { color: var(--gold); font-size: clamp(36px, 11vw, 64px); letter-spacing: .3em; margin-left: .3em; text-shadow: 0 3px 0 #8a5a14, 0 8px 16px rgba(0,0,0,.45); }
.claim, .stat { text-align: center; color: var(--muted); margin: 0; font-size: 16px; }
.stat { font-size: 14px; }
h2 { margin: 0; text-align: center; font-size: 28px; }
.card { background: var(--card); border: 1.5px solid rgba(255,255,255,.15); border-radius: 20px; padding: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.card.center { text-align: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.btn { appearance: none; border: 0; border-radius: 16px; padding: 14px 16px; font: 700 18px/1.15 "Space Grotesk", sans-serif; color: #fff; background: linear-gradient(180deg, #3d6b56, #285240); box-shadow: 0 4px 0 #173528, 0 8px 18px rgba(0,0,0,.25); cursor: pointer; touch-action: manipulation; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.btn small { font-size: 13px; color: var(--muted); font-weight: 700; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #173528; }
.btn.big { font-size: 24px; padding: 17px; background: linear-gradient(180deg, #e04b60, var(--red) 55%, #a8192f); box-shadow: 0 5px 0 #6e0f1e, 0 10px 24px rgba(214,51,74,.35); }
.btn.big small { color: #ffe0e5; }
.btn.daily { background: linear-gradient(180deg, #f6cf6a, #e3a92c); color: #3a2400; box-shadow: 0 4px 0 #8a5a14; }
.btn.daily small { color: #5a3a00; }
.btn.ghost { background: transparent; box-shadow: none; border: 1.5px solid rgba(255,255,255,.3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-width: 900px !important; }
.lcard { appearance: none; border: 1.5px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(255,255,255,.06); color: #fff; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: 700 16px "Space Grotesk", sans-serif; }
.lcard:hover, .lcard:focus-visible { border-color: var(--gold); background: rgba(242,193,78,.12); }
.lcard canvas { width: 100%; height: auto; max-width: 180px; }
.lcard small { font-size: 12.5px; color: var(--muted); }
.lcard small.best { color: var(--gold); }
.optrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 16px; flex-wrap: wrap; }
.seg { display: flex; gap: 6px; }
.seg button { appearance: none; border: 1.5px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: var(--muted); border-radius: 10px; padding: 9px 12px; font: 700 15px "Space Grotesk", sans-serif; cursor: pointer; }
.seg button.on { background: var(--gold); color: #3a2400; border-color: #fff; }
#setPrev { display: block; margin: 0 auto; max-width: 100%; }
.help p, .help li { font-size: 16px; line-height: 1.5; color: #eef6f0; }
.help ul { padding-left: 20px; }
.note { color: var(--muted); font-size: 14px !important; }
.win { font-size: 40px; color: var(--gold); text-shadow: 0 4px 0 #8a5a14; }
.bigtime { font-size: 58px; font-variant-numeric: tabular-nums; margin: 4px 0; }
.sub { color: var(--muted); margin: 4px 0; font-size: 15px; }
.rec { color: var(--gold); font-size: 18px; margin: 6px 0; }
.noscript { padding: 20px; }
@media (orientation: landscape) and (max-height: 560px) {
  .scr { padding-top: 12px; gap: 8px; }
  .scr.title { justify-content: center; align-items: flex-end; padding-right: 5vw; background: linear-gradient(90deg, rgba(5,15,10,0) 30%, rgba(5,15,10,.85) 62%); }
  .scr.title > * { max-width: 380px; }
  .logo span { font-size: 40px; } .logo span + span { font-size: 34px; }
  .btn.big { font-size: 20px; padding: 12px; }
  .bigtime { font-size: 42px; }
}
@media (min-aspect-ratio: 6/5) and (min-width: 900px) {
  .scr.title { justify-content: center; align-items: flex-end; padding-right: max(5vw, 24px); background: linear-gradient(90deg, rgba(5,15,10,0) 35%, rgba(5,15,10,.82) 65%); }
  .scr.title > * { max-width: 440px; }
}
