/* Basta. © 2026 Extun. Todos los derechos reservados. */
.game-basta { --game: var(--pen-margen); }
.stage { display: grid; gap: 16px; min-width: 0; }
.rhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rhead h1 { font-size: 30px; }
.codechip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px dashed var(--ink-faint); background: #fff; border-radius: 9px; padding: 3px 4px 3px 12px; font-family: var(--hand); font-weight: 700; font-size: 20px; letter-spacing: .2em; }
.roster { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.chipp { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; background: #fff; border: 1.5px solid var(--line); border-radius: 99px; font-size: 14px; }
.chipp .nm { font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipp .pt { font-family: var(--hand); font-weight: 700; font-size: 18px; color: var(--margin); }
.chipp.me { border-color: var(--ink); }
.chipp .tick { color: var(--ok); }
.chipp .tick .ico { width: 16px; height: 16px; }
.chipp.spec { opacity: .6; }

/* sala de espera */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1.5px solid var(--grid); }
.plist li:first-child { border-top: 0; }
.plist .nm { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .tagc { font-size: 12px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
.plist .crown { color: #b78a00; }
.setgrp { padding: 12px 0; border-top: 1.5px solid var(--grid); }
.setgrp:first-of-type { border-top: 0; padding-top: 0; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
.setrow > span { font-weight: 500; }
.setrow small { display: block; color: var(--ink-soft); font-size: 13px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.cat { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; background: #fff; border: 1.5px solid var(--ink); border-radius: 99px; font-weight: 600; font-size: 14px; }
.cat button { all: unset; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--ink-soft); }
.cat button:hover { background: var(--bad-bg); color: var(--bad); }
.cat button:focus-visible { outline: 2px solid var(--pen); }
.cat.ro { padding-right: 12px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sugg button { border: 1.5px dashed var(--line); background: transparent; border-radius: 99px; padding: 2px 10px; font-size: 13px; color: var(--ink-soft); }
.sugg button:hover:not(:disabled) { border-style: solid; color: var(--ink); background: #fff; }
.sugg button:disabled { opacity: .35; }
.letters { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.letters button { aspect-ratio: 1; min-width: 0; border: 1.5px solid var(--line); background: #fff; border-radius: 7px; font-family: var(--hand); font-weight: 700; font-size: 17px; padding: 0; }
.letters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.letters button:disabled { cursor: not-allowed; }
.startbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.startbar .btn { min-width: 180px; }

/* letra girando */
.spin { display: grid; place-items: center; min-height: 340px; text-align: center; }
.spin .lab2 { font-family: var(--hand); font-size: 22px; color: var(--ink-soft); }
.bigletter { font-family: var(--hand); font-weight: 700; font-size: clamp(140px, 30vw, 230px); line-height: 1; color: var(--margin); min-width: 1.1em; }
.bigletter.land { animation: land .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes land { from { transform: scale(1.35) rotate(-6deg); } }

/* ronda */
.ptop { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lbox { font-family: var(--hand); font-weight: 700; font-size: 64px; line-height: 1; width: 92px; height: 92px; display: grid; place-items: center; border: 2.5px solid var(--margin); border-radius: 14px; color: var(--margin); background: #fff; transform: rotate(-3deg); flex: none; }
.pinfo { flex: 1; min-width: 150px; }
.pinfo .rn { font-size: 14px; color: var(--ink-soft); }
.clock { font-family: var(--hand); font-weight: 700; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.clock.low { color: var(--margin); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.bar { height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform .3s linear; }
.bar.low i { background: var(--margin); }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; background: var(--warn-bg); border: 1.5px solid #e9cf5a; font-weight: 600; }
.cells { display: grid; gap: 12px; padding-bottom: 6px; }
.cell { display: grid; grid-template-columns: minmax(96px, 150px) 1fr; gap: 12px; align-items: center; }
.cell label { font-family: var(--hand); font-weight: 700; font-size: 20px; line-height: 1.1; }
.cell .wrap { position: relative; }
.cell .input { padding-right: 38px; font-size: 18px; min-height: 50px; }
.cell .chk { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ok); display: none; }
.cell.good .chk { display: block; }
.cell.good .input { border-color: var(--ok); }
.cell.bad .input { border-color: var(--bad); background: var(--bad-bg); }
.cell .hint { grid-column: 2; font-size: 13px; color: var(--bad); margin-top: -6px; display: none; }
.cell.bad .hint { display: block; }
.bastawrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.bastabtn { font-family: var(--hand); font-weight: 700; font-size: 38px; letter-spacing: .04em; line-height: 1; padding: 12px 34px 10px; color: var(--margin); background: #fff; border: 4px solid var(--margin); border-radius: 12px; outline: 2px solid var(--margin); outline-offset: -9px; transform: rotate(-2.5deg); transition: transform .1s, background .15s, color .15s; }
.bastabtn:hover:not(:disabled) { background: var(--margin); color: #fff; transform: rotate(-2.5deg) scale(1.04); }
.bastabtn:disabled { opacity: .4; cursor: not-allowed; }
.bastabtn.hit { animation: stamp .3s ease-out; }
@keyframes stamp { from { transform: rotate(-2.5deg) scale(1.5); opacity: .3; } }

/* revisión */
.revcat { margin-bottom: 14px; }
.revcat h3 { font-size: 22px; margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.ans { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1.5px solid var(--grid); }
.ans:first-of-type { border-top: 0; }
.ans .t { min-width: 0; }
.ans .txt { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.ans.empty .txt { color: var(--ink-faint); font-weight: 400; font-style: italic; }
.ans.void .txt { text-decoration: line-through; text-decoration-color: var(--margin); text-decoration-thickness: 2px; color: var(--ink-soft); }
.ans .sub { font-size: 13px; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ans .sub .counted { background: var(--hl); color: var(--ink); border-radius: 4px; padding: 0 5px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #e8edf4; color: var(--ink-soft); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.ai { background: #e9e4fb; color: #5a3fb5; }
.pill .ico { width: 13px; height: 13px; }
.acts2 { display: flex; gap: 6px; align-items: center; }
.rej { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; min-height: 34px; display: inline-flex; gap: 5px; align-items: center; }
.rej[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.hostmini { display: inline-flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.hostmini button { border: 0; background: transparent; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-soft); }
.hostmini button[aria-pressed="true"].v { background: var(--ok); color: #fff; }
.hostmini button[aria-pressed="true"].i { background: var(--bad); color: #fff; }
.aistat { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; background: #efeafb; color: #4a3396; font-size: 14px; font-weight: 600; }
.aistat.off { background: #eaeef4; color: var(--ink-soft); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* resultados */
.tablewrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.score { width: 100%; border-collapse: collapse; font-size: 14px; }
.score th, .score td { padding: 8px 6px; text-align: left; border-bottom: 1.5px solid var(--grid); vertical-align: top; }
.score th { font-family: var(--hand); font-size: 17px; font-weight: 700; white-space: nowrap; }
.score td.n { text-align: center; font-variant-numeric: tabular-nums; }
.score td .w { font-weight: 600; display: block; overflow-wrap: anywhere; }
.score td .p { font-family: var(--hand); font-weight: 700; font-size: 20px; color: var(--margin); line-height: 1; }
.score td.dim .w { color: var(--ink-faint); text-decoration: line-through; }
.score td.dim .p { color: var(--ink-faint); }
.score td .st { font-size: 12px; color: var(--ink-soft); }
.score .tot { font-family: var(--hand); font-weight: 700; font-size: 24px; text-align: center; }
.score tr.me td { background: color-mix(in srgb, var(--hl) 22%, transparent); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: grid; grid-template-columns: 34px 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1.5px solid var(--grid); }
.rank .pos { font-family: var(--hand); font-weight: 700; font-size: 26px; text-align: center; color: var(--ink-soft); }
.rank li:first-child .pos { color: #b78a00; }
.rank .sc { font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--margin); }
.rank .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rank .gain { font-size: 13px; color: var(--ok); font-weight: 600; margin-left: 6px; }
.winner { text-align: center; padding: 10px 0 18px; }
.winner .crownbig { color: #c29a00; width: 48px; height: 48px; }
.winner h1 { font-size: clamp(34px, 6vw, 52px); margin-top: 4px; }
.winner p { color: var(--ink-soft); font-size: 18px; }
.waiting { color: var(--ink-soft); font-size: 15px; display: flex; gap: 8px; align-items: center; }

@media (max-width: 860px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .cell { grid-template-columns: 1fr; gap: 4px; }
  .cell .hint { grid-column: 1; }
  .lbox { width: 74px; height: 74px; font-size: 50px; }
  .clock { font-size: 38px; }
  .letters { grid-template-columns: repeat(9, 1fr); }
  .ans { grid-template-columns: 30px 1fr; }
  .ans .acts2 { grid-column: 2; }
  .bastabtn { font-size: 34px; width: 100%; }
  .bastawrap { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 14px 0 calc(8px + env(safe-area-inset-bottom)); margin: 0 -2px; z-index: 5; }
  .rank li { grid-template-columns: 26px 36px 1fr auto; gap: 8px; }
}
.col { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.sheet { min-width: 0; }

.score th:last-child, .score td:last-child { position: sticky; right: 0; background: var(--sheet); box-shadow: -6px 0 6px -6px rgba(22,33,58,.25); }
.score tr.me td:last-child { background: #f6f3d9; }
