/* =========================================================================
 * تتریس: اودیسه کهکشانی — استایل خودبسنده (وب + اپ)
 * همهٔ کلاس‌ها با پیشوند to- و زیر ریشهٔ #tetris-odyssey-root محدود شده‌اند
 * تا با دیزاین‌سیستم کوییزبی و سایر پنل‌های بازی تداخل نکنند.
 * ========================================================================= */

#tetris-odyssey-root,
.to-root {
    --to-accent: #22d3ee;
    --to-accent-soft: rgba(34, 211, 238, 0.18);
    --to-bg-a: #03101f;
    --to-bg-b: #071a33;
    --to-ink: #e2e8f0;
    --to-muted: #93a4bd;
    --to-line: rgba(148, 163, 184, 0.18);
    --to-panel: rgba(7, 12, 28, 0.86);
    --to-radius: 20px;
    font-family: "Vazirmatn", "Sahel", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--to-ink);
    position: relative;
    isolation: isolate;
}

#tetris-odyssey-root *,
.to-root * { box-sizing: border-box; }

#tetris-odyssey-root button,
.to-root button {
    font-family: inherit;
    color: inherit;
    border: 0;
    background: none;
    cursor: pointer;
}

.to-shell {
    position: relative;
    display: block;
    padding: 14px;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 90% 0%, rgba(34, 211, 238, 0.14), transparent 55%),
        radial-gradient(110% 90% at 0% 100%, rgba(217, 70, 239, 0.14), transparent 55%),
        linear-gradient(160deg, var(--to-bg-b), var(--to-bg-a) 60%, #020713);
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: 0 24px 70px -32px rgba(2, 8, 23, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    outline: none;
}

.to-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.85;
    z-index: 0;
}

.to-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 2px 4px 12px;
    border-bottom: 1px solid var(--to-line);
}

.to-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.to-logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 21px;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.28), rgba(217, 70, 239, 0.22));
    border: 1px solid rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 24px -8px var(--to-accent);
    flex: 0 0 auto;
}

.to-brand-txt h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.2px;
    background: linear-gradient(90deg, #a5f3fc, #fff, #fde68a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.to-brand-txt p {
    margin: 2px 0 0;
    font-size: 10.5px;
    color: var(--to-muted);
    font-weight: 600;
}

.to-head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.to-chip {
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    color: #06121f;
    background: linear-gradient(135deg, #67e8f9, #22d3ee 55%, #38bdf8);
    box-shadow: 0 6px 18px -8px rgba(34, 211, 238, 0.9);
    white-space: nowrap;
}

.to-ico {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 14px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--to-line);
    transition: 0.18s ease;
}
.to-ico:hover { background: rgba(148, 163, 184, 0.2); transform: translateY(-1px); }
.to-ico.is-on {
    background: rgba(34, 211, 238, 0.2);
    border-color: rgba(34, 211, 238, 0.65);
    box-shadow: 0 0 14px -4px var(--to-accent);
}

.to-body {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 158px minmax(0, 1fr) 196px;
    gap: 12px;
    align-items: start;
    padding-top: 12px;
}

.to-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.to-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(5, 9, 22, 0.96));
    border: 1px solid var(--to-line);
    border-radius: 16px;
    padding: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.to-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--to-muted);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.to-kbd {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(34, 211, 238, 0.14);
    color: #a5f3fc;
    border: 1px solid rgba(34, 211, 238, 0.25);
    direction: ltr;
}

.to-mini-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 96 / 70;
    border-radius: 10px;
    background: rgba(2, 6, 18, 0.75);
    border: 1px solid rgba(34, 211, 238, 0.18);
}

.to-next-canvas { aspect-ratio: 96 / 168; }

.to-stat { display: flex; flex-direction: column; gap: 2px; }
.to-stat span { font-size: 9.5px; color: var(--to-muted); font-weight: 700; }
.to-stat strong { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; }

.to-stat-score {
    align-items: center;
    padding: 6px 4px 8px;
    border-radius: 12px;
    background: radial-gradient(90% 140% at 50% 0%, rgba(34, 211, 238, 0.16), transparent 70%);
    border: 1px solid rgba(34, 211, 238, 0.18);
}
.to-stat-score strong { font-size: 25px; color: #a5f3fc; text-shadow: 0 0 18px rgba(34, 211, 238, 0.55); }

.to-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; text-align: center; }
.to-stat-row .to-stat { background: rgba(148, 163, 184, 0.07); border-radius: 10px; padding: 5px 2px; }
.to-stat-row .to-stat strong { font-size: 15px; }
.to-stat-row .to-stat:nth-child(1) strong { color: #6ee7b7; }
.to-stat-row .to-stat:nth-child(2) strong { color: #f9a8d4; }
.to-stat-row .to-stat:nth-child(3) strong { color: #fcd34d; }

.to-timer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 9px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 10.5px;
    font-weight: 800;
    color: #bae6fd;
}
.to-timer[hidden] { display: none !important; }
.to-timer strong { font-variant-numeric: tabular-nums; font-size: 14px; }
.to-timer.is-danger { background: rgba(244, 63, 94, 0.16); border-color: rgba(244, 63, 94, 0.5); color: #fecdd3; animation: to-pulse 1s infinite; }

.to-best {
    margin-top: 7px;
    font-size: 10px;
    color: var(--to-muted);
    text-align: center;
    font-weight: 700;
}
.to-best b { color: #fcd34d; font-variant-numeric: tabular-nums; }

.to-keys .to-key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: var(--to-muted);
    padding: 3px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.1);
}
.to-keys .to-key-row:last-child { border-bottom: 0; }
.to-keys b { color: #cbd5e1; font-size: 10px; }

/* ---------------- ستون میانی: باس + زمین بازی ---------------- */
.to-main { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }

.to-boss {
    width: 100%;
    max-width: 348px;
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.13), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(244, 63, 94, 0.35);
    box-shadow: 0 8px 26px -18px rgba(244, 63, 94, 0.9);
}
.to-boss[hidden] { display: none; }

.to-boss-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    font-size: 22px;
    border-radius: 12px;
    background: rgba(244, 63, 94, 0.14);
    border: 1px solid rgba(244, 63, 94, 0.4);
    transition: transform 0.14s ease, filter 0.3s ease;
}
.to-boss-avatar.is-dead { filter: grayscale(1) brightness(0.6); transform: rotate(12deg) scale(0.92); }

.to-boss-info { flex: 1; min-width: 0; }
.to-boss-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.to-boss-top strong { font-size: 11.5px; font-weight: 900; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.to-boss-hp { font-size: 9.5px; font-weight: 800; color: #fda4af; font-variant-numeric: tabular-nums; white-space: nowrap; }

.to-bar { height: 5px; border-radius: 999px; background: rgba(2, 6, 18, 0.8); overflow: hidden; margin-top: 4px; border: 1px solid rgba(148, 163, 184, 0.14); }
.to-bar i { display: block; height: 100%; border-radius: 999px; transition: width 0.25s ease; }
.to-bar-shield i { background: linear-gradient(90deg, #22d3ee, #7dd3fc); box-shadow: 0 0 8px rgba(56, 189, 248, 0.7); }
.to-bar-hp { height: 7px; }
.to-bar-hp i { background: linear-gradient(90deg, #f43f5e, #fb7185, #fbbf24); box-shadow: 0 0 10px rgba(244, 63, 94, 0.6); }

.to-boss-sub { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 9px; color: #a5b4c8; }
.to-boss-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-boss-sub b { color: #fcd34d; white-space: nowrap; }

.to-board-frame {
    position: relative;
    width: 100%;
    max-width: 348px;
    padding: 8px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(8, 13, 30, 0.95), rgba(2, 5, 15, 0.98));
    border: 1.5px solid rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 34px -12px var(--to-accent), inset 0 0 40px rgba(34, 211, 238, 0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.to-board {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 10 / 20;
    border-radius: 12px;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.to-hype {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    pointer-events: none;
    opacity: 0;
    z-index: 6;
    text-align: center;
    padding: 0 10px;
}
.to-hype b {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 0 22px var(--to-accent), 0 4px 18px rgba(0, 0, 0, 0.8);
}
.to-hype span {
    font-size: 11px;
    font-weight: 800;
    color: #cffafe;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    direction: rtl;
}
.to-hype.is-show { animation: to-hype 1.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes to-hype {
    0% { opacity: 0; transform: scale(0.7); }
    16% { opacity: 1; transform: scale(1.04); }
    72% { opacity: 1; transform: scale(1) translateY(-6px); }
    100% { opacity: 0; transform: scale(1.06) translateY(-22px); }
}

/* ---------------- اورلی‌ها ---------------- */
.to-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 20px;
    overflow-y: auto;
    background: rgba(3, 7, 20, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.to-hidden { display: none !important; }

.to-panel {
    width: 100%;
    max-width: 320px;
    margin: auto;
    padding: 14px;
    border-radius: 16px;
    text-align: center;
    background: linear-gradient(165deg, rgba(16, 26, 52, 0.96), rgba(4, 8, 20, 0.98));
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.9);
}
.to-panel-sm { max-width: 270px; }
.to-panel h4 { margin: 6px 0 2px; font-size: 17px; font-weight: 900; color: #fff; }
.to-panel-sub { margin: 0 0 10px; font-size: 10.5px; color: var(--to-muted); font-weight: 600; line-height: 1.7; }

.to-hero {
    width: 46px;
    height: 46px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 23px;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.24), rgba(217, 70, 239, 0.2));
    border: 1px solid rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 26px -8px var(--to-accent);
}

.to-modes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 9px; }
.to-mode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    text-align: right;
    padding: 8px 10px;
    border-radius: 11px;
    background: rgba(148, 163, 184, 0.07);
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: 0.18s ease;
}
.to-mode b { font-size: 11.5px; font-weight: 900; color: #e2e8f0; }
.to-mode span { font-size: 9.5px; color: var(--to-muted); }
.to-mode:hover { background: rgba(148, 163, 184, 0.14); }
.to-mode.is-active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(217, 70, 239, 0.14));
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: inset 0 0 20px -10px var(--to-accent);
}
.to-mode.is-active b { color: #a5f3fc; }

.to-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: var(--to-muted);
    font-weight: 700;
    margin-bottom: 10px;
}
.to-slider-row input { flex: 1; accent-color: #22d3ee; height: 4px; }
.to-slider-row b { color: #a5f3fc; font-size: 12px; min-width: 18px; }

.to-play {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 900;
    color: #04121c;
    background: linear-gradient(135deg, #67e8f9, #22d3ee 45%, #6366f1);
    box-shadow: 0 10px 26px -14px rgba(34, 211, 238, 0.95);
    transition: 0.18s ease;
}
.to-play:hover { transform: translateY(-1px); filter: brightness(1.06); }
.to-play:active { transform: scale(0.98); }
.to-play-sm { font-size: 11.5px; padding: 9px 8px; }
.to-duel { margin-top: 8px; background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #2b1a02; }

.to-hint { margin-top: 8px; font-size: 9.5px; color: var(--to-muted); line-height: 1.7; }

.to-row-btns { display: flex; gap: 6px; margin-top: 8px; }
.to-row-btns > * { flex: 1; }

.to-ghost {
    padding: 9px 10px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.24);
    transition: 0.18s ease;
}
.to-ghost:hover { background: rgba(148, 163, 184, 0.2); }
.to-ghost.to-danger { color: #fda4af; border-color: rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.12); }

.to-reward {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 900;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.45);
}

.to-upgrades { display: flex; flex-direction: column; gap: 7px; }
.to-upgrade {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-areas: "ico title" "ico desc";
    gap: 1px 8px;
    text-align: right;
    padding: 8px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.28);
    transition: 0.18s ease;
}
.to-upgrade:hover {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -16px rgba(251, 191, 36, 0.9);
}
.to-upgrade-ico { grid-area: ico; display: grid; place-items: center; font-size: 20px; border-radius: 10px; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3); }
.to-upgrade b { grid-area: title; font-size: 11px; font-weight: 900; color: #fcd34d; align-self: end; }
.to-upgrade em { grid-area: desc; font-size: 9.5px; font-style: normal; color: #cbd5e1; line-height: 1.6; }

.to-final-score { font-size: 32px; font-weight: 900; color: #a5f3fc; text-shadow: 0 0 20px rgba(34, 211, 238, 0.5); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.to-final-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 8px; }
.to-final-grid > div { padding: 5px 2px; border-radius: 9px; background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.16); }
.to-final-grid span { display: block; font-size: 9px; color: var(--to-muted); }
.to-final-grid b { font-size: 13px; color: #e2e8f0; font-variant-numeric: tabular-nums; }

.to-sync { min-height: 30px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; line-height: 1.7; color: #cbd5e1; }
.to-sync.is-ok { color: #6ee7b7; }
.to-sync.is-warn { color: #fda4af; }

/* ---------------- دکمه‌های لمسی ---------------- */
.to-touch {
    width: 100%;
    max-width: 348px;
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}
.to-touch button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 8px 0;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(9, 13, 30, 0.96));
    border: 1px solid rgba(34, 211, 238, 0.28);
    transition: 0.12s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.to-touch button i { font-style: normal; font-size: 16px; line-height: 1; color: #a5f3fc; }
.to-touch button span { font-size: 8px; font-weight: 800; color: #93a4bd; }
.to-touch button.is-pressed { transform: scale(0.93); background: rgba(34, 211, 238, 0.24); border-color: #22d3ee; }
.to-touch button[data-t="rotate"] i { color: #f9a8d4; }
.to-touch button[data-t="drop"] i { color: #fcd34d; }
.to-touch button[data-t="hold"] i { color: #6ee7b7; }

/* ---------------- مهارت‌ها و ارتقاها ---------------- */
.to-skills { display: flex; flex-direction: column; gap: 6px; }
.to-skill {
    position: relative;
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 6px;
    text-align: right;
    padding: 7px 7px 9px;
    border-radius: 11px;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.16);
    overflow: hidden;
    transition: 0.18s ease;
}
.to-skill-ico { font-size: 16px; text-align: center; }
.to-skill-txt { min-width: 0; }
.to-skill-txt b { display: block; font-size: 10px; font-weight: 900; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.to-skill-txt em { display: block; font-style: normal; font-size: 8.5px; color: var(--to-muted); line-height: 1.5; }
.to-skill-pct { font-size: 9.5px; font-weight: 900; color: #93a4bd; font-variant-numeric: tabular-nums; }
.to-skill-bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: rgba(2, 6, 18, 0.75); }
.to-skill-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22d3ee, #6366f1); transition: width 0.2s ease; }
.to-skill.is-ready {
    border-color: rgba(251, 191, 36, 0.75);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(15, 23, 42, 0.9));
    box-shadow: 0 0 18px -8px rgba(251, 191, 36, 0.9);
    cursor: pointer;
}
.to-skill.is-ready .to-skill-pct { color: #fcd34d; }
.to-skill.is-ready .to-skill-bar i { background: linear-gradient(90deg, #fbbf24, #f43f5e); }

.to-relics { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.to-relic { width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; border-radius: 8px; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.32); }
.to-empty { font-size: 9.5px; color: var(--to-muted); }

/* ---------------- لیدربرد ---------------- */
.to-lb-card { min-height: 170px; }
.to-refresh { font-size: 12px; color: #a5f3fc; padding: 0 3px; }
.to-lb-tabs { display: flex; gap: 3px; padding: 2px; border-radius: 9px; background: rgba(2, 6, 18, 0.6); margin-bottom: 6px; }
.to-lb-tabs button { flex: 1; padding: 4px 0; border-radius: 7px; font-size: 9px; font-weight: 800; color: var(--to-muted); }
.to-lb-tabs button.is-active { background: rgba(34, 211, 238, 0.2); color: #a5f3fc; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.4); }

.to-lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; }
.to-lb li {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 5px;
    padding: 4px 5px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.05);
    font-size: 9.5px;
}
.to-lb li.is-me { background: rgba(34, 211, 238, 0.13); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35); }
.to-lb li.to-empty { display: block; text-align: center; padding: 12px 4px; line-height: 1.7; }
.to-lb-rank { font-size: 11px; text-align: center; }
.to-lb-name { min-width: 0; font-weight: 800; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.to-lb-name em { display: block; font-style: normal; font-size: 8px; color: var(--to-muted); font-weight: 600; }
.to-lb-score { font-size: 9.5px; font-weight: 900; color: #fcd34d; font-variant-numeric: tabular-nums; }

/* ---------------- راهنما ---------------- */
.to-help {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(2, 5, 15, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 28px;
}
.to-help-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 86%;
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(4, 8, 20, 0.99));
    border: 1px solid rgba(34, 211, 238, 0.35);
}
.to-help-box h4 { margin: 0 0 10px; font-size: 15px; font-weight: 900; color: #a5f3fc; }
.to-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.to-help-grid > div { padding: 8px; border-radius: 11px; background: rgba(148, 163, 184, 0.06); border: 1px solid rgba(148, 163, 184, 0.14); }
.to-help-grid b { display: block; font-size: 10.5px; color: #e2e8f0; margin-bottom: 2px; }
.to-help-grid span { font-size: 9.5px; color: var(--to-muted); line-height: 1.7; }
.to-close { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 8px; background: rgba(148, 163, 184, 0.12); font-size: 12px; color: #cbd5e1; }

@keyframes to-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------------- ریسپانسیو ---------------- */
@media (max-width: 1080px) {
    .to-body { grid-template-columns: 140px minmax(0, 1fr) 172px; gap: 9px; }
    .to-stat-score strong { font-size: 21px; }
    .to-brand-txt p { display: none; }
}

@media (max-width: 880px) {
    .to-shell { padding: 11px; border-radius: 22px; }
    .to-body {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "main main" "a b";
        gap: 9px;
    }
    .to-main { grid-area: main; }
    .to-side-a { grid-area: a; }
    .to-side-b { grid-area: b; }
    .to-side-a, .to-side-b { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
    .to-side-a .to-keys { display: none; }
    .to-side-b .to-lb-card { grid-column: 1 / -1; }
    .to-side-b .to-relics-card { display: none; }
    .to-touch { display: grid; }
    .to-board-frame { max-width: 100%; }
    .to-boss { max-width: 100%; }
    .to-lb { max-height: 150px; }
    .to-lb-card { min-height: 0; }
    .to-help-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .to-shell { padding: 9px; border-radius: 18px; }
    .to-head { padding-bottom: 9px; }
    .to-brand-txt h3 { font-size: 13.5px; }
    .to-logo { width: 36px; height: 36px; font-size: 18px; border-radius: 12px; }
    .to-chip { font-size: 9px; padding: 5px 8px; }
    .to-ico { width: 29px; height: 29px; font-size: 12.5px; }
    .to-body { gap: 8px; }
    .to-side-a, .to-side-b { grid-template-columns: 1fr; }
    .to-side-b .to-skills { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
    .to-skill { grid-template-columns: 1fr; text-align: center; gap: 2px; padding: 6px 4px 9px; }
    .to-skill-txt em { display: none; }
    .to-skill-ico { font-size: 17px; }
    .to-skill-pct { font-size: 8.5px; }
    .to-touch { gap: 5px; }
    .to-touch button { padding: 7px 0; border-radius: 10px; }
    .to-touch button i { font-size: 15px; }
    .to-touch button span { font-size: 7px; }
    .to-panel { padding: 12px; }
    .to-panel h4 { font-size: 15px; }
    .to-mode b { font-size: 10.5px; }
    .to-mode span { font-size: 8.5px; }
    .to-hype b { font-size: 18px; }
    .to-final-score { font-size: 27px; }
    .to-boss-sub { display: none; }
    .to-boss-avatar { width: 36px; height: 36px; font-size: 19px; }
}

@media (max-height: 760px) and (min-width: 881px) {
    .to-keys { display: none; }
    .to-lb-card { min-height: 140px; }
    .to-lb { max-height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
    .to-hype.is-show { animation-duration: 0.9s; }
    .to-timer.is-danger { animation: none; }
    .to-play, .to-mode, .to-upgrade, .to-ico { transition: none; }
}
