/* ==========================================================================
   THE BUTTON — PRO: темы, скины кнопки, рамка аватара, реклама, модалки
   Базовая тема `cyber` — это штатный стиль сайта (#141526 / #ff2a6d / #05d9e8),
   поэтому правила ниже включаются только при body[data-ui-theme=gold|matrix|velvet].
   ========================================================================== */

/* ---------- ТЕМЫ: переменные ---------- */
body[data-ui-theme="gold"]   { --t-bg:#17120a; --t-card:#241b0c; --t-accent:#ffd24a; --t-hot:#d4a017; --t-text:#fff4d6; --t-muted:#b39a5c; }
body[data-ui-theme="matrix"] { --t-bg:#020a04; --t-card:#07160a; --t-accent:#39ff14; --t-hot:#00b32c; --t-text:#d6ffdb; --t-muted:#4f9a5a; }
body[data-ui-theme="velvet"] { --t-bg:#14081a; --t-card:#230f2f; --t-accent:#c77dff; --t-hot:#ff4d8d; --t-text:#f6e6ff; --t-muted:#9a78b0; }

/* ---------- ТЕМЫ: переменные верхних плашек (ФИДБЕК / профиль) ---------- */
body[data-ui-theme]:not([data-ui-theme="cyber"]) { --accent-primary: var(--t-accent); --accent-secondary: var(--t-hot); --card-bg: var(--t-card); }

/* ---------- ТЕМЫ: главное меню (index.html, цвета там захардкожены) ---------- */
body[data-ui-theme]:not([data-ui-theme="cyber"]) { background-color: var(--t-bg) !important; color: var(--t-text) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .menu-card { --menu-card-bg: var(--t-card); background: var(--menu-card-bg) !important; border-color: var(--t-accent) !important; box-shadow: 0 0 35px color-mix(in srgb, var(--t-accent) 25%, transparent) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) h1 { color: var(--t-accent) !important; text-shadow: 0 0 15px color-mix(in srgb, var(--t-accent) 60%, transparent) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .menu-btn:hover,
body[data-ui-theme]:not([data-ui-theme="cyber"]) .sub-btn:hover { border-color: var(--t-accent) !important; color: var(--t-accent) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .btn-main-play { background: linear-gradient(135deg, var(--t-hot), color-mix(in srgb, var(--t-hot) 55%, #000)) !important; color: #fff !important; border: none !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .window-panel { border-left-color: var(--t-hot) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .modal-panel { border-color: var(--t-accent) !important; background: var(--t-card) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .modal-title-text,
body[data-ui-theme]:not([data-ui-theme="cyber"]) .mode-status-text { color: var(--t-accent) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .compact-input:focus { border-color: var(--t-accent) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .code-display-box { border-color: var(--t-accent) !important; color: var(--t-accent) !important; }
body[data-ui-theme]:not([data-ui-theme="cyber"]) .btn-modal-action:not(.danger) { background: linear-gradient(135deg, var(--t-accent), var(--t-hot)) !important; color: #0d0e15 !important; }

/* ---------- ТЕМЫ: игровой экран (game.html, там есть CSS-переменные) ---------- */
body[data-ui-theme]:not([data-ui-theme="cyber"]) {
    --bg-color: var(--t-bg); --card-bg: var(--t-card);
    --accent-color: var(--t-hot); --accent-glow: var(--t-accent);
    --text-main: var(--t-text); --text-muted: var(--t-muted);
}
body[data-ui-theme]:not([data-ui-theme="cyber"]) .mode-chip.active { border-color: var(--t-accent); }
body[data-ui-theme="gold"]   .turn-card { box-shadow: 0 0 30px rgba(255,210,74,.12); }
body[data-ui-theme="matrix"] .turn-card { box-shadow: 0 0 30px rgba(57,255,20,.12); font-family: 'Courier New', monospace; }
body[data-ui-theme="velvet"] .turn-card { box-shadow: 0 0 30px rgba(199,125,255,.14); }

/* ---------- СКИНЫ ГЛАВНОЙ КНОПКИ (game.html) ---------- */
.main-action-btn { position: relative; }
.main-action-btn.skin-plasma {
    background: radial-gradient(circle at 35% 30%, #7df9ff 0%, #05d9e8 28%, #7b2cbf 70%, #2b0a4d 100%);
    border-color: transparent; color: #fff; text-shadow: 0 0 8px #fff;
    box-shadow: 0 0 18px 4px rgba(5,217,232,.75), 0 0 45px 14px rgba(123,44,191,.55), 0 8px 0 #1c0a38;
    animation: skinPlasma 1.8s ease-in-out infinite;
}
.main-action-btn.skin-plasma::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(5,217,232,.6); animation: skinPlasmaRing 1.8s ease-out infinite; pointer-events: none; }
.main-action-btn.skin-plasma:active { transform: translateY(6px); box-shadow: 0 0 14px 3px rgba(5,217,232,.8), 0 2px 0 #1c0a38; }
@keyframes skinPlasma { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.25); box-shadow: 0 0 28px 8px rgba(5,217,232,.9), 0 0 70px 24px rgba(123,44,191,.7), 0 8px 0 #1c0a38; } }
@keyframes skinPlasmaRing { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

.main-action-btn.skin-vip_gold {
    background: linear-gradient(135deg, #fff1a8 0%, #ffd24a 30%, #c98a00 62%, #7a4e00 100%);
    color: #3a2400; border-color: #fff1a8; text-shadow: 0 1px 0 rgba(255,255,255,.5); overflow: hidden;
    box-shadow: 0 8px 0 #6b4300, 0 15px 25px rgba(255,210,74,.45), inset 0 0 12px rgba(255,255,255,.5);
}
.main-action-btn.skin-vip_gold::after { content: ''; position: absolute; top: -20%; left: -60%; width: 40%; height: 140%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent); transform: skewX(-20deg); animation: skinShine 2.8s ease-in-out infinite; pointer-events: none; }
.main-action-btn.skin-vip_gold:active { box-shadow: 0 2px 0 #6b4300, 0 5px 10px rgba(255,210,74,.6); }
@keyframes skinShine { 0% { left: -60%; } 55%,100% { left: 130%; } }

.main-action-btn.skin-glitch {
    background: #05070a; color: #39ff14; border-color: #39ff14; font-family: 'Courier New', monospace;
    text-shadow: 2px 0 #ff2a6d, -2px 0 #05d9e8;
    box-shadow: 0 0 14px rgba(57,255,20,.6), 0 8px 0 #0a3d05;
    animation: skinGlitch 2.2s steps(1) infinite;
}
.main-action-btn.skin-glitch::before, .main-action-btn.skin-glitch::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; }
.main-action-btn.skin-glitch::before { background: repeating-linear-gradient(0deg, rgba(57,255,20,.0) 0 3px, rgba(57,255,20,.18) 3px 4px); }
.main-action-btn.skin-glitch::after { box-shadow: inset 4px 0 0 rgba(255,42,109,.7), inset -4px 0 0 rgba(5,217,232,.7); animation: skinGlitchSlice 2.2s steps(1) infinite; }
.main-action-btn.skin-glitch:active { box-shadow: 0 0 14px rgba(57,255,20,.8), 0 2px 0 #0a3d05; }
@keyframes skinGlitch { 0%,88%,100% { transform: translate(0,0); } 90% { transform: translate(-3px,1px) skewX(6deg); } 92% { transform: translate(3px,-1px) skewX(-6deg); } 94% { transform: translate(-2px,0); } 96% { transform: translate(2px,1px); } }
@keyframes skinGlitchSlice { 0%,88%,100% { clip-path: inset(0 0 0 0); } 90% { clip-path: inset(20% 0 55% 0); } 93% { clip-path: inset(60% 0 10% 0); } 96% { clip-path: inset(35% 0 40% 0); } }
.main-action-btn.pop-in.skin-plasma, .main-action-btn.pop-in.skin-glitch { animation-name: none; } /* не конфликтуем с popIn-обёрткой */

/* ---------- ЗОЛОТАЯ РАМКА АВАТАРА ДЛЯ PRO ---------- */
.avatar-pro-frame { border: 2px solid #ffd24a !important; box-shadow: 0 0 0 2px #7a4e00, 0 0 12px 2px rgba(255,210,74,.7) !important; background-clip: padding-box; }
.avatar-pro-wrap { position: relative; display: inline-block; line-height: 0; }
.avatar-pro-wrap::after { content: '👑'; position: absolute; top: -9px; right: -7px; font-size: 13px; line-height: 1; filter: drop-shadow(0 0 3px rgba(0,0,0,.8)); }

/* ---------- БЕЙДЖИ ---------- */
.pro-badge { display: inline-block; background: linear-gradient(135deg, #ffd24a, #c98a00); color: #3a2400; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 10px; letter-spacing: .5px; vertical-align: middle; }

/* ---------- РЕКЛАМНЫЕ СЛОТЫ ---------- */
.ad-slot { width: 100%; max-width: 100%; margin: 14px auto 0; display: flex; align-items: stretch; justify-content: center; box-sizing: border-box; overflow: hidden; }
.ad-slot > * { max-width: 100%; }
.ad-placeholder { position: relative; width: 100%; box-sizing: border-box; border: 1px dashed rgba(5,217,232,.4); background: linear-gradient(135deg, rgba(5,217,232,.06), rgba(255,42,109,.06)); border-radius: 12px; padding: 22px 12px 12px; text-align: center; color: #94a3b8; font-size: 12px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.ad-placeholder .ad-tag { position: absolute; top: 5px; left: 9px; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #64748b; }
.ad-placeholder .ad-body b { color: #05d9e8; }
.ad-placeholder .ad-remove { color: #ffd24a; font-size: 11px; font-weight: bold; text-decoration: none; }

/* ---------- МОДАЛКИ PRO / РЕЙТИНГ / ИЗБРАННОЕ ---------- */
.mp-overlay { display: none; position: fixed; inset: 0; background: rgba(5,6,12,.88); z-index: 100000; align-items: center; justify-content: center; padding: 14px; overflow-y: auto; backdrop-filter: blur(3px); }
.mp-overlay.open { display: flex; }
.mp-box { background: #141526; border: 1px solid #05d9e8; border-radius: 16px; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; padding: 20px; box-sizing: border-box; color: #e2e8f0; box-shadow: 0 10px 40px rgba(5,217,232,.18); margin: auto; text-align: left; font-family: sans-serif; }
.mp-box.gold { border-color: #ffd24a; box-shadow: 0 10px 40px rgba(255,210,74,.22); }
.mp-title { margin: 0 0 6px; font-size: 18px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: #05d9e8; text-align: center; }
.mp-box.gold .mp-title { color: #ffd24a; }
.mp-sub { text-align: center; color: #94a3b8; font-size: 12px; margin: 0 0 14px; line-height: 1.4; }
.mp-close { display: block; width: 100%; margin-top: 12px; background: #1e2230; border: 1px solid #334155; color: #cbd5e1; padding: 11px; border-radius: 10px; font-weight: bold; cursor: pointer; font-size: 12px; text-transform: uppercase; }
.mp-btn { display: block; width: 100%; margin-top: 10px; background: linear-gradient(135deg, #ffd24a, #c98a00); color: #2b1a00; border: none; padding: 12px; border-radius: 10px; font-weight: 900; cursor: pointer; font-size: 13px; text-transform: uppercase; }
.mp-btn.pink { background: linear-gradient(135deg, #ff2a6d, #b3003b); color: #fff; }
.mp-btn[disabled] { opacity: .5; cursor: not-allowed; }
.mp-perks { list-style: none; padding: 0; margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: #cbd5e1; }
.mp-perks li { padding: 5px 0 5px 4px; border-bottom: 1px solid rgba(255,255,255,.05); }
.mp-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mp-plan { background: #1b1e30; border: 1px solid #334155; border-radius: 12px; padding: 12px 6px; text-align: center; cursor: pointer; color: #e2e8f0; font-family: inherit; }
.mp-plan:hover { border-color: #ffd24a; }
.mp-plan.best { border-color: #ffd24a; box-shadow: 0 0 14px rgba(255,210,74,.25); }
.mp-plan .pn { font-size: 11px; text-transform: uppercase; color: #94a3b8; letter-spacing: .5px; }
.mp-plan .pp { font-size: 17px; font-weight: 900; color: #ffd24a; margin-top: 4px; }
.mp-promo-row { display: flex; gap: 8px; }
.mp-promo-row input { flex: 1; min-width: 0; background: #242938; border: 1px solid #334155; color: #fff; padding: 11px; border-radius: 8px; font-size: 14px; text-transform: uppercase; box-sizing: border-box; }
.mp-promo-row button { background: #05d9e8; color: #04222a; border: none; padding: 0 16px; border-radius: 8px; font-weight: 900; cursor: pointer; }
.mp-msg { font-size: 12px; margin-top: 8px; min-height: 16px; text-align: center; }
.mp-msg.ok { color: #00ffaa; } .mp-msg.err { color: #ff5577; }

/* таблица рейтинга */
.lb-row { display: flex; align-items: center; gap: 10px; background: #1b1e30; border-radius: 10px; padding: 8px 10px; margin-bottom: 7px; border: 1px solid transparent; }
.lb-row.top1 { border-color: #ffd24a; } .lb-row.top2 { border-color: #cbd5e1; } .lb-row.top3 { border-color: #cd7f32; }
.lb-rank { width: 28px; text-align: center; font-weight: 900; color: #05d9e8; font-size: 15px; flex-shrink: 0; }
.lb-av { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: #0f172a; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: bold; font-size: 14px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-status { font-size: 11px; color: #94a3b8; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cups { font-weight: 900; color: #ffd24a; font-size: 14px; white-space: nowrap; }

/* блок кастомизации в настройках */
.cz-block { border: 1px solid rgba(255,210,74,.35); border-radius: 12px; padding: 12px; background: rgba(255,210,74,.04); margin-bottom: 16px; }
.cz-title { font-size: 13px; font-weight: 900; color: #ffd24a; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.cz-label { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin: 10px 0 6px; font-weight: bold; }
.cz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cz-item { position: relative; background: #1b1e30; border: 2px solid #334155; border-radius: 10px; padding: 10px 6px; text-align: center; font-size: 12px; color: #e2e8f0; cursor: pointer; font-family: inherit; }
.cz-item.active { border-color: #05d9e8; box-shadow: 0 0 10px rgba(5,217,232,.35); }
.cz-item.locked { opacity: .8; }
.cz-item .lock { position: absolute; top: 3px; right: 5px; font-size: 11px; }
.cz-sw { display: block; height: 22px; border-radius: 6px; margin-bottom: 6px; border: 1px solid rgba(255,255,255,.15); }
.cz-sw.t-cyber  { background: linear-gradient(90deg,#141526 40%,#ff2a6d 40% 70%,#05d9e8 70%); }
.cz-sw.t-gold   { background: linear-gradient(90deg,#17120a 40%,#d4a017 40% 70%,#ffd24a 70%); }
.cz-sw.t-matrix { background: linear-gradient(90deg,#020a04 40%,#00b32c 40% 70%,#39ff14 70%); }
.cz-sw.t-velvet { background: linear-gradient(90deg,#14081a 40%,#ff4d8d 40% 70%,#c77dff 70%); }
.cz-sw.s-classic  { background: radial-gradient(circle at 35% 30%, #ff5a8c, #990033); }
.cz-sw.s-plasma   { background: radial-gradient(circle at 35% 30%, #7df9ff, #05d9e8 30%, #7b2cbf 80%); box-shadow: 0 0 10px #05d9e8; }
.cz-sw.s-vip_gold { background: linear-gradient(135deg,#fff1a8,#ffd24a 35%,#c98a00 70%,#7a4e00); }
.cz-sw.s-glitch   { background: #05070a; box-shadow: inset 3px 0 #ff2a6d, inset -3px 0 #05d9e8; }
.cz-sw.m { background: linear-gradient(90deg,#1b1e30,#334155); height: 8px; }
.cz-select { width: 100%; background: #242938; border: 1px solid #334155; color: #fff; padding: 10px; border-radius: 8px; font-size: 13px; box-sizing: border-box; }
.cz-note { font-size: 11px; color: #94a3b8; margin-top: 8px; line-height: 1.4; }
.cz-preview-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: #141526; border: 1px solid #ffd24a; color: #fff; padding: 10px 14px; border-radius: 12px; z-index: 100001; display: none; align-items: center; gap: 10px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.6); max-width: calc(100vw - 24px); box-sizing: border-box; }
.cz-preview-bar.open { display: flex; }
.cz-preview-bar button { background: linear-gradient(135deg,#ffd24a,#c98a00); color: #2b1a00; border: none; padding: 7px 12px; border-radius: 8px; font-weight: 900; cursor: pointer; font-size: 12px; white-space: nowrap; }
.cz-preview-bar .cnt { font-weight: 900; color: #ffd24a; min-width: 18px; text-align: center; }

/* кнопки 📸 ⭐ рядом с заданием */
.task-tools { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.task-tool-btn { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15); color: #fff; width: 44px; height: 40px; border-radius: 10px; font-size: 18px; cursor: pointer; transition: transform .1s, background .2s; }
.task-tool-btn:active { transform: scale(.92); }
.task-tool-btn.on { background: rgba(255,210,74,.2); border-color: #ffd24a; }

/* кнопки звука в шапке игры */
.hdr-tools { display: flex; gap: 6px; align-items: center; }
.hdr-tool { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: var(--text-main, #fff); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; padding: 0; }
.hdr-tool.off { opacity: .45; text-decoration: line-through; }

/* избранное в Personal Hub */
.fav-card { background: #1b1e30; border-left: 3px solid #ffd24a; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.fav-card .ft { font-size: 14px; color: #fff; line-height: 1.4; }
.fav-card .fc { font-size: 12px; color: #05d9e8; font-style: italic; margin-top: 4px; }
.fav-card .fd { background: none; border: none; color: #ff5577; cursor: pointer; float: right; font-size: 16px; padding: 0 0 0 8px; }

/* подвал */
.site-footer { margin-top: 18px; font-size: 11px; color: #64748b; text-align: center; line-height: 1.8; }
.site-footer a { color: #94a3b8; text-decoration: none; margin: 0 6px; }
.site-footer a:hover { color: #05d9e8; }

/* страницы /terms /privacy */
.legal-wrap { max-width: 760px; margin: 0 auto; background: #151722; border: 1px solid #05d9e8; border-radius: 20px; padding: 28px 24px; box-shadow: 0 0 35px rgba(5,217,232,.15); line-height: 1.65; font-size: 14px; color: #cbd5e1; }
.legal-wrap h1 { font-size: 22px; letter-spacing: 2px; margin: 0 0 4px; color: #05d9e8; text-transform: uppercase; }
.legal-wrap h2 { font-size: 15px; color: #ff2a6d; margin: 22px 0 6px; text-transform: uppercase; letter-spacing: 1px; }
.legal-wrap a { color: #05d9e8; }
.legal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.legal-top a.back { text-decoration: none; font-weight: bold; font-size: 13px; }
.legal-lang span { cursor: pointer; padding: 4px 8px; border: 1px solid #334155; border-radius: 6px; font-size: 11px; font-weight: bold; color: #94a3b8; margin-left: 4px; }
.legal-lang span.active { color: #05d9e8; border-color: #05d9e8; }

@media (max-width: 420px) {
    .mp-plans { grid-template-columns: 1fr; }
    .cz-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .main-action-btn.skin-plasma, .main-action-btn.skin-plasma::before, .main-action-btn.skin-vip_gold::after,
    .main-action-btn.skin-glitch, .main-action-btn.skin-glitch::after { animation: none !important; }
}

/* демо-кнопка в блоке кастомизации (index.html) */
.cz-demo-btn { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #141526; background: linear-gradient(135deg, #ff0055 0%, #990033 100%); color: #fff; font-size: 1.1rem; font-weight: 900; box-shadow: 0 6px 0 #660022, 0 12px 20px rgba(255,0,85,.4); cursor: default; padding: 0; }
.cz-demo-btn.skin-plasma, .cz-demo-btn.skin-vip_gold, .cz-demo-btn.skin-glitch { margin: 8px 0; }

/* итоги матча: карточка не должна выходить за экран из-за рекламы */
.stats-card { max-height: 94vh; overflow-y: auto; }
