/* ─────────── Pictionary Game (LittleScreen v2.5 Phase A) ───────────
   Lives inside the canvas pane (.cc-canvas-wrap). Hidden when the
   game is idle. Mirrors the trivia-game.css visual language. */

.cc-canvas-wrap { position: relative; }

/* Base toggles */
.pg-overlay { display: none; }
.pg-overlay.active { display: block; }

/* ─────────── Top header strip ─────────── */
.pg-header {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  z-index: 5;
  display: flex; gap: 10px; align-items: center;
  padding: 6px 12px;
  background: rgba(20, 14, 24, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #f5ede8;
  font-size: 13px;
  pointer-events: auto;
}
.pg-header .pg-pack { opacity: 0.85; }
.pg-header .pg-round { font-weight: 600; color: #ffd070; }
.pg-header .pg-drawer {
  display: flex; gap: 6px; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  margin-left: auto;
}
.pg-header .pg-drawer .ic { font-size: 16px; }
.pg-header .pg-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 16px;
  min-width: 44px; text-align: right;
  color: #2ecc71;
}
.pg-header .pg-timer.warn { color: #f1c40f; }
.pg-header .pg-timer.crit { color: #e74c3c; animation: pgPulse 0.6s ease-in-out infinite alternate; }
@keyframes pgPulse { from { opacity: 0.6; } to { opacity: 1; } }

.pg-header .pg-host-bar { display: flex; gap: 6px; }
.pg-header button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #f5ede8; padding: 4px 10px;
  border-radius: 8px; font-size: 12px; cursor: pointer;
}
.pg-header button:hover { background: rgba(255,255,255,0.16); }

/* ─────────── Target word panel ─────────── */
.pg-target {
  position: absolute;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 10px 24px;
  background: rgba(20, 14, 24, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #f5ede8;
  text-align: center;
  pointer-events: none;
  max-width: 80%;
}
.pg-target .pg-target-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
  margin-bottom: 4px;
}
.pg-target .pg-target-word {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 22px; letter-spacing: 0.18em;
  font-weight: 700;
  color: #ffe8a0;
}
.pg-target.drawer .pg-target-word { color: #7ce0a0; letter-spacing: 0.04em; }
.pg-target .pg-target-tier {
  display: inline-block; margin-top: 4px;
  font-size: 10px; padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.pg-target .pg-target-tier.easy   { color: #2ecc71; }
.pg-target .pg-target-tier.medium { color: #f1c40f; }
.pg-target .pg-target-tier.hard   { color: #e74c3c; }
.pg-target .pg-target-tier.genius { color: #c8a2ff; }

/* ─────────── Side panel (guesses + scoreboard) ─────────── */
.pg-side {
  position: absolute;
  top: 60px; right: 8px; bottom: 80px;
  width: 260px;
  z-index: 5;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: auto;
}
.pg-side .pg-card {
  background: rgba(20, 14, 24, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #f5ede8;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pg-side .pg-card-title {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; opacity: 0.65;
  padding: 8px 12px 4px;
}
.pg-side .pg-guess-feed {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px;
}
.pg-side .pg-guess {
  display: flex; gap: 6px; align-items: baseline;
  padding: 4px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  word-break: break-word;
}
.pg-side .pg-guess .nm { font-weight: 600; }
.pg-side .pg-guess.correct { background: rgba(46, 204, 113, 0.18); border-left: 3px solid #2ecc71; }
.pg-side .pg-guess.close   { background: rgba(241, 196, 15, 0.14); border-left: 3px solid #f1c40f; }
.pg-side .pg-guess.wrong   { opacity: 0.85; }

.pg-side .pg-scores {
  flex: 0 0 auto;
  max-height: 40%; overflow-y: auto;
  padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 13px;
}
.pg-side .pg-score-row {
  display: flex; gap: 6px; align-items: center;
  padding: 3px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}
.pg-side .pg-score-row.drawer { background: rgba(124, 224, 160, 0.16); }
.pg-side .pg-score-row.me     { outline: 1px solid rgba(255, 224, 130, 0.4); }
.pg-side .pg-score-row .ic { font-size: 14px; }
.pg-side .pg-score-row .nm { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-side .pg-score-row .pts { font-variant-numeric: tabular-nums; font-weight: 700; color: #ffd070; }
.pg-side .pg-score-row .award { font-size: 11px; color: #7ce0a0; margin-left: 4px; }

/* ─────────── Bottom guess input ─────────── */
.pg-bottom {
  position: absolute;
  left: 8px; right: 276px; bottom: 8px;
  z-index: 5;
  pointer-events: auto;
}
.pg-bottom form {
  display: flex; gap: 8px;
  background: rgba(20, 14, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 8px;
}
.pg-bottom input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f5ede8;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.pg-bottom input:focus {
  outline: none;
  border-color: #ffd070;
  background: rgba(255,255,255,0.1);
}
.pg-bottom button {
  background: linear-gradient(135deg, #ff7043, #ffd070);
  color: #1a1118;
  font-weight: 700;
  border: 0;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.pg-bottom .pg-drawer-toolbar {
  display: flex; gap: 8px;
}
.pg-bottom .pg-drawer-toolbar button {
  background: rgba(255,255,255,0.1);
  color: #f5ede8;
  border: 1px solid rgba(255,255,255,0.18);
}

/* ─────────── Modals (choosing word, ended) ─────────── */
.pg-modal {
  position: absolute; inset: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 5, 12, 0.6);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}
.pg-modal-card {
  background: linear-gradient(180deg, #1a1118, #2a1a2c);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 24px;
  min-width: 320px; max-width: 90%;
  color: #f5ede8;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pg-modal-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.pg-modal-card .pg-modal-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 18px;
}
.pg-choice-row {
  display: flex; gap: 10px;
  flex-wrap: wrap; justify-content: center;
}
.pg-choice {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #f5ede8;
  padding: 14px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  min-width: 130px;
  transition: transform 0.1s, background 0.1s;
}
.pg-choice:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
.pg-choice .pg-choice-tier {
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  opacity: 0.65;
}
.pg-choice.easy .pg-choice-tier   { color: #2ecc71; }
.pg-choice.medium .pg-choice-tier { color: #f1c40f; }
.pg-choice.hard .pg-choice-tier   { color: #e74c3c; }
.pg-choice.genius .pg-choice-tier { color: #c8a2ff; }

.pg-final-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 16px 0;
  text-align: left;
}
.pg-final-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
}
.pg-final-row.rank-1 { background: linear-gradient(90deg, rgba(255, 215, 0, 0.22), rgba(255,255,255,0.04)); }
.pg-final-row.rank-2 { background: linear-gradient(90deg, rgba(192, 192, 192, 0.18), rgba(255,255,255,0.04)); }
.pg-final-row.rank-3 { background: linear-gradient(90deg, rgba(205, 127, 50, 0.18), rgba(255,255,255,0.04)); }
.pg-final-row .rank { font-size: 18px; font-weight: 800; min-width: 28px; }
.pg-final-row .nm { flex: 1; }
.pg-final-row .pts { font-variant-numeric: tabular-nums; font-weight: 700; color: #ffd070; }

.pg-modal-card .pg-actions {
  display: flex; gap: 10px; justify-content: center;
  margin-top: 12px;
}
.pg-modal-card button.primary {
  background: linear-gradient(135deg, #ff7043, #ffd070);
  color: #1a1118;
  font-weight: 700;
  border: 0; padding: 10px 22px;
  border-radius: 10px; cursor: pointer;
}
.pg-modal-card button.secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f5ede8;
  padding: 10px 18px; border-radius: 10px; cursor: pointer;
}

/* ─────────── Idle / start banner ─────────── */
.pg-startbar {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px;
  background: rgba(20, 14, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #f5ede8;
  font-size: 13px;
}
.pg-startbar button.primary {
  background: linear-gradient(135deg, #ff7043, #ffd070);
  color: #1a1118; font-weight: 700;
  border: 0; padding: 8px 18px; border-radius: 8px; cursor: pointer;
}
.pg-startbar button.secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f5ede8; padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.pg-startbar .pg-mode-toggle {
  display: flex; gap: 0; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
}
.pg-startbar .pg-mode-toggle button {
  background: transparent; color: #f5ede8;
  border: 0; padding: 6px 12px; cursor: pointer; font-size: 12px;
}
.pg-startbar .pg-mode-toggle button.active {
  background: rgba(255, 224, 130, 0.18); color: #ffe8a0;
}

/* Mobile */
@media (max-width: 720px) {
  .pg-side { width: 200px; }
  .pg-bottom { right: 216px; }
  .pg-target .pg-target-word { font-size: 18px; }
}
@media (max-width: 540px) {
  .pg-side {
    position: absolute; right: 8px; left: 8px;
    bottom: 64px; top: auto; height: 38%;
    width: auto;
  }
  .pg-bottom { right: 8px; }
  .pg-target { top: 56px; }
  .pg-target .pg-target-word { font-size: 16px; letter-spacing: 0.12em; }
}
