/* style.css — الأرنوبة الشقية (unified design system) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@500;700;800;900&display=swap');

:root {
    --bg: #070b14;
    --panel-a: rgba(22, 32, 56, 0.97);
    --panel-b: rgba(11, 17, 32, 0.98);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --orange: #fb923c;
    --pink: #f43f5e;
    --gold: #fbbf24;
    --green: #22c55e;
    --cyan: #22d3ee;
    --grad: linear-gradient(135deg, #ff8a00 0%, #f43f5e 100%);
    --radius: 22px;
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior: none;
}

body { position: fixed; inset: 0; }

button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button, .tc-btn, .pill, .chip, .tab { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; user-select: none; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

#app { position: fixed; inset: 0; overflow: hidden; }

#gameCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* ==================== SCREENS ==================== */
.screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    padding: max(12px, var(--sat)) max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.screen > * { margin: auto; }

.screen-bg {
    background:
        radial-gradient(1100px 560px at 50% -12%, rgba(124, 58, 237, 0.35), transparent 60%),
        radial-gradient(900px 520px at 105% 115%, rgba(234, 88, 12, 0.28), transparent 55%),
        var(--bg);
}

.screen-dim {
    z-index: 60;
    background: rgba(4, 7, 15, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.panel {
    width: 100%;
    background: linear-gradient(160deg, var(--panel-a), var(--panel-b));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* ==================== TYPOGRAPHY / BUTTONS ==================== */
.brand-title {
    font-weight: 900;
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    line-height: 1.2;
    background: linear-gradient(90deg, #fde047, #fb923c 55%, #f43f5e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-title.sm { font-size: clamp(1.15rem, 2.2vw, 1.55rem); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 22px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    white-space: nowrap;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(244, 63, 94, 0.32); }
.btn-primary:not(:disabled):hover { box-shadow: 0 14px 32px rgba(244, 63, 94, 0.5); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.btn-ghost:not(:disabled):hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line-strong); }
.btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn-block { width: 100%; }

.icon-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: rgba(10, 15, 30, 0.82);
    border: 1px solid var(--line);
    transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: rgba(30, 41, 59, 0.9); }

.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.4);
    color: #fdba74;
    font-weight: 800;
    font-size: 0.82rem;
}

.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==================== BOOT ==================== */
.boot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--orange);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== AUTH ==================== */
.auth-panel {
    max-width: 860px;
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    overflow: hidden;
}
.auth-hero { position: relative; background: #0b1220; min-height: 100%; }
.auth-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-hero-tag {
    position: absolute; left: 12px; right: 12px; bottom: 12px;
    padding: 6px 10px; border-radius: 12px; text-align: center;
    background: rgba(7, 11, 20, 0.82); border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--gold); font-weight: 800; font-size: 0.9rem;
}
.auth-body { padding: 28px 30px; display: flex; flex-direction: column; gap: 12px; }

.seg {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    padding: 5px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
.seg-btn { padding: 9px 10px; border-radius: 10px; font-weight: 800; color: var(--muted); transition: background 0.15s, color 0.15s; }
.seg-btn.active { background: var(--grad); color: #fff; }

#auth-form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 0.85rem; font-weight: 700; color: #cbd5e1; }
.field input {
    width: 100%;
    font-family: inherit;
    font-size: 16px; /* prevents iOS zoom on focus */
    color: var(--text);
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--line-strong);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2); }
.form-error { min-height: 1.2em; color: #fda4af; font-weight: 700; font-size: 0.88rem; }
.auth-mode { font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ==================== INTRO ==================== */
.intro-panel {
    max-width: 880px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 26px;
    padding: 28px;
    align-items: center;
}
.intro-visual {
    aspect-ratio: 3 / 4;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.25);
    animation: float 2.6s ease-in-out infinite alternate;
}
.intro-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes float { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-8px) rotate(1deg); } }
.intro-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.intro-title { font-size: clamp(1.35rem, 2.6vw, 2rem); font-weight: 900; color: #fde047; line-height: 1.3; }
.intro-text { font-size: clamp(0.95rem, 1.5vw, 1.12rem); line-height: 1.8; color: #e2e8f0; }
.dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); transition: all 0.25s; }
.dot.active { width: 30px; background: var(--gold); }

/* ==================== HUB ==================== */
.hub {
    max-width: 1120px;
    height: min(780px, 100%);
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    gap: 12px;
}
.hub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; border: 2px solid var(--gold); flex-shrink: 0; }
.hub-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
    font-weight: 800; font-size: 0.95rem; white-space: nowrap;
}
.chip-carrot { border-color: rgba(251, 146, 60, 0.45); color: #fdba74; }
.chip-gold { border-color: rgba(251, 191, 36, 0.45); color: #fde047; }

.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto;
    padding: 10px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
    color: #cbd5e1; font-weight: 800; font-size: 0.95rem; white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tab.active { background: linear-gradient(135deg, rgba(255, 138, 0, 0.22), rgba(244, 63, 94, 0.22)); border-color: var(--orange); color: #fff; }

.hub-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 146, 60, 0.5) transparent;
}
.hub-content::-webkit-scrollbar { width: 6px; }
.hub-content::-webkit-scrollbar-thumb { background: rgba(251, 146, 60, 0.5); border-radius: 99px; }

.hub-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    padding-top: 12px; border-top: 1px solid var(--line); flex-shrink: 0;
}
.controls-hint { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.controls-hint kbd {
    font-family: inherit; font-weight: 800; color: #fff;
    padding: 1px 8px; border-radius: 6px;
    background: rgba(255, 255, 255, 0.1); border-bottom: 2px solid rgba(255, 255, 255, 0.25);
}

.world-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.world-bar::-webkit-scrollbar { display: none; }
.world-btn {
    flex-shrink: 0; padding: 6px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
    font-weight: 800; font-size: 0.85rem; color: #cbd5e1; white-space: nowrap;
}
.world-btn.active { background: var(--grad); border-color: transparent; color: #fff; }
.world-btn.locked { opacity: 0.55; }

.grid { display: grid; gap: 12px; }
.grid-levels { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.level-card {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 14px 8px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    text-align: center;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.level-card:not(.locked):hover { transform: translateY(-3px); border-color: var(--line-strong); }
.level-card.selected { border-color: var(--green); background: rgba(34, 197, 94, 0.1); box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25) inset; }
.level-card.locked { opacity: 0.45; cursor: not-allowed; }
.level-num { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.level-icon { font-size: 1.1rem; }
.level-stars { font-size: 0.85rem; letter-spacing: 1px; color: var(--gold); }
.level-meta { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.level-lock { position: absolute; top: 8px; left: 8px; font-size: 0.8rem; }

.card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.card.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2) inset; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-ico {
    width: 50px; height: 50px; flex-shrink: 0; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.06);
}
.card-title { font-weight: 900; font-size: 1.02rem; line-height: 1.35; }
.card-sub { font-size: 0.8rem; color: #fde047; font-weight: 800; }
.card-desc { font-size: 0.85rem; color: #cbd5e1; line-height: 1.55; flex: 1; }
.skin-preview {
    height: 70px; border-radius: 12px; border: 1px solid var(--line-strong);
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.lvl-dots { display: flex; gap: 5px; }
.lvl-dots i { width: 18px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); }
.lvl-dots i.on { background: var(--green); }

.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
    display: grid; grid-template-columns: 44px 1fr auto auto auto; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
    font-weight: 800;
}
.lb-row.me { border-color: var(--orange); background: rgba(251, 146, 60, 0.1); }
.lb-rank { font-size: 1.15rem; text-align: center; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stat { font-size: 0.85rem; color: #cbd5e1; white-space: nowrap; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ==================== MODALS ==================== */
.modal { max-width: 440px; padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.modal-ico { font-size: 2.6rem; }
.modal-title { font-size: 1.55rem; font-weight: 900; line-height: 1.35; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.result-img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
.result-stars { font-size: 2.2rem; letter-spacing: 4px; }
.result-stats {
    width: 100%; padding: 12px 14px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
    line-height: 1.8; font-size: 0.95rem;
}
.result-stats b { color: #fdba74; }

/* ==================== HUD ==================== */
.hud {
    position: absolute; top: 0; left: 0; right: 0; z-index: 20;
    display: flex; flex-direction: column; gap: 6px;
    padding: max(10px, var(--sat)) max(12px, var(--sar)) 0 max(12px, var(--sal));
    pointer-events: none;
}
.hud-row { display: flex; align-items: center; gap: 10px; }
.hud-stats, .hud-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; flex-shrink: 0; }
.pill {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 14px; border-radius: 999px;
    background: rgba(7, 11, 22, 0.9); border: 1px solid var(--line);
    transition: transform 0.12s, border-color 0.12s;
    will-change: transform;
}
.pill.bump { transform: scale(1.1); border-color: var(--gold); }
.pill-ico { font-size: 1.15rem; }
.pill-txt small { display: block; font-size: 0.66rem; color: var(--muted); font-weight: 700; line-height: 1.2; }
.pill-txt b { display: block; font-size: 1rem; font-weight: 900; line-height: 1.25; white-space: nowrap; }
.pill-carrot b { color: #fdba74; }

.hud-progress {
    flex: 1; min-width: 0; max-width: 560px; margin: 0 auto;
    direction: ltr;
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(7, 11, 22, 0.72); border: 1px solid var(--line);
}
.hud-level { font-weight: 900; font-size: 0.8rem; color: #86efac; white-space: nowrap; direction: rtl; }
.track { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); position: relative; }
.fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #22c55e, #fbbf24, #f97316); }
.runner { position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%); font-size: 1rem; line-height: 1; }
.hud-flag { font-size: 1rem; }

.hud-powerups { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pu {
    padding: 3px 12px; border-radius: 999px;
    background: rgba(7, 11, 22, 0.82); border: 1px solid rgba(251, 191, 36, 0.55);
    font-size: 0.78rem; font-weight: 800;
}
.pu.cyan { border-color: rgba(34, 211, 238, 0.6); }

/* ==================== TOUCH CONTROLS ==================== */
.touch-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 25;
    direction: ltr;
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 0 max(18px, var(--sar)) max(14px, var(--sab)) max(18px, var(--sal));
    pointer-events: none;
}
html:not(.is-touch) .touch-controls { display: none !important; }
.tc-group { display: flex; align-items: flex-end; gap: 12px; pointer-events: auto; }
.tc-btn {
    width: 66px; height: 66px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: rgba(7, 11, 22, 0.55); border: 2px solid rgba(255, 255, 255, 0.35);
    font-size: 1.45rem; line-height: 1;
    touch-action: none;
    transition: transform 0.08s, background 0.08s, opacity 0.2s;
}
.tc-btn small { font-size: 0.6rem; font-weight: 800; color: #fde047; }
.tc-btn.is-down { transform: scale(0.9); background: rgba(251, 146, 60, 0.7); border-color: var(--gold); }
.tc-jump { width: 80px; height: 80px; font-size: 1.7rem; }
.tc-dash { border-color: rgba(34, 211, 238, 0.7); }
.tc-dash.cooldown { opacity: 0.4; }

/* ==================== ROTATE OVERLAY ==================== */
.rotate-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 30px; text-align: center;
    background: radial-gradient(circle at 50% 40%, #1e1b4b, #020617 75%);
}
.rotate-overlay h2 { font-size: 1.6rem; font-weight: 900; color: #fde047; }
.rotate-overlay p { color: #cbd5e1; line-height: 1.7; max-width: 320px; }
.rotate-ios-hint { font-size: 0.82rem; color: var(--muted) !important; }
.rotate-phone { font-size: 4.2rem; animation: rotatePhone 1.8s ease-in-out infinite; }
@keyframes rotatePhone { 0%, 20% { transform: rotate(0deg); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }

/* ==================== TOAST ==================== */
.toast {
    position: fixed; z-index: 200;
    left: 50%; bottom: max(20px, var(--sab));
    transform: translateX(-50%);
    max-width: min(90vw, 480px);
    padding: 10px 18px; border-radius: 14px;
    background: rgba(15, 23, 42, 0.96); border: 1px solid var(--line-strong);
    font-weight: 800; font-size: 0.9rem; text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 760px) {
    .auth-panel { grid-template-columns: 1fr; }
    .auth-hero { height: 170px; min-height: 0; }
    .intro-panel { grid-template-columns: 1fr; padding: 20px; text-align: center; }
    .intro-visual { width: 150px; margin: 0 auto; }
    .intro-body { align-items: center; }
    .hud-row { flex-wrap: wrap; }
    .hud-progress { order: 3; flex-basis: 100%; max-width: none; }
    .lb-row { grid-template-columns: 36px 1fr auto; }
    .lb-row .lb-stat:nth-child(4), .lb-row .lb-stat:nth-child(5) { display: none; }
}

/* Short screens = phones in landscape */
@media (max-height: 520px) {
    .screen { padding: max(8px, var(--sat)) max(10px, var(--sar)) max(8px, var(--sab)) max(10px, var(--sal)); }
    .btn { min-height: 38px; padding: 7px 16px; font-size: 0.9rem; border-radius: 12px; }
    .icon-btn { width: 34px; height: 34px; font-size: 0.9rem; border-radius: 10px; }

    .auth-panel { grid-template-columns: 210px 1fr; max-width: 760px; }
    .auth-hero { height: auto; min-height: 100%; }
    .auth-hero-tag { display: none; }
    .auth-body { padding: 14px 18px; gap: 8px; }
    .auth-body > p.muted { display: none; }
    .brand-title { font-size: 1.4rem; }
    .seg-btn { padding: 6px 8px; font-size: 0.88rem; }
    .field > span { font-size: 0.78rem; }
    .field input { padding: 7px 12px; }
    #auth-form { gap: 6px; }

    .intro-panel { grid-template-columns: 150px 1fr; padding: 16px; gap: 16px; text-align: right; }
    .intro-visual { width: auto; }
    .intro-body { align-items: flex-start; gap: 8px; }
    .intro-text { line-height: 1.6; }

    .hub { padding: 10px 14px; gap: 8px; height: 100%; }
    .avatar { width: 38px; height: 38px; border-radius: 12px; }
    .hub-brand .small { font-size: 0.75rem; }
    .chip { padding: 4px 10px; font-size: 0.82rem; }
    .tab { padding: 6px 12px; font-size: 0.85rem; }
    .hub-foot { padding-top: 8px; }
    .controls-hint { display: none; }
    .hub-foot .row-actions { width: 100%; }
    .hub-foot .btn-play { flex: 1; }
    .world-bar { padding-bottom: 6px; }
    .grid-levels { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
    .level-card { padding: 8px 6px; }
    .level-num { font-size: 1.25rem; }
    .grid-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
    .card { padding: 10px; gap: 6px; }
    .skin-preview { height: 46px; font-size: 1.5rem; }

    .modal { padding: 14px 18px; gap: 6px; max-width: 560px; }
    .modal-ico { font-size: 1.8rem; }
    .modal-title { font-size: 1.15rem; }
    .result-img { width: 56px; height: 56px; }
    .result-stars { font-size: 1.5rem; }
    .result-stats { padding: 8px 12px; font-size: 0.85rem; line-height: 1.6; }
    .modal-actions { flex-direction: row; }
    .modal-actions .btn { flex: 1; }

    .hud { padding-top: max(6px, var(--sat)); gap: 4px; }
    .hud-row { gap: 6px; }
    .hud-stats, .hud-actions { gap: 5px; }
    .pill { padding: 3px 10px; gap: 5px; }
    .pill-ico { font-size: 0.95rem; }
    .pill-txt small { display: none; }
    .pill-txt b { font-size: 0.88rem; }
    .hud-progress { padding: 4px 10px; gap: 6px; }
    .pu { font-size: 0.7rem; padding: 2px 9px; }

    .tc-btn { width: 56px; height: 56px; font-size: 1.2rem; }
    .tc-jump { width: 68px; height: 68px; font-size: 1.45rem; }
    .tc-btn small { font-size: 0.55rem; }
}
