/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #273344;
  --border: #334155;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --card-w: 68px;
  --card-h: 96px;
  --radius: 10px;
}

body {
  font-family: var(--font-ui, system-ui, -apple-system, sans-serif);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Views ─────────────────────────────────────────────────── */
.view { min-height: 100vh; }

/* ── Landing ───────────────────────────────────────────────── */
#view-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 2rem;
}

#view-landing header { text-align: center; }
#view-landing h1 { font-size: 2.5rem; }
.subtitle { color: var(--text-muted); margin-top: .4rem; }

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 680px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
}

.divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

@media (max-width: 580px) {
  .two-col { grid-template-columns: 1fr; }
  .divider { width: 100%; height: 1px; }
}

form { display: flex; flex-direction: column; gap: .75rem; }

label { font-size: .85rem; color: var(--text-muted); }

input[type="text"],
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .55rem .75rem;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus,
select:focus { border-color: var(--accent); }
select { cursor: pointer; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }

.form-error { color: var(--danger); font-size: .85rem; min-height: 1.2rem; }

/* ── Room header ───────────────────────────────────────────── */
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
}

.room-header h1 { font-size: 1.4rem; }

.room-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .9rem;
}

#btn-copy-code {
  background: transparent;
  color: var(--text-muted);
  padding: .2rem .4rem;
  font-size: .9rem;
}
#btn-copy-code:hover { color: var(--text); background: transparent; }

/* ── Room body ─────────────────────────────────────────────── */
.room-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: calc(100vh - 60px);
}

@media (max-width: 640px) {
  .room-body { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.sidebar h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .75rem; }

#participant-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }

#participant-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  padding: .35rem .5rem;
  border-radius: 6px;
  background: var(--surface2);
}

.participant-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-you { font-size: .7rem; background: var(--accent); color: #fff; border-radius: 4px; padding: .1rem .35rem; }
.badge-mod { font-size: .7rem; background: var(--warning); color: #000; border-radius: 4px; padding: .1rem .35rem; }
.badge-role { font-size: .65rem; border-radius: 4px; padding: .1rem .3rem; font-weight: 600; }
.badge-role--backend  { background: #1e3a5f; color: #60a5fa; }
.badge-role--frontend { background: #3b1f5e; color: #c084fc; }
.badge-role--both     { background: #1a3a2e; color: #6ee7b7; }
.vote-indicator { font-size: .75rem; }
.voted { color: var(--success); }
.not-voted { color: var(--text-muted); }
.participant-inactive { opacity: .45; }

/* ── Main area ─────────────────────────────────────────────── */
.main-area {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Story label ───────────────────────────────────────────── */
.story-label {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: 1rem;
  color: var(--text-muted);
}
.story-label strong { color: var(--text); }

/* ── Moderator controls ────────────────────────────────────── */
#moderator-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

#ctrl-voter-filter {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.voter-filter-label { font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
#voter-filter-select { font-size: .85rem; padding: .35rem .6rem; }

#ctrl-waiting { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
#story-label-input { flex: 1; min-width: 180px; }
#btn-start { white-space: nowrap; }
#btn-reveal { background: #f59e0b; }
#btn-reveal:hover { background: #d97706; }
#btn-reset { background: #64748b; }
#btn-reset:hover { background: #475569; }

/* ── Not-voting message ────────────────────────────────────── */
.not-voting-msg {
  color: var(--text-muted);
  font-size: .9rem;
  text-align: center;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── Card deck ─────────────────────────────────────────────── */
#card-deck h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 1rem; }

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.card {
  width: var(--card-w);
  height: var(--card-h);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card.selected { border-color: var(--accent); background: var(--accent); color: #fff; transform: translateY(-6px); }

/* ── Results panel ─────────────────────────────────────────── */
#results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#results-consensus {
  font-size: 1.3rem;
  text-align: center;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  font-size: .9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.stat { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Poker table ───────────────────────────────────────────── */
.table-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  min-height: 320px;
}

.table-felt {
  position: absolute;
  inset: 19% 17%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 38%, #1d6f42 0%, #14532d 65%, #0e3d21 100%);
  border: 8px solid #4a3424;
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, .45),
    0 10px 35px rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .5s, border-color .5s;
}

.table-felt.consensus {
  border-color: var(--success);
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, .35),
    0 0 55px rgba(52, 211, 153, .4),
    0 10px 35px rgba(0, 0, 0, .45);
}

.table-center {
  text-align: center;
  color: rgba(255, 255, 255, .88);
  font-weight: 700;
  font-size: 1.35rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  padding: 0 1rem;
}
.table-center small {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .65;
  margin-top: .15rem;
}

#table-seats { position: absolute; inset: 0; }

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  width: 80px;
  z-index: 2;
}
.seat-inactive { opacity: .4; }

.seat-name {
  font-size: .72rem;
  color: var(--text-muted);
  max-width: 80px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.seat-name.me { color: var(--accent-hover); font-weight: 700; }

.seat-slot {
  width: 48px;
  height: 68px;
  border: 2px dashed rgba(148, 163, 184, .45);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.seat-card {
  width: 48px;
  height: 68px;
  perspective: 600px;
}

.seat-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4, .2, .2, 1);
}
.seat-card.flipped .seat-card-inner { transform: rotateY(180deg); }

.seat-card-front,
.seat-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seat-card-front {
  background:
    repeating-linear-gradient(45deg, #4f46e5 0 6px, #4338ca 6px 12px);
  border: 2px solid #818cf8;
  font-size: 1.1rem;
}

.seat-card-back {
  background: var(--surface);
  border: 2px solid var(--accent);
  transform: rotateY(180deg);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}

.seat-card.outlier .seat-card-back {
  border-color: var(--warning);
  background: rgba(251, 191, 36, .12);
  color: var(--warning);
}

.seat-card.deal { animation: deal-in .4s cubic-bezier(.2, .9, .3, 1.2); }

@keyframes deal-in {
  from { transform: translateY(-28px) rotate(-8deg) scale(.55); opacity: 0; }
  to   { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  .table-wrap { min-height: 280px; }
  .seat { width: 62px; }
  .seat-name { max-width: 62px; font-size: .65rem; }
  .seat-slot, .seat-card { width: 38px; height: 54px; }
  .seat-card-back { font-size: 1rem; }
  .table-center { font-size: 1.05rem; }
}

.confetti-fixed {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}

/* ── Landing tools row ─────────────────────────────────────── */
.btn-tool {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: .75rem 1.4rem;
  font-size: 1rem;
  transition: border-color .15s, background .15s;
}
.btn-tool:hover { border-color: var(--accent); background: var(--surface2); }

/* ── Wheel button in room header ───────────────────────────── */
#btn-open-wheel {
  background: transparent;
  color: var(--text-muted);
  padding: .2rem .45rem;
  font-size: 1rem;
}
#btn-open-wheel:hover { color: var(--text); background: var(--surface2); }

/* ── Modal overlay ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 740px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 1.15rem; }

.btn-close {
  background: transparent;
  color: var(--text-muted);
  padding: .25rem .55rem;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 6px;
}
.btn-close:hover { color: var(--text); background: var(--surface2); }

/* ── Wheel layout ──────────────────────────────────────────── */
.wheel-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  align-items: start;
}

@media (max-width: 620px) {
  .wheel-layout { grid-template-columns: 1fr; }
}

.wheel-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
}

#wheel-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
}

.btn-spin {
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  padding: .7rem 1.5rem;
  background: var(--success);
  color: #052e16;
  border-radius: 8px;
  transition: background .15s, transform .1s;
}
.btn-spin:hover:not(:disabled) { background: #059669; color: #fff; transform: translateY(-2px); }
.btn-spin:disabled { background: var(--surface2); color: var(--text-muted); transform: none; }

/* ── Winner overlay ────────────────────────────────────────── */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.72);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.winner-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 2px solid var(--warning);
  border-radius: 1.5rem;
  padding: 2.5rem 3.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  box-shadow: 0 0 80px rgba(251,191,36,.3), 0 20px 60px rgba(0,0,0,.5);
  animation: winner-card-enter .45s cubic-bezier(.34,1.56,.64,1);
}

@keyframes winner-card-enter {
  0%   { transform: scale(.3) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.winner-trophy {
  font-size: 4.5rem;
  line-height: 1;
  animation: trophy-bounce 1.1s ease-in-out infinite;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-14px) rotate(3deg); }
}

.winner-label {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--warning);
}

.winner-name {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  max-width: 380px;
  word-break: break-word;
  line-height: 1.2;
}

.winner-actions {
  display: flex;
  gap: .75rem;
  margin-top: .4rem;
}

.winner-actions button:first-child {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .6rem 1.4rem;
}
.winner-actions button:first-child:hover { background: var(--border); }

#btn-winner-copy {
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: .6rem 1.4rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
#btn-winner-copy:hover:not(:disabled) { background: var(--accent); color: #fff; }
#btn-winner-copy:disabled { opacity: .6; }

#btn-winner-again {
  background: var(--success);
  color: #052e16;
  font-weight: 700;
  border-radius: 8px;
  padding: .6rem 1.5rem;
}
#btn-winner-again:hover { background: #059669; color: #fff; }

/* ── Wheel right panel ─────────────────────────────────────── */
.wheel-right {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.names-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.names-header h3 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}
.names-actions { display: flex; gap: .4rem; }

.wheel-presets { display: flex; gap: .4rem; }
.wheel-presets select {
  flex: 1; min-width: 0;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: .3rem .5rem; font-size: .85rem;
}
.wheel-presets .btn-sm:disabled { opacity: .4; cursor: default; }

.btn-sm {
  font-size: .78rem;
  padding: .3rem .65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}
.btn-sm:hover { background: var(--border); }

.wheel-reason-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: .5rem .75rem;
  font-size: .875rem;
  outline: none;
  transition: border-color .15s;
}
.wheel-reason-input:focus { border-color: var(--accent); }
.wheel-reason-input::placeholder { color: var(--text-muted); font-style: italic; }

.wheel-names-textarea {
  width: 100%;
  flex: 1;
  min-height: 220px;
  resize: vertical;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: .65rem .75rem;
  font-size: .95rem;
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  transition: border-color .15s;
}
.wheel-names-textarea:focus { border-color: var(--accent); }
.wheel-names-textarea::placeholder { color: var(--text-muted); }

.names-hint { font-size: .78rem; color: var(--text-muted); }

/* ── Wheel history ─────────────────────────────────────────── */
.wheel-history { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.wheel-history h3 {
  display: flex; align-items: center; gap: .6rem;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}
.wheel-history-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; max-height: 260px; overflow-y: auto; }
.wheel-full-list summary { cursor: pointer; font-size: .85rem; color: var(--text-muted); }
.wheel-full-list textarea { margin-top: .4rem; min-height: 90px; }
.wheel-history-list li { display: flex; gap: .4rem; align-items: flex-start; }
.wheel-history-list li details { flex: 1; min-width: 0; }
.wheel-history-action, .wheel-history-delete { flex: none; }
.wheel-history-list details {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .8rem;
}
.wheel-history-list summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; cursor: pointer; min-width: 0;
}
.wheel-history-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.wheel-history-winner { color: var(--warning); font-weight: 600; overflow-wrap: anywhere; }
.wheel-history-meta { font-size: .75rem; color: var(--text-muted); margin-left: auto; }
.wheel-history-names { margin-top: .4rem; font-size: .85rem; color: var(--text-muted); overflow-wrap: anywhere; }

/* ── Landing: selector de modo y Retro ─────────────────────── */
.mode-switch {
  display: inline-flex; gap: .3rem; padding: .3rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.mode-switch button { background: transparent; color: var(--text-muted); border-radius: 999px; padding: .45rem 1.1rem; }
.mode-switch button:hover { background: var(--surface2); }
.mode-switch button.active { background: var(--accent); color: #fff; }
.mode-pane { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.wheel-panel { max-width: 820px; padding: 0; }

.retro-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 820px; }
.retro-panel section { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.retro-panel form { display: flex; flex-direction: column; gap: .6rem; }
.board-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; max-height: 360px; overflow-y: auto; }
.board-list a {
  display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem;
}
.board-list a:hover { border-color: var(--accent); }
.board-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list span { font-size: .75rem; color: var(--text-muted); }

@media (max-width: 720px) {
  .retro-panel { grid-template-columns: 1fr; }
}

/* ── Changelog ─────────────────────────────────────────────── */
.changelog-link {
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  padding: .25rem .5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.changelog-link:hover { color: var(--text); background: transparent; }
.changelog-box { max-width: 520px; }
.changelog-body { padding: 1rem 1.25rem 1.25rem; font-size: .9rem; }
.changelog-body h3 {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 1rem 0 .35rem;
}
.changelog-body h3:first-child { margin-top: 0; }
.changelog-body ul { padding-left: 1.2rem; display: grid; gap: .25rem; }

/* ── Selector de equipo ────────────────────────────────────── */
#identity-box {
  position: fixed; top: 10px; right: 10px; z-index: 40; display: flex; gap: .3rem; padding: .25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
/* Solo en la home: dentro de una sala o de la ruleta modal no se cambia de equipo ni de nombre. */
body:has(#view-landing.hidden) #identity-box { display: none; }
#team-badge, #name-badge { background: var(--surface2); color: var(--text); border-radius: 999px; padding: .3rem .9rem; font-size: .85rem; }
#team-badge:hover, #name-badge:hover { background: var(--border); }
.team-gate { max-width: 460px; }
.team-gate-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.team-grid button { padding: .8rem; font-weight: 600; letter-spacing: .04em; }

/* ── Juego del día ─────────────────────────────────────────── */
.daily-panel { max-width: 820px; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.daily-game, .daily-ranking-box { display: flex; flex-direction: column; align-items: center; gap: .8rem; min-width: 0; }
.daily-ranking-box { align-items: stretch; }
.daily-board { display: grid; gap: 6px; }
.daily-row { display: grid; grid-template-columns: repeat(5, 52px); gap: 6px; }
.daily-tile {
  height: 52px; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; border: 2px solid var(--border); border-radius: 6px;
  background: var(--surface2); text-transform: uppercase;
}
.daily-tile.filled { border-color: var(--text-muted); }
.daily-tile.correct, .daily-key.correct { background: #15803d; border-color: #15803d; color: #fff; }
.daily-tile.present, .daily-key.present { background: #b45309; border-color: #b45309; color: #fff; }
.daily-tile.absent, .daily-key.absent { background: #1e293b; border-color: #1e293b; color: var(--text-muted); }
.daily-board.blurred, .daily-keyboard.blurred { filter: blur(10px); cursor: pointer; user-select: none; }
.daily-keyboard.blurred button { pointer-events: none; }
.daily-message { min-height: 2.6em; text-align: center; font-size: .9rem; color: var(--text-muted); }
.daily-message.ok { color: var(--success); }
.daily-message.bad { color: var(--danger); }
.daily-keyboard { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 360px; }
.daily-keys { display: flex; justify-content: center; gap: 4px; }
.daily-key {
  flex: 1; min-width: 0; padding: .7rem 0; font-size: .95rem; font-weight: 600;
  background: var(--surface2); border: 2px solid var(--border); color: var(--text); border-radius: 6px;
}
.daily-key.wide { flex: 1.6; }
.daily-tabs { display: flex; gap: .3rem; }
.daily-tabs button { flex: 1; background: var(--surface2); color: var(--text-muted); }
.daily-tabs button.active { background: var(--accent); color: #fff; }
.daily-ranking { list-style: none; display: flex; flex-direction: column; gap: .4rem; max-height: 340px; overflow-y: auto; }
.daily-ranking li { display: flex; align-items: baseline; gap: .6rem; padding: .45rem .6rem; border-radius: 6px; background: var(--surface2); }
.daily-ranking li.me { outline: 2px solid var(--accent); }
.daily-ranking strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-pos { color: var(--text-muted); width: 1.4rem; }
.daily-detail { margin-left: auto; font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.daily-points { font-weight: 700; color: var(--warning); white-space: nowrap; }
.daily-empty { color: var(--text-muted); font-size: .9rem; }
.daily-history { max-height: 460px; }
.daily-history li { display: block; }
.daily-history details { display: flex; flex-direction: column; }
.daily-history summary { display: flex; align-items: baseline; gap: .6rem; cursor: pointer; list-style: none; }
.daily-history summary::-webkit-details-marker { display: none; }
.daily-history summary::before { content: '▸'; color: var(--text-muted); transition: transform .15s; }
.daily-history details[open] summary::before { transform: rotate(90deg); }
.daily-history .daily-detail.won { color: var(--success); }
.daily-history .daily-detail.lost { color: var(--danger); }
.daily-history .daily-board, .daily-history .daily-empty { margin: .6rem 0 .2rem; justify-self: center; align-self: center; }
.daily-history .daily-row { grid-template-columns: repeat(5, 28px); gap: 4px; }
.daily-history .daily-board { gap: 4px; }
.daily-history .daily-tile { height: 28px; font-size: .85rem; border-width: 1px; border-radius: 4px; }
.daily-date { color: var(--text-muted); font-size: .8rem; width: 5.6rem; white-space: nowrap; }
.daily-answer { letter-spacing: .08em; }
@media (max-width: 720px) {
  .daily-panel { grid-template-columns: 1fr; }
  .daily-row { grid-template-columns: repeat(5, 46px); }
  .daily-tile { height: 46px; font-size: 1.4rem; }
}

/* ── Login ─────────────────────────────────────────────────── */
.login-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1rem; gap: 2rem;
}
.login-view header { text-align: center; }
.login-view h1 { font-size: 2.5rem; }
.login-panel { max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.login-panel form { display: flex; flex-direction: column; gap: .6rem; width: 100%; }
#login-google { width: 100%; }
#google-button { display: flex; justify-content: center; line-height: 0; }
.login-panel .form-error:empty { display: none; }
.login-dev-note { color: var(--warning); font-size: .85rem; }

/* ── Contadores ────────────────────────────────────────────── */
.counters-panel { max-width: 720px; display: flex; flex-direction: column; gap: 1rem; }
.counter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.counter { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; background: var(--surface2); border-radius: 12px; }
.counter[draggable=true] { cursor: grab; }
.counter.dragging { opacity: .4; }
.counter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.counter-value { font-size: 1.6rem; font-weight: 700; white-space: nowrap; }
.counter-bar { height: 14px; background: var(--border); border-radius: 999px; overflow: hidden; }
.counter-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.counter-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 1.8rem; }
.counter-meta { font-size: .85rem; color: var(--text-muted); }
.counter-actions { display: flex; gap: .3rem; }
.counter-form { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: 1rem; background: var(--surface2); border-radius: 12px; }
.counter-field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--text-muted); min-width: 0; }
.counter-field:first-child { grid-column: 1 / -1; }
.counter-form-actions { grid-column: 1 / -1; display: flex; gap: .6rem; }
@media (max-width: 560px) { .counter-form { grid-template-columns: 1fr; } }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface2); }

/* ── Amigo invisible ───────────────────────────────────────── */
.santa-panel { max-width: 720px; display: flex; flex-direction: column; gap: 1.2rem; }
.santa-result { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 1.5rem 1rem; background: var(--surface2); border-radius: 12px; text-align: center; }
.santa-count { font-size: 5rem; font-weight: 800; line-height: 1; color: var(--accent); }
.santa-name {
  font-size: 2.6rem; font-weight: 800; padding: .3rem 1rem; background: none; color: var(--text);
  border: 0; cursor: pointer; overflow-wrap: anywhere;
}
.santa-name.blurred { filter: blur(14px); user-select: none; }
.santa-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.santa-players h2 { margin-bottom: .6rem; }
.santa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.santa-list li { padding: .35rem .8rem; background: var(--surface2); border-radius: 999px; }
.santa-list li.me { outline: 2px solid var(--accent); }
.santa-seal { max-width: 100%; font-size: .7rem; font-family: monospace; color: var(--text-muted); overflow-wrap: anywhere; }
.santa-ok { color: var(--success); font-size: .9rem; }
.santa-published { display: flex; flex-direction: column; gap: .6rem; }
.santa-pairs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.santa-pairs li { padding: .4rem .8rem; background: var(--surface2); border-radius: 6px; }
