:root {
  --bg: #0b0d0d;
  --surface: #141817;
  --surface-2: #1a201e;
  --surface-3: #232b28;
  --text: #f5f2e8;
  --muted: #8f9a94;
  --border: #2a342f;
  --empty-border: #34413b;
  --key-bg: #202824;
  --key-bg-hover: #2a342f;
  --correct: #3f9f68;
  --correct-deep: #28734b;
  --present: #d8b84f;
  --present-deep: #9f7b28;
  --absent: #4d5652;
  --absent-deep: #343c39;
  --danger: #d96155;
  --accent: #e8c660;
  --accent-2: #65c4ad;
  --focus: #88c7ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
  --radius: 8px;
  --word-length: 12;
  --max-guesses: 3;
  --board-gap: clamp(3px, 0.72vw, 5px);
  --key-gap: clamp(4px, 0.82vw, 7px);
  --transition: 190ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(232, 198, 96, 0.045), transparent 170px),
    linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.24) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.016) 0,
      rgba(255, 255, 255, 0.016) 1px,
      transparent 1px,
      transparent 88px
    ),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.app {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(10px, 2.2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 16px);
}

.topbar {
  padding: 2px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.16rem, 4.4vw, 1.86rem);
  line-height: 1;
  letter-spacing: 0;
  text-align: left;
  text-shadow: 0 1px 24px rgba(232, 198, 96, 0.16);
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 50%;
  background: rgba(20, 24, 23, 0.62);
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
  transition:
    background var(--transition),
    transform var(--transition),
    border-color var(--transition);
}

.icon-button:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

.icon-button:active {
  transform: translateY(1px);
}

.top-link {
  min-height: 34px;
  padding: 0 12px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(232, 198, 96, 0.28);
  border-radius: 7px;
  background: rgba(232, 198, 96, 0.055);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  transition:
    background var(--transition),
    transform var(--transition),
    border-color var(--transition);
}

.top-link:hover {
  background: rgba(228, 183, 95, 0.18);
  border-color: var(--accent);
}

.top-link:active {
  transform: translateY(1px);
}

.day-label {
  width: min(100%, 666px);
  min-height: 34px;
  margin: -2px auto -6px;
  padding: 8px 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 198, 96, 0.28);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(232, 198, 96, 0.04), rgba(232, 198, 96, 0.12), rgba(232, 198, 96, 0.04)),
    rgba(16, 19, 18, 0.78);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  opacity: 1;
}

.game-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(12px, 2vh, 18px);
}

.game-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 666px) minmax(248px, 288px);
  align-items: start;
  justify-content: center;
  gap: clamp(16px, 2.4vw, 24px);
}

.play-area {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2.2vh, 18px);
  padding-block: clamp(2px, 0.8vh, 7px) clamp(10px, 1.8vh, 16px);
}

.status {
  min-height: 34px;
  width: min(100%, 420px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.88rem;
  text-align: center;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity var(--transition),
    transform var(--transition),
    background var(--transition);
  pointer-events: none;
}

.status.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent-2) 70%, #172220);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.status.error.show {
  background: var(--danger);
}

.board-frame {
  position: relative;
  width: min(100%, 666px);
  padding: clamp(9px, 1.7vw, 15px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 38%),
    linear-gradient(180deg, rgba(232, 198, 96, 0.07), transparent 72%),
    rgba(18, 23, 21, 0.8);
  border: 1px solid rgba(232, 198, 96, 0.16);
  border-radius: var(--radius);
  box-shadow:
    0 28px 76px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.board-frame::before {
  content: "";
  position: absolute;
  inset: 0 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 198, 96, 0.72), transparent);
  pointer-events: none;
}

.board {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-rows: repeat(var(--max-guesses), auto);
  gap: var(--board-gap);
  perspective: 980px;
}

.row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--word-length), minmax(0, 1fr));
  gap: var(--board-gap);
}

.tile {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #101413;
  border: 1px solid var(--empty-border);
  border-radius: 5px;
  color: var(--text);
  font-size: clamp(0.72rem, 2.35vw, 1.26rem);
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, background, border-color;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease,
    transform 120ms ease;
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tile.filled {
  background: #1b231f;
  border-color: color-mix(in srgb, var(--accent) 64%, var(--empty-border));
  animation: tile-pop 170ms cubic-bezier(0.2, 1, 0.32, 1);
  box-shadow:
    0 0 0 1px rgba(232, 198, 96, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.065);
}

.tile.erasing {
  animation: tile-delete 140ms ease-out;
}

.tile.reveal {
  transform-origin: center;
  animation: tile-flip 640ms cubic-bezier(0.32, 0, 0.18, 1) both;
  animation-delay: var(--delay, 0ms);
}

.tile[data-state="correct"],
.key[data-state="correct"] {
  background: linear-gradient(180deg, var(--correct), var(--correct-deep));
  border-color: var(--correct);
  color: #ffffff;
  box-shadow:
    0 9px 18px rgba(63, 159, 104, 0.16),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tile[data-state="present"],
.key[data-state="present"] {
  background: linear-gradient(180deg, var(--present), var(--present-deep));
  border-color: var(--present);
  color: #15160f;
  box-shadow:
    0 9px 18px rgba(216, 184, 79, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tile[data-state="absent"],
.key[data-state="absent"] {
  background: linear-gradient(180deg, var(--absent), var(--absent-deep));
  border-color: var(--absent);
  color: #ffffff;
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.row.shake {
  animation: row-shake 420ms ease;
}

.row.submitted {
  animation: row-submit 260ms ease;
}

.keyboard-wrap {
  width: min(100%, 666px);
  margin: 0 auto;
  padding: 2px 4px 4px;
}

.keyboard {
  display: grid;
  gap: var(--key-gap);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: var(--key-gap);
}

.key {
  min-width: 0;
  width: clamp(24px, 7.1vw, 50px);
  height: clamp(50px, 10.2vw, 60px);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 58%),
    var(--key-bg);
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    transform 95ms ease,
    border-color var(--transition),
    box-shadow var(--transition);
  user-select: none;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.key:hover {
  background: var(--key-bg-hover);
  border-color: rgba(232, 198, 96, 0.22);
}

.key:active {
  transform: translateY(2px) scale(0.985);
}

.key.pressed {
  animation: key-press 150ms ease-out;
}

.key.wide {
  width: clamp(42px, 12.5vw, 88px);
  font-size: clamp(0.66rem, 2.2vw, 0.78rem);
}

.result-dialog {
  width: min(calc(100% - 28px), 430px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
}

.result-dialog::backdrop {
  background: rgba(7, 8, 9, 0.78);
  backdrop-filter: blur(5px);
}

.result-dialog[open] .dialog-panel {
  animation: dialog-enter 180ms cubic-bezier(0.2, 1, 0.32, 1);
}

.dialog-panel {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 120px),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.compact-panel {
  text-align: left;
}

.compact-panel h2 {
  text-align: center;
}

.dialog-panel h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.dialog-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.guess-summary {
  margin-top: 16px;
  color: var(--accent);
  font-weight: 950;
  letter-spacing: 0;
}

.result-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.result-stat {
  min-width: 0;
  padding: 10px 8px;
  display: grid;
  gap: 4px;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.result-stat span {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(0.9rem, 3.6vw, 1.1rem);
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-stat small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.claim-panel {
  margin-top: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.claim-panel[hidden] {
  display: none;
}

.claim-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.claim-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

.claim-feedback {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.35;
}

.claim-feedback.error {
  color: var(--danger);
}

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

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #151815;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 95ms ease,
    filter var(--transition),
    background var(--transition),
    color var(--transition);
}

.button:hover {
  filter: brightness(1.06);
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button.secondary {
  background: var(--key-bg);
  color: var(--text);
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.share-feedback {
  min-height: 20px;
  margin-top: 12px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.share-feedback.error {
  color: var(--danger);
}

.help-grid {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.mini-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-tile {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 950;
}

.mini-tile.correct {
  background: var(--correct);
}

.mini-tile.present {
  background: var(--present);
  color: #17140f;
}

.mini-tile.absent {
  background: var(--absent);
}

.dialog-note {
  margin-top: 16px;
  text-align: center;
}

.leaderboard {
  position: relative;
  width: 100%;
  margin: clamp(2px, 1vh, 8px) 0 0;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(232, 198, 96, 0.045), transparent 68px),
    rgba(17, 21, 20, 0.76);
  border: 1px solid rgba(232, 198, 96, 0.16);
  border-radius: var(--radius);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  opacity: 0.82;
  overflow: hidden;
  transition:
    border-color var(--transition),
    background var(--transition),
    transform var(--transition);
}

.leaderboard::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.58;
}

.leaderboard:hover,
.leaderboard:focus-within {
  background:
    linear-gradient(180deg, rgba(232, 198, 96, 0.08), transparent 74px),
    rgba(19, 24, 23, 0.92);
  border-color: rgba(232, 198, 96, 0.3);
  opacity: 1;
  transform: translateY(-1px);
}

.leaderboard-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  z-index: 1;
}

.leaderboard h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.15;
}

.leaderboard p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.player-name {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-name input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(11, 13, 13, 0.82);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: none;
}

.leaderboard-tabs {
  margin-top: 14px;
  padding: 4px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: rgba(11, 13, 13, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  z-index: 1;
}

.leaderboard-tab {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.leaderboard-tab.active {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-3));
  color: var(--accent);
}

.leaderboard-list {
  position: relative;
  max-height: clamp(230px, 42vh, 390px);
  min-height: 86px;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--surface-3) transparent;
  z-index: 1;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: rgba(11, 13, 13, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.062);
  border-radius: 6px;
}

.leaderboard-time {
  grid-column: 2;
  justify-self: start;
}

.leaderboard-row.is-current {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}

.leaderboard-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 950;
}

.leaderboard-meta {
  min-width: 0;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 950;
}

.leaderboard-detail {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.leaderboard-time {
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
  font-weight: 950;
}

.leaderboard-empty {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.seo-content {
  width: min(100%, 666px);
  margin: 0 auto;
  padding: 12px;
  display: grid;
  gap: 14px;
  background: rgba(18, 22, 20, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  color: var(--muted);
  opacity: 0.52;
  transition:
    opacity var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.seo-content:hover,
.seo-content:focus-within {
  background: rgba(23, 27, 29, 0.8);
  border-color: rgba(255, 255, 255, 0.105);
  opacity: 1;
}

.seo-content h2,
.seo-content h3,
.seo-content p {
  margin: 0;
}

.seo-content h2 {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.25;
}

.seo-content h3 {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
}

.seo-content p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.seo-step-list,
.seo-faq-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.seo-step-list section,
.seo-faq-list section {
  min-width: 0;
  padding: 10px;
  background: rgba(15, 17, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 7px;
}

.remote-content {
  width: min(100%, 666px);
  margin: 0 auto;
  padding: 8px 12px;
  background: rgba(18, 22, 20, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  opacity: 0.54;
  transition:
    opacity var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.remote-content:hover,
.remote-content:focus-within {
  background: rgba(23, 27, 29, 0.82);
  border-color: rgba(255, 255, 255, 0.105);
  opacity: 1;
}

.remote-content p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.remote-content-list {
  margin-top: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.remote-link-primary,
.remote-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.remote-link-row {
  gap: 10px;
}

.remote-link-separator {
  color: color-mix(in srgb, var(--muted) 42%, transparent);
  font-size: 0.78rem;
  line-height: 1;
}

.remote-text-button {
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  font-family: inherit;
  line-height: 1.25;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition:
    color var(--transition),
    opacity var(--transition),
    transform var(--transition);
}

.remote-text-button.quiet {
  color: var(--muted);
  font-size: 0.78rem;
}

.remote-text-button:hover {
  color: var(--text);
}

.remote-text-button:active {
  transform: translateY(1px);
}

.remote-content-empty {
  padding: 14px 10px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.remote-detail-dialog {
  width: min(calc(100% - 28px), 560px);
}

.remote-detail-panel {
  max-height: min(82vh, 680px);
  overflow: auto;
}

.remote-detail-source {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.remote-detail-body {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.remote-detail-body p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.remote-detail-body .remote-detail-summary {
  padding: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.remote-detail-loading,
.remote-detail-error {
  text-align: center;
}

@keyframes tile-pop {
  0% {
    transform: translateY(2px) scale(0.92);
  }

  50% {
    transform: translateY(-1px) scale(1.075);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes tile-delete {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(0.88);
    border-color: var(--empty-border);
    opacity: 0.72;
  }
}

@keyframes tile-flip {
  0% {
    filter: brightness(1);
    transform: rotateX(0) scale(1);
  }

  45% {
    filter: brightness(0.74);
    transform: rotateX(90deg) translateY(1px) scale(0.985);
  }

  55% {
    filter: brightness(0.8);
    transform: rotateX(90deg) translateY(1px) scale(0.985);
  }

  100% {
    filter: brightness(1);
    transform: rotateX(0) scale(1);
  }
}

@keyframes row-submit {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(2px) scale(0.996);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes key-press {
  0% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(2px) scale(0.965);
    filter: brightness(1.12);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes dialog-enter {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes row-shake {
  10%,
  90% {
    transform: translateX(-2px);
  }

  20%,
  80% {
    transform: translateX(4px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }

  40%,
  60% {
    transform: translateX(6px);
  }
}

@media (max-width: 980px) {
  .app {
    width: min(100%, 760px);
  }

  .game-layout {
    grid-template-columns: minmax(0, 666px);
    justify-content: center;
  }

  .leaderboard {
    width: min(100%, 666px);
    margin: 0 auto;
  }

  .leaderboard-list {
    max-height: 240px;
  }
}

@media (max-width: 520px) {
  .app {
    padding-inline: 8px;
    gap: 10px;
  }

  .game-shell {
    gap: 10px;
  }

  .title-row {
    gap: 8px;
  }

  .topbar h1 {
    font-size: clamp(1.05rem, 5.4vw, 1.35rem);
  }

  .top-actions {
    gap: 5px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .top-link {
    min-height: 30px;
    padding-inline: 7px;
    font-size: 0.68rem;
  }

  .board-frame,
  .keyboard-wrap,
  .day-label,
  .leaderboard,
  .remote-content {
    width: 100%;
  }

  .day-label {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  .board-frame {
    padding: 6px;
  }

  .keyboard-row {
    gap: 4px;
  }

  .key {
    width: clamp(23px, 7.7vw, 36px);
    height: 50px;
    border-radius: 6px;
    font-size: 0.8rem;
  }

  .key.wide {
    width: clamp(40px, 12vw, 58px);
  }

  .leaderboard-header {
    display: grid;
  }

  .seo-step-list,
  .seo-faq-list {
    grid-template-columns: 1fr;
  }

  .remote-content-list {
    grid-template-columns: 1fr;
  }

  .remote-link-separator {
    display: none;
  }

  .remote-link-row {
    gap: 7px 12px;
  }

  .remote-text-button {
    font-size: 0.8rem;
  }

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

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

  .player-name {
    width: 100%;
  }

  .claim-panel {
    grid-template-columns: 1fr;
  }

  .claim-panel .button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .topbar h1 {
    font-size: 1rem;
  }

  .top-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
