/* ── CSS variables (overridden at runtime from Telegram theme) ─────────────── */
:root {
  --bg:#fff; --bg2:#f4f4f5; --surface:#fff; --border:#e4e4e7;
  --text:#18181b; --text2:#71717a; --accent:#6366f1; --accent-l:#eef2ff;
  --premium:#f59e0b; --red:#ef4444; --green:#10b981; --radius:14px;
  --theme-btn-bg:#f4f4f5;
}

/* ── Dark mode ──────────────────────────────────────────────────────────────── */
body.dark {
  --bg:#18181b; --bg2:#27272a; --surface:#1c1c1f; --border:#3f3f46;
  --text:#fafafa; --text2:#a1a1aa; --accent-l:#2e2e52; --theme-btn-bg:#3f3f46;
}
/* Explicit plan-card overrides so dark mode is guaranteed regardless of Telegram theme */
body.dark .plan-card { background:var(--surface); }
body.dark .plan-card.featured { background:#3f3f7f; border-color:#6366f1; }
body.dark .plan-card .plan-name,
body.dark .plan-card .plan-desc { color:var(--text2); }
body.dark .plan-card.featured .plan-name { color:#fff; font-weight:800; }
body.dark .plan-card.featured .plan-desc { color:#c7d2fe; }
body.dark .plan-card.featured .plan-price { color:#fbbf24; font-weight:800; }
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;overflow-x:hidden}

/* ── Header ────────────────────────────────────────────────────────────────── */
.header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px 10px;border-bottom:1px solid var(--border);background:var(--surface);position:sticky;top:0;z-index:10}
.header h1{font-size:19px;font-weight:700}.header h1 span{color:var(--accent)}
.header-right{display:flex;align-items:center;gap:8px}
.plan-badge{font-size:11px;font-weight:700;padding:3px 8px;border-radius:10px;background:var(--bg2);color:var(--text2);cursor:pointer;transition:opacity .15s}.plan-badge:hover{opacity:.8}
.plan-badge.pro{background:var(--premium);color:#fff}
.lang-btns{display:flex;gap:3px}
.lang-btn{border:none;cursor:pointer;border-radius:7px;font-size:11px;font-weight:600;padding:3px 7px;background:var(--bg2);color:var(--text2);transition:all .15s}
.lang-btn.active{background:var(--accent);color:#fff}

/* ── Usage bar ─────────────────────────────────────────────────────────────── */
.usage-bar{background:var(--bg2);padding:7px 16px;font-size:12px;color:var(--text2);display:flex;gap:14px;align-items:center}
.usage-item{display:flex;align-items:center;gap:4px}
.usage-dot{width:6px;height:6px;border-radius:50%;background:var(--green)}
.usage-dot.warn{background:var(--premium)}.usage-dot.full{background:var(--red)}
.usage-bar a{color:var(--accent);font-weight:600;text-decoration:none;margin-left:auto;font-size:11px}

/* ── Tab navigation ─────────────────────────────────────────────────────────── */
.tab-nav{display:flex;gap:4px;background:var(--surface);border-bottom:1px solid var(--border);padding:0 8px;position:sticky;top:53px;z-index:9;overflow-x:auto;scrollbar-width:none}
.tab-nav::-webkit-scrollbar{display:none}
.tab-btn{flex:0 0 auto;min-width:max-content;border:none;background:none;cursor:pointer;padding:10px 8px 8px;font-size:12px;font-weight:500;color:var(--text2);border-bottom:2px solid transparent;transition:all .15s;white-space:nowrap}
.tab-btn.active{color:var(--accent);border-bottom-color:var(--accent)}

/* ── Category chips ─────────────────────────────────────────────────────────── */
.cats{display:flex;gap:7px;overflow-x:auto;padding:10px 16px 7px;scrollbar-width:none}
.cats::-webkit-scrollbar{display:none}
.cat-chip{border:1px solid var(--border);border-radius:20px;padding:5px 13px;font-size:12px;cursor:pointer;white-space:nowrap;background:var(--surface);color:var(--text2);transition:all .15s}
.cat-chip.active{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ── Template grid ──────────────────────────────────────────────────────────── */
.template-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:8px 16px 100px}
.tpl-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px 11px;cursor:pointer;transition:all .15s;position:relative;display:flex;flex-direction:column;gap:5px}
.tpl-card:active{transform:scale(.97)}
.tpl-emoji{font-size:26px}
.tpl-name{font-size:12px;font-weight:600;line-height:1.3}
.tpl-cat{font-size:11px;color:var(--text2)}
.badge-premium{position:absolute;top:7px;right:7px;background:var(--premium);color:#fff;font-size:9px;font-weight:700;padding:2px 5px;border-radius:8px}
.badge-beta{background:var(--green);color:#fff;font-size:8px;font-weight:700;padding:1px 4px;border-radius:6px;vertical-align:middle;margin-left:3px}

/* ── Builder ────────────────────────────────────────────────────────────────── */
.builder{padding:14px 16px 100px;display:flex;flex-direction:column;gap:12px}
label{font-size:12px;font-weight:600;color:var(--text2);display:block;margin-bottom:4px}
input[type=text],input[type=url],textarea,select{width:100%;border:1px solid var(--border);border-radius:10px;padding:9px 11px;font-size:14px;background:var(--surface);color:var(--text);font-family:inherit;outline:none;transition:border-color .15s}
input:focus,textarea:focus,select:focus{border-color:var(--accent)}
textarea{min-height:90px;resize:vertical}
select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2371717a' d='M5 7L0 2h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 11px center}
.char-count{font-size:11px;color:var(--text2);text-align:right;margin-top:2px}
.img-preview{width:100%;max-height:160px;object-fit:cover;border-radius:10px;margin-top:6px;display:none}
.img-preview.show{display:block}

/* ── Music picker ───────────────────────────────────────────────────────────── */
.music-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:6px}
.music-chip{border:1px solid var(--border);border-radius:10px;padding:8px 4px;text-align:center;cursor:pointer;font-size:11px;transition:all .15s;background:var(--surface)}
.music-chip .mc-emoji{font-size:18px;display:block;margin-bottom:2px}
.music-chip.active{border-color:var(--accent);background:var(--accent-l);color:var(--accent);font-weight:600}

/* ── AI box ─────────────────────────────────────────────────────────────────── */
.ai-box{background:var(--bg2);border-radius:var(--radius);padding:12px}
.ai-box label{color:var(--accent)}
.ai-row{display:flex;gap:7px;margin-bottom:8px}
.ai-row select{flex:1}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn{border:none;border-radius:10px;padding:11px 18px;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s;width:100%}
.btn-primary{background:var(--accent);color:#fff}.btn-primary:disabled{opacity:.5;cursor:not-allowed}
.btn-secondary{background:var(--bg2);color:var(--text)}
.btn-outline{background:none;border:1px solid var(--border);color:var(--text2)}
.btn-sm{padding:7px 12px;font-size:12px;width:auto}
.btn-danger{background:var(--red);color:#fff}
.btn-green{background:var(--green);color:#fff}
.row-btns{display:flex;gap:8px}.row-btns .btn{flex:1}

/* ── Drafts ─────────────────────────────────────────────────────────────────── */
.drafts-list{padding:10px 16px 100px;display:flex;flex-direction:column;gap:10px}
.draft-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:13px;display:flex;flex-direction:column;gap:5px}
.draft-title{font-size:14px;font-weight:600}
.draft-body{font-size:12px;color:var(--text2);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}
.draft-actions{display:flex;gap:5px;margin-top:3px}
.draft-date{font-size:11px;color:var(--text2)}

/* ── Profile / Feedback tab ─────────────────────────────────────────────────── */
.profile-section{padding:14px 16px 100px;display:flex;flex-direction:column;gap:14px}
.profile-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px}
.profile-card h3{font-size:14px;font-weight:700;margin-bottom:10px;color:var(--text2)}
.info-row{display:flex;justify-content:space-between;align-items:center;padding:5px 0;font-size:13px}
.info-row span:last-child{font-weight:600}
.feedback-list{display:flex;flex-direction:column;gap:8px}
.fb-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px;display:flex;flex-direction:column;gap:4px}
.fb-title{font-size:13px;font-weight:600}
.fb-meta{font-size:11px;color:var(--text2);display:flex;gap:8px}
.fb-status{font-size:10px;font-weight:700;padding:2px 7px;border-radius:8px;background:var(--bg2)}
.fb-status.open{background:#dbeafe;color:#1d4ed8}
.fb-status.reviewing{background:#fef3c7;color:#92400e}
.fb-status.done{background:#d1fae5;color:#065f46}
.fb-type-badge{font-size:10px;padding:2px 6px;border-radius:6px;background:var(--bg2);color:var(--text2)}

/* ── Modals ──────────────────────────────────────────────────────────────────── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100;display:flex;align-items:flex-end}
.modal-overlay.hidden{display:none}
.modal-sheet{background:var(--surface);border-radius:20px 20px 0 0;width:100%;max-height:90vh;overflow-y:auto;padding:18px 16px 40px;display:flex;flex-direction:column;gap:12px}
.modal-handle{width:36px;height:4px;background:var(--border);border-radius:2px;margin:0 auto 6px}
.modal-title{font-size:17px;font-weight:700;display:flex;align-items:center;gap:7px}
.modal-close{margin-left:auto;background:none;border:none;font-size:19px;cursor:pointer;color:var(--text2)}

/* ── Paywall ─────────────────────────────────────────────────────────────────── */
.paywall-header{text-align:center;padding:8px 0 4px}
.paywall-header .big{font-size:40px}
.paywall-header h2{font-size:18px;font-weight:700;margin-top:6px}
.paywall-header p{font-size:13px;color:var(--text2);margin-top:4px}
.plan-cards{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.plan-card{border:1px solid var(--border);border-radius:var(--radius);padding:13px 14px;cursor:pointer;transition:all .15s;display:flex;align-items:center;justify-content:space-between}
.plan-card.featured{border-color:var(--accent);background:var(--accent-l)}
.plan-card:active{transform:scale(.98)}
.plan-name{font-size:14px;font-weight:700}
.plan-desc{font-size:12px;color:var(--text2);margin-top:1px}
.plan-price{font-size:15px;font-weight:800;color:var(--accent);white-space:nowrap;text-align:right}
.plan-price small{font-size:11px;font-weight:500;color:var(--text2)}

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast{position:fixed;bottom:76px;left:50%;transform:translateX(-50%);background:#18181b;color:#fff;padding:9px 18px;border-radius:20px;font-size:13px;font-weight:500;z-index:300;opacity:0;transition:opacity .2s;pointer-events:none;white-space:nowrap;max-width:90vw}
.toast.show{opacity:1}

/* ── Hot / New / Popular badges on templates ─────────────────────────────────── */
.badge-hot{position:absolute;top:7px;right:7px;background:#ef4444;color:#fff;font-size:9px;font-weight:700;padding:2px 5px;border-radius:8px}
.badge-new{position:absolute;top:7px;right:7px;background:var(--green);color:#fff;font-size:9px;font-weight:700;padding:2px 5px;border-radius:8px}
.badge-popular{position:absolute;top:7px;right:7px;background:#8b5cf6;color:#fff;font-size:9px;font-weight:700;padding:2px 5px;border-radius:8px}

/* ── Media type + source pickers ─────────────────────────────────────────────── */
.media-type-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.media-type-btn{flex:1;min-width:60px;border:1.5px solid var(--border);border-radius:20px;background:var(--surface);color:var(--text2);font-size:12px;font-weight:600;padding:6px 10px;cursor:pointer;transition:all .15s;white-space:nowrap;text-align:center}
.media-type-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.media-source-row{display:flex;gap:5px;margin-bottom:8px}
.media-source-btn{border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text2);font-size:11px;font-weight:600;padding:4px 12px;cursor:pointer;transition:all .15s}
.media-source-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.size-limit-hint{font-size:10px;color:var(--text2);margin-top:4px;text-align:right}
.size-limit-hint a{color:var(--accent);text-decoration:none}

/* ── Image/media upload box ──────────────────────────────────────────────────── */
.upload-box{border:1.5px dashed var(--border);border-radius:10px;padding:14px;text-align:center;cursor:pointer;transition:border-color .15s;position:relative}
.upload-box:hover{border-color:var(--accent)}
.upload-hint{font-size:13px;color:var(--text2)}
.upload-box .img-preview{margin-top:8px}

/* ── Admin panel ─────────────────────────────────────────────────────────────── */
.admin-section{padding:10px 16px 100px;display:flex;flex-direction:column;gap:12px}
.admin-tabs{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:6px}
.admin-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px}
.admin-card h3{font-size:13px;font-weight:700;color:var(--text2);margin-bottom:10px;text-transform:uppercase;letter-spacing:.5px}
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat-item{background:var(--bg2);border-radius:10px;padding:10px 8px;text-align:center}
.stat-num{font-size:20px;font-weight:800;color:var(--accent)}
.stat-lbl{font-size:10px;color:var(--text2);margin-top:2px}
.user-row{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border);font-size:13px}
.user-row:last-child{border-bottom:none}
.user-info{display:flex;flex-direction:column;gap:2px}
.user-name{font-weight:600}
.user-meta{font-size:11px;color:var(--text2)}
.user-actions{display:flex;gap:5px}
.admin-fb-card{background:var(--bg2);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:6px;margin-bottom:7px}
.admin-status-sel{border:1px solid var(--border);border-radius:7px;padding:4px 8px;font-size:12px;background:var(--surface);color:var(--text)}
.badge-blocked{font-size:9px;background:var(--red);color:#fff;padding:2px 5px;border-radius:6px;font-weight:700}

/* ── Theme toggle ────────────────────────────────────────────────────────────── */
.theme-btn{border:none;cursor:pointer;border-radius:8px;padding:4px 8px;font-size:16px;background:var(--theme-btn-bg);color:var(--text);transition:all .15s;line-height:1}

/* ── Visibility switch ───────────────────────────────────────────────────────── */
.vis-switch{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text2);cursor:pointer;user-select:none}
.vis-switch input[type=checkbox]{width:34px;height:20px;appearance:none;border-radius:10px;background:var(--border);cursor:pointer;position:relative;transition:background .2s;flex-shrink:0}
.vis-switch input[type=checkbox]:checked{background:var(--accent)}
.vis-switch input[type=checkbox]::after{content:'';position:absolute;width:14px;height:14px;background:#fff;border-radius:50%;top:3px;left:3px;transition:left .2s}
.vis-switch input[type=checkbox]:checked::after{left:17px}
.vis-label{font-size:11px;font-weight:600}

/* ── Community Tabriks ───────────────────────────────────────────────────────── */
.tabriks-list{padding:10px 16px 100px;display:flex;flex-direction:column;gap:10px}
.tabrik-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:13px;display:flex;flex-direction:column;gap:6px}
.tabrik-head-row{display:flex;align-items:flex-start;gap:10px}
.tabrik-head-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}
.tabrik-thumb{width:48px;height:48px;border-radius:12px;object-fit:cover;border:1px solid var(--border);flex-shrink:0}
.tabrik-thumb-emoji{width:48px;height:48px;border-radius:12px;border:1px solid var(--border);background:var(--bg2);display:grid;place-items:center;font-size:24px;flex-shrink:0}
.tabrik-title{font-size:14px;font-weight:600}
.tabrik-body{font-size:12px;color:var(--text2);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical}
.tabrik-meta{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--text2)}
.tabrik-author{font-weight:600}
.tabrik-uses{color:var(--accent)}

/* ── Feedback voting ─────────────────────────────────────────────────────────── */
.vote-row{display:flex;align-items:center;gap:8px;margin-top:4px}
.vote-btn{border:1px solid var(--border);background:var(--bg2);border-radius:8px;padding:3px 10px;font-size:13px;cursor:pointer;transition:all .15s;display:flex;align-items:center;gap:4px;color:var(--text2)}
.vote-btn.up.active{background:#d1fae5;border-color:var(--green);color:#065f46}
.vote-btn.down.active{background:#fee2e2;border-color:var(--red);color:#991b1b}
.vote-btn:hover{border-color:var(--accent)}
.vote-score{font-size:13px;font-weight:700;min-width:24px;text-align:center;color:var(--text)}

/* ── Public feedback tabs ─────────────────────────────────────────────────────── */
.sub-tabs{display:flex;gap:6px;padding:10px 16px 4px;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none}
.sub-tabs::-webkit-scrollbar{display:none}
.sub-tab{border:none;background:none;cursor:pointer;padding:6px 14px;font-size:12px;font-weight:500;color:var(--text2);border-radius:20px;transition:all .15s;white-space:nowrap}
.sub-tab.active{background:var(--accent);color:#fff}

/* ── Misc ────────────────────────────────────────────────────────────────────── */
.empty{text-align:center;padding:50px 20px;color:var(--text2)}
.empty .big{font-size:44px;margin-bottom:10px}
.empty p{font-size:14px;line-height:1.6}
.spinner{text-align:center;padding:36px;color:var(--text2);font-size:22px}
.footer{text-align:center;padding:14px 16px 60px;font-size:11px;color:var(--text2)}
.footer a{color:var(--accent);text-decoration:none}
.section-pad{padding:0 16px 100px}

/* ── Games (Lobby + 4 mini games) ─────────────────────────────────────────── */
.game-lobby{padding:14px 16px 100px}
.game-header-title{font-size:20px;font-weight:800;letter-spacing:-.2px}
.game-subtitle{margin-top:4px;font-size:13px;color:var(--text2)}
.game-grid{margin-top:12px;display:grid;grid-template-columns:1fr 1fr;gap:10px}
.game-card{position:relative;background:linear-gradient(160deg,var(--surface),var(--bg2));border:1px solid var(--border);border-radius:16px;padding:12px;cursor:pointer;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease;min-height:118px;display:flex;flex-direction:column;justify-content:space-between}
.game-card:active{transform:scale(.98)}
.game-card:hover{border-color:var(--accent);box-shadow:0 8px 18px rgba(0,0,0,.07)}
.game-card-emoji{font-size:30px;line-height:1}
.game-card-name{margin-top:8px;font-size:13px;font-weight:700}
.game-card-desc{margin-top:4px;font-size:11px;color:var(--text2);line-height:1.35}
.game-card-badge{position:absolute;top:10px;right:10px;background:var(--accent-l);color:var(--accent);font-size:10px;font-weight:700;padding:2px 7px;border-radius:999px;min-width:24px;text-align:center}
.game-rewards-strip{margin-top:12px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--text2);background:var(--bg2);border:1px solid var(--border);padding:10px 11px;border-radius:12px}
.game-rewards-strip > span{background:var(--surface);border:1px solid var(--border);padding:4px 8px;border-radius:999px;color:var(--text)}

.game-screen-header{display:flex;align-items:center;gap:10px;padding:12px 16px 8px}
#game-screen-title{font-weight:800;font-size:16px}
.game-back-btn{border:none;border-radius:10px;padding:7px 11px;background:var(--bg2);color:var(--text);font-size:12px;font-weight:700;cursor:pointer}
#game-content{padding:4px 16px 100px}
.game-error{background:#fee2e2;color:#991b1b;border-radius:10px;padding:10px 12px;font-size:13px}

/* Daily spin */
.spin-container{display:flex;flex-direction:column;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:14px}
.spin-wheel-wrap{position:relative;display:grid;place-items:center}
.spin-pointer{position:absolute;top:-12px;left:50%;transform:translateX(-50%);font-size:17px;color:var(--accent);font-weight:800;text-shadow:0 1px 0 #fff}
#spin-canvas{width:280px;height:280px;max-width:100%;background:var(--bg2);border-radius:50%;border:2px solid var(--border);box-shadow:inset 0 0 0 4px rgba(255,255,255,.35)}
.spin-center-btn{position:absolute;width:34px;height:34px;border-radius:50%;background:#fff;border:2px solid var(--border);box-shadow:0 2px 8px rgba(0,0,0,.14)}
.spin-info{text-align:center}
.spin-count{font-size:13px;font-weight:700}
.game-spin-btn{max-width:260px}
.spin-result{width:100%}
.spin-result-inner{background:var(--bg2);border:1px solid var(--border);border-radius:13px;padding:10px 12px;text-align:center}
.spin-result-emoji{font-size:26px}
.spin-result-label{margin-top:4px;font-size:14px;font-weight:800}
.spin-result-reward{margin-top:5px;font-size:12px;color:var(--green);font-weight:700}

/* Emoji match */
.match-container{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:12px}
.match-header{display:flex;justify-content:space-between;font-size:12px;font-weight:700;color:var(--text2);margin-bottom:10px}
.match-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.match-card{aspect-ratio:1/1;perspective:700px;cursor:pointer}
.match-card-inner{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .36s ease}
.match-card.flipped .match-card-inner,.match-card.matched .match-card-inner{transform:rotateY(180deg)}
.match-card-front,.match-card-back{position:absolute;inset:0;display:grid;place-items:center;border-radius:12px;backface-visibility:hidden;font-size:24px}
.match-card-front{background:linear-gradient(160deg,var(--accent-l),var(--bg2));border:1px solid var(--border)}
.match-card-back{background:var(--surface);border:1px solid var(--accent);transform:rotateY(180deg)}
.match-card.matched .match-card-back{background:#ecfdf5;border-color:var(--green)}

/* Quiz */
.quiz-container{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:13px}
.quiz-header{display:flex;flex-direction:column;gap:8px}
.quiz-progress{height:8px;background:var(--bg2);border-radius:999px;overflow:hidden}
.quiz-progress-bar{height:100%;background:linear-gradient(90deg,#10b981,var(--accent));transition:width .25s ease}
.quiz-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--text2);font-weight:700}
.quiz-question{margin-top:8px;font-size:15px;font-weight:700;line-height:1.4}
.quiz-options{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.quiz-option{border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text);text-align:left;padding:10px 11px;display:flex;align-items:center;gap:9px;font-size:13px;font-weight:600;cursor:pointer;transition:all .13s}
.quiz-option:active{transform:scale(.99)}
.quiz-option.correct{border-color:var(--green);background:#ecfdf5;color:#065f46}
.quiz-option.wrong{border-color:var(--red);background:#fef2f2;color:#991b1b}
.quiz-opt-letter{display:grid;place-items:center;width:22px;height:22px;border-radius:999px;background:var(--bg2);color:var(--text2);font-size:11px;font-weight:800;flex-shrink:0}

/* Tap rush */
.tap-container{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:14px;display:flex;flex-direction:column;align-items:center;gap:10px}
.tap-countdown{font-size:24px;font-weight:900;color:var(--accent);letter-spacing:.8px}
.tap-score-display{text-align:center}
.tap-count{font-size:38px;font-weight:900;line-height:1}
.tap-label{font-size:12px;color:var(--text2);font-weight:700}
.tap-timer-bar-wrap{width:100%;height:10px;background:var(--bg2);border-radius:999px;overflow:hidden;border:1px solid var(--border)}
.tap-timer-bar{height:100%;background:linear-gradient(90deg,#f59e0b,#ef4444);transition:width .05s linear}
.tap-big-btn{width:min(280px,100%);height:180px;border-radius:18px;background:linear-gradient(160deg,var(--accent),#4f46e5);display:grid;place-items:center;color:#fff;font-size:58px;font-weight:900;user-select:none;touch-action:manipulation;box-shadow:0 10px 24px rgba(79,70,229,.32);transition:transform .08s ease,filter .12s ease}
.tap-big-btn:active{transform:scale(.98)}
.tap-rank{min-height:22px}
.tap-rank-badge{display:inline-flex;align-items:center;gap:6px;background:var(--bg2);border:1px solid var(--border);padding:5px 10px;border-radius:999px;font-size:12px;font-weight:800}

/* Shared result */
.game-result{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:14px;text-align:center}
.result-new-best{display:inline-block;background:#ecfdf5;border:1px solid var(--green);color:#065f46;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:800}
.result-score{margin-top:8px;font-size:42px;font-weight:900;line-height:1;color:var(--accent)}
.result-best{margin-top:4px;font-size:13px;color:var(--text2);font-weight:700}
.result-extra{margin-top:7px;font-size:13px;font-weight:700}
.result-reward{margin-top:8px;color:var(--green);font-size:13px;font-weight:800}
.result-actions{margin-top:10px;display:flex;gap:8px}
.result-actions .btn{flex:1}

@media (max-width:360px){
  .game-grid{grid-template-columns:1fr}
  .tap-big-btn{height:160px;font-size:50px}
}
