/* ============================================================
   Boggle Lab — structural layout and original components.
   The Game Room visual theme lives in assets/game-room.css.
   Hand-built CSS. No frameworks, no external assets, no build.
   ============================================================ */

:root {
  --ink: #0e2438;
  --ink-soft: #435a70;
  --ink-mute: #5b7185;
  --line: rgba(90, 140, 190, 0.2);
  --line-strong: rgba(70, 125, 180, 0.34);
  --blue: #0a84ff;
  --blue-deep: #0a6fd0;
  --blue-ink: #074a8c;
  --aqua: #00a7c4;
  --aqua-deep: #007f96;
  --aqua-light: #8ce7ff;
  --pink: #d92f75;
  --pink-deep: #b81b64;
  --rose: #ffb7d9;
  --mint: #8ce79c;
  --green: #1a8234;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-deep: rgba(238, 248, 255, 0.62);
  --glass-line: rgba(255, 255, 255, 0.86);
  --shadow: 0 30px 70px -38px rgba(18, 64, 110, 0.55);
  --shadow-soft: 0 18px 40px -28px rgba(18, 64, 110, 0.45);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 24px;
  --radius-sm: 14px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: #dcefff;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: #0a6fc2;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button,
a,
.tile {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

::selection {
  color: #3d0b23;
  background: rgba(255, 120, 175, 0.3);
}

:focus-visible {
  outline: 3px solid #0a6fc2;
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -70px;
  left: 18px;
  z-index: 80;
  padding: 10px 16px;
  border: 1px solid rgba(120, 170, 215, 0.55);
  border-radius: 10px;
  background: #fff;
  color: #12314d;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(20, 70, 120, 0.25);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- light desktop ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 82% -12%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 62%),
    radial-gradient(1000px 700px at 64% 8%, rgba(86, 180, 255, 0.45), rgba(86, 180, 255, 0) 66%),
    radial-gradient(820px 620px at 2% 22%, rgba(70, 212, 212, 0.3), rgba(70, 212, 212, 0) 62%),
    radial-gradient(760px 600px at 95% 76%, rgba(255, 145, 195, 0.3), rgba(255, 145, 195, 0) 66%),
    radial-gradient(820px 560px at 44% 108%, rgba(145, 190, 255, 0.42), rgba(145, 190, 255, 0) 68%),
    linear-gradient(168deg, #f3fbff 0%, #dceffd 36%, #c9e4f8 72%, #b7d9f1 100%);
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.22) 0 1px,
    transparent 1px 5px
  );
  opacity: 0.5;
  mix-blend-mode: soft-light;
}

.scene-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.52;
}

.glow-one {
  top: -18vh;
  right: -10vw;
  width: 62vw;
  height: 55vh;
  background: radial-gradient(circle, rgba(60, 155, 255, 0.55), transparent 68%);
}

.glow-two {
  top: 38vh;
  left: -16vw;
  width: 48vw;
  height: 48vh;
  background: radial-gradient(circle, rgba(50, 215, 215, 0.36), transparent 68%);
}

.glow-three {
  bottom: -20vh;
  right: 6vw;
  width: 44vw;
  height: 42vh;
  background: radial-gradient(circle, rgba(255, 125, 185, 0.32), transparent 68%);
}

.scene-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.16);
}

.ring-one {
  top: 12vh;
  right: 7vw;
  width: 240px;
  height: 240px;
  opacity: 0.45;
}

.ring-two {
  bottom: 14vh;
  left: 5vw;
  width: 150px;
  height: 150px;
  opacity: 0.32;
}

.scene-grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- shell ---------- */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 26px 18px;
  flex-direction: column;
}

.glass {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.86) 0%, rgba(240, 249, 255, 0.66) 58%, rgba(232, 246, 255, 0.58) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(120, 175, 220, 0.1) inset,
    var(--shadow);
  backdrop-filter: blur(20px) saturate(1.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.16);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 13px;
  background: linear-gradient(155deg, #5dc5ff, #0a6fd0 70%);
  box-shadow:
    0 12px 22px -12px rgba(10, 100, 190, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-copy small {
  color: #34637e;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navlink {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  color: #27506b;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.navlink:hover {
  background: rgba(255, 255, 255, 0.55);
  color: #0a5a9a;
}

.navlink-github {
  color: #0a6fc2;
}

.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 #fff, 0 8px 16px -12px rgba(20, 70, 120, 0.5);
  color: #27506b;
  transition: background 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-off {
  display: none;
}

body.is-muted .sound-on {
  display: none;
}

body.is-muted .sound-off {
  display: block;
}

/* ---------- buttons and fields ---------- */

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  color: #12314d;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.1;
  text-decoration: none;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    filter 0.14s ease,
    background 0.14s ease;
  user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  filter: saturate(0.4);
  opacity: 0.55;
}

.btn-primary {
  border-color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(180deg, #40b8ff 0%, #0a7fe6 52%, #0a6ac4 100%);
  box-shadow:
    0 9px 20px -12px rgba(10, 100, 200, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 60, 120, 0.55);
}

.btn-primary:hover:not(:disabled) {
  box-shadow:
    0 13px 24px -12px rgba(10, 100, 200, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-secondary {
  background: linear-gradient(180deg, #ffffff, #eaf6ff);
  box-shadow:
    0 8px 18px -14px rgba(20, 80, 140, 0.65),
    inset 0 1px 0 #fff;
  color: #0a5f9e;
}

.btn-ghost {
  border-color: rgba(120, 165, 205, 0.3);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #40627a;
}

.btn-large {
  min-height: 52px;
  padding: 14px 23px;
  border-radius: 14px;
  font-size: 15.5px;
}

.btn-compact {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-arrow {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field > span {
  color: #557188;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field select {
  min-height: 38px;
  padding: 7px 30px 7px 11px;
  border: 1px solid rgba(120, 165, 205, 0.4);
  border-radius: 9px;
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 2px rgba(20, 70, 120, 0.06);
  color: #1b3d55;
  font-size: 13.5px;
  font-weight: 550;
}

/* ---------- home hero ---------- */

.screen {
  animation: screen-in 0.32s ease both;
}

.home-screen {
  padding-bottom: 12px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 24px;
  align-items: center;
  overflow: hidden;
  min-height: 520px;
  padding: 44px 42px 42px 46px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #17658a;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a8c4;
  box-shadow: 0 0 0 4px rgba(22, 168, 196, 0.13);
}

.hero-title {
  margin-bottom: 20px;
  color: #0d263d;
  font-size: clamp(48px, 6.6vw, 82px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.91;
}

.hero-title em {
  background: linear-gradient(96deg, #0a7fe6 10%, #00a7c4 58%, #d92f75 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.hero-lede {
  max-width: 47ch;
  margin-bottom: 24px;
  color: #39566d;
  font-size: 16px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.round-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.load-status {
  min-height: 20px;
  margin-top: 15px;
  color: #4c7088;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.load-status.is-ready {
  color: #26754a;
}

.load-status.is-error {
  color: #b42b45;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 13px;
  color: #5f7c90;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #7fa6bf;
}

.hero-meta b {
  color: #265a78;
  font-weight: 700;
}

.hero-art {
  position: relative;
  display: grid;
  min-height: 430px;
  place-items: center;
}

.art-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, 100%);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 18%, rgba(140, 231, 255, 0.18) 46%, transparent 70%),
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.4) 0deg 8deg, transparent 8deg 24deg);
  transform: translate(-50%, -50%);
  opacity: 0.9;
}

.preview-caption {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 3;
  color: #2f6f8d;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.preview-board {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(330px, 78%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow:
    0 24px 50px -30px rgba(20, 70, 120, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: rotate(-2deg);
}

.preview-board .tile {
  min-height: 64px;
  font-size: clamp(20px, 2.3vw, 28px);
  cursor: default;
}

.preview-board .tile:hover {
  transform: none;
}

.solver-badge {
  position: absolute;
  right: 0;
  bottom: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 15px 12px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 30px -18px rgba(20, 70, 120, 0.5), inset 0 1px 0 #fff;
  backdrop-filter: blur(12px);
}

.solver-badge span {
  color: #5a7a8f;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.solver-badge strong {
  color: #0a6fd0;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.solver-badge small {
  color: #55748a;
  font-size: 9px;
}

.float-chip {
  position: absolute;
  z-index: 3;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 9px 18px -14px rgba(20, 70, 120, 0.55), inset 0 1px 0 #fff;
  color: #2a6380;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}

.chip-qu {
  top: 18%;
  left: 2%;
  color: #9a2357;
  transform: rotate(-6deg);
}

.chip-11 {
  top: 9%;
  right: 1%;
  transform: rotate(5deg);
}

.chip-dfs {
  bottom: 24%;
  left: 1%;
  transform: rotate(4deg);
}

/* ---------- feature row ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.feature {
  padding: 19px 19px 18px;
  border-radius: 18px;
}

.feature-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.feature-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-blue {
  background: linear-gradient(160deg, #dff2ff, #b9dcff);
  color: #0a63b4;
}

.icon-aqua {
  background: linear-gradient(160deg, #dcfbff, #a8e9f3);
  color: #087382;
}

.icon-pink {
  background: linear-gradient(160deg, #ffe6f2, #ffc1dc);
  color: #a51a56;
}

.feature h2 {
  margin-bottom: 6px;
  color: #12314d;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature p {
  color: #4c687d;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- reduced motion is handled at the end ---------- */

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- board lab ---------- */

.lab {
  margin-top: 14px;
  padding: 27px 28px 25px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-head h2 {
  max-width: 22ch;
  color: #0e2b43;
  font-size: clamp(25px, 3.1vw, 36px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-lede {
  max-width: 66ch;
  margin-top: 10px;
  color: #4b687e;
  font-size: 13.5px;
  line-height: 1.65;
}

.section-lede b {
  color: #2b5874;
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 8px;
}

.lab-status {
  min-height: 18px;
  margin-top: 16px;
  color: #3c718d;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.lab-summary {
  min-height: 20px;
  margin-top: 5px;
  color: #47677d;
  font-size: 12.5px;
  line-height: 1.55;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.lab-card {
  padding: 15px 15px 12px;
  border: 1px solid rgba(150, 190, 225, 0.4);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.43);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.lab-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lab-card-head h3 {
  color: #173b55;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lab-card-head span {
  color: #68849a;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.histogram {
  display: flex;
  min-height: 164px;
  align-items: stretch;
  justify-content: center;
}

.hist-placeholder {
  display: grid;
  width: 100%;
  min-height: 150px;
  place-items: center;
  border: 1px dashed rgba(140, 180, 215, 0.45);
  border-radius: 10px;
  color: #7792a6;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-align: center;
}

.hist-bars {
  display: flex;
  width: 100%;
  height: 150px;
  align-items: flex-end;
  gap: 5px;
  padding-top: 18px;
}

.hist-col {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.hist-count {
  color: #4d7189;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
}

.hist-bar {
  width: 100%;
  max-width: 38px;
  height: var(--h, 0%);
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #77dcff 0%, #22a7e8 50%, #0a6fd0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 10px -6px rgba(10, 100, 190, 0.6);
}

.hist-col:nth-child(2n) .hist-bar {
  background: linear-gradient(180deg, #a2f0f7 0%, #1ab9cb 52%, #008da4 100%);
}

.hist-bin {
  overflow: hidden;
  max-width: 100%;
  color: #6e8a9e;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.hill-card {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(150, 190, 225, 0.4);
  border-radius: 17px;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.58), rgba(235, 248, 255, 0.46));
}

.hill-board-wrap {
  position: relative;
  flex: 0 0 auto;
}

.mini-board {
  display: grid;
  width: 178px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(150, 190, 225, 0.42);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 #fff;
}

.mini-board .tile {
  min-height: 34px;
  border-radius: 7px;
  font-size: 13px;
  cursor: default;
}

.mini-board .tile:hover {
  transform: none;
}

.mini-board .tile-order {
  display: none;
}

.hill-tag {
  position: absolute;
  right: -7px;
  bottom: -7px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #ffe3ef);
  box-shadow: 0 6px 12px -8px rgba(120, 30, 70, 0.5);
  color: #a51a56;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hill-copy {
  min-width: 0;
}

.hill-copy h3 {
  margin-bottom: 5px;
  color: #163b56;
  font-size: 15px;
  font-weight: 700;
}

.hill-copy p {
  max-width: 65ch;
  margin-bottom: 10px;
  color: #4f6c81;
  font-size: 12.5px;
  line-height: 1.55;
}

.hill-copy .btn {
  margin-top: 2px;
}

.fine-print {
  margin-top: 9px !important;
  color: #6c8698 !important;
  font-family: var(--mono);
  font-size: 9px !important;
  letter-spacing: 0.02em;
}

/* ---------- how strip ---------- */

.how-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  padding: 0;
}

.how-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 19px 20px;
  border-right: 1px solid rgba(140, 185, 220, 0.28);
}

.how-step:last-child {
  border-right: 0;
}

.how-step > span {
  color: #1682aa;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.how-step h3 {
  margin-bottom: 3px;
  color: #183c56;
  font-size: 13px;
  font-weight: 700;
}

.how-step p {
  color: #506d82;
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---------- game screen ---------- */

.game-screen {
  padding-bottom: 10px;
}

.game-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 18px;
}

.round-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-right: 15px;
  border-right: 1px solid rgba(140, 185, 220, 0.32);
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #e4f5ff);
  box-shadow: inset 0 1px 0 #fff, 0 4px 9px -7px rgba(20, 70, 120, 0.5);
  color: #0a6b9e;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.round-detail {
  overflow: hidden;
  color: #4a6a80;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer {
  min-width: 150px;
  flex: 1;
}

.timer-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #12314d;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-line small {
  color: #6d879a;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timer-track {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid rgba(120, 165, 205, 0.35);
  border-radius: 999px;
  background: rgba(215, 235, 250, 0.7);
  box-shadow: inset 0 1px 2px rgba(20, 70, 120, 0.08);
}

#timerFill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fd0e0, #0a9ec4 58%, #0a7fe6);
  transition: width 0.2s linear, background 0.25s ease;
}

#timerFill.is-warn {
  background: linear-gradient(90deg, #ffd76b, #f3a91d);
}

#timerFill.is-low {
  background: linear-gradient(90deg, #ff9b7d, #d92f48);
}

.timer.is-urgent .timer-line {
  color: #b42038;
}

.hud-score {
  display: flex;
  min-width: 54px;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 14px;
  border-left: 1px solid rgba(140, 185, 220, 0.32);
}

.hud-score span {
  color: #6a8497;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-score strong {
  color: #12314d;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.cpu-hud strong {
  color: #a51a56;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 302px;
  gap: 14px;
  align-items: start;
  margin-top: 13px;
}

.play-column,
.side-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.board-card {
  padding: 17px 20px 13px;
  border-radius: 22px;
}

.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.board-label {
  color: #49697f;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.found-counter {
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #4f7389;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.word-form {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.word-input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  padding: 10px 13px;
  border: 1px solid rgba(120, 165, 205, 0.48);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 3px rgba(20, 70, 120, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.8);
  color: #12314d;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.word-input::placeholder {
  color: #7b95a8;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.word-input:focus-visible {
  border-color: rgba(10, 127, 230, 0.7);
  outline-offset: 2px;
}

.board-wrap {
  position: relative;
  width: min(100%, 470px);
  margin: 13px auto 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(var(--side, 4), minmax(0, 1fr));
  gap: clamp(6px, 1.5vw, 10px);
}

.tile {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: clamp(10px, 2.4vw, 17px);
  background:
    linear-gradient(155deg, #ffffff 0%, #f1faff 58%, #d9edfc 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -5px 10px rgba(70, 130, 190, 0.12),
    0 10px 18px -14px rgba(20, 70, 120, 0.65);
  color: #12314d;
  font-family: var(--sans);
  font-size: clamp(22px, 6.2vw, 42px);
  font-weight: 780;
  letter-spacing: -0.06em;
  line-height: 1;
  cursor: pointer;
  touch-action: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease,
    color 0.12s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -5px 10px rgba(70, 130, 190, 0.1),
    0 15px 24px -15px rgba(20, 70, 120, 0.7);
}

.tile:active {
  transform: translateY(1px) scale(0.985);
}

.tile:focus-visible {
  z-index: 5;
  outline-offset: 2px;
}

.tile-letter {
  display: block;
  pointer-events: none;
}

.tile-letter.is-qu {
  font-size: 0.68em;
  letter-spacing: -0.09em;
}

.tile-order {
  position: absolute;
  top: 5px;
  right: 6px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #0a5f9e;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.tile.is-selected {
  border-color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(155deg, #a7f0ff 0%, #43c9f0 45%, #0aa0cf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -5px 10px rgba(0, 90, 130, 0.16),
    0 0 0 3px rgba(0, 167, 196, 0.28),
    0 13px 22px -14px rgba(0, 90, 130, 0.7);
  color: #043345;
  transform: translateY(-1px);
}

.tile.is-selected .tile-order {
  opacity: 1;
}

.tile.is-preview,
.tile.is-path {
  background: linear-gradient(155deg, #ffe8f3 0%, #ffb7d9 50%, #ec6aa9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -5px 10px rgba(130, 20, 70, 0.14),
    0 0 0 2px rgba(217, 47, 117, 0.22),
    0 13px 22px -14px rgba(120, 30, 70, 0.6);
  color: #4b0a25;
}

.tile.is-start {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 0 4px rgba(255, 183, 217, 0.55),
    0 13px 22px -14px rgba(120, 30, 70, 0.6);
}

.tile.is-end {
  outline: 2px solid rgba(217, 47, 117, 0.55);
  outline-offset: 2px;
}

.tile.is-path .tile-order,
.tile.is-preview .tile-order {
  opacity: 1;
  color: #9a2357;
}

.path-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.path-line {
  fill: none;
  stroke: rgba(184, 27, 100, 0.46);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-line.is-preview {
  stroke: rgba(184, 27, 100, 0.68);
  stroke-dasharray: 2 10;
}

.path-dot {
  fill: #ffffff;
  stroke: rgba(184, 27, 100, 0.8);
  stroke-width: 2.5;
}

.path-dot.is-preview {
  fill: #ffe8f3;
}

.path-dot.is-end {
  fill: #b81b64;
}

@media (max-width: 700px) {
  .path-line {
    stroke-width: 6;
  }
}

.word-line {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.current-word {
  overflow: hidden;
  color: #12314d;
  font-family: var(--mono);
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.current-word.is-empty {
  color: #8ba2b3;
  letter-spacing: 0;
}

.word-score {
  min-width: 42px;
  color: #0a7f9e;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.board-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.key-hint {
  color: #6c879a;
  font-size: 10.5px;
  line-height: 1.4;
  text-align: right;
}

kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid rgba(120, 165, 205, 0.38);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 -1px 0 rgba(120, 165, 205, 0.2);
  color: #426277;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.4;
}

.live-message {
  min-height: 22px;
  margin-top: 7px;
  color: #5b788c;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-align: center;
}

.live-message.is-good {
  color: #17724a;
}

.live-message.is-warn {
  color: #9a6511;
}

.live-message.is-bad {
  color: #b42b45;
}

/* ---------- side panel ---------- */

.side-card {
  padding: 15px 16px;
  border-radius: 18px;
}

.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.side-head h2 {
  color: #173b55;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.side-head span {
  color: #6a8497;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-pair > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 9px;
  border: 1px solid rgba(150, 190, 225, 0.35);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.38);
}

.stat-pair span {
  color: #6c879a;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-pair strong {
  color: #12314d;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.cpu-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(150, 190, 225, 0.28);
}

.cpu-panel-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cpu-panel-head b {
  color: #8f2455;
  font-size: 10.5px;
  font-weight: 650;
}

.cpu-panel-head span:last-child {
  margin-left: auto;
  color: #6a8497;
  font-family: var(--mono);
  font-size: 8px;
}

.cpu-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d92f75;
  box-shadow: 0 0 0 3px rgba(217, 47, 117, 0.12);
}

.cpu-panel p {
  min-height: 18px;
  margin-top: 6px;
  color: #5b788c;
  font-size: 10.5px;
  line-height: 1.45;
}

.word-list {
  display: flex;
  max-height: 245px;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 150, 190, 0.4) transparent;
}

.word-list.tall {
  max-height: 430px;
}

.word-list::-webkit-scrollbar {
  width: 8px;
}

.word-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(100, 150, 190, 0.35);
  background-clip: padding-box;
}

.word-btn {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(150, 190, 225, 0.32);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.36);
  color: #244a63;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.word-btn:hover {
  border-color: rgba(10, 127, 230, 0.35);
  background: rgba(255, 255, 255, 0.72);
}

.word-btn .pts {
  color: #0a7f9e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
}

.word-btn.is-active {
  border-color: rgba(217, 47, 117, 0.45);
  background: rgba(255, 231, 242, 0.8);
  color: #8f2455;
}

.empty {
  padding: 8px 4px;
  color: #7792a4;
  font-size: 11px;
  line-height: 1.5;
}

.scoring-card .score-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.score-list > div {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
}

.score-list dt {
  color: #5d7a8d;
}

.score-list dd {
  margin-left: auto;
  color: #12314d;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.side-note {
  margin-top: 9px;
  color: #6c879a;
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- results ---------- */

.results-screen {
  padding-bottom: 10px;
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 23px 25px 21px;
}

.results-title {
  color: #0d2a43;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.results-title:focus {
  outline: none;
}

.results-sub {
  max-width: 66ch;
  margin-top: 8px;
  color: #47657b;
  font-size: 13.5px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.summary-card {
  display: flex;
  min-height: 111px;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 15px;
  border-radius: 16px;
}

.summary-card > span {
  color: #5e7b8f;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.summary-card strong {
  color: #12314d;
  font-family: var(--mono);
  font-size: clamp(27px, 3.4vw, 37px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 1;
}

.summary-card small {
  color: #668194;
  font-size: 10px;
  line-height: 1.35;
}

.summary-card:nth-child(1) strong {
  color: #0a6fd0;
}

.summary-card:nth-child(2) strong {
  color: #0a8ea8;
}

.summary-card:nth-child(3) strong {
  color: #a51a56;
}

.cpu-result {
  margin-top: 10px;
  padding: 11px 15px;
  border-radius: 13px;
  color: #6d2147;
  font-size: 12px;
  line-height: 1.5;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.08fr);
  gap: 13px;
  align-items: start;
  margin-top: 12px;
}

.results-board-column {
  position: sticky;
  top: 12px;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
}

.results-lists {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 11px;
}

.list-card {
  padding: 15px 16px 13px;
  border-radius: 17px;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.list-head h2 {
  color: #173b55;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.list-head span {
  color: #6a8497;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.list-note {
  margin: 3px 0 8px;
  color: #6a8497;
  font-size: 10.5px;
  line-height: 1.45;
}

.results-lists .word-btn {
  min-height: 34px;
}

.path-readout {
  min-height: 36px;
  margin-top: 9px;
  color: #4d6d83;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.55;
}

.result-meta {
  padding: 9px 12px;
  border-radius: 11px;
  color: #5d7a8e;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
}

.board-static .tile {
  cursor: default;
}

.board-static .tile:hover {
  transform: none;
}

/* ---------- dialog ---------- */

.how-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(84vh, 780px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  background: linear-gradient(155deg, #ffffff, #eef9ff 62%, #e2f3ff);
  box-shadow: 0 40px 100px -30px rgba(10, 50, 90, 0.6), inset 0 1px 0 #fff;
  color: #203d55;
}

.how-dialog::backdrop {
  background: rgba(15, 45, 75, 0.34);
  backdrop-filter: blur(6px);
}

.how-dialog[open] {
  animation: dialog-in 0.2s ease both;
}

.dialog-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(140, 185, 220, 0.32);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.dialog-bar h2 {
  color: #12314d;
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -0.03em;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(120, 165, 205, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: #426277;
  font-size: 21px;
  line-height: 1;
}

.dialog-close:hover {
  background: #fff;
}

.dialog-body {
  max-height: calc(min(84vh, 780px) - 67px);
  padding: 4px 24px 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.dialog-body section {
  padding: 17px 0;
  border-bottom: 1px solid rgba(140, 185, 220, 0.24);
}

.dialog-body section:last-child {
  border-bottom: 0;
}

.dialog-body h3 {
  margin-bottom: 6px;
  color: #16405d;
  font-size: 13.5px;
  font-weight: 700;
}

.dialog-body p {
  color: #4a687e;
  font-size: 12.5px;
  line-height: 1.7;
}

.dialog-body b {
  color: #1b5274;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- footer ---------- */

.page-foot {
  margin-top: auto;
  padding: 26px 2px 4px;
  color: #5c788c;
  font-size: 10.5px;
  line-height: 1.55;
}

.foot-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.foot-main > p {
  max-width: 66ch;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
  flex: 0 0 auto;
}

.foot-nav a {
  color: #356982;
  text-decoration: none;
}

.foot-nav a:hover {
  color: #0a5f9e;
  text-decoration: underline;
}

.foot-fine {
  margin-top: 8px;
  color: #718b9d;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.noscript {
  padding: 16px;
  border: 1px solid #e0a0ae;
  border-radius: 10px;
  background: #fff2f4;
  color: #7c1b2e;
}

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 36px 34px 34px;
  }

  .hero-art {
    min-height: 360px;
  }

  .hero-lede {
    max-width: 58ch;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .results-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .results-board-column {
    position: static;
  }
}

@media (max-width: 860px) {
  .app {
    padding: 16px 18px 14px;
  }

  .topnav .navlink {
    padding: 7px 9px;
    font-size: 12.5px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature:last-child {
    grid-column: 1 / -1;
  }

  .lab {
    padding: 22px;
  }

  .section-head {
    flex-direction: column;
    gap: 14px;
  }

  .section-head h2 {
    max-width: 26ch;
  }

  .lab-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .how-step {
    padding: 15px 14px;
  }

  .results-head {
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .app {
    padding: 12px 13px 10px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-bottom: 15px;
  }

  .topnav {
    gap: 0;
  }

  .topnav .navlink {
    padding: 7px 7px;
    font-size: 12px;
  }

  .navlink-github {
    display: none;
  }

  .hero {
    min-height: 0;
    padding: 27px 23px 25px;
  }

  .hero-art {
    min-height: 320px;
  }

  .hero-title {
    font-size: clamp(43px, 12vw, 62px);
  }

  .hero-lede {
    font-size: 14.5px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature:last-child {
    grid-column: auto;
  }

  .lab-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hill-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hill-copy {
    width: 100%;
  }

  .how-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .how-step {
    border-right: 0;
    border-bottom: 1px solid rgba(140, 185, 220, 0.28);
  }

  .how-step:last-child {
    border-bottom: 0;
  }

  .game-head {
    flex-wrap: wrap;
    gap: 9px 12px;
    padding: 11px 12px;
  }

  .round-meta {
    padding-right: 10px;
  }

  .timer {
    order: 5;
    min-width: 100%;
    flex-basis: 100%;
  }

  .hud-score {
    min-width: 44px;
    padding-left: 10px;
  }

  .hud-score strong {
    font-size: 19px;
  }

  .board-card {
    padding: 13px 13px 11px;
  }

  .word-form {
    gap: 6px;
  }

  .word-input {
    padding: 9px 10px;
    font-size: 16px;
  }

  .word-form .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .key-hint {
    font-size: 9px;
  }

  .side-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-head {
    padding: 19px 18px 17px;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .btn {
    flex: 1 1 auto;
  }

  .foot-main {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .app {
    padding: 9px 9px 8px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    font-size: 8.5px;
  }

  .topnav .navlink {
    padding: 6px 5px;
    font-size: 11.5px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding: 23px 17px 21px;
  }

  .hero::before {
    inset: 7px;
  }

  .hero-title {
    font-size: clamp(40px, 12.5vw, 52px);
  }

  .hero-art {
    min-height: 275px;
  }

  .preview-board {
    width: min(272px, 88%);
    gap: 6px;
    padding: 9px;
  }

  .preview-board .tile {
    min-height: 52px;
    font-size: 21px;
  }

  .solver-badge {
    right: -2px;
    bottom: 5px;
    padding: 8px 11px;
  }

  .solver-badge strong {
    font-size: 25px;
  }

  .float-chip {
    font-size: 8px;
  }

  .round-options {
    gap: 8px;
  }

  .field {
    flex: 1 1 42%;
  }

  .field select {
    width: 100%;
  }

  .lab {
    padding: 18px 14px;
  }

  .lab-actions {
    width: 100%;
  }

  .lab-actions .btn {
    flex: 1 1 auto;
  }

  .hist-bars {
    gap: 3px;
  }

  .hist-bin {
    font-size: 6.5px;
  }

  .board-card {
    padding: 11px 10px 9px;
  }

  .board-wrap {
    margin-top: 10px;
  }

  .tile {
    font-size: clamp(20px, 8.4vw, 34px);
    border-radius: 10px;
  }

  .current-word {
    font-size: 18px;
  }

  .board-actions {
    justify-content: center;
  }

  .key-hint {
    display: none;
  }

  .results-head {
    padding: 16px 14px 14px;
  }

  .summary-card {
    min-height: 96px;
    padding: 11px 12px;
  }

  .summary-card strong {
    font-size: 25px;
  }

  .list-card {
    padding: 13px 12px 11px;
  }

  .foot-fine {
    font-size: 7.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

