/* Hocle — "Neon Paper" visual identity */
:root {
  --ink: #16161C;
  --paper: #FAF7F2;
  --violet: #7C4DFF;
  --amber: #F5B940;
  --mint: #35C28C;
  --sky: #4DA3FF;
  --card: #FFFFFF;
  --shadow: 0 2px 10px rgba(22, 22, 28, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Nunito", "Manrope", -apple-system, "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; max-width: 640px; margin: 0 auto;
}

.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-q { display: grid; grid-template-columns: 11px 11px; gap: 3px; }
.logo-q i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.logo-q i:nth-child(1) { background: var(--violet); }
.logo-q i:nth-child(2) { background: var(--amber); }
.logo-q i:nth-child(3) { background: var(--mint); }
.logo-q i:nth-child(4) { background: var(--sky); }
.logo-text { font-weight: 900; font-size: 22px; letter-spacing: 2px; }

.chips { display: flex; gap: 8px; }
.chip {
  background: var(--card); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow);
}

main { max-width: 640px; margin: 0 auto; padding: 8px 18px 40px; }
.view.hidden, .hidden { display: none !important; }

.tagline { text-align: center; font-size: 18px; font-weight: 700; margin: 18px 0 22px; color: var(--violet); }

.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.menu-card {
  background: var(--card); border: none; border-radius: var(--radius);
  padding: 20px 16px; text-align: left; cursor: pointer;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
  transition: transform .12s ease, box-shadow .12s ease;
  border-top: 4px solid var(--violet);
  font-family: inherit; color: inherit;
}
.menu-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22,22,28,.14); }
.menu-card.daily { border-top-color: var(--amber); }
.menu-card.battle { border-top-color: var(--violet); }
.menu-card.endless { border-top-color: var(--mint); }
.menu-card.board { border-top-color: var(--sky); }
.menu-emoji { font-size: 26px; }
.menu-title { font-weight: 900; font-size: 17px; }
.menu-sub { font-size: 12.5px; color: #5a5a66; }

.player-line { text-align: center; margin-top: 22px; font-size: 13px; color: #77777f; }

/* Game */
.game-top { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 14px; gap: 10px; }
#game-status { font-weight: 800; font-size: 15px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 20px; color: var(--violet); }

.opponent-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; font-size: 13.5px;
}
.opp-name { font-weight: 800; }
.opp-quads, .opp-mist { letter-spacing: 2px; }

#solved-groups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.solved-row {
  border-radius: 10px; padding: 10px 12px; text-align: center; color: var(--ink);
  animation: pop .35s ease;
}
.solved-row .cat { font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; }
.solved-row .ws { font-size: 12.5px; font-weight: 600; }
.solved-row.yellow { background: var(--amber); }
.solved-row.green  { background: var(--mint); }
.solved-row.blue   { background: var(--sky); }
.solved-row.purple { background: var(--violet); color: #fff; }

@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile {
  aspect-ratio: 1.55; border: none; border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow);
  font-family: inherit; font-weight: 800; color: var(--ink); cursor: pointer;
  font-size: clamp(9px, 2.6vw, 14px); text-transform: uppercase;
  transition: transform .1s ease, background .1s ease, color .1s ease;
  padding: 2px; word-break: break-word;
}
.tile:hover { transform: translateY(-1px); }
.tile.sel { background: var(--ink); color: var(--paper); transform: scale(.96); }
.grid.shake .tile.sel { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0) scale(.96); }
  25% { transform: translateX(-5px) scale(.96); }
  75% { transform: translateX(5px) scale(.96); }
}

.mistakes { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; align-items: center; font-size: 13px; font-weight: 700; color: #5a5a66; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #ddd6cc; display: inline-block; }
.dot.used { background: var(--ink); }

.controls { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.btn {
  border: none; border-radius: 999px; padding: 10px 20px; font-weight: 800;
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: transform .1s ease, opacity .1s ease;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn.primary { background: var(--violet); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.hint-box {
  margin-top: 14px; background: #FFF6DC; border: 1px solid var(--amber);
  border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600;
}

/* Leaderboard */
.lb-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lb-list li {
  background: var(--card); border-radius: 10px; padding: 10px 16px;
  display: flex; justify-content: space-between; box-shadow: var(--shadow);
  font-weight: 700; font-size: 14.5px;
}
.lb-list li .lg { color: var(--violet); font-size: 12.5px; }

/* Queue */
.queue-box { text-align: center; margin-top: 60px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.queue-anim { display: grid; grid-template-columns: 22px 22px; gap: 6px; }
.queue-anim i { width: 22px; height: 22px; border-radius: 6px; animation: pulse 1.2s infinite ease-in-out; }
.queue-anim i:nth-child(1) { background: var(--violet); animation-delay: 0s; }
.queue-anim i:nth-child(2) { background: var(--amber); animation-delay: .15s; }
.queue-anim i:nth-child(3) { background: var(--mint); animation-delay: .3s; }
.queue-anim i:nth-child(4) { background: var(--sky); animation-delay: .45s; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.7); } }
.muted { color: #77777f; font-size: 13.5px; max-width: 380px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(22,22,28,.5);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-card {
  background: var(--paper); border-radius: 18px; padding: 26px;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .3s ease;
  max-height: 85vh; overflow-y: auto;
}
.modal-card h2 { margin-bottom: 12px; font-size: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.emoji-grid { font-size: 22px; line-height: 1.35; margin: 10px 0; letter-spacing: 2px; }
.reward-line { font-weight: 800; color: var(--violet); margin-top: 6px; }
.solution-mini { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; text-align: left; }
.solution-mini div { border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; }

.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 10px 22px; font-weight: 800; font-size: 14px; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: pop .25s ease;
}

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