/**
 * smgr/css/pages/3x3.css — estilos del mini-juego "3x3" (parrilla ACB)
 * portado al chrome "Foco". Mismo recipe que masomenos.css:
 *   · :root con las variables --g-* sin scope.
 *   · body { background } del original pasa a .game-scope { background }.
 *   · TODO el resto de selectores prefijado con ".game-scope ".
 *   · Reset de aislamiento arriba (img, button) contra rincon.css.
 *   · Se elimina .logo-main (era del chrome del sitio clásico).
 */

/* ===== Variables del juego (globales, sin scope) ===== */
:root { --g-navy:#1e3a5f; --g-navy2:#2c5282; --g-orange:#ed8936; --g-ok:#16a34a; --g-bad:#ef4444;
    --g-bg:#eef2f8; --g-surface:#fff; --g-border:#e2e8f0; --g-muted:#64748b; --g-ink:#0f172a; }

/* ===== Reset de aislamiento (contrarresta rincon.css dentro del juego) ===== */
.game-scope img { max-width: none; }
.game-scope button { font: inherit; }

/* Fondo inmersivo del juego (antes en body). Solo cubre el área de juego. */
.game-scope { background: var(--g-bg); }

.game-scope #g3-app { max-width: 860px; margin: 16px auto 40px; padding: 0 12px; font-family: Roboto, sans-serif; color: var(--g-ink); }
/* La landing (hero + modos + clasificaciones) aprovecha todo el ancho; el tablero y el
   resultado se mantienen centrados y enfocados, sin estirarse. */
.game-scope #state-game, .game-scope #state-over { max-width: 640px; margin-left: auto; margin-right: auto; }

/* hero */
.game-scope .g3-hero { background:linear-gradient(135deg,var(--g-navy),var(--g-navy2)); color:#fff; border-radius:16px; padding:26px 22px; text-align:center; position:relative; overflow:hidden; box-shadow:0 4px 16px rgba(15,23,42,.08); }
.game-scope .g3-hero .wm { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:clamp(2.2rem,8vw,3rem); letter-spacing:-.02em; line-height:1; }
.game-scope .g3-hero .wm b { color:var(--g-orange); }
.game-scope .g3-hero .hero-lockup { display:block; height:72px; max-width:90%; margin:0 auto; }
.game-scope .g3-hero .sub { margin:12px auto 0; max-width:460px; opacity:.92; font-size:14.5px; line-height:1.45; }
.game-scope .challenge-badge { display:inline-block; background:var(--g-orange); color:#1f2937; font-weight:700; font-size:12px; letter-spacing:.06em; padding:4px 12px; border-radius:999px; margin-bottom:8px; }

/* landing */
.game-scope .g3-card { background:var(--g-surface); border-radius:16px; box-shadow:0 4px 16px rgba(15,23,42,.07); padding:20px; }
.game-scope .g3-body { margin-top:14px; }
.game-scope .guest-block { margin:0 auto 16px; max-width:340px; }
.game-scope .guest-block label { font-size:13px; font-weight:700; color:var(--g-muted); display:block; margin-bottom:4px; }
.game-scope .guest-block input { width:100%; padding:11px 13px; border:2px solid var(--g-border); border-radius:10px; font-size:16px; }
.game-scope .guest-block input:focus { outline:none; border-color:var(--g-navy2); }
.game-scope .guest-hint { font-size:12px; color:var(--g-muted); margin-top:4px; }
.game-scope .guest-err { display:none; font-size:12px; color:#dc2626; font-weight:600; margin-top:4px; }
.game-scope .guest-block.error input { border-color:#dc2626; box-shadow:0 0 0 3px rgba(220,38,38,.15); }
.game-scope .guest-block.error .guest-hint { display:none; }
.game-scope .guest-block.error .guest-err { display:block; }
.game-scope .mode-picker { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.game-scope .mode-card { background:#f8fafc; border:2px solid var(--g-border); border-radius:14px; padding:16px; cursor:pointer; display:flex; flex-direction:column; gap:9px; transition:.15s; }
.game-scope .mode-card:hover { transform:translateY(-2px); box-shadow:0 8px 20px rgba(30,58,95,.12); background:#fff; }
.game-scope .mode-daily:hover { border-color:var(--g-orange); } .game-scope .mode-libre:hover { border-color:var(--g-navy2); }
.game-scope .mc-head { display:flex; align-items:center; gap:10px; font-weight:700; font-size:16px; }
.game-scope .mc-ico { width:32px; height:32px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; font-size:16px; flex:0 0 32px; }
.game-scope .mode-daily .mc-ico { background:#fed7aa; color:#c2410c; } .game-scope .mode-libre .mc-ico { background:#dbeafe; color:var(--g-navy2); }
.game-scope .mc-desc { font-size:12.5px; color:#475569; line-height:1.4; }
.game-scope .mc-rec { font-size:12px; color:#475569; padding:5px 9px; background:#fff; border-radius:6px; border:1px dashed #cbd5e1; }
.game-scope .mc-cta { margin-top:auto; align-self:stretch; text-align:center; font-weight:700; font-size:13.5px; color:#fff; padding:10px; border-radius:10px; }
.game-scope .mode-daily .mc-cta { background:linear-gradient(135deg,var(--g-orange),#dd6b20); } .game-scope .mode-libre .mc-cta { background:linear-gradient(135deg,var(--g-navy2),var(--g-navy)); }
.game-scope .mode-card.done { background:#f1f5f9; border-color:#cbd5e1; } .game-scope .mode-card.done .mc-ico { background:#dcfce7; color:var(--g-ok); }
.game-scope .mode-card.highlight { border-color:var(--g-navy2); box-shadow:0 4px 14px rgba(44,82,130,.14); }
.game-scope .mc-cta.ghost { background:#e2e8f0; color:var(--g-navy); }
.game-scope .g3-hub { text-align:center; margin-top:16px; } .game-scope .g3-hub a { color:var(--g-muted); font-weight:600; font-size:13px; text-decoration:none; } .game-scope .g3-hub a:hover { text-decoration:underline; }

/* landing leaderboards */
.game-scope .g3-boards { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:18px; }
.game-scope .board { background:#f8fafc; border:1px solid var(--g-border); border-radius:12px; padding:12px 14px; }
.game-scope .board h4 { margin:0 0 2px; font-size:13px; font-weight:700; color:var(--g-navy); text-transform:uppercase; letter-spacing:.04em; }
.game-scope .board-sub { font-size:11px; color:var(--g-muted); margin:0 0 8px; }
.game-scope .board .nm-sub { color:var(--g-muted); font-weight:400; }
.game-scope .board ol { margin:0; padding-left:0; list-style:none; counter-reset:r; }
.game-scope .board li { display:flex; justify-content:space-between; gap:8px; font-size:13px; padding:3px 0; border-bottom:1px dashed #e8edf3; counter-increment:r; }
.game-scope .board li:last-child { border-bottom:none; }
.game-scope .board li .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.game-scope .board li .nm::before { content:counter(r) ". "; color:var(--g-muted); }
.game-scope .board li .st { font-weight:700; color:var(--g-ok); font-family:'Space Grotesk',sans-serif; white-space:nowrap; }
.game-scope .board .empty { font-size:12px; color:var(--g-muted); padding:6px 0; }
.game-scope .board-all { display:inline-block; margin-top:9px; font-size:12.5px; font-weight:700; color:var(--g-navy2); text-decoration:none; }
.game-scope .board-all:hover { text-decoration:underline; } .game-scope .board-all i { font-size:11px; margin-left:3px; }
@media (max-width:560px){ .game-scope .g3-boards { grid-template-columns:minmax(0, 1fr); } }

/* ===== board ===== */
.game-scope #state-game { display:none; }
.game-scope .g3-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; gap:8px; }
.game-scope .g3-top .mode-pill { font-size:12px; font-weight:700; color:#fff; background:var(--g-navy2); padding:4px 11px; border-radius:999px; }
.game-scope .g3-top .mode-pill.daily { background:var(--g-orange); color:#1f2937; }
.game-scope .g3-top .score { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:16px; }
.game-scope .g3-top .score b { font-size:22px; color:var(--g-ok); }
.game-scope .g3-board { display:grid; grid-template-columns: 78px repeat(3, 1fr); gap:6px; }
.game-scope .g3-corner { }
.game-scope .g3-head { background:var(--g-navy); color:#fff; border-radius:10px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:6px 4px; gap:3px; min-height:64px; }
.game-scope .g3-head img { width:30px; height:30px; object-fit:contain; background:#fff; border-radius:5px; }
.game-scope .g3-head .lab { font-size:10.5px; font-weight:600; line-height:1.1; }
.game-scope .g3-head.g3-rowhead { min-height:0; }
.game-scope .g3-cell { background:var(--g-surface); border:2px solid var(--g-border); border-radius:10px; min-height:64px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:4px; cursor:pointer; transition:.12s; position:relative; }
.game-scope .g3-cell.empty:hover { border-color:var(--g-navy2); background:#f8fafc; }
.game-scope .g3-cell .plus { font-size:24px; color:#cbd5e1; font-weight:700; }
.game-scope .g3-cell .nm { font-size:11px; font-weight:600; line-height:1.12; }
.game-scope .g3-cell .rar { font-size:9.5px; color:var(--g-muted); margin-top:2px; }
.game-scope .g3-cell.ok { background:#f0fdf4; border-color:var(--g-ok); cursor:default; }
.game-scope .g3-cell.ok .nm { color:#065f46; }
.game-scope .g3-cell.bad { background:#fef2f2; border-color:var(--g-bad); cursor:default; }
.game-scope .g3-cell.bad .nm { color:#991b1b; text-decoration:line-through; }
.game-scope .g3-howto { font-size:12.5px; color:var(--g-muted); text-align:center; margin-top:12px; line-height:1.4; }
.game-scope .g3-finish { display:block; margin:14px auto 0; background:#eef2f8; color:var(--g-navy); border:none; border-radius:10px; padding:10px 18px; font-weight:700; font-size:14px; cursor:pointer; }

/* search modal */
/* móvil: hoja anclada ARRIBA (input + resultados quedan sobre el teclado);
   desktop: diálogo centrado. La altura se ajusta al visualViewport en JS al abrir el teclado. */
.game-scope .g3-search-back { position:fixed; inset:0; background:rgba(15,23,42,.5); display:none; align-items:flex-start; justify-content:center; z-index:9999; }
.game-scope .g3-search-back.g3-open { display:flex; }
@media (min-width:560px){ .game-scope .g3-search-back.g3-open { align-items:center; } }
.game-scope .g3-search { background:#fff; width:100%; max-width:520px; border-radius:0 0 16px 16px; max-height:80vh; display:flex; flex-direction:column; }
@media (min-width:560px){ .game-scope .g3-search { border-radius:16px; } }
.game-scope .g3-search-head { padding:14px 16px; border-bottom:1px solid var(--g-border); }
.game-scope .g3-search-crit { font-size:13px; color:var(--g-muted); }
.game-scope .g3-search-crit b { color:var(--g-navy); }
.game-scope .g3-search-head input { width:100%; margin-top:8px; padding:11px 13px; border:2px solid var(--g-border); border-radius:10px; font-size:16px; }
.game-scope .g3-search-head input:focus { outline:none; border-color:var(--g-navy2); }
.game-scope .g3-search-close { float:right; background:none; border:none; font-size:22px; color:#94a3b8; cursor:pointer; line-height:1; }
.game-scope .g3-results { overflow-y:auto; padding:6px 8px 14px; min-height:0; -webkit-overflow-scrolling:touch; }
.game-scope .g3-result { display:flex; align-items:center; gap:10px; padding:10px 10px; border-bottom:1px solid #f1f5f9; cursor:pointer; }
.game-scope .g3-result:hover { background:#f7fafc; }
.game-scope .g3-result .rn { font-weight:600; font-size:14.5px; }
.game-scope .g3-result .rm { font-size:12px; color:var(--g-muted); }
.game-scope .g3-search-msg { padding:14px; text-align:center; color:#94a3b8; font-size:13px; }
.game-scope .g3-toast { padding:8px 14px; margin:0 12px; background:#fef3c7; color:#92400e; border-radius:8px; font-size:13px; font-weight:600; }

/* ===== over ===== */
.game-scope #state-over { display:none; }
.game-scope .over-card { background:var(--g-surface); border-radius:16px; box-shadow:0 4px 16px rgba(15,23,42,.07); padding:24px 20px; text-align:center; }
.game-scope .over-card .msg { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:20px; }
.game-scope .over-card .big { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:54px; line-height:1; color:var(--g-ok); margin:6px 0 0; }
.game-scope .over-card .big small { font-size:24px; color:var(--g-muted); }
.game-scope .over-card .rar { font-size:14px; color:var(--g-muted); margin-top:2px; }
.game-scope .over-emoji { font-size:30px; line-height:1.2; letter-spacing:4px; margin:14px 0; white-space:pre; }
.game-scope .over-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:6px; }
.game-scope .g3-btn { border:none; border-radius:11px; padding:12px 18px; font-weight:700; font-size:15px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
.game-scope .g3-btn.primary { background:var(--g-navy2); color:#fff; } .game-scope .g3-btn.ghost { background:#eef2f8; color:var(--g-navy); }
.game-scope .share-grid { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:14px; }
.game-scope .share-grid button { width:46px; height:46px; border-radius:50%; border:none; color:#fff; font-size:18px; cursor:pointer; }
.game-scope .sh-x{background:#000}.game-scope .sh-wa{background:#25d366}.game-scope .sh-tg{background:#229ed9}.game-scope .sh-fb{background:#1877f2}.game-scope .sh-copy{background:#64748b}
.game-scope .share-hint { font-size:12px; color:var(--g-muted); margin-top:8px; }
.game-scope .vuelve { font-size:13px; color:var(--g-muted); margin-top:10px; display:none; }
.game-scope .sol-wrap { margin-top:18px; text-align:left; display:none; }
.game-scope .sol-wrap h4 { font-size:14px; color:var(--g-navy); margin:0 0 8px; font-weight:700; }
.game-scope .sol-cell { font-size:12.5px; padding:6px 0; border-bottom:1px dashed #e8edf3; }
.game-scope .sol-cell .c { color:var(--g-muted); } .game-scope .sol-cell .pl { color:var(--g-ink); }

/* share card offscreen */
.game-scope .share-card { position:fixed; left:-20000px; top:0; width:1200px; height:675px; background:linear-gradient(135deg,#1e3a5f,#2c5282); color:#fff; font-family:'Space Grotesk',Roboto,sans-serif; padding:56px 64px; box-sizing:border-box; }
.game-scope .share-card .sc-top { font-size:34px; font-weight:700; } .game-scope .share-card .sc-top b { color:#f6ad55; }
.game-scope .share-card .sc-mark { height:60px; vertical-align:middle; margin-right:16px; }
.game-scope .share-card .sc-wm { vertical-align:middle; } .game-scope .share-card .sc-tag { opacity:.85; font-size:24px; font-weight:500; vertical-align:middle; }
.game-scope .share-card .sc-mode { float:right; font-size:18px; background:rgba(255,255,255,.15); padding:6px 16px; border-radius:999px; }
.game-scope .share-card .sc-emoji { font-size:78px; line-height:1.12; letter-spacing:10px; margin-top:24px; white-space:pre; }
.game-scope .share-card .sc-score { font-size:40px; margin-top:24px; } .game-scope .share-card .sc-score b { color:#86efac; }
.game-scope .share-card .sc-cta { position:absolute; bottom:54px; left:64px; right:64px; display:flex; justify-content:space-between; align-items:flex-end; }
.game-scope .share-card .sc-cta .l1 { font-size:30px; font-weight:700; } .game-scope .share-card .sc-cta .l2 { font-size:22px; opacity:.85; }

@media (max-width:560px){ .game-scope .mode-picker { grid-template-columns:1fr 1fr; } .game-scope .g3-board { grid-template-columns:62px repeat(3,1fr); gap:5px; } .game-scope .g3-head .lab { font-size:9.5px; } .game-scope .g3-head img { width:26px; height:26px; } .game-scope .g3-cell .nm { font-size:10px; } }
