/* Estilos de la fiesta (móvil y TV). Se apoya en /juegos/base.css */

body { --accent: #f472b6; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0,0,0,.4); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 3px 8px rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.35); }
.avatar.away { opacity: .35; filter: grayscale(.8); }

.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); font-weight: 700; font-size: .9rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; white-space: nowrap; }
.bar { height: 10px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; width: 100%; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #4ade80, #fde047, #fb7185); transform-origin: left; }

.board-list { display: flex; flex-direction: column; gap: .45rem; width: 100%; }
.board-row { display: flex; align-items: center; gap: .7rem; padding: .45rem .7rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.board-row .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .score { font-weight: 900; font-variant-numeric: tabular-nums; }
.board-row .gain { color: var(--ok); font-weight: 800; font-size: .85rem; animation: pop .3s ease-out; }
.board-row.me { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.board-row.drawing { border-color: var(--gold); }
.board-row .rank { width: 1.6rem; color: var(--muted); font-weight: 800; text-align: center; }

.toast-f { position: fixed; top: 16%; left: 50%; transform: translateX(-50%); z-index: 80; background: #f1f4fb; color: #0b0e16; padding: .6rem 1.1rem; border-radius: 14px; font-weight: 800; animation: pop .15s ease-out; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* ---------------- móvil ---------------- */
.phone { width: 100%; max-width: 520px; margin: 0 auto; padding: .4rem 1rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; flex: 1; min-height: 0; overflow-y: auto; }
.phone h2 { margin: .2rem 0; font-size: 1.4rem; }
.phone .sub { color: var(--muted); }
.who { display: flex; gap: .5rem; flex-wrap: wrap; }
.who .chip { display: flex; align-items: center; gap: .4rem; padding: .25rem .7rem .25rem .3rem; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; font-weight: 700; font-size: .9rem; }
.who .chip .avatar { width: 28px; height: 28px; font-size: 11px; }
.gamecards { display: grid; gap: .8rem; }
.gamecard { display: flex; gap: .9rem; align-items: center; padding: 1rem; border-radius: 20px; border: 1px solid var(--border); cursor: pointer; text-align: left; color: var(--text); font: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); transition: transform .1s, border-color .15s; width: 100%; }
.gamecard:active { transform: scale(.98); }
.gamecard:hover:not(:disabled) { border-color: var(--accent); }
.gamecard:disabled { opacity: .45; }
.gamecard .em { font-size: 2.4rem; }
.gamecard b { display: block; font-size: 1.15rem; }
.gamecard small { color: var(--muted); }
.stepper { display: flex; align-items: center; gap: .6rem; justify-content: space-between; padding: .6rem .9rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.stepper .btn { padding: .35rem .9rem; font-size: 1.2rem; }

.tools { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); padding: 0; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.swatch.on { border-color: #fff; transform: scale(1.15); }
.size { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); background: var(--chip); display: grid; place-items: center; cursor: pointer; padding: 0; }
.size i { display: block; border-radius: 50%; background: #fff; }
.size.on { border-color: var(--accent); }
.canvas-wrap canvas { width: 100%; height: auto; touch-action: none; border-radius: 16px; background: #fff; max-height: none; }

.wordchoice { display: grid; gap: .6rem; }
.wordchoice .btn { font-size: 1.3rem; padding: 1rem; font-weight: 800; }
.hint { font-size: clamp(1.4rem, 7vw, 2rem); font-weight: 900; letter-spacing: .25em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.guessform { display: flex; gap: .5rem; }
.guessform input { flex: 1; padding: .8rem 1rem; border-radius: 14px; border: 1px solid var(--border); background: rgba(8,11,20,.7); color: var(--text); font: inherit; font-size: 1.1rem; }
.guessform input:focus { outline: 0; border-color: var(--accent); }
.feed { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; max-height: 7rem; overflow: hidden; }
.feed div { color: var(--muted); } .feed b { color: var(--text); } .feed .ok { color: var(--ok); font-weight: 800; } .feed .close { color: var(--gold); }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; flex: 1; min-height: 240px; }
.answer { border: 0; border-radius: 22px; color: #fff; font: inherit; font-weight: 800; font-size: 1.05rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: .8rem; text-align: center;
  cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.35); text-shadow: 0 2px 0 rgba(0,0,0,.25); transition: transform .08s, filter .15s; }
.answer:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.answer .shape { font-size: 1.8rem; line-height: 1; }
.answer.a0 { background: linear-gradient(180deg, #f87171, #dc2626); } .answer.a1 { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.answer.a2 { background: linear-gradient(180deg, #facc15, #ca8a04); } .answer.a3 { background: linear-gradient(180deg, #4ade80, #16a34a); }
.answer.dim { filter: grayscale(.8) brightness(.55); box-shadow: none; }
.answer.right { box-shadow: 0 0 0 5px #fff, 0 0 40px rgba(74,222,128,.8); animation: pop .3s; }
.answer.mine { outline: 4px solid #fff; }
.question { font-size: 1.35rem; font-weight: 800; text-align: center; line-height: 1.25; }
.big-result { text-align: center; font-size: 1.6rem; font-weight: 900; }
.podium-me { text-align: center; }
.podium-me .rank { font-size: 4rem; font-weight: 900; background: linear-gradient(180deg,#fff,var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.conn { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 90; background: #7a1426; color: #fff; padding: .4rem .9rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.conn[hidden] { display: none; }

/* ---------------- TV ---------------- */
body.tv { overflow: hidden; align-items: stretch; --tv: clamp(14px, 1.7vmin, 30px); font-size: var(--tv); }
.tvwrap { flex: 1; display: flex; flex-direction: column; padding: 2vmin 3vmin; gap: 2vmin; min-height: 0; }
.tvtop { display: flex; align-items: center; gap: 2vmin; }
.tvtop h1 { margin: 0; font-size: 3.2vmin; flex: 1; font-weight: 900; }
.tv-lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4vmin; align-items: center; min-height: 0; }
.qrbox { background: #fff; padding: 2vmin; border-radius: 3vmin; display: grid; place-items: center; box-shadow: 0 2vmin 6vmin rgba(0,0,0,.5), 0 0 12vmin -2vmin var(--glow); }
.qrbox img { width: min(36vmin, 100%); height: auto; display: block; }
.joininfo { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.6vmin; }
.joininfo .url { font-size: 3.6vmin; font-weight: 900; padding: 1.2vmin 2.4vmin; background: var(--panel); border: 1px solid var(--border); border-radius: 2vmin; }
.joininfo p { margin: 0; color: var(--muted); font-size: 2.2vmin; }
.tv-players { display: flex; flex-wrap: wrap; gap: 1.6vmin; justify-content: center; }
.tv-players .p { display: flex; flex-direction: column; align-items: center; gap: .6vmin; font-weight: 800; font-size: 2.2vmin; animation: pop .3s ease-out; }
.tv-players .p .avatar { width: 8vmin; height: 8vmin; font-size: 3.2vmin; }
.tv-games { display: flex; gap: 2vmin; flex-wrap: wrap; justify-content: center; }
.tv-games .gamecard { width: auto; font-size: 2.2vmin; padding: 1.8vmin 2.6vmin; }
.tv-games .gamecard .em { font-size: 5vmin; }

.tv-draw { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 30vmin; gap: 2.4vmin; min-height: 0; }
.tv-draw .stage { display: flex; flex-direction: column; gap: 1.6vmin; min-height: 0; align-items: center; justify-content: center; }
.tv-draw canvas { max-width: 100%; max-height: 100%; aspect-ratio: 4/3; width: auto; height: auto; border-radius: 2vmin; background: #fff; box-shadow: 0 2vmin 6vmin rgba(0,0,0,.55), 0 0 10vmin -3vmin var(--glow); }
.tv-hint { font-size: 7vmin; font-weight: 900; letter-spacing: .3em; font-family: ui-monospace, Consolas, monospace; }
.tv-side { display: flex; flex-direction: column; gap: 1.2vmin; min-height: 0; overflow: hidden; }
.tv-side .board-row { padding: .8vmin 1.2vmin; font-size: 2.2vmin; }
.tv-side .avatar { width: 5vmin; height: 5vmin; font-size: 2vmin; }
.tv-feed { font-size: 2vmin; display: flex; flex-direction: column; gap: .5vmin; overflow: hidden; }

.tv-trivia { flex: 1; display: flex; flex-direction: column; gap: 2.4vmin; min-height: 0; }
.tv-q { font-size: 5vmin; font-weight: 900; text-align: center; line-height: 1.2; padding: 3vmin; background: var(--panel); border-radius: 3vmin; border: 1px solid var(--border); }
.tv-q small { display: block; font-size: 2vmin; color: var(--muted); letter-spacing: .15em; text-transform: uppercase; margin-bottom: 1vmin; font-weight: 700; }
.tv-opts { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2vmin; min-height: 0; }
.tv-opt { border-radius: 3vmin; display: flex; align-items: center; gap: 2vmin; padding: 2vmin 3vmin; color: #fff; font-weight: 800; font-size: 3.6vmin; text-shadow: 0 2px 0 rgba(0,0,0,.25); box-shadow: 0 1vmin 0 rgba(0,0,0,.35); position: relative; overflow: hidden; }
.tv-opt .shape { font-size: 5vmin; }
.tv-opt .count { margin-left: auto; background: rgba(0,0,0,.3); border-radius: 999px; padding: .3vmin 1.6vmin; font-size: 3vmin; }
.tv-opt.a0 { background: linear-gradient(180deg, #f87171, #dc2626); } .tv-opt.a1 { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.tv-opt.a2 { background: linear-gradient(180deg, #facc15, #ca8a04); } .tv-opt.a3 { background: linear-gradient(180deg, #4ade80, #16a34a); }
.tv-opt.dim { filter: grayscale(.85) brightness(.5); box-shadow: none; }
.tv-opt.right { box-shadow: 0 0 0 .8vmin #fff, 0 0 8vmin rgba(74,222,128,.9); animation: pop .35s; }
.tv-answered { display: flex; gap: 1vmin; justify-content: center; min-height: 6vmin; }
.tv-answered .avatar { width: 5vmin; height: 5vmin; font-size: 2vmin; animation: pop .25s; }

.tv-podium { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2.4vmin; padding-bottom: 2vmin; min-height: 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: 1vmin; width: 22vmin; }
.step .block { width: 100%; border-radius: 2vmin 2vmin 0 0; display: grid; place-items: center; font-weight: 900; font-size: 7vmin; color: rgba(0,0,0,.45); animation: rise .8s cubic-bezier(.2,.9,.3,1.1) backwards; }
.step.s1 .block { height: 30vmin; background: linear-gradient(180deg, #ffe58a, #f5b014); animation-delay: .6s; }
.step.s2 .block { height: 22vmin; background: linear-gradient(180deg, #e5e7eb, #9ca3af); animation-delay: .3s; }
.step.s3 .block { height: 16vmin; background: linear-gradient(180deg, #f3b98c, #b86a2a); }
.step .avatar { width: 9vmin; height: 9vmin; font-size: 3.6vmin; }
.step .nm { font-weight: 900; font-size: 2.6vmin; } .step .pts { color: var(--muted); font-size: 2.2vmin; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } }
.tv-others { display: flex; gap: 1.4vmin; justify-content: center; flex-wrap: wrap; font-size: 2.2vmin; color: var(--muted); }

.reveal-banner { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,7,14,.78); backdrop-filter: blur(6px); z-index: 10; border-radius: 2vmin; }
.reveal-banner .box { text-align: center; animation: cardIn .35s cubic-bezier(.2,.9,.3,1.25); }
.reveal-banner .w { font-size: 9vmin; font-weight: 900; background: linear-gradient(180deg,#fff,var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reveal-banner small { font-size: 2.4vmin; color: var(--muted); letter-spacing: .2em; text-transform: uppercase; }
.soundgate { position: fixed; inset: 0; z-index: 200; background: rgba(5,7,14,.85); display: grid; place-items: center; text-align: center; font-size: 3vmin; font-weight: 800; cursor: pointer; }

/* TV o ventana en vertical: todo en una columna */
@media (max-aspect-ratio: 1/1) {
  .tv-lobby { grid-template-columns: 1fr; gap: 3vmin; overflow-y: auto; }
  .tv-draw { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .tv-opts { grid-template-columns: 1fr 1fr; }
  .qrbox img { width: min(40vmin, 60vw); }
}
