/* PUDRUS · Juegos — on top of css/style.css (same tokens: --bg, --c1, --text, --border, --glow, --font) */
body.juegos { --text-rgb: 208,239,255; --rec: #ffd23f; }   /* the text colour as r,g,b and the «new record» yellow: what the light theme changes here */
body.juegos { background: var(--bg); }
.jg-hub[hidden], .jg-play[hidden] { display: none !important; }
.jg-hub, .jg-play { max-width: var(--content); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.jg-hub { min-height: auto; display: block; padding-top: calc(var(--nav-height) + 28px); padding-bottom: 40px; }
.jg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.jg-streak { font-size: 12px; color: var(--text2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; white-space: nowrap; }
.jg-streak b { color: var(--c1); font-size: 18px; margin-right: 4px; }

/* daily challenge */
.jg-daily { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: linear-gradient(90deg, rgba(var(--c1-rgb),0.10), rgba(var(--line-rgb),0.04)); border: 1px solid rgba(var(--c1-rgb),0.4); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; transition: box-shadow .2s, border-color .2s; }
.jg-daily:hover, .jg-daily:focus-visible { box-shadow: var(--glow); border-color: var(--c1); outline: none; }
.jg-daily .ic { font-size: 30px; line-height: 1; color: var(--c1); text-shadow: 0 0 14px rgba(var(--c1-rgb),0.6); }
.jg-daily .tx { flex: 1; min-width: 0; }
.jg-daily .tx small { display: block; color: var(--text2); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; margin-bottom: 2px; }
.jg-daily .tx b { font-size: 16px; }
.jg-daily .go { color: var(--c1); white-space: nowrap; }
.jg-daily.done { border-color: var(--border); background: var(--bg2); }

/* game cards */
.jg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.jg-card { position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; font: inherit; color: var(--text); cursor: pointer; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; min-height: 180px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.jg-card:hover, .jg-card:focus-visible { border-color: var(--c1); box-shadow: var(--glow); transform: translateY(-2px); outline: none; }
.jg-card .art { height: 64px; display: flex; align-items: center; }
.jg-card .art svg { height: 64px; width: auto; }
.jg-card .tag { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text2); }
.jg-card h3 { margin: 0; font-size: 18px; color: var(--head); }
.jg-card p { margin: 0; color: rgba(var(--text-rgb),0.7); line-height: 1.5; font-size: 12px; flex: 1; }
.jg-card .best { font-size: 11px; color: var(--c1); }
.jg-card .best.none { color: rgba(var(--text-rgb),0.4); }

/* play screen */
.jg-play { padding-top: calc(var(--nav-height) + 14px); padding-bottom: 30px; min-height: calc(100vh - 60px); display: block; }
.jg-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.jg-back, .jg-help-btn { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.jg-back:hover, .jg-help-btn:hover { border-color: var(--c1); color: var(--c1); }
.jg-help-btn { width: 34px; padding: 6px 0; }
.jg-title { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.jg-title b { font-size: 18px; color: var(--head); }
.jg-title span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text2); }
.jg-hud { display: flex; gap: 14px; font-size: 13px; color: var(--text2); }
.jg-hud b { color: var(--c1); font-size: 18px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.jg-how { color: rgba(var(--text-rgb),0.75); line-height: 1.6; margin: 10px 0 14px; max-width: 760px; }
.jg-how[hidden] { display: none; }
.jg-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; user-select: none; -webkit-user-select: none; }

/* shared bits */
.jg-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.jg-btn { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.jg-btn:hover, .jg-btn:focus-visible { border-color: var(--c1); outline: none; }
.jg-btn.on { border-color: var(--c1); color: var(--c1); }
.jg-btn.primary { background: var(--c1); color: var(--on-c1); border-color: var(--c1); font-weight: 700; }
.jg-msg { min-height: 20px; color: var(--text2); text-align: center; }
.jg-start { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 0; text-align: center; }
.jg-start .big { font-size: 46px; color: var(--c1); text-shadow: 0 0 22px rgba(var(--c1-rgb),0.55); }
.flash-ok { animation: flashOk .35s; }
.flash-bad { animation: flashBad .35s; }
@keyframes flashOk { 0% { box-shadow: 0 0 0 0 rgba(var(--c1-rgb),0.9); } 100% { box-shadow: 0 0 0 18px rgba(var(--c1-rgb),0); } }
@keyframes flashBad { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Circuito */
.jg-canvas { display: block; touch-action: manipulation; border-radius: 10px; border: 1px solid var(--border); background: #07070d; max-width: 100%; }

/* Sudoku */
.sd-grid { display: grid; grid-template-columns: repeat(9, 1fr); width: min(460px, 100%); aspect-ratio: 1; border: 2px solid var(--c1); border-radius: 8px; overflow: hidden; background: #07070d; box-shadow: 0 0 24px rgba(var(--c1-rgb),0.12); }
.sd-cell { position: relative; font: inherit; font-size: clamp(16px, 4.6vw, 24px); color: var(--c1); background: #0b0b14; border: 0; border-right: 1px solid rgba(var(--line-rgb),0.12); border-bottom: 1px solid rgba(var(--line-rgb),0.12); padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sd-cell.bl { border-left: 2px solid rgba(var(--c1-rgb),0.55); }
.sd-cell.bt { border-top: 2px solid rgba(var(--c1-rgb),0.55); }
.sd-cell.given { color: #fff; font-weight: 700; }
.sd-cell.peer { background: #10101c; }
.sd-cell.same { background: rgba(var(--c1-rgb),0.14); }
.sd-cell.sel { background: rgba(var(--c1-rgb),0.28); outline: 2px solid var(--c1); outline-offset: -2px; z-index: 1; }
.sd-cell.bad { color: #ff3355; }
.sd-notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(7px, 1.6vw, 10px); color: var(--text2); line-height: 1; }
.sd-notes i { font-style: normal; display: flex; align-items: center; justify-content: center; }
.sd-pad { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: min(460px, 100%); }
.sd-pad .sd-num { width: 42px; padding: 9px 0; font-size: 16px; }
.sd-pad .sd-num.full { opacity: 0.3; }

/* Qué sigue */
.qs-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.qs-cell { width: 92px; height: 92px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg2); display: flex; align-items: center; justify-content: center; }
.qs-cell.q { border-style: dashed; border-color: rgba(var(--c1-rgb),0.5); color: var(--c1); font-size: 34px; }
.qs-opts .qs-cell { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.qs-opts .qs-cell:hover, .qs-opts .qs-cell:focus-visible { border-color: var(--c1); box-shadow: var(--glow); outline: none; }
.qs-cell.right { border-color: var(--c1); box-shadow: 0 0 18px rgba(var(--c1-rgb),0.5); }
.qs-cell.wrong { border-color: #ff3355; }
.qs-sep { width: 100%; height: 0; }
.qs-bar { width: min(420px, 100%); height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.qs-bar i { display: block; height: 100%; background: var(--c1); transition: width .2s linear; }

/* Eco */
.eco-pads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; width: min(360px, 86vw); aspect-ratio: 1; }
.eco-pad { border-radius: 18px; border: 2px solid var(--pc); background: color-mix(in srgb, var(--pc) 12%, #07070d); cursor: pointer; transition: background .08s, box-shadow .08s; font: inherit; color: rgba(255,255,255,0.35); font-size: 13px; }
.eco-pad.lit { background: var(--pc); box-shadow: 0 0 36px var(--pc); color: #000; }
.eco-pads.locked .eco-pad { cursor: default; }

/* Interferencia */
.st-rule { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); }
.st-rule.word { border-color: #ffd23f; color: #ffd23f; }
.st-rule.ink { border-color: var(--c1); color: var(--c1); }
.st-word { font-size: clamp(44px, 12vw, 84px); font-weight: 700; letter-spacing: .04em; min-height: 1.3em; line-height: 1.3; }
.st-opts { display: grid; grid-template-columns: repeat(4, minmax(64px, 120px)); gap: 10px; }
.st-opt { aspect-ratio: 1.4; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; background: #07070d; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font: inherit; font-size: 10px; color: rgba(255,255,255,0.6); }
.st-opt i { position: absolute; }
.st-opt:hover, .st-opt:focus-visible { border-color: #fff; outline: none; }

/* Garabato */
.gb-wrap { position: relative; width: min(760px, 100%); }
.gb-wrap canvas { width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.gb-prompt { color: var(--text); text-align: center; }
.gb-prompt b { color: var(--c1); }
.gb-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.gb-col { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.gb-col.on { border-color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.6); }
.gb-result img { width: min(760px, 100%); border-radius: 10px; border: 1px solid var(--border); }

/* Mil usos */
.mu-obj { font-size: clamp(28px, 7vw, 46px); color: #fff; font-weight: 700; text-align: center; }
.mu-obj span { color: var(--c1); }
.mu-form { display: flex; gap: 8px; width: min(560px, 100%); }
.mu-form input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.mu-form input:focus { outline: none; border-color: var(--c1); box-shadow: var(--glow); }
.mu-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: min(760px, 100%); }
.mu-list span { border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12px; background: var(--bg2); }
.mu-list span.new { animation: muIn .3s; border-color: var(--c1); }
@keyframes muIn { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* result */
.jg-result { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(var(--bg-rgb),0.82); backdrop-filter: blur(4px); }
.jg-result[hidden] { display: none; }
.jg-result-box { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg2); border: 1px solid rgba(var(--c1-rgb),0.4); border-radius: 14px; padding: 22px; text-align: center; box-shadow: 0 0 40px rgba(var(--c1-rgb),0.15); }
.jg-score { font-size: clamp(42px, 11vw, 64px); font-weight: 700; color: var(--c1); margin: 6px 0; font-variant-numeric: tabular-nums; }
.jg-rlabel { margin: 0 0 6px; color: var(--text); }
.jg-best { margin: 0 0 12px; color: var(--text2); }
.jg-best.rec { color: var(--rec); }
.jg-rextra { margin-bottom: 14px; }
.jg-ractions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* glitch reward */
.glitch { position: relative; animation: glitchIn .7s steps(2) 1; }
@keyframes glitchIn {
  0% { text-shadow: 3px 0 #ff3fa4, -3px 0 #00d4ff; clip-path: inset(10% 0 60% 0); transform: translateX(-4px); }
  20% { text-shadow: -3px 0 #ff3fa4, 3px 0 #00d4ff; clip-path: inset(50% 0 20% 0); transform: translateX(4px); }
  40% { text-shadow: 2px 0 #ff3fa4, -2px 0 #00d4ff; clip-path: inset(0 0 80% 0); transform: none; }
  60% { text-shadow: -2px 0 #ff3fa4, 2px 0 #00d4ff; clip-path: inset(70% 0 0 0); }
  100% { text-shadow: 0 0 22px rgba(var(--c1-rgb),0.55); clip-path: inset(0); }
}
@media (max-width: 600px) {
  .qs-cell { width: 68px; height: 68px; }
  .st-opts { grid-template-columns: repeat(2, minmax(64px, 1fr)); width: 100%; }
  .jg-hud { width: 100%; order: 5; }
}
/* ── DRUS v3: the hub always fits the window (no scroll), footer visible; the play area is its own panel ── */
body.juegos.hubmode { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.juegos.hubmode main { flex: 1; min-height: 0; display: flex; }
body.juegos.hubmode .jg-hub { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: calc(var(--nav-height) + clamp(10px, 2.2vh, 26px)); padding-bottom: clamp(8px, 1.6vh, 18px); width: 100%; }
body.juegos .jg-head { margin-bottom: clamp(8px, 1.6vh, 18px); }
body.juegos .jg-head .section-title { margin-bottom: 4px; font-size: clamp(22px, 3.4vh, 34px); }
body.juegos .jg-head .section-desc { margin: 0; }
body.juegos .jg-daily { padding: clamp(8px, 1.4vh, 16px) 16px; margin-bottom: clamp(8px, 1.4vh, 16px); }
body.juegos.hubmode .jg-grid { flex: 1; min-height: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: clamp(8px, 1.2vh, 14px); }
body.juegos.hubmode .jg-card { min-height: 0; padding: clamp(8px, 1.4vh, 16px); gap: clamp(3px, 0.8vh, 8px); }
body.juegos .jg-card .art { height: clamp(28px, 6vh, 64px); }
body.juegos .jg-card .art svg { height: 100%; }
body.juegos .jg-card h3 { font-size: clamp(14px, 2vh, 18px); }
body.juegos .jg-card p { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
body.juegos .jg-card p { flex: 0 1 auto; }
body.juegos .jg-card .best { margin-top: auto; }
@media (max-height: 860px) and (min-width: 601px) { body.juegos .jg-card p { -webkit-line-clamp: 2; } }
body.juegos footer { padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); flex-direction: row; gap: 6px 16px; font-size: 10px; }
body.juegos footer .footer-separator { display: inline; }
@media (max-width: 1100px) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } body.juegos .jg-card p { -webkit-line-clamp: 2; } }
@media (max-width: 600px) {
  body.juegos.hubmode .jg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.juegos .jg-card p, body.juegos .jg-card .tag { display: none; }
  body.juegos.hubmode .jg-card { flex-direction: row; align-items: center; gap: 8px; }
  body.juegos .jg-card .art { height: min(30px, 4.2vh); width: 46px; flex: none; justify-content: center; }
  body.juegos.hubmode .jg-card { padding: 4px 8px; }
  body.juegos .jg-card h3 { font-size: 14px; }
  body.juegos .jg-card .best { position: absolute; right: 8px; bottom: 4px; font-size: 9px; }
  body.juegos .jg-head .section-desc, body.juegos .jg-streak { display: none; }
  body.juegos footer span:not(:first-child), body.juegos footer .footer-separator { display: none; }
}
@media (max-height: 640px) { body.juegos .jg-card p { display: none; } body.juegos .jg-head .section-desc { display: none; } }

/* the play area: a panel of its own, a shade lighter than the page, with a faint grid */
.jg-stage { background: linear-gradient(rgba(var(--line-rgb),0.035) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(var(--line-rgb),0.035) 1px, transparent 1px) 0 0 / 24px 24px, #0c0c16;
  border: 1px solid rgba(var(--c1-rgb),0.22); border-radius: 14px; padding: clamp(14px, 2.4vh, 26px) 12px; margin-top: 12px; box-shadow: inset 0 0 40px rgba(0,0,0,0.5); }
.jg-rules { max-width: 560px; color: rgba(var(--text-rgb),0.8); line-height: 1.6; margin: 0; }
.jg-how:not([hidden]) { position: relative; background: var(--bg2); border: 1px solid rgba(var(--c1-rgb),0.35); border-radius: 10px; padding: 10px 14px; }

/* Destellos */
.ds-grid { display: grid; gap: 8px; width: min(380px, 86vw); }
.ds-cell { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: #12121e; cursor: pointer; padding: 0; transition: background .12s, box-shadow .12s; }
.ds-grid.locked .ds-cell { cursor: default; }
.ds-cell.lit { background: var(--c1); box-shadow: 0 0 22px rgba(var(--c1-rgb),0.6); }
.ds-cell.ok { background: rgba(var(--c1-rgb),0.45); border-color: var(--c1); }
.ds-cell.bad { background: #ff3355; }
.ds-cell.miss { border: 2px dashed var(--c1); }

/* Intruso */
.it-grid { display: grid; gap: 6px; width: min(440px, 88vw); }
.it-cell { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--border); background: #10101a; cursor: pointer; padding: 10%; }
.it-cell svg { width: 100%; height: 100%; display: block; }
.it-cell:hover { border-color: rgba(255,255,255,0.3); }
.it-cell.bad { border-color: #ff3355; }
/* ── v4: cards adapt to their own height (container queries): description, then tag, then one row ── */
body.juegos .jg-card { container-type: size; padding: 0 !important; }
body.juegos .jg-card .ci { position: absolute; inset: 0; display: flex; flex-direction: column; gap: clamp(3px, 0.8vh, 8px); padding: clamp(8px, 1.4vh, 16px); min-height: 0; overflow: hidden; }
body.juegos .jg-card .tx { display: flex; flex-direction: column; gap: inherit; flex: 1; min-height: 0; min-width: 0; }
body.juegos .jg-card .tx > * { min-width: 0; }
body.juegos .jg-card .best { position: static !important; margin-top: auto; }
@container (max-height: 175px) { .ci p { display: none !important; } }
@container (max-height: 118px) { .ci .tag { display: none !important; } .ci .art { height: 30px !important; } }
@container (max-height: 104px) {
  .ci { flex-direction: row !important; align-items: center; gap: 8px !important; padding: 4px 8px !important; }
  .ci .art { height: min(30px, 70cqh) !important; width: 44px; flex: none; justify-content: center; }
  .ci .tx { justify-content: center; gap: 1px !important; }
  .ci h3 { font-size: 13px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ci .best { margin-top: 0; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@container (max-height: 44px) { .ci .best { display: none; } }
/* the old phone rules (≤600 px) are now handled by the container queries */
@media (max-width: 600px) { body.juegos .jg-card p, body.juegos .jg-card .tag { display: revert; } body.juegos.hubmode .jg-card { flex-direction: column; } }
/* tablets in portrait: 2 columns × 5 rows reads better than 3 × 4 */
@media (max-width: 860px) and (min-width: 601px) and (orientation: portrait) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* short screens (phones sideways, small laptops): a compact header */
@media (max-height: 560px) {
  body.juegos.hubmode .jg-hub { padding-top: calc(var(--nav-height) + 6px); padding-bottom: 6px; }
  body.juegos .jg-head { margin-bottom: 6px; }
  body.juegos .jg-head .section-tag, body.juegos .jg-head .section-desc, body.juegos .jg-streak { display: none; }
  body.juegos .jg-head .section-title { font-size: 18px; margin: 0; }
  body.juegos .jg-daily { padding: 6px 12px; margin-bottom: 6px; }
  body.juegos .jg-daily .ic { font-size: 18px; } body.juegos .jg-daily .tx small { display: none; } body.juegos .jg-daily .tx b { font-size: 13px; }
  body.juegos.hubmode .jg-grid { gap: 6px; }
  body.juegos footer { padding: 6px var(--gutter); }
}
@media (max-height: 560px) and (orientation: landscape) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* ── v5: a game also fits the window: the stage takes the free height and every board sizes itself to it ── */
body.juegos.playmode { height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); overflow: hidden; display: flex; flex-direction: column; }
body.juegos.playmode main { flex: 1; min-height: 0; display: flex; }
body.juegos.playmode .jg-play { flex: 1; min-height: 0; width: 100%; display: flex !important; flex-direction: column; padding-top: calc(var(--nav-height) + clamp(6px, 1.4vh, 14px)); padding-bottom: clamp(6px, 1.2vh, 12px); }
body.juegos.playmode .jg-bar { flex: none; }
body.juegos.playmode .jg-stage { flex: 1; min-height: 0; overflow: auto; justify-content: center; container-type: size; margin-top: clamp(6px, 1.2vh, 12px); padding: clamp(8px, 1.6vh, 20px) 10px; gap: clamp(6px, 1.2vh, 14px); }
body.juegos.playmode .jg-how:not([hidden]) { position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter); top: calc(var(--nav-height) + 64px); margin: 0 auto; max-width: 720px; }
body.juegos.playmode .jg-start { padding: 0; }
body.juegos.playmode .jg-start .big { font-size: clamp(24px, 6cqh, 46px); }
/* each board: never taller than the stage */
body.juegos.playmode .eco-pads { width: min(360px, 86cqw, calc(100cqh - 56px)); }
body.juegos.playmode .ds-grid { width: min(380px, 92cqw, calc(100cqh - 52px)); }
body.juegos.playmode .it-grid { width: min(440px, 92cqw, calc(100cqh - 52px)); }
body.juegos.playmode .sd-grid { width: min(460px, 100cqw, calc(100cqh - 120px)); }
body.juegos.playmode .sd-pad { width: min(460px, 100cqw); }
body.juegos.playmode .sd-pad .sd-num { width: auto; flex: 1 1 32px; padding: clamp(4px, 1.2cqh, 9px) 0; }
body.juegos.playmode .gb-wrap { width: min(760px, 100cqw, calc((100cqh - 120px) * 1.5)); }
body.juegos.playmode .qs-cell { width: clamp(44px, min(92px, calc((100cqh - 160px) / 3)), 92px); height: clamp(44px, min(92px, calc((100cqh - 160px) / 3)), 92px); }
body.juegos.playmode .qs-cell svg { width: 76%; height: 76%; }
body.juegos.playmode .st-word { font-size: clamp(32px, min(12vw, 16cqh), 84px); min-height: 0; }
body.juegos.playmode .st-opts { width: min(520px, 100cqw); }
body.juegos.playmode .st-opt { aspect-ratio: auto; height: clamp(42px, 16cqh, 84px); }
body.juegos.playmode .mu-list { max-height: 34cqh; overflow: auto; }
body.juegos.playmode footer { padding: 6px var(--gutter); }
@container (max-width: 440px) { .gb-wrap { width: min(100cqw, calc((100cqh - 170px) * 1.5)) !important; } .gb-tools .jg-btn { padding: 6px 9px; } .gb-col { width: 26px; height: 26px; } }
@media (max-height: 560px) { body.juegos.playmode .jg-play { padding-top: calc(var(--nav-height) + 4px); } body.juegos.playmode .jg-title span { display: none; } body.juegos.playmode footer { display: none; } }
@media (prefers-reduced-motion: reduce) { .glitch, .flash-ok, .flash-bad, .mu-list span.new { animation: none; } }

/* ── LIGHT THEME (opt-in: js/theme.js sets data-theme="light" on <html>; css/style.css has the panel colours) ──
   The menu, the cards and the results take the light panel; the game itself is a dark display, like the screens of the
   labs: the board, the canvases and the pads keep the dark colours (and the card pictures sit on a small dark screen). */
:root[data-theme="light"] body.juegos { --text-rgb: 43,47,53; --rec: #865600; }
:root[data-theme="light"] .jg-stage, :root[data-theme="light"] .jg-card .art {
  color: var(--text);
  --bg: #050508; --bg2: #0b0b14; --bg3: #0f0f1a; --c1: #66ff33; --c2: #00bb16; --c3: #00662c;
  --text: #d0efff; --text2: #15a048; --border: rgba(0,212,255,0.15); --glow: 0 0 20px rgba(102,255,51,0.25);
  --head: #fff; --on-c1: #050508; --c1-rgb: 102,255,51; --line-rgb: 0,212,255; --bg-rgb: 5,5,8; --text-rgb: 208,239,255;
}
:root[data-theme="light"] .jg-card .art { width: fit-content; padding: 0 12px; border-radius: 8px; background: #0b0b14; }
:root[data-theme="light"] .jg-daily .ic { text-shadow: none; }
:root[data-theme="light"] .jg-daily:not(.done) { background: var(--bg2); border-color: var(--c1); }
:root[data-theme="light"] .jg-card .best.none { color: var(--text2); }
:root[data-theme="light"] .jg-result { background: rgba(43,47,53,0.45); }
:root[data-theme="light"] .jg-card, :root[data-theme="light"] .jg-daily { box-shadow: 0 1px 3px rgba(43,47,53,0.1); }
/* ── v6 (phones): the nav was counted twice (main + the screen itself), so everything moves up;
   the cards show their whole name and «Sin jugar todavía» ── */
body.juegos.hubmode main, body.juegos.playmode main { padding-top: 0; }
@media (max-width: 600px) {
  body.juegos .jg-head { margin-bottom: 10px; }
  body.juegos .jg-head .section-title { font-size: clamp(20px, 2.9vh, 26px); }
  body.juegos .jg-daily { gap: 12px; padding: 8px 12px; margin-bottom: 10px; }
  body.juegos .jg-daily .ic { font-size: 22px; }
  body.juegos .jg-daily .tx b { font-size: 14px; }
  body.juegos .jg-daily .tx small { font-size: 9px; }
}
/* a short card: the picture on top and the name across the whole card, not squeezed beside the picture */
@container (max-height: 130px) and (min-height: 70px) {
  .ci { flex-direction: column !important; align-items: flex-start; justify-content: center; gap: 3px !important; padding: 6px 10px !important; }
  .ci .art { height: min(28px, 32cqh) !important; width: auto !important; justify-content: flex-start; }
  .ci .tx { flex: none !important; gap: 2px !important; width: 100%; }
  .ci h3 { font-size: 14px !important; white-space: normal !important; overflow: visible !important; line-height: 1.15; }
  .ci .best { font-size: 10px; white-space: normal !important; margin-top: 0 !important; }
}
/* a very short card stays in one row: a narrower picture, and the name may take two lines */
@container (max-height: 69px) {
  .ci .art { width: 34px !important; }
  .ci h3 { font-size: 12.5px !important; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.1; }
}
/* light theme: the dark plate behind each picture must not eat the narrow picture of a one-row card */
@container (max-height: 69px) { :root[data-theme="light"] .ci .art { padding: 0 4px !important; width: 40px !important; } }

/* ── Duelo: the hub entry next to the daily challenge, and the duel screen ── */
body.juegos { --duel: #ff3fa4; --duel-rgb: 255,63,164; }
.jg-top { display: flex; gap: 10px; align-items: stretch; margin-bottom: clamp(8px, 1.4vh, 16px); }
.jg-top .jg-daily { margin-bottom: 0 !important; flex: 1; min-width: 0; }
.jg-duelbtn { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 18px; font: inherit; color: var(--text); cursor: pointer; text-align: left;
  background: linear-gradient(90deg, rgba(var(--duel-rgb),0.12), rgba(var(--duel-rgb),0.03)); border: 1px solid rgba(var(--duel-rgb),0.45); border-radius: 12px; transition: box-shadow .15s, border-color .15s; }
.jg-duelbtn:hover, .jg-duelbtn:focus-visible { border-color: var(--duel); box-shadow: 0 0 18px rgba(var(--duel-rgb),0.35); outline: none; }
.jg-duelbtn .ic { font-size: 24px; color: var(--duel); text-shadow: 0 0 12px rgba(var(--duel-rgb),0.6); }
.jg-duelbtn .tx { display: flex; flex-direction: column; }
.jg-duelbtn b { font-size: 15px; color: var(--head); }
.jg-duelbtn small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); }
@media (max-width: 600px) { .jg-top { gap: 8px; } .jg-duelbtn { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 10px; text-align: center; } .jg-duelbtn .ic { font-size: 20px; } .jg-duelbtn small { display: none; } }
/* the duel screen: a normal page that scrolls if it must */
.jg-duel[hidden] { display: none !important; }
.jg-duel { max-width: 760px; margin: 0 auto; padding: calc(var(--nav-height) + 14px) var(--gutter) 30px; min-height: auto; display: block; }
body.juegos.duelmode main { padding-top: 0; }
.jg-dbody { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: left; }
.jg-dname { display: flex; flex-direction: column; gap: 6px; color: var(--text2); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.jg-dinput { font: inherit; font-size: 16px; color: var(--head); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0; text-transform: none; letter-spacing: 0; }
.jg-dinput:focus { outline: none; border-color: var(--c1); }
.jg-dcode { text-transform: uppercase; letter-spacing: .4em; font-weight: 700; text-align: center; max-width: 170px; }
.jg-dopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .jg-dopts { grid-template-columns: 1fr; } }
.jg-dopt { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); }
.jg-dopt b { color: var(--head); font-size: 15px; }
.jg-dopt span { color: rgba(var(--text-rgb),0.75); font-size: 12px; line-height: 1.5; flex: 1; }
.jg-dopt .jg-btn { align-self: flex-start; }
.jg-drow2 { display: flex; gap: 8px; align-items: center; }
.jg-dnote { color: var(--text2); font-size: 12px; line-height: 1.5; margin: 0; }
.jg-dnote.center { text-align: center; }
.jg-dwait { color: var(--text); text-align: center; line-height: 1.6; margin: 6px 0; }
.jg-dinvite { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px; border-radius: 12px; border: 1px solid rgba(var(--duel-rgb),0.45); background: linear-gradient(90deg, rgba(var(--duel-rgb),0.10), transparent); }
.jg-dinv-tx { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.jg-dinv-tx small { color: var(--text2); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
.jg-dcodebig { font-size: clamp(34px, 9vw, 48px); font-weight: 700; letter-spacing: .3em; color: var(--duel); text-shadow: 0 0 16px rgba(var(--duel-rgb),0.5); line-height: 1; }
.jg-dqr { flex: none; width: 132px; height: 132px; border-radius: 8px; overflow: hidden; background: #fff; }
.jg-dqr:empty { display: none; }
.jg-dqr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
@media (max-width: 420px) { .jg-dqr { width: 104px; height: 104px; } }
.jg-dh { margin: 6px 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text2); font-weight: 400; }
.jg-dplayers { display: flex; flex-wrap: wrap; gap: 6px; }
.jg-dchip { display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg2); }
.jg-dchip b { color: var(--head); font-weight: 600; }
.jg-dchip i { font-style: normal; color: var(--c1); font-size: 12px; }
.jg-dchip.me { border-color: rgba(var(--c1-rgb),0.6); }
.jg-dtable { display: flex; flex-direction: column; gap: 4px; }
.jg-drow { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--border); }
.jg-drow .nm { color: var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-drow .sc { color: var(--text); font-variant-numeric: tabular-nums; }
.jg-drow .pt { color: var(--c1); text-align: right; font-weight: 700; }
.jg-drow .pos { text-align: center; color: var(--text2); }
.jg-drow.win { border-color: rgba(var(--c1-rgb),0.6); box-shadow: 0 0 14px rgba(var(--c1-rgb),0.15); }
.jg-drow.me .nm::after { content: ' (vos)'; color: var(--text2); font-weight: 400; }
.jg-dgames { display: flex; flex-wrap: wrap; gap: 6px; }
.jg-dgame { font: inherit; font-size: 13px; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; padding: 7px 12px; cursor: pointer; }
.jg-dgame:hover { border-color: rgba(var(--c1-rgb),0.6); }
.jg-dgame.on { border-color: var(--c1); color: var(--c1); box-shadow: 0 0 10px rgba(var(--c1-rgb),0.25); }
.jg-dgo { align-self: center; font-size: 16px; padding: 12px 22px; }
.jg-dgo:disabled { opacity: 0.45; cursor: default; }
.jg-dleave { align-self: center; background: transparent; border-color: transparent; color: var(--text2); font-size: 12px; }
.jg-dleave:hover { color: var(--text); }
.jg-dnames { display: flex; flex-direction: column; gap: 6px; }
.jg-dnames > .jg-btn { align-self: flex-start; }
.jg-dx { flex: none; width: 40px; padding: 9px 0; }
.jg-dturn small { color: var(--text2); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }
.jg-dturn .big { color: var(--duel); text-shadow: 0 0 22px rgba(var(--duel-rgb),0.5); word-break: break-word; }
.jg-dtoast { position: fixed; left: 50%; top: calc(var(--nav-height) + 10px); z-index: 120; transform: translateX(-50%) translateY(-8px); padding: 8px 14px; border-radius: 10px;
  background: var(--bg2); border: 1px solid rgba(var(--duel-rgb),0.6); color: var(--head); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-dtoast.on { opacity: 1; transform: translateX(-50%); }
.jg-count .big { font-size: clamp(60px, 18vw, 120px) !important; }
:root[data-theme="light"] body.juegos { --duel: #b0236f; --duel-rgb: 176,35,111; }
@media (max-width: 600px) {
  .jg-top .jg-daily { gap: 10px; padding: 7px 10px; }
  .jg-top .jg-daily .go { display: none; }            /* the whole card is the button */
  .jg-top .jg-daily .tx { font-size: 12px; line-height: 1.35; }
  .jg-top .jg-daily .tx b { font-size: 13px; }
  .jg-duelbtn { padding: 6px 12px; }
}
@container (max-height: 69px) {
  .ci { gap: 6px !important; }
  .ci .art { width: 30px !important; }
  .ci h3 { font-size: 12px !important; }
}
/* ── v7 (phones): never cut a card — on a real phone the visible height is often less than measured (browser bars,
   Android's navigation bar, a bigger font setting). The cards get a fixed comfortable height and, if they don't
   fit, the page scrolls a little instead of hiding the last row. ── */
@media (max-width: 600px) {
  body.juegos.hubmode { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  body.juegos.hubmode main, body.juegos.hubmode .jg-hub { flex: none; }
  body.juegos.hubmode .jg-grid { flex: none; grid-auto-rows: 74px; }
}
@media (max-width: 600px) and (max-height: 600px) { body.juegos.hubmode .jg-grid { grid-auto-rows: 60px; } }
/* ── Trazos (draw and guess, in a Duelo room) ── */
.jg-dgame.tz { border-color: rgba(var(--duel-rgb),0.5); }
.jg-dgame.tz.on { border-color: var(--duel); color: var(--duel); box-shadow: 0 0 10px rgba(var(--duel-rgb),0.3); }
.tz { display: flex; flex-direction: column; gap: 8px; }
.tz-head { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.tz-who { color: var(--text2); font-size: 12px; white-space: nowrap; }
.tz-mask { flex: 1; text-align: center; font-size: clamp(18px, 5vw, 26px); font-weight: 700; letter-spacing: .28em; color: var(--head); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.tz-mask.known { color: var(--c1); letter-spacing: .08em; }
.tz-mask.show { color: var(--duel); letter-spacing: .08em; }
.tz-clock { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; min-width: 52px; text-align: right; }
.tz-clock.low { color: #ff5470; }
.tz-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.tz-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.tz-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center;
  background: rgba(8,8,14,0.82); color: #fff; }
.tz-over[hidden] { display: none; }
.tz-over b { font-size: 16px; }
.tz-over small { color: #aab; }
.tz-over .tz-answer { font-size: clamp(26px, 8vw, 40px); color: #ff8acb; letter-spacing: .06em; }
.tz-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tz-opts .jg-btn { font-size: 15px; padding: 10px 14px; }
.tz-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.tz-tools[hidden], .tz-guess[hidden], .tz-chat[hidden] { display: none; }
.tz-sw, .tz-sz { display: flex; gap: 4px; }
.tz-col { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; font-size: 13px; color: #555; }
.tz-col.on { border-color: var(--c1); box-shadow: 0 0 0 2px rgba(var(--c1-rgb),0.45); }
.tz-size, .tz-tool { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 16px; }
.tz-size i { display: block; border-radius: 50%; background: var(--text); }
.tz-size.on { border-color: var(--c1); }
.tz-guess { display: flex; gap: 8px; }
.tz-chat { display: flex; flex-direction: column; gap: 2px; max-height: 120px; overflow: auto; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--border); }
.tz-line b { color: var(--head); font-weight: 600; }
.tz-line.ok, .tz-line.ok b { color: var(--c1); }
.tz-line.near { color: var(--rec); }
.tz-scores { display: flex; flex-wrap: wrap; gap: 6px; }
.tz-pt { display: inline-flex; gap: 8px; align-items: baseline; padding: 5px 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg2); font-size: 13px; }
.tz-pt b { color: var(--head); font-weight: 600; }
.tz-pt i { font-style: normal; color: var(--c1); }
.tz-pt.drawer { border-color: rgba(var(--duel-rgb),0.6); }
.tz-pt.ok { border-color: rgba(var(--c1-rgb),0.6); }
.tz-pt.me b::after { content: ' (vos)'; color: var(--text2); font-weight: 400; }
/* English: «(you)» instead of «(vos)» next to your own name */
html[lang="en"] .jg-drow.me .nm::after, html[lang="en"] .tz-pt.me b::after { content: ' (you)'; }

/* ── colour-blind mode (body.cb): the switch on every start screen, and what it changes ── */
.jg-cb { font: inherit; font-size: 12px; color: var(--text2); background: transparent; border: 1px dashed var(--border); border-radius: 18px; padding: 6px 12px; cursor: pointer; }
.jg-cb:hover { color: var(--text); border-color: var(--text2); }
.jg-cb.on { color: var(--c1); border-style: solid; border-color: rgba(var(--c1-rgb),0.6); }
body.cb .st-opt { font-size: clamp(11px, 3.2vw, 14px); font-weight: 700; color: #050508; align-items: center; padding: 4px; text-align: center; }
body.cb .sd-cell.bad { text-decoration: line-through 3px; text-decoration-color: #ff3355; background: repeating-linear-gradient(45deg, rgba(255,51,85,0.18) 0 4px, transparent 4px 8px); }

/* ── Núcleo: its button (next to Duelo) and the game: the picture fills the stage, the HUD floats over it ── */
.jg-ncbtn { background: linear-gradient(90deg, rgba(var(--c1-rgb),0.12), rgba(var(--c1-rgb),0.03)); border-color: rgba(var(--c1-rgb),0.45); }
.jg-ncbtn .ic { color: var(--c1); text-shadow: 0 0 12px rgba(var(--c1-rgb),0.6); }
.jg-ncbtn:hover, .jg-ncbtn:focus-visible { border-color: var(--c1); box-shadow: 0 0 18px rgba(var(--c1-rgb),0.35); }
.jg-stage.nc-stage { padding: 0 !important; overflow: hidden !important; justify-content: stretch !important; align-items: stretch !important; background: #000 !important; border-radius: 10px; }
.nc-wrap { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden; background: #000; touch-action: none; -webkit-user-select: none; user-select: none; color: #e8f6ff; font-family: 'IBM Plex Mono', Consolas, monospace; }
.nc-wrap:fullscreen { border-radius: 0; }
.nc-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.nc-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }
.nc-hud { position: absolute; inset: 0; pointer-events: none; }
.nc-hud button { pointer-events: auto; }
.nc-cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.nc-cross::before, .nc-cross::after { content: ''; position: absolute; background: rgba(160,240,255,0.85); box-shadow: 0 0 6px #0cf; }
.nc-cross::before { left: 10px; top: 0; width: 2px; height: 22px; clip-path: polygon(0 0,100% 0,100% 30%,0 30%,0 70%,100% 70%,100% 100%,0 100%); }
.nc-cross::after { top: 10px; left: 0; height: 2px; width: 22px; clip-path: polygon(0 0,30% 0,30% 100%,0 100%,0 0,70% 0,100% 0,100% 100%,70% 100%); }
.nc-cross.hit::before, .nc-cross.hit::after { background: #fff; box-shadow: 0 0 10px #fff; }
.nc-cross.auto { border: 1.5px dashed rgba(255,210,120,0.75); border-radius: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; }   /* a phone aiming by itself */
.nc-cross.auto::before { left: 14px; top: 4px; } .nc-cross.auto::after { top: 14px; left: 4px; }
.nc-hp { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9fe8ff; text-shadow: 0 0 6px rgba(0,200,255,0.5); }
.nc-hp .bar { width: clamp(110px, 18vw, 220px); height: 8px; border: 1px solid rgba(0,212,255,0.6); border-radius: 2px; overflow: hidden; background: rgba(0,20,30,0.5); }
.nc-hp .bar i { display: block; height: 100%; background: linear-gradient(90deg, #00d4ff, #8ff); box-shadow: 0 0 10px #0cf; transition: width .15s; }
.nc-hp b { font-size: 16px; color: #fff; min-width: 3ch; }
.nc-hp.low { color: #ff6a7a; } .nc-hp.low .bar { border-color: #ff3355; } .nc-hp.low .bar i { background: #ff3355; box-shadow: 0 0 10px #f35; }
.nc-dash { position: absolute; left: 16px; bottom: 38px; width: 60px; height: 3px; background: rgba(0,212,255,0.15); }
.nc-dash i { display: block; height: 100%; background: #8ff; }
.nc-cores { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #ffe7a0; text-shadow: 0 0 6px rgba(255,210,63,0.6); }
.nc-cores i { width: 10px; height: 10px; transform: rotate(45deg); border: 1.5px solid #ffd23f; opacity: 0.35; }
.nc-cores i.on { background: #ffd23f; opacity: 1; box-shadow: 0 0 8px #ffd23f; }
.nc-cores.open { color: #8ff; text-shadow: 0 0 8px #0cf; }
.nc-toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 8px); padding: 6px 14px; font-size: 13px; letter-spacing: .06em; color: #fff; background: rgba(0,10,20,0.55); border: 1px solid rgba(0,212,255,0.4); border-radius: 4px; opacity: 0; transition: opacity .25s, transform .25s; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.nc-toast.on { opacity: 1; transform: translate(-50%, 0); }
.nc-map { position: absolute; right: 12px; top: 12px; width: clamp(96px, 14vw, 150px); height: clamp(96px, 14vw, 150px); opacity: 0.92; }
.nc-big { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity .35s; text-align: center; }
.nc-big.on { opacity: 1; }
.nc-big b { font-size: clamp(28px, 7vw, 64px); letter-spacing: .12em; text-transform: uppercase; color: #fff; text-shadow: 0 0 18px #0cf, 0 0 40px rgba(0,212,255,0.5); }
.nc-big small { font-size: 13px; letter-spacing: .1em; color: #9fe8ff; }
.nc-tools { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; z-index: 7; }
.nc-tool { width: 32px; height: 32px; border: 1px solid rgba(0,212,255,0.35); border-radius: 6px; background: rgba(0,10,20,0.5); color: #bdf3ff; font-size: 14px; cursor: pointer; }
.nc-tool:hover { border-color: #0cf; }
.nc-pause { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0,4,10,0.6); cursor: pointer; z-index: 3; }
.nc-pause[hidden] { display: none; }
.nc-pause b { font-size: clamp(26px, 6vw, 54px); letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 0 18px #0cf; }
.nc-pause small { font-size: 13px; color: #9fe8ff; letter-spacing: .06em; padding: 0 16px; text-align: center; }
.nc-touch { position: absolute; inset: 0; z-index: 2; touch-action: none; }
.nc-stick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 1.5px solid rgba(0,212,255,0.35); opacity: 0; pointer-events: none; transition: opacity .15s; }
.nc-stick.on { opacity: 1; }
.nc-stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(0,212,255,0.3); border: 1.5px solid #0cf; }
.nc-fire, .nc-dashbtn { position: absolute; border-radius: 50%; border: 2px solid rgba(0,212,255,0.6); background: rgba(0,30,45,0.45); color: #bff6ff; font-size: 26px; touch-action: none; }
.nc-fire { right: 22px; bottom: 26px; width: 84px; height: 84px; }
.nc-fire:active { background: rgba(0,212,255,0.35); }
.nc-dashbtn { right: 118px; bottom: 34px; width: 58px; height: 58px; font-size: 22px; }
.nc-wrap.touch .nc-hp { bottom: auto; top: 54px; left: 12px; }
.nc-wrap.touch .nc-dash { bottom: auto; top: 76px; left: 12px; }
.nc-wrap.touch .nc-map { width: 92px; height: 92px; }
/* Núcleo: the strange ones (the prompt and the dialog) */
.nc-prompt { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); padding: 7px 16px; font: inherit; font-size: 13px; letter-spacing: .05em; color: #f3e6ff; background: rgba(20,6,34,0.7); border: 1px solid rgba(220,160,255,0.65); border-radius: 999px; box-shadow: 0 0 16px rgba(200,120,255,0.35); cursor: pointer; white-space: nowrap; animation: ncPulse 1.6s ease-in-out infinite; }
.nc-prompt[hidden] { display: none; }
.nc-prompt { z-index: 3; touch-action: manipulation; }   /* over the touch layer (z 2), or a phone can't tap it */
@keyframes ncPulse { 50% { box-shadow: 0 0 26px rgba(200,120,255,0.6); } }
.nc-talk { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(680px, calc(100% - 24px)); padding: 14px 18px 12px; background: rgba(6,4,16,0.86); border: 1px solid transparent; border-radius: 10px; pointer-events: auto; cursor: pointer; z-index: 3;
  background-clip: padding-box; box-shadow: 0 0 0 1px rgba(210,150,255,0.55), 0 0 30px rgba(150,80,255,0.3); }
.nc-talk[hidden] { display: none; }
.nc-talk b { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; background: linear-gradient(90deg, #8ff, #e9b8ff, #ffd23f); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; }
.nc-talk p { margin: 0; min-height: 2.8em; font-size: clamp(14px, 2.2vw, 17px); line-height: 1.4; color: #f4ecff; }
.nc-talk small { display: block; margin-top: 6px; text-align: right; font-size: 10px; letter-spacing: .1em; color: rgba(230,210,255,0.55); text-transform: uppercase; }
/* Núcleo: folds (a core in a side-scrolling zone) */
.nc-cores i.fold { border-color: #ff5af0; }
.nc-cores i.on.fold { background: #ff5af0; box-shadow: 0 0 8px #ff5af0; }
.nc-jumpbtn { position: absolute; right: 112px; bottom: 104px; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,90,240,0.6); background: rgba(40,0,40,0.45); color: #ffd0fb; font-size: 22px; touch-action: none; }
.nc-jumpbtn:active { background: rgba(255,90,240,0.35); }
/* Núcleo: the weapons */
.nc-weapon { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(190,230,255,0.45); }
.nc-weapon span.on { color: #fff; text-shadow: 0 0 8px #0cf; }
.nc-weapon small { padding: 1px 6px; border: 1px solid rgba(0,212,255,0.4); border-radius: 3px; font-size: 10px; color: #9fe8ff; }
.nc-wrap.touch .nc-weapon { right: auto; left: 50%; transform: translateX(-50%); bottom: auto; top: 34px; }
.nc-swapbtn { position: absolute; right: 186px; bottom: 30px; width: 50px; height: 50px; border-radius: 50%; border: 2px solid rgba(0,212,255,0.5); background: rgba(0,30,45,0.45); color: #bff6ff; font-size: 20px; touch-action: none; }
/* Núcleo: the Great Core's bar */
.nc-boss { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #ffd9a0; text-shadow: 0 0 8px rgba(255,160,60,0.7); }
.nc-boss[hidden] { display: none; }
.nc-boss .bar { width: clamp(180px, 40vw, 420px); height: 7px; border: 1px solid rgba(255,190,90,0.7); border-radius: 2px; overflow: hidden; background: rgba(40,10,0,0.5); }
.nc-boss .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb340, #ffe9a8); box-shadow: 0 0 10px #fa0; transition: width .12s; }
.nc-boss.p2 .bar i { background: linear-gradient(90deg, #ff7a30, #ffc070); }
.nc-boss.p3 .bar i { background: linear-gradient(90deg, #ff2a4a, #ff8a70); box-shadow: 0 0 12px #f24; }
.nc-wrap.touch .nc-boss { top: 54px; }
/* Núcleo: choosing an upgrade (between levels, or from a relic) */
.nc-pick { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; background: radial-gradient(ellipse at center, rgba(10,4,26,0.82), rgba(0,2,8,0.94)); text-align: center; }
.nc-pick[hidden] { display: none; }
.nc-pick > b { font-size: clamp(22px, 5vw, 44px); letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 0 18px #0cf, 0 0 36px rgba(0,212,255,0.45); }
.nc-pick > small { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #e9b8ff; }
.nc-pick .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; max-width: 760px; }
.nc-pick .card { position: relative; width: clamp(150px, 26vw, 220px); min-height: 170px; padding: 16px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 7px; font: inherit; color: #e9f8ff; background: rgba(4,14,26,0.85); border: 1px solid rgba(0,212,255,0.35); border-radius: 10px; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.nc-pick .card:hover, .nc-pick .card.on { transform: translateY(-3px); border-color: #e9b8ff; box-shadow: 0 0 22px rgba(200,120,255,0.45), inset 0 0 18px rgba(0,212,255,0.12); }
.nc-pick .card i { font-style: normal; font-size: 30px; line-height: 1; color: #8ff; text-shadow: 0 0 12px #0cf; }
.nc-pick .card strong { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.nc-pick .card span { font-size: 12.5px; line-height: 1.35; color: #b9d8e8; }
.nc-pick .card em { margin-top: auto; font-style: normal; font-size: 10px; letter-spacing: .2em; color: #ffd23f; }
.nc-pick .card kbd { position: absolute; left: 8px; top: 7px; font: inherit; font-size: 10px; color: #9fe8ff; opacity: 0.7; }
.nc-pick .have { margin-top: 6px; font-size: 13px; letter-spacing: .1em; color: rgba(190,230,255,0.7); }
.nc-have { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: 560px; padding: 0 16px; font-size: 12px; color: #e9b8ff; }
@media (max-width: 560px) { .nc-pick .card { width: 100%; min-height: 0; flex-direction: row; text-align: left; gap: 10px; } .nc-pick .card em { margin: 0 0 0 auto; } .nc-pick .row { flex-direction: column; } }
/* Núcleo: the seed, your best runs */
.jg-note { max-width: 520px; margin: 0; font-size: 13px; color: rgba(var(--text-rgb),0.7); }
.nc-seedline { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,210,63,0.75); }
.nc-runs { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.nc-runs > b { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(var(--text-rgb),0.6); }
.nc-runs table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.nc-runs td { padding: 3px 10px; color: rgba(var(--text-rgb),0.75); text-align: right; }
.nc-runs td:first-child { color: rgba(var(--text-rgb),0.4); }
.nc-runs td:nth-child(3), .nc-runs td:nth-child(5) { text-align: left; }
.nc-runs tr.me td { color: var(--c1); font-weight: 700; }
.nc-seed { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: 4px 0 0; font-size: 12px; letter-spacing: .06em; color: rgba(var(--text-rgb),0.7); }
/* Núcleo: the visual mode (it plays itself): only the picture */
.nc-hud.demo > :not(.nc-tools):not(.nc-big) { display: none !important; }
/* Núcleo: the options panel, the pause buttons */
.nc-fire, .nc-dashbtn, .nc-jumpbtn, .nc-swapbtn { scale: var(--nc-btn, 1); transform-origin: 100% 100%; }
.nc-pbtns { display: flex; gap: 10px; margin-top: 6px; }
.nc-pbtn { padding: 8px 16px; font: inherit; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #dff8ff; background: rgba(0,20,34,0.75); border: 1px solid rgba(0,212,255,0.45); border-radius: 6px; cursor: pointer; }
.nc-pbtn:hover { border-color: #0cf; box-shadow: 0 0 12px rgba(0,212,255,0.35); }
.nc-pbtn.primary { background: rgba(0,212,255,0.2); border-color: #0cf; }
.nc-opts { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; width: min(520px, 100%); margin: 0 auto; background: rgba(2,8,16,0.94); border-left: 1px solid rgba(0,212,255,0.3); border-right: 1px solid rgba(0,212,255,0.3); color: #dff8ff; cursor: default; }
.nc-opts[hidden] { display: none; }
.nc-opts .head { padding: 14px 18px 8px; font-size: 18px; letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 0 12px #0cf; }
.nc-opts .body { flex: 1; overflow-y: auto; padding: 0 18px 8px; overscroll-behavior: contain; }
.nc-opts h4 { margin: 14px 0 6px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #e9b8ff; font-weight: 600; }
.nc-opts .row { display: grid; grid-template-columns: 1fr minmax(110px, 46%) 52px; align-items: center; gap: 10px; min-height: 36px; font-size: 13px; }
.nc-opts .row.chk { grid-template-columns: 1fr auto; }
.nc-opts .row:has(.seg) { grid-template-columns: 1fr auto; }
.nc-opts input[type=range] { width: 100%; accent-color: #0cf; height: 28px; }
.nc-opts input[type=checkbox] { width: 20px; height: 20px; accent-color: #0cf; }
.nc-opts .val { text-align: right; font-variant-numeric: tabular-nums; color: #9fe8ff; font-size: 12px; }
.nc-opts .seg { display: flex; border: 1px solid rgba(0,212,255,0.4); border-radius: 6px; overflow: hidden; }
.nc-opts .seg button { padding: 6px 10px; font: inherit; font-size: 12px; color: #bfe9f7; background: transparent; border: 0; cursor: pointer; }
.nc-opts .seg button.on { background: rgba(0,212,255,0.25); color: #fff; }
.nc-opts .foot { display: flex; justify-content: space-between; gap: 10px; padding: 10px 18px 14px; border-top: 1px solid rgba(0,212,255,0.2); }
@media (max-width: 720px) {
  .nc-opts { top: 52px; border: 0; border-top: 1px solid rgba(0,212,255,0.3); }
  .nc-opts .row { grid-template-columns: 1fr 52px; gap: 2px 10px; padding: 4px 0; }
  .nc-opts .row .lbl { grid-column: 1 / -1; }
  .nc-opts .row.chk { grid-template-columns: 1fr auto; }
  .nc-opts .row.chk .lbl { grid-column: auto; }
  .nc-opts .row:has(.seg) { grid-template-columns: 1fr; }
}

/* ── Núcleo en red: the room, the names over the others' heads, the versus scoreboard ── */
.nc-lobby { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.nc-lh { margin: 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--c1); font-weight: 600; }
.nc-lopts .jg-dopt { min-width: 0; }
.nc-lmodes { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.nc-lplayers { display: flex; flex-direction: column; gap: 6px; }
.nc-lp { display: flex; align-items: center; gap: 10px; color: var(--head); font-size: 14px; }
.nc-lp i { width: 12px; height: 12px; transform: rotate(45deg); flex: none; }
.jg-dinput.nc-need { border-color: #ff5a6a; }
.nc-tag { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; white-space: nowrap; }
.nc-tag b { font-size: 11px; letter-spacing: .08em; text-shadow: 0 0 6px rgba(0,0,0,0.9), 0 0 2px #000; font-weight: 600; }
.nc-tag i { display: block; width: 44px; height: 3px; background: rgba(255,255,255,0.18); border-radius: 2px; overflow: hidden; }
.nc-tag u { display: block; height: 100%; text-decoration: none; }
.nc-score { position: absolute; left: 12px; top: 58px; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: rgba(0,10,20,0.5); border: 1px solid rgba(0,212,255,0.3); border-radius: 6px; font-size: 12px; color: #dff6ff; min-width: 150px; }
.nc-score small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(190,230,255,0.6); }
.nc-score span { display: flex; align-items: center; gap: 8px; }
.nc-score span.me b { color: #fff; }
.nc-score span i { width: 9px; height: 9px; transform: rotate(45deg); flex: none; }
.nc-score span b { flex: 1; font-weight: 400; color: rgba(223,246,255,0.8); overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.nc-score span em { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 700; }
.nc-wrap.touch .nc-score { top: 96px; left: 12px; min-width: 0; padding: 6px 8px; font-size: 11px; }
.nc-lobby .jg-btn:disabled { opacity: .4; cursor: default; filter: saturate(.4); }

/* ── Núcleo, featured: a banner next to the title (below it on narrower screens), compact on phones ── */
body.juegos .jg-head { align-items: stretch; flex-wrap: nowrap; }
body.juegos .jg-htext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
body.juegos .jg-htext .jg-streak { align-self: flex-start; margin-top: clamp(4px, 0.9vh, 10px); padding: 4px 10px; font-size: 11px; }
body.juegos .jg-htext .jg-streak b { font-size: 14px; }
.jg-nchero { position: relative; flex: 0 1 560px; min-width: 0; display: flex; align-items: stretch; padding: 0; overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  background: linear-gradient(100deg, #07070f 0%, rgba(var(--c1-rgb),0.10) 60%, rgba(255,63,164,0.10) 100%); border: 1px solid rgba(var(--c1-rgb),0.5); border-radius: 14px;
  box-shadow: 0 0 22px rgba(var(--c1-rgb),0.12); transition: box-shadow .2s, border-color .2s, transform .2s; }
.jg-nchero:hover, .jg-nchero:focus-visible { border-color: var(--c1); box-shadow: 0 0 30px rgba(var(--c1-rgb),0.35); transform: translateY(-1px); outline: none; }
.jg-nchero .nh-art { flex: 0 0 42%; position: relative; background: #04040a; border-right: 1px solid rgba(var(--c1-rgb),0.25); }
.jg-nchero .nh-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nh-run { transform-box: view-box; transform-origin: 80px 50px; animation: nhRun 2.4s linear infinite; opacity: 0; }
.nh-run.b { animation-delay: -1.2s; }
@keyframes nhRun { 0% { transform: scale(1); opacity: 0; } 15% { opacity: .9; } 100% { transform: scale(4.2); opacity: 0; } }
.nh-core { transform-box: view-box; transform-origin: 80px 50px; animation: nhCore 1.6s ease-in-out infinite; filter: drop-shadow(0 0 4px #7dff4a); }
@keyframes nhCore { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .nh-run, .nh-core { animation: none; } }
.jg-nchero .nh-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(2px, 0.6vh, 6px); padding: clamp(8px, 1.4vh, 14px) 16px; }
.jg-nchero .nh-tag { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #ff7ac4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-nchero .nh-title { font-size: clamp(20px, 3vh, 28px); line-height: 1.05; color: var(--head); letter-spacing: .04em; text-shadow: 0 0 16px rgba(var(--c1-rgb),0.45); }
.jg-nchero .nh-desc { font-size: 12px; line-height: 1.45; color: rgba(var(--text-rgb),0.75); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.jg-nchero .nh-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.jg-nchero .nh-rec { font-size: 11px; color: var(--c1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-nchero .nh-go { flex: none; margin-left: auto; font-size: 12px; font-weight: 700; color: #050508; background: var(--c1); border-radius: 8px; padding: 5px 12px; box-shadow: 0 0 14px rgba(var(--c1-rgb),0.45); }
/* narrower screens: the banner goes under the title, full width */
@media (max-width: 1000px) {
  body.juegos .jg-head { flex-direction: column; gap: clamp(8px, 1.4vh, 14px); }
  .jg-nchero { flex: none; width: 100%; min-height: 84px; }
  .jg-nchero .nh-title { font-size: clamp(20px, 2.6vh, 26px); }
  .jg-nchero .nh-art { flex-basis: 34%; }
}
/* phones: one compact row (the picture, the name, a line, the button) */
@media (max-width: 600px) {
  .jg-nchero { height: auto; min-height: 68px; border-radius: 12px; }
  .jg-nchero .nh-art { flex: 0 0 96px; }
  .jg-nchero .nh-tx { padding: 7px 10px; gap: 1px; }
  .jg-nchero .nh-title { font-size: 18px; padding-right: 72px; }
  .jg-nchero .nh-desc { font-size: 11px; line-height: 1.3; }
  .jg-nchero .nh-tag, .jg-nchero .nh-rec { display: none; }
  .jg-nchero .nh-foot { position: absolute; right: 8px; top: 7px; margin: 0; }
  .jg-nchero .nh-go { padding: 3px 9px; font-size: 11px; }
}
/* short screens: smaller still */
@media (max-height: 560px) {
  .jg-nchero { height: 58px; min-height: 0; }
  .jg-nchero .nh-desc, .jg-nchero .nh-tag { display: none; }
}
:root[data-theme="light"] .jg-nchero { background: linear-gradient(100deg, #0b0b16 0%, #10202a 60%, #2a1022 100%); color: #e8f6ff; }
:root[data-theme="light"] .jg-nchero .nh-title { color: #fff; }
:root[data-theme="light"] .jg-nchero .nh-desc { color: rgba(232,246,255,0.8); }

/* ── the hub with a wide card (Surco): 11 games in 12 cells ── */
body.juegos.hubmode .jg-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.juegos .jg-card.wide { grid-column: span 2; border-color: rgba(255,63,164,0.45); background: linear-gradient(120deg, rgba(255,63,164,0.10), rgba(63,240,255,0.06)), var(--bg2); }
body.juegos .jg-card.wide .tag { color: #ff7ac4; }
@media (max-width: 1100px) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) and (min-width: 601px) and (orientation: portrait) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { body.juegos.hubmode .jg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Surco ── */
.jg-stage.sc-stage { padding: 0 !important; overflow: hidden !important; justify-content: stretch !important; align-items: stretch !important; background: #000 !important; border-radius: 10px; }
.sc-wrap { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden; background: #000; touch-action: none; -webkit-user-select: none; user-select: none; color: #eafcff; font-family: 'IBM Plex Mono', Consolas, monospace; }
.sc-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sc-hud { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; text-shadow: 0 0 12px rgba(255,63,164,0.6); }
.sc-score { font-size: clamp(20px, 3.4vh, 30px); letter-spacing: .08em; }
.sc-combo { font-size: 12px; letter-spacing: .14em; color: #ffd23f; min-height: 1.2em; }
.sc-meters { position: absolute; left: 12px; bottom: 14px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.sc-m { display: grid; grid-template-columns: 7.5em 90px; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.sc-m i { display: block; height: 6px; width: 100%; background: var(--c); box-shadow: 0 0 10px var(--c); transform: scaleX(.5); transform-origin: 0 50%; transition: transform .2s; justify-self: start; max-width: 90px; }
.sc-prog { position: absolute; right: 12px; bottom: 14px; width: min(220px, 36%); height: 4px; background: rgba(255,255,255,0.12); pointer-events: none; }
.sc-prog i { position: absolute; inset: 0; background: linear-gradient(90deg, #3ff0ff, #ff3fa4); transform: scaleX(0); transform-origin: 0 50%; }
.sc-prog span { position: absolute; right: 0; bottom: 8px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(234,252,255,0.75); white-space: nowrap; }
.sc-big { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.9); font-size: clamp(20px, min(6vh, 7.5vw), 54px); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; text-shadow: 0 0 24px #ff3fa4, 0 0 48px #3ff0ff; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s; white-space: nowrap; }
.sc-big.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sc-hint { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); font-size: 12px; letter-spacing: .06em; color: rgba(234,252,255,0.8); background: rgba(0,0,0,0.45); padding: 6px 12px; border-radius: 999px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.sc-hint.off { opacity: 0; }
.sc-pbtn { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 8px; border: 1px solid rgba(63,240,255,0.5); background: rgba(0,10,20,0.5); color: #bff6ff; font: inherit; font-weight: 700; cursor: pointer; z-index: 3; }
.sc-fs { right: 56px; font-size: 18px; }
.sc-wrap:fullscreen { border-radius: 0; }
.sc-wrap:fullscreen .sc-meters, .sc-wrap:fullscreen .sc-prog { bottom: 22px; }
.sc-pause { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(0,4,10,0.65); cursor: pointer; z-index: 4; }
.sc-pause[hidden] { display: none; }
.sc-pause b { font-size: 28px; letter-spacing: .2em; text-transform: uppercase; }
.sc-pause span { font-size: 12px; color: rgba(234,252,255,0.7); }
.sc-judge { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font-size: clamp(16px, 3.2vh, 26px); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; pointer-events: none; opacity: 0; white-space: nowrap; text-shadow: 0 0 14px currentColor; }
.sc-judge.on { animation: scJudge .5s ease-out forwards; } .sc-judge.on2 { animation: scJudgeB .5s ease-out forwards; }
.sc-judge.j0 { color: #fff7a8; } .sc-judge.j1 { color: #7dffcf; } .sc-judge.j2 { color: #9ec8ff; } .sc-judge.miss { color: #ff5a7a; }
@keyframes scJudge { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 60% { opacity: 1; transform: translate(-50%, -60%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -75%) scale(1); } }
@keyframes scJudgeB { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 60% { opacity: 1; transform: translate(-50%, -60%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -75%) scale(1); } }
.sc-m.cut { opacity: .35; }
.sc-setup { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sc-cal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(0,4,10,0.86); padding: 16px; }
.sc-cal-box { position: relative; width: min(420px, 100%); max-height: 100%; overflow: auto; background: var(--bg2, #0b0f14); border: 1px solid rgba(63,240,255,0.4); border-radius: 14px; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--text, #eafcff); }
.sc-cal-t { font-size: 18px; letter-spacing: .08em; }
.sc-cal-box p { margin: 0; font-size: 13px; line-height: 1.5; opacity: .85; }
.sc-cal-x { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: none; color: inherit; cursor: pointer; }
.sc-cal-pad { width: 150px; height: 150px; border-radius: 50%; border: 2px solid #3ff0ff; background: radial-gradient(circle, rgba(63,240,255,0.18), rgba(255,63,164,0.08)); color: #eafcff; font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.sc-cal-pad.live { border-color: #ff3fa4; }
.sc-cal-pad.hit { animation: scPad .18s ease-out; }
@keyframes scPad { 0% { transform: scale(.92); box-shadow: 0 0 30px #3ff0ff; } 100% { transform: scale(1); box-shadow: none; } }
.sc-cal-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.sc-cal-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.sc-cal-dots i.on { background: #3ff0ff; box-shadow: 0 0 8px #3ff0ff; }
.sc-cal-res { font-size: 15px !important; font-weight: 700; opacity: 1 !important; }
.sc-rj { justify-content: center; color: inherit; font-size: 12px; }
.sc-rtip { margin: 4px 0 0; font-size: 12px; opacity: .8; max-width: 320px; }
.sc-res { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; min-width: 220px; }
.sc-rrow { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--c); border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 4px; }
@media (max-height: 560px) { .sc-hud { top: 6px; } .sc-score { font-size: 18px; } .sc-combo { font-size: 10px; } .sc-meters { left: 10px; bottom: 8px; gap: 3px; } .sc-m { grid-template-columns: 7em 56px; font-size: 8px; gap: 6px; } .sc-m i { height: 4px; max-width: 56px; } .sc-prog { bottom: 8px; width: min(160px, 28%); } .sc-prog span { font-size: 9px; } .sc-hint { bottom: 8px; font-size: 10px; padding: 4px 10px; } .sc-pbtn { top: 6px; right: 8px; width: 32px; height: 32px; } .sc-fs { right: 46px; } .sc-big { top: 34%; } }
@media (max-width: 600px) { .sc-m { grid-template-columns: 6.5em 60px; font-size: 9px; } .sc-m i { max-width: 60px; } .sc-hint { font-size: 11px; bottom: auto; top: 22%; white-space: normal; text-align: center; width: 80%; } }
