/* ~/lab/robloxdle: the daily guessing game. Shared window, help box and controls come from ../base.css. */
.game-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; }
.game-intro h1 { margin-bottom: 8px; }
.game-intro .lede { margin: 0; }
.no { color: var(--accent); font-size: 0.6em; vertical-align: 0.35em; }
.next { margin: 0; font-size: 12px; color: var(--dim); text-align: right; }
.next b { color: var(--white); font-weight: 500; font-variant-numeric: tabular-nums; }

.modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px clamp(18px, 4vw, 40px) 0; }
.mode-tab {
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer; padding: 6px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); transition: border-color 0.2s, background 0.2s;
}
.mode-tab:hover { border-color: var(--accent); }
.mode-tab[aria-selected="true"] { background: rgba(8, 145, 178, 0.25); border-color: var(--accent); color: var(--white); }
.mode-tab .done { color: var(--mint); margin-left: 6px; }
.practice-tag { font-size: 12px; color: var(--blue); margin-left: 6px; }
.linkish { font: inherit; color: var(--accent); background: none; border: 0; padding: 0 0 0 6px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.board, .stats-pane { margin: 12px clamp(18px, 4vw, 40px) 0; }
.howto { margin: 0 0 14px; font-size: 13px; color: var(--mist); max-width: 80ch; }

/* ---------- icon mode ---------- */
.icon-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-bottom: 16px; }
#iconCanvas { width: 240px; height: 240px; border-radius: 14px; border: 1px solid var(--line); background: #07111a; image-rendering: pixelated; }
.icon-hints { margin: 0; font-size: 13px; color: var(--mist); display: grid; gap: 6px; }
.icon-hints b { color: var(--white); font-weight: 500; }

/* ---------- guess box ---------- */
.guess-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.combo { position: relative; flex: 1; max-width: 460px; }
.combo input { width: 100%; font-size: 15px; padding: 10px 12px; border-radius: 10px; }
.left { font-size: 12px; color: var(--dim); white-space: nowrap; }
.suggest {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px;
  background: rgba(9, 18, 27, 0.98); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  max-height: 340px; overflow-y: auto;
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.suggest li[aria-selected="true"], .suggest li:hover { background: rgba(8, 145, 178, 0.25); color: var(--white); }
.suggest img { width: 28px; height: 28px; border-radius: 6px; flex: none; }
.suggest .by { color: var(--dim); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ---------- classic clue grid ---------- */
.grid-wrap { overflow-x: auto; }
.clues { border-collapse: separate; border-spacing: 6px; margin: -6px; font-size: 12.5px; min-width: 640px; }
.clues th { font-weight: 400; color: var(--dim); text-align: center; padding: 0 4px; font-size: 12px; }
.clues th.g { text-align: left; }
.clues td { text-align: center; vertical-align: middle; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); color: var(--dim); background: rgba(255, 255, 255, 0.02); min-width: 84px; }
.clues td.g { text-align: left; color: var(--white); border-color: transparent; background: none; padding-left: 0; min-width: 190px; }
.clues td.g span { display: inline-flex; align-items: center; gap: 8px; }
.clues td.g img { width: 32px; height: 32px; border-radius: 6px; }
.clues td.hit { color: var(--mint); border-color: rgba(134, 239, 172, 0.55); background: rgba(134, 239, 172, 0.08); }
.clues td.near { color: var(--blue); border-color: rgba(96, 165, 250, 0.55); background: rgba(96, 165, 250, 0.08); }
.clues td .arrow { display: block; font-size: 12px; margin-top: 2px; }
.js .clues tbody tr:last-child td { animation: flip 0.45s ease-out backwards; }
.js .clues tbody tr:last-child td:nth-child(2) { animation-delay: 0.05s; }
.js .clues tbody tr:last-child td:nth-child(3) { animation-delay: 0.1s; }
.js .clues tbody tr:last-child td:nth-child(4) { animation-delay: 0.15s; }
.js .clues tbody tr:last-child td:nth-child(5) { animation-delay: 0.2s; }
.js .clues tbody tr:last-child td:nth-child(6) { animation-delay: 0.25s; }
.js .clues tbody tr:last-child td:nth-child(7) { animation-delay: 0.3s; }
@keyframes flip { from { opacity: 0; transform: rotateX(80deg); } }

/* ---------- icon mode tries ---------- */
.tries { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 460px; }
.tries li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; color: var(--mist); }
.tries li img { width: 28px; height: 28px; border-radius: 6px; }
.tries li .mark { margin-left: auto; color: var(--dim); }
.tries li.hit { border-color: rgba(134, 239, 172, 0.55); color: var(--white); }
.tries li.hit .mark { color: var(--mint); }

/* ---------- result ---------- */
.result { margin-top: 18px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(8, 145, 178, 0.06); display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; }
.result img { width: 96px; height: 96px; border-radius: 14px; grid-row: span 3; }
.result h2 { margin: 0; font-size: 18px; color: var(--white); }
.result p { margin: 0; font-size: 13px; color: var(--mist); }
.result .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.empty { margin: 0; font-size: 14px; color: var(--mist); }

/* ---------- stats ---------- */
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; text-align: center; }
.tally div { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.tally dt { font-size: 12px; color: var(--dim); }
.tally dd { margin: 0; font-size: 22px; color: var(--white); font-weight: 700; }
.dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 420px; font-size: 12px; }
.dist li { display: grid; grid-template-columns: 2ch 1fr; gap: 8px; align-items: center; color: var(--dim); }
.dist .b { display: block; min-width: 26px; padding: 1px 8px; border-radius: 6px; background: rgba(52, 224, 234, 0.14); color: var(--white); text-align: right; }
.dist .b.today { background: rgba(52, 224, 234, 0.4); }

.rules-help { margin: 14px clamp(18px, 4vw, 40px) 18px; padding: 0; }
.key { padding: 0 6px; border-radius: 6px; border: 1px solid; }
.k-hit { color: var(--mint); border-color: rgba(134, 239, 172, 0.55); }
.k-near { color: var(--blue); border-color: rgba(96, 165, 250, 0.55); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 8px 14px; border-radius: 10px; font-size: 13px; color: var(--white);
  background: rgba(9, 18, 27, 0.96); border: 1px solid var(--accent); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  /* each guess stacks: the game, then its six clues in a labelled 3 x 2 grid */
  .clues { min-width: 0; margin: 0; width: 100%; }
  .clues thead { display: none; }
  .clues tbody { display: grid; gap: 14px; }
  .clues tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .clues td { display: block; min-width: 0; padding: 6px 4px; font-size: 12px; overflow-wrap: anywhere; }
  .clues td.g { grid-column: 1 / -1; padding: 0; }
  .clues td:not(.g)::before { content: attr(data-label); display: block; font-size: 12px; color: var(--dim); margin-bottom: 2px; }
  .next { text-align: left; }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result { grid-template-columns: 1fr; }
  .result img { grid-row: auto; width: 72px; height: 72px; }
  #iconCanvas { width: 200px; height: 200px; }
}
