:root {
  --bg: #0f172a;
  --panel: #111827;
  --tile: #1f2937;
  --tile-border: #4b5563;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --key: #334155;
  --key-text: #f8fafc;
  --green: #2563eb;
  --yellow: #ea580c;
  --gray: #7c3aed;
  --correct: #2563eb;
  --present: #ea580c;
  --absent: #7c3aed;
  --danger: #f97316;
  --grid-cols: 5;
  --grid-rows: 7;
}

.light-mode {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --tile: #e2e8f0;
  --tile-border: #94a3b8;
  --text: #0f172a;
  --muted: #475569;
  --key: #e2e8f0;
  --key-text: #0f172a;
  --green: #1d4ed8;
  --yellow: #c2410c;
  --gray: #6d28d9;
  --correct: #1d4ed8;
  --present: #c2410c;
  --absent: #6d28d9;
}

.color-blind-mode {
  --green: #0ea5e9;
  --yellow: #f59e0b;
  --gray: #a855f7;
  --correct: #0ea5e9;
  --present: #f59e0b;
  --absent: #a855f7;
}

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at top, #1e293b, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

body.light-mode {
  background: #e5e7eb;
}

.app {
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 1.5rem;
  gap: 1rem;
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-logo {
  height: clamp(38px, 7.5vw, 56px);
  width: auto;
  display: block;
}

#brand-text {
  display: none;
}

.brand {
  margin: 0;
  font-size: clamp(1.4rem, 4.2vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.settings-btn {
  background: #0ea5e9;
  border: 0;
  color: #082f49;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 180ms ease, background 180ms ease;
}

.settings-btn:hover {
  filter: brightness(1.1);
}

.settings-btn:active {
  transform: scale(0.96);
}

.dictionary-btn {
  background: #475569;
  border: 0;
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 180ms ease, background 180ms ease;
}

.dictionary-btn:hover {
  filter: brightness(1.08);
}

.dictionary-btn:active {
  transform: scale(0.96);
}

.word-category-btn {
  background: #16a34a;
  border: 0;
  color: #ecfdf5;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 180ms ease, background 180ms ease;
}

.word-category-btn:hover {
  filter: brightness(1.08);
}

.word-category-btn:active {
  transform: scale(0.96);
}

.new-game-btn {
  background: #2563eb;
  border: 0;
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 180ms ease;
}

.new-game-btn:hover {
  background: #1d4ed8;
}

.new-game-btn:active {
  transform: scale(0.97);
}

.meta-panel {
  width: 100%;
  background: color-mix(in oklab, var(--panel) 88%, #000);
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
}

.light-mode .meta-panel {
  background: #020b24;
  border-color: #334155;
}

.light-mode .stats-line {
  color: #e2e8f0;
  font-weight: 800;
}

.quick-modes {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: -0.35rem;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: color-mix(in oklab, var(--panel) 88%, #000);
  border: 1px solid #374151;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text);
}

.light-mode .toggle-chip {
  background: #d1d5db;
  border-color: #475569;
  color: #111827;
}

.toggle-chip input {
  accent-color: #22c55e;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text);
}

.stats-line {
  font-size: 0.86rem;
  color: var(--muted);
}

.share-btn {
  background: #16a34a;
  border: 0;
  color: #052e16;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, filter 180ms ease, opacity 180ms ease;
}

.share-btn:hover {
  filter: brightness(1.08);
}

.share-btn:active {
  transform: scale(0.97);
}

.share-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats-btn {
  background: #7c3aed;
  border: 0;
  color: #f5f3ff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, filter 180ms ease;
}

.stats-btn:hover {
  filter: brightness(1.08);
}

.stats-btn:active {
  transform: scale(0.97);
}

.status-wrap {
  width: 100%;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-message {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.status-message.error {
  color: var(--danger);
}

.status-message.good {
  color: #4ade80;
}

.letter-hints-line {
  width: 100%;
  margin: -0.3rem 0 0.2rem;
  font-size: 0.88rem;
  color: #93c5fd;
  text-align: center;
}

.grid {
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 5), 1fr);
  gap: 0.55rem;
}

.tile {
  width: 100%;
  min-height: 58px;
  aspect-ratio: 0.92;
  display: grid;
  place-items: center;
  border-radius: 4px 14px 4px 14px;
  border: 2px solid var(--tile-border);
  background: color-mix(in oklab, var(--tile) 84%, #000);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: clamp(1.25rem, 6.5vw, 1.85rem);
  font-weight: 800;
  text-transform: uppercase;
  transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease;
  user-select: none;
}

.light-mode .tile {
  background: #f3f4f6;
  border-color: #c5cad3;
}

.tile.filled {
  border-color: #94a3b8;
  transform: scale(1.02);
}

.light-mode .tile.filled {
  border-color: #b8beca;
}

.tile.flip {
  animation: flip 480ms ease;
}

.tile.pop {
  animation: pop 130ms ease;
}

.tile.correct {
  background: var(--correct);
  border-color: #93c5fd;
  color: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45);
}

.tile.present {
  background: var(--present);
  border-color: #fdba74;
  color: #fff7ed;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.4);
}

.tile.absent {
  background: var(--absent);
  border-color: #c4b5fd;
  color: #f5f3ff;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35);
}

.tile.reveal-word {
  outline: 2px dashed var(--present);
  outline-offset: 2px;
}

.keyboard {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.65rem;
  border-radius: 16px;
  background: color-mix(in oklab, var(--panel) 88%, transparent);
  border: 1px solid var(--tile-border);
}

.keyboard-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.4rem;
  justify-content: center;
}

.keyboard-row:nth-child(2) {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  padding-inline: 0.35rem;
}

.keyboard-row:nth-child(3) {
  grid-template-columns: 1.4fr repeat(7, minmax(0, 1fr)) 1.4fr;
}

.key {
  border: 1px solid color-mix(in oklab, var(--tile-border) 70%, transparent);
  border-radius: 999px;
  background: var(--key);
  color: var(--key-text);
  min-height: 50px;
  min-width: 0;
  padding: 0 0.35rem;
  flex: 1;
  max-width: none;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 0 color-mix(in oklab, #000 25%, transparent);
  transition: transform 100ms ease, filter 180ms ease, background-color 180ms ease;
}

.key.wide {
  max-width: none;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.key:hover {
  filter: brightness(1.1);
}

.key:active {
  transform: scale(0.96);
}

.key.correct {
  background: var(--green);
  color: #052e16;
}

.key.present {
  background: var(--yellow);
  color: #3f2c00;
}

.key.absent {
  background: var(--gray);
}

@keyframes flip {
  0% {
    transform: rotateX(0deg);
  }
  50% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  z-index: 30;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.toast.good {
  border-color: #16a34a;
}

.toast.error {
  border-color: #f97316;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}

.modal-card {
  width: min(100%, 420px);
  background: #0b1220;
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 0.8rem 0.9rem 1rem;
}

.dictionary-modal-card {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #f8fafc;
  color: #334155;
  border-color: #d1d5db;
}

.dictionary-modal-card .modal-head h2 {
  color: #1f2937;
}

.dictionary-modal-card .icon-close {
  background: #d1d5db;
  color: #111827;
}

.dictionary-subtitle {
  margin: 0.35rem 0 0.2rem;
  text-align: center;
  font-size: clamp(1.25rem, 2.8vw, 2rem);
  color: #1f2937;
}

.dictionary-note {
  text-align: center;
  margin: 0 0 0.9rem;
  color: #6b7280;
}

.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.dictionary-card {
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  background: #e5e7eb;
  text-decoration: none;
  color: #1f2937;
  padding: 0.85rem 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  display: block;
}

.dictionary-card:hover {
  filter: brightness(0.98);
}

.dictionary-card.active {
  border-color: #63ba6f;
  background: #63ba6f;
  color: #ecfdf5;
}

.word-category-modal-card {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  color: #1f2937;
  border-color: #e5e7eb;
}

.word-category-modal-card .modal-head h2 {
  color: #0f172a;
  font-weight: 900;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
}

.word-category-modal-card .icon-close {
  background: #1f2937;
  color: #f8fafc;
}

.word-category-note {
  text-align: center;
  margin: 0.25rem 0 1rem;
  color: #6b7280;
}

.word-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.word-category-grid .word-category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  padding: 1.2rem 0.75rem;
  min-height: 140px;
  text-decoration: none !important;
  text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.word-category-grid .word-category-card:hover {
  transform: translateY(-2px);
  border-color: #d1d5db;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.word-category-grid .word-category-card:visited,
.word-category-grid .word-category-card:active {
  color: #111827;
  text-decoration: none !important;
}

.word-category-grid .wc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f3f4f6;
  color: #374151;
}

.word-category-grid .wc-label {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.92rem;
  color: #1f2937;
}

.word-category-grid .word-category-card.active {
  background: #0b1220;
  border-color: #0b1220;
  color: #f8fafc;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
}

.word-category-grid .word-category-card.active .wc-icon {
  background: #1f2937;
  color: #f8fafc;
}

.word-category-grid .word-category-card.active .wc-label {
  color: #f8fafc;
}

@media (max-width: 760px) {
  .word-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .word-category-grid {
    grid-template-columns: 1fr;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.icon-close {
  border: 0;
  background: #1f2937;
  color: #e5e7eb;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.modal-metrics {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.metric {
  text-align: center;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 0.4rem 0.2rem;
}

.metric span {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
}

.metric small {
  font-size: 0.7rem;
  color: var(--muted);
}

.dist-title {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.95rem;
}

.distribution {
  display: grid;
  gap: 0.35rem;
}

.dist-row {
  display: grid;
  grid-template-columns: 18px 1fr 28px;
  align-items: center;
  gap: 0.45rem;
}

.dist-bar {
  min-height: 24px;
  background: #1f2937;
  border-radius: 6px;
  overflow: hidden;
}

.dist-fill {
  min-height: 24px;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.45rem;
  font-size: 0.8rem;
  color: #e5e7eb;
  font-weight: 700;
  transition: width 200ms ease;
}

.dist-fill.highlight {
  background: #16a34a;
}

.modal-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-copy-btn,
.modal-play-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-copy-btn {
  background: #334155;
  color: #e2e8f0;
}

.modal-play-btn {
  background: #16a34a;
  color: #052e16;
}

.light-mode .modal {
  background: rgba(15, 23, 42, 0.22);
}

.light-mode .modal-card {
  background: #ffffff;
  border-color: #d1d5db;
  color: #0f172a;
}

.light-mode .icon-close {
  background: #e5e7eb;
  color: #1f2937;
}

.light-mode .metric {
  background: #f8fafc;
  border-color: #d1d5db;
}

.light-mode .metric small {
  color: #475569;
}

.light-mode .dist-bar {
  background: #e2e8f0;
}

.light-mode .dist-fill {
  background: #64748b;
  color: #ffffff;
}

.light-mode .dist-row {
  color: #334155;
}

.light-mode .modal-copy-btn {
  background: #475569;
  color: #f8fafc;
}

.light-mode .dist-fill.highlight {
  background: #16a34a;
}

.settings-card {
  width: min(100%, 580px);
}

.win-card {
  width: min(100%, 460px);
}

.win-text {
  margin: 0.4rem 0 0.1rem;
  color: var(--muted);
  font-size: 1rem;
}

.settings-list {
  margin-top: 0.25rem;
  display: grid;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.78rem 0.15rem;
  border-bottom: 1px solid #334155;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row h3 {
  margin: 0;
  font-size: 1rem;
}

.setting-row p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.setting-row .setting-subline {
  margin-top: 0.2rem;
  color: var(--text);
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

.switch input:checked + .slider {
  background: #4caf50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2) inset;
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
}

.seo-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem 0.5rem;
}

.seo-wrap {
  background: color-mix(in oklab, var(--panel) 84%, #000);
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 1rem 1rem 1.15rem;
  line-height: 1.65;
}

.seo-wrap h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.25;
}

.seo-wrap h2 {
  margin: 1.05rem 0 0.4rem;
  font-size: 1.15rem;
}

.seo-wrap h3 {
  margin: 0.85rem 0 0.3rem;
  font-size: 1rem;
}

.seo-wrap h3.examples-title {
  margin: 1rem 0 0.45rem;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 900;
  color: var(--text);
}

.seo-wrap p,
.seo-wrap li {
  color: var(--text);
}

.light-mode .seo-wrap {
  background: #ffffff;
  border-color: #d1d5db;
}

.seo-wrap ol,
.seo-wrap ul {
  margin: 0.2rem 0 0.55rem 1.2rem;
  padding: 0;
}

.clue-examples {
  margin: 0.2rem 0 0.9rem;
  padding: 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  gap: 0.75rem;
}

.clue-row p {
  margin: 0.3rem 0 0;
  color: #111827;
  font-weight: 600;
}

.clue-word {
  display: flex;
  gap: 0.35rem;
}

.clue-box {
  width: 44px;
  height: 44px;
  border: 2px solid #9ca3af;
  background: #ffffff;
  color: #111827;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clue-box.is-correct {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.clue-box.is-present {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #ffffff;
}

.clue-box.is-absent {
  border-color: var(--gray);
  background: var(--gray);
  color: #ffffff;
}

.seo-wrap h3 + .clue-examples {
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.faq-grid {
  margin-top: 0.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.faq-item {
  border: 1px solid #334155;
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel) 92%, #000);
  padding: 0.7rem 0.75rem;
}

.faq-item h3 {
  margin: 0 0 0.25rem;
}

.faq-item p {
  margin: 0;
}

.light-mode .faq-item {
  border-color: #d1d5db;
  background: #f8fafc;
}

.rating-content {
  max-width: 900px;
  margin: 0.7rem auto 0;
  padding: 0 1rem;
}

.rating-wrap {
  text-align: center;
  padding: 1.2rem 0 1rem;
}

.rate-badge {
  display: inline-block;
  background: #84cc16;
  color: #fff;
  font-weight: 800;
  border-radius: 16px;
  padding: 0.55rem 1.3rem;
  transform: rotate(-1deg);
}

.stars-row {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

.star-btn {
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.star-btn.active {
  color: #facc15;
}

.rating-submit-btn {
  margin-top: 0.7rem;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  background: #fff;
  color: #111827;
  font-weight: 700;
  cursor: pointer;
}

.rating-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rating-score {
  margin: 0.2rem 0 0;
  font-size: 2rem;
  font-weight: 800;
}

.rating-votes {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

.comment-wrap {
  background: #fff;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  padding: 1rem;
  color: #111827;
}

.comment-wrap h2 {
  margin: 0 0 0.65rem;
}

.comment-form {
  display: grid;
  gap: 0.7rem;
}

.comment-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  padding: 0.7rem 0.72rem;
  font: inherit;
  color: #111827;
  background: #fafafa;
}

.comment-form textarea {
  resize: vertical;
}

.comment-counter {
  margin: 0;
  text-align: right;
  color: #71717a;
  font-size: 0.86rem;
}

.comment-submit {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

.comment-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.extra-play-content {
  max-width: 900px;
  margin: 0.9rem auto 0;
  padding: 0 1rem;
}

.extra-wrap {
  border-top: 1px solid #d1d5db33;
  padding: 1rem 0 0.2rem;
}

.extra-wrap h2 {
  margin: 0 0 0.3rem;
  text-align: center;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  letter-spacing: 0.02em;
}

.extra-wrap p {
  margin: 0 0 0.8rem;
  text-align: center;
  color: var(--muted);
}

.length-grid,
.language-grid {
  display: grid;
  gap: 0.65rem;
}

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

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

.length-card,
.language-card {
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  background: #ffffff;
  text-decoration: none;
  color: #111827;
  padding: 0.95rem 0.75rem;
  text-align: center;
}

.length-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.length-card span {
  display: block;
  margin-top: 0.35rem;
  color: #52525b;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.language-card {
  font-weight: 600;
}

.language-card.active {
  border-color: #16a34a;
  background: #ecfdf5;
  color: #166534;
}

.extra-play-content.home-internal-links {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.home-internal-wrap {
  border-top: 0;
  background: color-mix(in oklab, var(--panel) 84%, #000);
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 1rem 1.05rem 1.15rem;
}

.home-internal-wrap h2 {
  margin: 0 0 0.4rem;
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: 0;
  color: #f8fafc;
  line-height: 1.25;
}

.home-internal-wrap p {
  margin: 0 0 0.95rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-internal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.home-internal-card {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.8rem 0.95rem;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.home-internal-card:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.home-internal-card strong {
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 0.98rem;
  color: #0f172a;
}

.home-internal-card span {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .home-internal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-internal-wrap {
    padding: 0.9rem 0.85rem 1rem;
  }
}

@media (max-width: 420px) {
  .home-internal-grid {
    grid-template-columns: 1fr;
  }
  .home-internal-card {
    padding: 0.7rem 0.85rem;
  }
}

.contact-wrap h1 {
  margin-bottom: 0.45rem;
}

.contact-intro {
  margin-top: 0;
  color: #dbeafe;
}

.contact-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.contact-card,
.contact-form-card {
  background: color-mix(in oklab, var(--panel) 90%, #000);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.9rem;
}

.contact-card h2,
.contact-form-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.contact-card p,
.contact-form-card p {
  margin: 0 0 0.45rem;
}

.contact-card a {
  color: #93c5fd;
  font-weight: 700;
}

.contact-form-card {
  margin-top: 0.85rem;
}

.contact-form {
  display: grid;
  gap: 0.45rem;
}

.contact-form label {
  font-size: 0.86rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #475569;
  background: #0b1220;
  color: var(--text);
  padding: 0.62rem 0.7rem;
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.contact-submit {
  margin-top: 0.25rem;
  border: 0;
  border-radius: 999px;
  background: #0ea5e9;
  color: #082f49;
  font-weight: 800;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.contact-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.contact-form-status {
  margin: 0.35rem 0 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-form-status.success {
  color: #4ade80;
}

.contact-form-status.error {
  color: #f87171;
}

.contact-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  max-width: 900px;
  margin: 0.4rem auto 1.2rem;
  padding: 0 1rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #93c5fd;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-disclaimer {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 500px) {
  .app {
    padding: 0.9rem 0.55rem 1rem;
  }

  .grid {
    gap: 0.32rem;
  }

  .keyboard-row {
    gap: 0.22rem;
  }

  .meta-panel {
    padding: 0.55rem 0.6rem;
    gap: 0.45rem 0.6rem;
  }

  .quick-modes {
    margin-top: -0.2rem;
  }

  .stats-line {
    width: 100%;
    font-size: 0.8rem;
  }

  .modal-card {
    padding: 0.7rem 0.7rem 0.9rem;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-copy-btn,
  .modal-play-btn {
    flex: 1;
  }

  .seo-wrap {
    padding: 0.85rem 0.8rem 1rem;
  }

  .seo-wrap h1 {
    font-size: 1.22rem;
  }

  .clue-box {
    width: 36px;
    height: 36px;
    font-size: 1.6rem;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

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

  .comment-row {
    grid-template-columns: 1fr;
  }

  .key {
    min-height: 44px;
    font-size: 0.85rem;
    max-width: none;
  }

  .setting-row {
    padding: 0.7rem 0;
  }

  .dictionary-grid {
    grid-template-columns: 1fr;
  }
}
.non-game{
    max-width:820px;
}
