/* Blockie. Builds on base.css, which carries the tokens and the shared
   components; this file is the same fixed-viewport treatment style.css gives
   Teteri, minus everything specific to a falling-block playfield. */

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  /* Dragging a piece means holding a finger down and moving it, which is also
     the gesture for select-and-drag text. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
}

/* ── overlay screens ───────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(80, 30, 140, .42), transparent 62%),
    rgba(4, 5, 12, .9);
  animation: fade-in .32s ease both;
  overflow-y: auto;
  touch-action: pan-y;
}
.screen.hidden { display: none; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

.panel {
  width: min(520px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: clamp(20px, 4vh, 40px) clamp(18px, 4vw, 40px);
  border: 1px solid var(--edge);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 24, 54, .78), rgba(8, 9, 22, .85));
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .04) inset,
    0 30px 90px rgba(0, 0, 0, .7),
    0 0 70px rgba(90, 40, 180, .35);
}

.logo { font-size: clamp(38px, 11vw, 82px); letter-spacing: clamp(3px, 1.1vw, 11px); }

.tagline {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: .5em;
  text-transform: uppercase;
  font-size: clamp(10px, 2.4vw, 13px);
  color: rgba(180, 220, 255, .62);
  margin-left: .5em;
  margin-top: 8px;
}

.heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 6vw, 38px);
  letter-spacing: .1em;
  color: #fff;
  text-shadow: 0 0 22px rgba(90, 220, 255, .8), 0 0 60px rgba(120, 90, 255, .6);
}

.cta.huge {
  width: 100%;
  padding: clamp(18px, 3.6vh, 26px) 34px;
  font-size: clamp(24px, 7vw, 40px);
  letter-spacing: .3em;
  text-indent: .3em;
  border-radius: 22px;
  box-shadow: 0 0 44px rgba(80, 210, 255, .55), 0 14px 40px rgba(0, 0, 0, .55);
}
.cta.huge:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 66px rgba(120, 220, 255, .8), 0 18px 46px rgba(0, 0, 0, .6);
}

.hiscore {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .3em;
  color: rgba(160, 200, 255, .55);
}
.hiscore span { color: var(--amber); text-shadow: 0 0 14px rgba(255, 193, 77, .7); }

.final {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 11vw, 66px);
  color: #fff;
  text-shadow: 0 0 26px rgba(80, 220, 255, .8);
  line-height: 1;
}
.newbest {
  font-family: var(--font-display);
  letter-spacing: .22em;
  font-size: 13px;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 193, 77, .8);
  animation: blink 1s steps(2) infinite;
}
.newbest.hidden { display: none; }
@keyframes blink { 50% { opacity: .25 } }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}
.stats div {
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid rgba(120, 190, 255, .16);
  background: rgba(120, 190, 255, .05);
}
.stats b { display: block; font-family: var(--font-display); font-size: 20px; color: #eaf6ff; }
.stats i {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(160, 200, 255, .55);
}

/* ── how-to-play steps ─────────────────────────────────────────────── */
.steps {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(120, 190, 255, .18);
  background: rgba(120, 190, 255, .05);
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(200, 226, 250, .88);
}
.steps b { color: #fff; font-weight: 700; }
.step-n {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #041018;
  background: linear-gradient(100deg, var(--cyan), var(--purple));
}
.hint-line {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(160, 200, 255, .55);
}

/* ── toolbar ───────────────────────────────────────────────────────── */
#toolbar {
  position: fixed;
  z-index: 30;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
}
.tool {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
  color: #bfe6ff;
  border: 1px solid rgba(120, 190, 255, .22);
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color .18s, border-color .18s, box-shadow .18s, transform .12s;
  font-size: 17px;
  line-height: 1;
}
.tool:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 4px rgba(34, 224, 255, .45);
}
.tool:hover  { color: #fff; border-color: rgba(140, 220, 255, .6); }
.tool:active { transform: scale(.93); }
.tool.off { color: rgba(150, 175, 205, .35); border-color: rgba(120, 150, 190, .16); }
.tool.off .ico { position: relative; }
.tool.off .ico::after {
  content: '';
  position: absolute;
  left: -4px; right: -4px; top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-38deg);
}

/* ── score readout ─────────────────────────────────────────────────── */
#hud {
  position: fixed;
  z-index: 10;
  top: max(12px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
#hud-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 20px rgba(80, 220, 255, .7);
}
#hud-combo {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 193, 77, .8);
}
#hud-combo.hidden { display: none; }
#hud.hidden { display: none; }
.hud-sub {
  display: flex;
  gap: 14px;
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: .17em;
  color: rgba(150, 195, 240, .5);
}
.hud-sub i { font-style: normal; color: rgba(210, 235, 255, .85); }

/* ── footer on the title screen ────────────────────────────────────── */
#site-footer { width: 100%; text-align: center; margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .screen, .newbest { animation: none !important; }
}
