/* ============================================================
   Lost Icon Rush v5 - game UI (ConvertICO.com, 2026-09-30, full screen added)
   Used by /lost-icon-rush/ and /errors/503.php. Everything is scoped to .lirg.
   The playfield is always dark; the HUD follows the site theme (custom_styles.css variables).
   ============================================================ */

.lirg { --lg-blue: #2b9edb; --lg-green: #31ae77; --lg-red: #f2534e; --lg-amber: #f59e0b; position: relative; color: var(--text-primary, #1e293b); }
.lirg *, .lirg *::before, .lirg *::after { box-sizing: border-box; }

/* HUD */
.lirg-hud { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lirg-stat {
    position: relative; flex: 1 1 90px; min-width: 84px; padding: 8px 12px 10px; border-radius: 12px; overflow: hidden;
    background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e2e8f0);
}
.lirg-stat span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary, #64748b); }
.lirg-stat b { display: block; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lirg-timebar, .lirg-combobar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(148, 163, 184, .2); }
.lirg-timebar i, .lirg-combobar i { display: block; height: 100%; width: 100%; background: var(--lg-blue); transition: width .2s linear; }
.lirg-combobar i { background: var(--lg-amber); transition: none; }
.lirg-low .lirg-time b { color: var(--lg-red); animation: lirg-tick 1s steps(2) infinite; }
.lirg-low .lirg-timebar i { background: var(--lg-red); }
@keyframes lirg-tick { 50% { opacity: .45; } }
.lirg-combo b { color: var(--text-secondary, #64748b); }
.lirg-combo.on b { color: var(--lg-amber); }
.lirg-lives b { display: flex; gap: 3px; align-items: center; height: 1.62rem; }
.lirg-lives svg { width: 18px; height: 18px; fill: var(--lg-red); stroke: none; }
.lirg-lives svg.lost { fill: rgba(148, 163, 184, .35); }
.lirg-tools { display: flex; gap: 6px; align-items: center; }
.lirg-icon {
    width: 44px; height: 100%; min-height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e2e8f0); color: var(--text-primary, #1e293b); cursor: pointer;
}
.lirg-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lirg-icon:hover { border-color: var(--lg-blue); }
.lirg-icon.off { opacity: .55; }

/* Stage */
.lirg-stage { position: relative; border-radius: 18px; overflow: hidden; background: #0b1224; box-shadow: 0 18px 40px -20px rgba(15, 23, 42, .6); display: flex; align-items: center; }
.lirg-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; outline: none; cursor: crosshair; }
/* Small screens: menus need more room than a 16:9 strip - the stage grows while a menu is open */
/* Online: rank line, name form, in-game leaderboard (2026-09-30) */
.lirg-online:empty { display: none; }
.lirg-online { margin: 0 auto 12px; max-width: 420px; }
.lirg-rank { margin: 0 0 4px; font-size: 1rem; color: #e2e8f0; }
.lirg-rank b { font-size: 1.35rem; color: #f5b83d; font-variant-numeric: tabular-nums; margin-right: 2px; }
.lirg-sub { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 6px; font-size: .85rem; line-height: 1.45; color: #94a3b8; }
.lirg-sub b { color: #fff; }
.lirg-warn { color: #fbbf77; }
.lirg-mini-spin { width: 18px; height: 18px; flex-shrink: 0; animation: lirg-spin 1.2s linear infinite; }
.lirg-nick { margin: 8px 0 0; text-align: left; }
.lirg-nick label { display: block; margin-bottom: 6px; font-size: .8rem; font-weight: 700; color: #cbd5e1; text-align: center; }
.lirg-nick > div { display: flex; gap: 6px; }
.lirg-nick input {
    flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: .95rem;
}
.lirg-nick input::placeholder { color: #94a3b8; }
.lirg-nick input:focus { outline: 2px solid #7cc8ef; outline-offset: 1px; }
.lirg-nick-msg { min-height: 1.2em; margin: 6px 0 0; font-size: .8rem; color: #fbbf77; text-align: center; }
.lirg-nick-msg:empty { display: none; }
.lirg-btn.small { min-width: 0; height: 40px; padding: 0 16px; background: var(--lg-green); border-color: var(--lg-green); }
.lirg-btn:disabled { opacity: .6; cursor: default; }
.lirg-link { border: 0; background: none; padding: 0; color: #7cc8ef; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lirg-link:hover { color: #fff; }
.lirg-link:focus-visible { outline: 2px solid #7cc8ef; outline-offset: 2px; border-radius: 4px; }
.lirg-board .lirg-diff { display: flex; width: max-content; max-width: 100%; margin: 0 auto 14px; }
.lirg-diff-sm button { font-size: .75rem; padding: 4px 12px; }
.lirg-lb { list-style: none; margin: 0 auto 8px; padding: 0; max-width: 380px; text-align: left; }
.lirg-lb li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; font-size: .9rem; color: #e2e8f0; font-variant-numeric: tabular-nums; }
.lirg-lb li:nth-child(odd) { background: rgba(255, 255, 255, .05); }
.lirg-lb li.me, .lirg-lb li.me.p1, .lirg-lb li.me.p2, .lirg-lb li.me.p3 { background: rgba(49, 174, 119, .16); }
/* "You" row: 5px green underline under the name text (padding keeps it inside the ellipsis clip, negative margin keeps the row height) */
.lirg-lb li.me .n { text-decoration-line: underline; text-decoration-color: #31ae77; text-decoration-thickness: 5px; text-underline-offset: 6px; padding-bottom: 12px; margin-bottom: -12px; }
.lirg-lb .r { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; font-weight: 800; color: #94a3b8; }
.lirg-lb .r svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lirg-lb li.p1 { background: rgba(245, 184, 61, .16); }
.lirg-lb li.p1 .r { color: #f5b83d; }
.lirg-lb li.p1 .r svg { fill: rgba(245, 184, 61, .35); }
.lirg-lb li.p1 .n { color: #ffe2a3; }
.lirg-lb li.p2 { background: rgba(203, 213, 225, .10); }
.lirg-lb li.p2 .r { color: #cbd5e1; }
.lirg-lb li.p3 { background: rgba(224, 145, 90, .12); }
.lirg-lb li.p3 .r { color: #e0915a; }
.lirg-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lirg-lb .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lirg-lb .s { font-weight: 800; color: #fff; }
.lirg-lb li.lirg-lb-msg { justify-content: center; background: none; color: #94a3b8; }

.lirg-board-where { margin-top: -2px; margin-bottom: 10px; }
.lirg-board .lirg-lb { margin-bottom: 6px; }
.lirg-board #lirgBoardMe { margin-bottom: 14px; }
/* Share screen */
.lirg-share-prev {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 460px; margin: 0 auto 12px;
    aspect-ratio: 1200 / 630; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .05); color: #94a3b8; font-size: .85rem;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .7);
}
.lirg-share-prev img { display: block; width: 100%; height: 100%; }
.lirg-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.lirg-social a, .lirg-social button {
    padding: 6px 13px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #e2e8f0;
    font: inherit; font-size: .8rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.lirg-social a:hover, .lirg-social button:hover { background: rgba(43, 158, 219, .3); color: #fff; }
.lirg-social a:focus-visible, .lirg-social button:focus-visible { outline: 2px solid #7cc8ef; outline-offset: 2px; }
.lirg-share-msg { min-height: 1.2em; margin: 6px 0 8px; font-size: .8rem; color: #7cc8ef; }
.lirg-btn:disabled svg { opacity: .6; }

@media (max-width: 640px) { .lirg-stage.has-screen { min-height: 460px; } }
.lirg-hint { margin: 10px 0 0; font-size: .85rem; color: var(--text-secondary, #64748b); text-align: center; }

/* Screens (start, pause, game over) */
.lirg-screen {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px;
    background: rgba(8, 13, 28, .74); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); color: #e2e8f0;
    overflow: auto;
}
.lirg-screen[hidden] { display: none !important; }
.lirg-card { width: 100%; max-width: 520px; text-align: center; animation: lirg-in .35s cubic-bezier(.2, .8, .2, 1); }
.lirg-card.small { max-width: 360px; }
@keyframes lirg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.lirg-card h2 { margin: 4px 0 6px; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900; color: #fff; letter-spacing: -.01em; }
.lirg-lead { margin: 0 auto 14px; max-width: 420px; font-size: .95rem; line-height: 1.5; color: #cbd5e1; }
.lirg-logo { width: 74px; height: 74px; margin: 0 auto 4px; }
.lirg-logo-svg { width: 100%; height: 100%; animation: lirg-spin 9s linear infinite; }
@keyframes lirg-spin { to { transform: rotate(360deg); } }
.lirg-legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: .8rem; color: #94a3b8; }
.lirg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lirg-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lirg-legend .dot.sq { border-radius: 3px; }

.lirg-diff { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .08); margin-bottom: 12px; }
.lirg-diff button { border: 0; background: none; color: #cbd5e1; font: inherit; font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.lirg-diff button.on { background: #fff; color: #0f172a; }

.lirg-skins { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lirg-skin {
    width: 64px; padding: 6px 4px 5px; border-radius: 12px; border: 2px solid transparent; background: rgba(255, 255, 255, .06);
    color: #cbd5e1; font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.lirg-skin svg { width: 30px; height: 30px; }
.lirg-skin.on { border-color: #fff; background: rgba(255, 255, 255, .12); color: #fff; }
.lirg-skin:disabled { opacity: .38; cursor: not-allowed; }
.lirg-skin:disabled svg { filter: grayscale(1); }

.lirg-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.lirg-btn {
    min-width: 120px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
    transition: transform .08s, background-color .15s;
}
.lirg-btn:hover { background: rgba(255, 255, 255, .14); }
.lirg-btn:active { transform: translateY(1px); }
.lirg-btn.primary { background: var(--lg-green); border-color: var(--lg-green); }
.lirg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.lirg-btn[hidden] { display: none; }
.lirg-btn svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lirg-btn.primary:hover { filter: brightness(1.08); }
.lirg-btn:focus-visible, .lirg-skin:focus-visible, .lirg-diff button:focus-visible { outline: 2px solid #7cc8ef; outline-offset: 2px; }
.lirg-best { margin: 12px 0 0; font-size: .85rem; color: #94a3b8; }
.lirg-best b { color: #fff; }

.lirg-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #f5b83d; color: #1f1300; font-size: .75rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; animation: lirg-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lirg-pop { from { transform: scale(.4); } }
.lirg-final { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 12px; }
.lirg-final div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 6px; }
.lirg-final b { display: block; font-size: 1.3rem; color: #fff; font-variant-numeric: tabular-nums; }
.lirg-final span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 700; }
.lirg-tip { margin: 0 auto 14px; max-width: 440px; font-size: .88rem; line-height: 1.5; color: #cbd5e1; }
.lirg-tip a { color: #7cc8ef; font-weight: 700; }

/* Toasts inside the stage */
.lirg-toasts { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; max-width: 60%; }
.lirg-toast {
    padding: 8px 12px; border-radius: 10px; background: rgba(15, 23, 42, .88); border: 1px solid rgba(255, 255, 255, .1);
    color: #e2e8f0; font-size: .8rem; line-height: 1.35; text-align: left;
    opacity: 0; transform: translateX(12px); transition: opacity .3s, transform .3s;
}
.lirg-toast.show { opacity: 1; transform: none; }
.lirg-toast strong { display: flex; align-items: center; gap: 6px; color: #fff; font-size: .85rem; }
.lirg-toast strong::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tc); flex-shrink: 0; }
.lirg-toast span { color: #cbd5e1; }

@media (max-width: 640px) {
    .lirg-stat { flex-basis: calc(33% - 8px); min-width: 0; padding: 6px 10px 8px; }
    .lirg-stat b { font-size: 1.1rem; }
    .lirg-lives, .lirg-combo { flex-basis: calc(50% - 56px); }
    .lirg-tools { flex: 0 0 auto; flex-direction: column; gap: 4px; }
    .lirg-icon { min-height: 0; height: 24px; width: 40px; border-radius: 8px; }
    .lirg-fs .lirg-hud { margin-bottom: 6px; gap: 6px; }
    .lirg-icon svg { width: 16px; height: 16px; }
    .lirg-final { grid-template-columns: repeat(2, 1fr); }
    .lirg-skin { width: 54px; }
    .lirg-card h2 { margin-top: 0; }
    .lirg-lead { font-size: .85rem; margin-bottom: 10px; }
    .lirg-logo { width: 52px; height: 52px; }
    .lirg-legend { display: none; }
    .lirg-lb li { padding: 4px 8px; font-size: .82rem; }
    .lirg-rank { font-size: .9rem; }
    .lirg-share-prev { max-width: 320px; }
    .lirg-share .lirg-btn { min-width: 0; padding: 0 12px; font-size: .85rem; }
}
/* Full screen (native Fullscreen API on .lirg, or .lirg-fs-fake overlay for iPhone Safari).
   HUD on top, stage fills the rest, canvas is sized by JS and centred (letterboxed). */
.lirg.lirg-fs {
    display: flex; flex-direction: column; box-sizing: border-box; width: 100%; height: 100%; margin: 0; background: #0b1224;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.lirg.lirg-fs-fake { position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh; }
.lirg-fs .lirg-hud { flex: 0 0 auto; }
.lirg-fs .lirg-stage { flex: 1 1 auto; min-height: 0; justify-content: center; border-radius: 12px; box-shadow: none; }
.lirg-fs .lirg-stage.has-screen { min-height: 0; }
.lirg-fs .lirg-stage canvas { flex: 0 0 auto; }
.lirg-fs .lirg-hint { display: none; }
/* Full screen HUD: dark glass tiles that match the playfield instead of the light page cards */
.lirg-fs .lirg-stat, .lirg-fs .lirg-icon { background: rgba(255, 255, 255, .05); border-color: rgba(148, 163, 184, .18); color: #e2e8f0; }
.lirg-fs .lirg-stat span { color: #8ea0b8; }
.lirg-fs .lirg-stat b { color: #fff; }
.lirg-fs .lirg-combo b { color: #8ea0b8; }
.lirg-fs .lirg-combo.on b { color: var(--lg-amber); }
.lirg-fs.lirg-low .lirg-time b { color: var(--lg-red); }
.lirg-fs .lirg-timebar, .lirg-fs .lirg-combobar { background: rgba(148, 163, 184, .14); }
.lirg-fs .lirg-lives svg.lost { fill: rgba(148, 163, 184, .25); }
.lirg-fs .lirg-icon:hover { border-color: var(--lg-blue); background: rgba(43, 158, 219, .12); }
.lirg:fullscreen { background: #0b1224; }
.lirg:-webkit-full-screen { background: #0b1224; width: 100%; height: 100%; }
html.lirg-lock, html.lirg-lock body { overflow: hidden !important; overscroll-behavior: none; }
.lirg-btn-fs { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.lirg-btn-fs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
    .lirg-logo-svg, .lirg-card, .lirg-badge, .lirg-low .lirg-time b { animation: none; }
    .lirg-mini-spin { animation-duration: 4s; }
}
