﻿.arcade-game-hero {
  background: radial-gradient(circle at 88% 16%, rgba(83, 225, 195, 0.22), transparent 42%),
              radial-gradient(circle at 14% 18%, rgba(97, 156, 255, 0.3), transparent 42%),
              linear-gradient(140deg, #0a1638 0%, #10245b 56%, #0a1840 100%);
}

.arcade-game-page {
  width: min(1120px, calc(100% - 1rem));
  margin: 0 auto 3rem;
  display: grid;
  gap: 1rem;
}

.arcade-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 220px));
  gap: 0.75rem;
  align-items: end;
  background: rgba(10, 20, 54, 0.86);
  border: 1px solid rgba(93, 137, 240, 0.35);
  border-radius: 12px;
  padding: 0.8rem;
}

.arcade-controls label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.94rem;
}

.arcade-error {
  border-radius: 12px;
  border: 1px solid rgba(239, 91, 108, 0.65);
  background: rgba(68, 18, 30, 0.75);
  padding: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.arcade-board {
  border-radius: 16px;
  border: 1px solid rgba(94, 136, 236, 0.4);
  background: linear-gradient(180deg, rgba(9, 17, 45, 0.95), rgba(9, 16, 39, 0.92));
  padding: 1rem;
  min-height: 320px;
  overflow-x: hidden;
}

.arcade-panel {
  display: grid;
  gap: 0.8rem;
}

.arcade-panel__prompt {
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.45;
  margin: 0;
}

.arcade-choices {
  display: grid;
  gap: 0.6rem;
}

.arcade-choice-btn {
  text-align: left;
  width: 100%;
}

.arcade-choice-btn.is-correct {
  border-color: rgba(86, 214, 153, 0.82);
  background: rgba(16, 77, 51, 0.5);
}

.arcade-choice-btn.is-wrong {
  border-color: rgba(248, 118, 124, 0.82);
  background: rgba(98, 28, 34, 0.55);
}

.arcade-rationale {
  border-radius: 10px;
  border: 1px solid rgba(109, 157, 255, 0.35);
  background: rgba(16, 29, 74, 0.72);
  padding: 0.85rem;
}

.arcade-rationale summary {
  cursor: pointer;
  font-weight: 700;
}

.arcade-score {
  font-weight: 700;
  color: #8ad7ff;
}

.arcade-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
}

.jeopardy-shell {
  display: grid;
  gap: 0.9rem;
}

.jeopardy-scorebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  border: 1px solid rgba(96, 143, 240, 0.34);
  border-radius: 12px;
  background: rgba(9, 22, 66, 0.66);
  padding: 0.65rem 0.8rem;
}

.jeopardy-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.jeopardy-board-wrap {
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.jeopardy-category {
  border-radius: 10px;
  border: 1px solid rgba(114, 167, 255, 0.42);
  background: linear-gradient(180deg, rgba(36, 71, 148, 0.96), rgba(25, 53, 122, 0.96));
  color: #eaf4ff;
  min-height: 60px;
  padding: 0.65rem 0.55rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(0.78rem, 1.7vw, 0.98rem);
  line-height: 1.25;
}

.jeopardy-clue-btn {
  border-radius: 10px;
  border: 1px solid rgba(85, 139, 255, 0.5);
  background: linear-gradient(180deg, rgba(17, 45, 115, 0.95), rgba(13, 31, 84, 0.95));
  color: #9bd3ff;
  min-height: 64px;
  font-size: clamp(1rem, 2.5vw, 1.26rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.jeopardy-clue-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  border-color: rgba(115, 196, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(82, 178, 255, 0.22);
  background: linear-gradient(180deg, rgba(20, 57, 141, 0.95), rgba(15, 38, 101, 0.95));
}

.jeopardy-clue-btn[disabled] {
  opacity: 0.42;
  cursor: default;
}

.jeopardy-clue-btn.is-done {
  color: rgba(222, 236, 255, 0.84);
  background: linear-gradient(180deg, rgba(57, 72, 111, 0.88), rgba(40, 51, 84, 0.88));
  border-color: rgba(129, 149, 196, 0.55);
}

.jeopardy-question {
  border: 1px solid rgba(89, 133, 225, 0.36);
  border-radius: 12px;
  background: rgba(10, 20, 59, 0.6);
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.arcade-mini {
  font-size: 0.9rem;
  color: rgba(207, 225, 255, 0.82);
}

/* LETdle */
.letdle-shell {
  display: grid;
  gap: 0.9rem;
}

.letdle-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.letdle-header__copy {
  display: grid;
  gap: 0.35rem;
}

.letdle-stats-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(120, 162, 255, 0.5);
  background: rgba(20, 35, 82, 0.9);
  color: #e9f3ff;
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-weight: 700;
  cursor: pointer;
}

.letdle-stats-trigger:hover {
  border-color: rgba(133, 191, 255, 0.8);
  background: rgba(28, 55, 122, 0.95);
}

.letdle-stats-trigger__icon {
  font-size: 1rem;
  line-height: 1;
}

.letdle-stats-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.letdle-stats-modal.is-open {
  display: block;
}

.letdle-stats-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 26, 0.68);
  backdrop-filter: blur(2px);
}

.letdle-stats-modal__card {
  position: relative;
  width: min(680px, calc(100% - 1.5rem));
  margin: 8vh auto 0;
  border-radius: 14px;
  border: 1px solid rgba(118, 156, 246, 0.45);
  background: linear-gradient(180deg, rgba(13, 24, 62, 0.98), rgba(11, 19, 52, 0.98));
  padding: 1rem 1rem 1.1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.letdle-stats-modal__close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: 1px solid rgba(118, 156, 246, 0.45);
  background: rgba(14, 24, 61, 0.9);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f1f6ff;
  cursor: pointer;
}

.letdle-stats-modal__close:hover {
  border-color: rgba(133, 191, 255, 0.8);
  background: rgba(29, 58, 126, 0.95);
}

.letdle-stats-modal__close .lur-close-icon {
  --lur-close-icon-size: 16px;
}

.letdle-stats-modal__card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.letdle-stats-modal__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.55rem 0 0.7rem;
  border-top: 1px solid rgba(115, 151, 238, 0.34);
  border-bottom: 1px solid rgba(115, 151, 238, 0.34);
}

.letdle-stats-modal__metrics div {
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  text-align: center;
}

.letdle-stats-modal__metrics strong {
  font-size: clamp(1.3rem, 4vw, 2.1rem);
  line-height: 1;
}

.letdle-stats-modal__metrics span {
  color: rgba(221, 232, 255, 0.92);
  font-size: 0.92rem;
}

.letdle-stats-modal__distribution {
  margin-top: 0.9rem;
}

.letdle-stats-modal__distribution h4 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.letdle-stats-modal__dist-row {
  display: grid;
  grid-template-columns: 1rem 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.34rem;
}

.letdle-stats-modal__dist-label {
  font-weight: 700;
  text-align: right;
}

.letdle-stats-modal__dist-track {
  background: rgba(59, 77, 128, 0.45);
  border: 1px solid rgba(115, 145, 222, 0.28);
  border-radius: 4px;
  min-height: 22px;
  overflow: hidden;
}

.letdle-stats-modal__dist-fill {
  height: 100%;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.5rem;
  background: linear-gradient(90deg, #4f9955, #6ab85f);
  color: #f3fff3;
  font-weight: 700;
  font-size: 0.86rem;
  border-right: 1px solid rgba(255, 255, 255, 0.26);
}

.letdle-stats {
  display: grid;
  gap: 0.45rem;
  border: 1px solid rgba(105, 145, 240, 0.34);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(11, 21, 58, 0.58);
}

.letdle-stats__numbers {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: rgba(221, 233, 255, 0.9);
}

.letdle-history {
  display: grid;
  grid-template-columns: repeat(14, minmax(10px, 1fr));
  gap: 0.24rem;
}

.letdle-history__cell {
  display: block;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(122, 151, 224, 0.35);
  background: rgba(51, 64, 101, 0.55);
}

.letdle-history__cell.is-win {
  background: #3e8f58;
  border-color: #56b476;
}

.letdle-history__cell.is-loss {
  background: #a0454e;
  border-color: #d36a74;
}

.letdle-grid {
  display: grid;
  gap: clamp(0.2rem, 0.85vw, 0.34rem);
  justify-content: center;
}

.letdle-row {
  display: grid;
  grid-auto-flow: column;
  gap: clamp(0.2rem, 0.85vw, 0.34rem);
}

.letdle-tile {
  width: clamp(26px, 7.2vw, 48px);
  height: clamp(26px, 7.2vw, 48px);
  border-radius: 8px;
  border: 2px solid rgba(113, 145, 232, 0.42);
  background: rgba(13, 24, 63, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.8rem, 3.3vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  transform-style: preserve-3d;
}

.letdle-tile.is-reveal {
  animation: letdle-flip 460ms ease both;
  animation-delay: var(--flip-delay, 0ms);
}

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

.letdle-tile.is-filled {
  border-color: rgba(173, 198, 255, 0.85);
}

.letdle-tile.is-active {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(117, 186, 255, 0.22);
}

.letdle-tile.is-correct {
  border-color: #4da96b;
  background: linear-gradient(180deg, #3d9258, #2f7848);
}

.letdle-tile.is-present {
  border-color: #c39d36;
  background: linear-gradient(180deg, #b68f2d, #947520);
}

.letdle-tile.is-absent {
  border-color: #4b5877;
  background: linear-gradient(180deg, #3f4c6a, #303a50);
}

.letdle-status {
  margin: 0;
  color: rgba(225, 235, 255, 0.9);
  font-size: 0.95rem;
}

.letdle-keyboard {
  display: grid;
  gap: clamp(0.22rem, 0.9vw, 0.35rem);
  justify-content: center;
  width: min(100%, 620px);
  margin: 0 auto;
}

.letdle-key-row {
  display: grid;
  gap: clamp(0.22rem, 0.9vw, 0.35rem);
}

.letdle-key-row:nth-child(1) {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.letdle-key-row:nth-child(2) {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

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

.letdle-key {
  min-width: 0;
  width: 100%;
  height: clamp(36px, 8.7vw, 46px);
  border-radius: 8px;
  border: 1px solid rgba(126, 157, 235, 0.45);
  background: rgba(24, 38, 87, 0.82);
  color: #f0f6ff;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.28rem;
  font-size: clamp(0.76rem, 2.8vw, 0.98rem);
}

.letdle-key[disabled] {
  opacity: 0.7;
  cursor: default;
}

.letdle-key--wide {
  min-width: 0;
}

.letdle-key.is-correct {
  background: #3a8c55;
  border-color: #4da96b;
}

.letdle-key.is-present {
  background: #9e7d27;
  border-color: #c39d36;
}

.letdle-key.is-absent {
  background: #3d4a67;
  border-color: #4b5877;
}

/* Crossword */
.crossword-shell {
  display: grid;
  gap: 0.85rem;
}

.crossword-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.crossword-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.crossword-current {
  margin: 0;
  font-size: 0.93rem;
  color: rgba(219, 233, 255, 0.92);
}

.crossword-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 340px);
  gap: 0.85rem;
  align-items: start;
}

.crossword-grid {
  display: grid;
  grid-template-columns: repeat(var(--cw-cols, 10), minmax(28px, 1fr));
  gap: 2px;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(109, 143, 232, 0.42);
  background: rgba(15, 26, 68, 0.92);
  max-width: 620px;
}

.crossword-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 1px solid rgba(118, 152, 237, 0.45);
  background: rgba(245, 251, 255, 0.97);
  color: #0f1f46;
  font-weight: 800;
  font-size: clamp(0.88rem, 1.5vw, 1.06rem);
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}

.crossword-cell.is-block {
  background: rgba(8, 14, 40, 0.98);
  border-color: rgba(30, 43, 92, 0.9);
  cursor: default;
}

.crossword-cell.is-focus-word {
  background: #edf8ff;
}

.crossword-cell.is-active {
  box-shadow: inset 0 0 0 2px #53b9ff;
  background: #d9f0ff;
}

.crossword-cell.is-correct {
  background: #d7f4dd;
}

.crossword-cell.is-wrong {
  background: #ffd8dd;
}

.crossword-cell__num {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.54rem;
  font-weight: 700;
  color: #38528f;
  line-height: 1;
}

.crossword-cell__val {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.crossword-clues {
  display: grid;
  gap: 0.7rem;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.25rem;
}

.crossword-clues__group h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.crossword-clue {
  width: 100%;
  text-align: left;
  margin-bottom: 0.3rem;
  border-radius: 8px;
  border: 1px solid rgba(110, 144, 235, 0.38);
  background: rgba(17, 30, 73, 0.75);
  color: #e9f1ff;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.crossword-clue.is-active {
  border-color: rgba(94, 199, 255, 0.88);
  background: rgba(29, 71, 132, 0.85);
}

.crossword-result {
  margin-top: 0.25rem;
}

@media (max-width: 940px) {
  .crossword-layout {
    grid-template-columns: 1fr;
  }
  .crossword-grid {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .arcade-board {
    padding: 0.8rem 0.65rem;
  }

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

  .letdle-stats-modal__card {
    margin-top: 5vh;
  }

  .letdle-header {
    flex-direction: column;
    align-items: stretch;
  }

  .letdle-stats-trigger {
    width: fit-content;
  }

  .arcade-error .ghost-btn {
    width: 100%;
  }

  .arcade-panel__prompt {
    overflow-wrap: anywhere;
  }

  .arcade-controls {
    grid-template-columns: 1fr;
  }

  .jeopardy-board {
    min-width: 500px;
  }

  .jeopardy-category {
    min-height: 54px;
    padding: 0.5rem 0.4rem;
  }

  .jeopardy-clue-btn {
    min-height: 56px;
  }
}

@media (max-width: 480px) {
  .arcade-game-page {
    width: calc(100% - 0.5rem);
  }

  .arcade-board {
    padding: 0.72rem 0.5rem;
  }
}
