/* Floor is Boar — a tall thin game about getting away from something.
   Everything is portrait, because the whole point is up. */

:root {
  --ink:   #f2eefb;
  --dim:   #a79ec0;
  --bg:    #140f1c;
  --panel: #211a2e;
  --line:  #3a2f4f;
  --hot:   #ffbe3d;
  --boar:  #c0392b;
  --sky:   #2b2140;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 30;
  background: var(--hot); color: #241700; padding: .5rem .8rem; border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }

.bar {
  display: flex; align-items: center; gap: .9rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #150f1f70;
  position: sticky; top: 0; z-index: 8;
  backdrop-filter: blur(6px);
}
.bar h1 { font-size: 1.1rem; margin: 0; }
.bar .home { color: var(--dim); text-decoration: none; font-size: .9rem; }
.bar .home:hover { color: var(--ink); }
.bar .tag { margin: 0 0 0 auto; color: var(--dim); font-size: .78rem; }

main { padding: 1rem; }

.screen { display: none; }
.screen.active { display: block; }

.panel {
  max-width: 34rem; margin: 1.2rem auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 18px 50px #0009;
}
.panel h2 { margin: 0 0 .5rem; font-size: 1.6rem; }
.panel h3 { margin: 1.3rem 0 .4rem; font-size: 1rem; color: var(--hot); }
.lede { color: var(--dim); margin: .2rem 0 1rem; }
.hint { color: var(--dim); font-size: .9rem; }
.hint kbd {
  background: #120e1b; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: .3rem; padding: 0 .35rem; font-size: .82rem; color: var(--ink);
}
.best { font-size: 1.05rem; color: var(--hot); font-weight: 700; margin: .2rem 0 0; }

.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

.btn {
  background: var(--hot); color: #241700; border: 0;
  border-radius: .7rem; padding: .6rem 1.1rem;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.big { padding: .85rem 1.6rem; font-size: 1.1rem; }
.btn.ghost { background: #332a47; color: var(--ink); }

.score { display: grid; gap: .45rem; margin: .8rem 0 0; }
.score div {
  display: flex; justify-content: space-between; gap: 1rem;
  background: #2a2240; border-radius: .6rem; padding: .5rem .8rem; font-size: .92rem;
}
.score b { color: var(--hot); }

/* ---- the game ---- */
.hud {
  max-width: 34rem; margin: 0 auto .5rem;
  display: flex; gap: .5rem; align-items: center; justify-content: center;
}
.chip {
  background: #2a2240; border: 1px solid var(--line);
  border-radius: .5rem; padding: .25rem .6rem; font-size: .85rem;
}
.chip.big { font-size: 1.25rem; font-weight: 800; color: var(--hot); padding: .25rem .8rem; }
.chip.warn { color: var(--boar); }

.stage {
  position: relative;
  width: min(100%, 34rem);
  max-height: calc(100vh - 11rem);
  aspect-ratio: 3 / 5;
  margin: 0 auto;
}
#climb {
  display: block; width: 100%; height: 100%;
  background: var(--sky); border: 1px solid var(--line); border-radius: .8rem;
  touch-action: none;
}

.toast {
  position: absolute; left: 50%; top: .8rem; transform: translateX(-50%);
  background: #140f1cdd; border: 1px solid var(--line);
  border-radius: .6rem; padding: .3rem .8rem; margin: 0;
  font-size: .9rem; backdrop-filter: blur(3px);
}

/* ---- phones: the whole thing is one steering pad ---- */
.touch, .pad { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.touch { position: absolute; inset: 0; z-index: 4; }
.pad { position: absolute; inset: 0; }

body.full { overflow: hidden; }
body.full .bar, body.full .hud, body.full .row, body.full .skip-link { display: none; }
body.full main { padding: 0; }
body.full .stage {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  max-height: none; aspect-ratio: auto; margin: 0;
}
body.full #climb { border: 0; border-radius: 0; }

@media (max-width: 620px) {
  main { padding: .5rem; }
  .panel { padding: 1rem; }
  .stage { max-height: calc(100vh - 9rem); }
}
