:root {
    --accent: #ff7a45;
    --accent-dark: #e8592a;
    --accent-glow: rgba(255, 122, 69, 0.35);
    --cyan: #a78bfa;
    --bg-panel: #171022;
    --bg-input: #1c1428;
    --border: #332a42;
    --border-hover: #4a3d5c;
    --text-dim: #a1a1aa;

    --bg-body-1: #0a0710;
    --bg-body-2: #1e1233;
    --bg-body-3: #2d1542;
    --bg-body-4: #170e28;
    --bg-body-5: #3b1840;
}

body:has(input[value="cyan"]:checked) {
    --accent: #00f2fe;
    --accent-dark: #00c6ff;
    --accent-glow: rgba(0, 242, 254, 0.35);
    --cyan: #38ef7d;
    --bg-panel: #091a24;
    --bg-input: #0e2433;
    --border: #1a3a52;
    --border-hover: #29587a;

    --bg-body-1: #03131d;
    --bg-body-2: #092537;
    --bg-body-3: #0c3852;
    --bg-body-4: #081d2c;
    --bg-body-5: #0a4566;
}

body:has(input[value="emerald"]:checked) {
    --accent: #10b981;
    --accent-dark: #059669;
    --accent-glow: rgba(16, 185, 129, 0.35);
    --cyan: #34d399;
    --bg-panel: #062016;
    --bg-input: #0b2e20;
    --border: #154d36;
    --border-hover: #1e6b4c;

    --bg-body-1: #02170f;
    --bg-body-2: #072e1f;
    --bg-body-3: #0e442f;
    --bg-body-4: #052418;
    --bg-body-5: #11573c;
}

body:has(input[value="crimson"]:checked) {
    --accent: #f43f5e;
    --accent-dark: #e11d48;
    --accent-glow: rgba(244, 63, 94, 0.35);
    --cyan: #fb7185;
    --bg-panel: #200810;
    --bg-input: #2e0d18;
    --border: #4d1829;
    --border-hover: #6e243c;

    --bg-body-1: #1a0309;
    --bg-body-2: #330815;
    --bg-body-3: #4d0d21;
    --bg-body-4: #26050e;
    --bg-body-5: #610e28;
}

body:has(input[value="gold"]:checked) {
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-glow: rgba(245, 158, 11, 0.35);
    --cyan: #fef08a;
    --bg-panel: #1f1807;
    --bg-input: #2d220a;
    --border: #4a3a14;
    --border-hover: #6e561e;

    --bg-body-1: #140d02;
    --bg-body-2: #2b1c05;
    --bg-body-3: #422c08;
    --bg-body-4: #1f1403;
    --bg-body-5: #573a0b;
}

body:has(input[value="pink"]:checked) {
    --accent: #ec4899;
    --accent-dark: #db2777;
    --accent-glow: rgba(236, 72, 153, 0.35);
    --cyan: #f472b6;
    --bg-panel: #220819;
    --bg-input: #310c24;
    --border: #52183d;
    --border-hover: #752358;

    --bg-body-1: #170211;
    --bg-body-2: #2e0522;
    --bg-body-3: #450833;
    --bg-body-4: #210318;
    --bg-body-5: #5c0a44;
}

body:has(input[value="midnight"]:checked) {
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --cyan: #60a5fa;
    --bg-panel: #0a1329;
    --bg-input: #0f1c3d;
    --border: #1e3261;
    --border-hover: #2b478a;

    --bg-body-1: #030817;
    --bg-body-2: #081230;
    --bg-body-3: #0d1e4a;
    --bg-body-4: #050d24;
    --bg-body-5: #112863;
}

body:has(input[value="lime"]:checked) {
    --accent: #84cc16;
    --accent-dark: #65a30d;
    --accent-glow: rgba(132, 204, 22, 0.35);
    --cyan: #a3e635;
    --bg-panel: #121f07;
    --bg-input: #1a2e0a;
    --border: #2e4d14;
    --border-hover: #436e1e;

    --bg-body-1: #0b1403;
    --bg-body-2: #172906;
    --bg-body-3: #223d0a;
    --bg-body-4: #111f04;
    --bg-body-5: #2d520d;
}

/* Satisfying Blue — matches the main website palette */
body:has(input[value="satisfying"]:checked) {
    --accent: #5EEBFF;
    --accent-dark: #00c6e0;
    --accent-glow: rgba(94, 235, 255, 0.35);
    --cyan: #A78BFA;
    --bg-panel: #0B0D16;
    --bg-input: #10131F;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.18);
    --text-dim: #8B93B3;

    --bg-body-1: #030308;
    --bg-body-2: #080b14;
    --bg-body-3: #0d1120;
    --bg-body-4: #060810;
    --bg-body-5: #111628;
}

* { box-sizing: border-box; }

/* Page reveal on load — curtain slides down and away */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

body {
    animation: pageIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    margin: 0;
    background: linear-gradient(
        -45deg,
        var(--bg-body-1),
        var(--bg-body-2),
        var(--bg-body-3),
        var(--bg-body-4),
        var(--bg-body-5),
        var(--bg-body-2),
        var(--bg-body-1)
    );
    background-size: 400% 400%;
    animation: smoothFlow 35s ease infinite;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 80px 20px 20px;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

@keyframes smoothFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== PAGE TRANSITION (curtain slide) ===== */
@keyframes curtainIn {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
@keyframes curtainOut {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
}

#page-transition {
    position: fixed; top: 0; left: 0; right: 0; height: 100vh;
    z-index: 99999; pointer-events: none;
    background: linear-gradient(160deg, #030308 60%, #0d1120 100%);
    transform: translateY(-100%);
}
#page-transition.active {
    pointer-events: all;
    animation: curtainIn 0.42s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

/* ===== GAME NAVBAR ===== */
#game-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 58px;
    background: rgba(8, 5, 14, 0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav-logo {
    display: inline-flex; align-items: center;
    font-size: 19px; font-weight: 900; letter-spacing: -0.5px;
    text-decoration: none; cursor: pointer; flex-shrink: 0;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.8; }

.nav-center-links {
    display: flex; align-items: center; gap: 24px;
}

.nav-link {
    font-size: 13px; font-weight: 500; color: var(--text-dim);
    text-decoration: none; cursor: pointer; transition: color 0.2s;
}
.nav-link:hover { color: #fff; }

.nav-right-group {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.nav-btn {
    border: none; cursor: pointer; font-size: 12px; font-weight: 600;
    border-radius: 8px; padding: 6px 13px; transition: all 0.2s; white-space: nowrap;
}
.nav-btn-login {
    background: transparent; border: 1px solid var(--border-hover); color: var(--text-dim);
}
.nav-btn-login:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn-feedback {
    background: var(--accent-glow);
    border: 1px solid var(--border-hover);
    color: var(--accent); font-size: 11px;
    transition: border-color 0.2s, background 0.2s;
}
.nav-btn-feedback:hover { border-color: var(--accent); }

/* ===== THEME DROPDOWN (hamburger) ===== */
.theme-menu-details { position: relative; }

.theme-menu-summary {
    display: flex; align-items: center; gap: 7px;
    cursor: pointer; user-select: none; list-style: none;
    background: transparent; border: 1px solid var(--border-hover);
    color: var(--text-dim); border-radius: 8px; padding: 6px 12px;
    font-size: 12px; font-weight: 600; transition: all 0.2s; white-space: nowrap;
}
.theme-menu-summary::-webkit-details-marker { display: none; }
.theme-menu-summary:hover { border-color: var(--accent); color: var(--accent); }

.hamburger-icon {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 14px; height: 10px; flex-shrink: 0;
}
.hamburger-icon span {
    display: block; height: 2px; border-radius: 2px;
    background: currentColor; transition: background 0.2s;
}

.theme-menu-content {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 195px; background: var(--bg-panel);
    border: 1px solid var(--border-hover); border-radius: 12px;
    padding: 10px 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.7);
    z-index: 100;
    overflow: hidden; max-height: 0; opacity: 0; pointer-events: none;
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.22s, padding 0.22s;
}
.theme-menu-details[open] .theme-menu-content {
    max-height: 380px; opacity: 1; pointer-events: all;
}

.theme-menu-title {
    font-size: 11px; font-weight: 700; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.5px;
    display: block; margin-bottom: 6px; padding: 0 4px;
}

.theme-option {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: #e4e4e7; cursor: pointer;
    padding: 5px 6px; border-radius: 6px; transition: background 0.15s;
}
.theme-option:hover { background: rgba(255,255,255,0.06); }

.theme-dot {
    width: 13px; height: 13px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}

/* Animated shimmer on theme dots */
@keyframes dotPulse { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.5) saturate(1.3)} }
.theme-option:nth-child(2) .theme-dot { animation: dotPulse 2s 0.0s infinite; }
.theme-option:nth-child(3) .theme-dot { animation: dotPulse 2s 0.25s infinite; }
.theme-option:nth-child(4) .theme-dot { animation: dotPulse 2s 0.5s infinite; }
.theme-option:nth-child(5) .theme-dot { animation: dotPulse 2s 0.75s infinite; }
.theme-option:nth-child(6) .theme-dot { animation: dotPulse 2s 1.0s infinite; }
.theme-option:nth-child(7) .theme-dot { animation: dotPulse 2s 1.25s infinite; }
.theme-option:nth-child(8) .theme-dot { animation: dotPulse 2s 1.5s infinite; }
.theme-option:nth-child(9) .theme-dot { animation: dotPulse 2s 1.75s infinite; }

/* ===== GAME MODALS ===== */
@keyframes modalPop {
    from { transform: scale(0.92) translateY(12px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.game-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,0.78); backdrop-filter: blur(8px);
    align-items: center; justify-content: center; padding: 16px;
}
.game-modal-overlay.active { display: flex; }

.game-modal-box {
    position: relative; background: var(--bg-panel);
    border: 1px solid var(--border-hover); border-radius: 18px;
    padding: 28px 26px; max-width: 420px; width: 100%;
    animation: modalPop 0.28s cubic-bezier(0.34,1.56,0.64,1);
    max-height: 90vh; overflow-y: auto;
}

/* slim dark scrollbar for tall windows (Account settings, Pricing) */
.game-modal-box { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }
.game-modal-box::-webkit-scrollbar { width: 8px; }
.game-modal-box::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
.game-modal-box::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 8px; }
.game-modal-box::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.game-modal-close {
    position: absolute; top: 14px; right: 18px;
    background: none; border: none; color: var(--text-dim);
    font-size: 22px; cursor: pointer; line-height: 1; transition: color 0.2s;
}
.game-modal-close:hover { color: #fff; }

.game-modal-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.game-modal-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; }

/* Pricing */
.gp-billing-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.gp-billing-btn {
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-dim); border-radius: 8px; padding: 6px 12px;
    font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 5px;
}
.gp-billing-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-color: var(--accent); color: #fff;
}
.gp-save-badge {
    background: rgba(255,90,168,0.8); color: #fff;
    border-radius: 4px; padding: 1px 5px; font-size: 10px;
}
.gp-plan-card {
    background: var(--bg-input); border: 1px solid var(--border-hover);
    border-radius: 14px; padding: 20px;
}
.gp-popular-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    color: #fff; font-size: 10px; font-weight: 800;
    letter-spacing: 0.8px; border-radius: 20px; padding: 3px 10px; margin-bottom: 10px;
}
.gp-plan-name { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.gp-plan-price { font-size: 42px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 16px; }
.gp-plan-price #gpPrice { transition: opacity 0.18s; }
.gp-plan-period { font-size: 14px; color: var(--text-dim); }
.gp-features {
    list-style: none; padding: 0; margin: 0 0 18px;
    font-size: 13px; color: #fff; display: flex; flex-direction: column; gap: 7px;
}
.gp-features .gp-dim { color: var(--text-dim); }
.gp-cta-btn {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--accent));
    color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.gp-cta-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Forms */
.game-form { display: flex; flex-direction: column; gap: 14px; }
.game-form-label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.game-form-input {
    width: 100%; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px; color: #fff; font-size: 13px;
    outline: none; transition: border-color 0.2s; font-family: inherit; resize: vertical;
}
.game-form-input:focus { border-color: var(--accent); }
.game-form-input option { background: var(--bg-panel); }
.game-form-optional { color: var(--text-dim); font-size: 11px; font-weight: 400; }
.feedback-success-msg {
    display: none; color: #4ade80; font-size: 13px; text-align: center; padding: 4px 0;
}

.default-dot { background: linear-gradient(135deg, #a78bfa, #ff7a45); }
.cyan-dot { background: linear-gradient(135deg, #38ef7d, #00f2fe); }
.emerald-dot { background: linear-gradient(135deg, #34d399, #10b981); }
.crimson-dot { background: linear-gradient(135deg, #fb7185, #f43f5e); }
.gold-dot { background: linear-gradient(135deg, #fef08a, #f59e0b); }
.pink-dot { background: linear-gradient(135deg, #f472b6, #ec4899); }
.midnight-dot { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.lime-dot { background: linear-gradient(135deg, #a3e635, #84cc16); }
.satisfying-dot { background: linear-gradient(135deg, #5EEBFF, #A78BFA); }

#app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(24, 16, 32, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 22px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 1px rgba(255,255,255,0.15);
    gap: 20px;
    max-width: 1050px;
    width: 95%;
    border: 1px solid rgba(255,255,255,0.08);
}

#brand-header {
    width: 100%;
    text-align: center;
    padding: 4px 0 10px 0;
    user-select: none;
}

.brand-tagline {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    margin-top: 2px;
    opacity: 0.75;
}

.brand-title {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -1.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 25px rgba(255, 122, 69, 0.25);
}

.brand-word-satisfying {
    background: linear-gradient(135deg, #ffffff 20%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-word-labs {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 6px;
    font-weight: 800;
}

#main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
}

#controls-panel {
    width: 340px;
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-input) 100%);
    padding: 18px;
    border-radius: 14px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 4px 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

#controls-panel::-webkit-scrollbar { width: 6px; }
#controls-panel::-webkit-scrollbar-track { background: var(--bg-panel); }
#controls-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
#controls-panel::-webkit-scrollbar-thumb:hover { background: var(--accent); }

h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff 0%, var(--accent) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.btn-record, .btn-action {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-record::before, .btn-action::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.5s ease;
    z-index: -1;
}
.btn-record:hover::before, .btn-action:hover::before { transform: translateX(120%); }

.btn-record {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #000;
    border: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    flex: 1;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-record:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-record:active { transform: translateY(0) scale(0.98); }
.btn-record.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    animation: pulse 1.5s infinite;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(0.99); }
    100% { opacity: 1; transform: scale(1); }
}

.search-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    width: 100%;
    outline: none;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}
.search-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

#gui-manager {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 5px;
    transition: border-color 0.2s ease;
}
#gui-manager:hover { border-color: var(--border-hover); }
#gui-manager-header { font-size: 13px; font-weight: bold; color: #e4e4e7; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
#gui-manager-content { display: none; flex-direction: column; gap: 6px; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.gui-checkbox-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #aaa; transition: color 0.15s; }
.gui-checkbox-row:hover { color: #fff; }

.menu-section { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.section-header:hover { color: var(--accent); background: rgba(255,255,255,0.03); }
.section-content { display: none; flex-direction: column; gap: 10px; padding: 6px 4px 12px 4px; animation: fadeIn 0.2s ease; }
.section-content.open { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.mode-box {
    background: var(--bg-input);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border);
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.mode-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.mode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 6px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    transition: transform 0.18s cubic-bezier(0.4,0,0.2,1), border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.mode-card .mode-icon { font-size: 20px; }
.mode-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.mode-card:active { transform: translateY(-1px) scale(0.97); }
.mode-card.active {
    background: linear-gradient(155deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.2) 100%);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 1px var(--accent) inset, 0 6px 18px var(--accent-glow);
}
.mode-card.active::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--accent);
}

.btn-action {
    background: var(--bg-panel);
    color: #fff;
    border: 1px solid var(--border);
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.btn-action:hover {
    background: var(--bg-input);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.btn-action:active { transform: translateY(0) scale(0.97); }
.btn-green { background: linear-gradient(135deg, #15803d 0%, #166534 100%); border-color: #16a34a; }
.btn-green:hover { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); border-color: #22c55e; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25); }
.btn-red { background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%); border-color: #dc2626; }
.btn-red:hover { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); border-color: #ef4444; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25); }

.btn-group { display: flex; gap: 8px; width: 100%; }
.btn-group .btn-action { flex: 1; }

label { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; width: 100%; transition: color 0.2s; }
label:hover { color: #e4e4e7; }

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 24px;
    border-radius: 12px;
    background: var(--accent);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 24px;
    border-radius: 12px;
    background: var(--accent);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="color"] { background: transparent; border: none; padding: 0; width: 28px; height: 28px; cursor: pointer; border-radius: 6px; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid var(--border-hover);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    vertical-align: middle;
}
input[type="checkbox"]:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

input[type="file"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 6px;
    color: var(--text-dim);
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.2s;
    max-width: 160px;
}
input[type="file"]:hover { border-color: var(--border-hover); color: #fff; }
input[type="file"]::-webkit-file-upload-button {
    background: var(--accent);
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 6px;
    transition: background 0.2s;
}
input[type="file"]::-webkit-file-upload-button:hover { background: var(--accent-dark); }
input[type="file"]::file-selector-button {
    background: var(--accent);
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 6px;
    transition: background 0.2s;
}
input[type="file"]::file-selector-button:hover { background: var(--accent-dark); }

input[type="text"] { outline: none; }

select {
    background: var(--bg-panel);
    color: #fff;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    width: 130px;
    cursor: pointer;
    transition: all 0.2s;
}
select:focus, select:hover { border-color: var(--accent); }

#canvas-area { display: flex; flex-direction: column; align-items: center; gap: 10px; }
canvas {
    box-shadow: 0 0 30px var(--accent-glow), 0 20px 40px rgba(0,0,0,0.8);
    border-radius: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    width: 550px;
    height: 550px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
canvas:hover {
    border-color: var(--accent);
    box-shadow: 0 0 35px var(--accent-glow), 0 20px 40px rgba(0,0,0,0.8);
}

@media (max-width: 800px) {
    body { padding: 70px 10px 10px; align-items: flex-start; }
    #app-container { padding: 15px; gap: 15px; }
    #main-content { flex-direction: column; }
    #controls-panel { width: 100%; max-height: none; overflow: visible; order: 2; }
    #canvas-area { width: 100%; order: 1; }
    .nav-center-links { display: none; }
    .nav-btn-feedback { display: none; }
    #game-navbar { padding: 0 14px; }
}

/* --- SOUND ASSET LIBRARY TILES UI --- */
.sound-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.sound-tile {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sound-tile:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: var(--bg-input);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.sound-tile:active {
    transform: translateY(0) scale(0.98);
}

/* Active Highlight for selected sound tile */
.sound-tile.active-sound {
    background: linear-gradient(155deg, rgba(16, 185, 129, 0.15) 0%, rgba(0, 0, 0, 0.25) 100%);
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981 inset, 0 4px 15px rgba(16, 185, 129, 0.3);
}

.sound-tile.active-sound::after {
    content: "✓";
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 11px;
    font-weight: bold;
    color: #10b981;
}

.sound-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.sound-tile-header strong {
    color: #f3f4f6;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sound-preview-btn {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    color: #fff;
    border: 1px solid #22c55e;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    padding: 0;
    line-height: 1;
}

.sound-preview-btn:hover {
    transform: scale(1.15);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.sound-tile-desc {
    color: var(--text-dim);
    font-size: 10px;
    margin-top: 4px;
}

/* --- ADVANCED SETTINGS TOGGLE: tagged options stay in place, only hidden --- */
body.hide-advanced .adv-setting { display: none !important; }
.advanced-toggle-row {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 5px;
    transition: border-color 0.2s ease;
}
.advanced-toggle-row:hover { border-color: var(--border-hover); }

/* --- WALL COUNT vs CLOCK SPIKES notice --- */
.wall-notice {
    background: var(--bg-input);
    border: 1px dashed var(--border-hover);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-dim);
}
.wall-notice.is-warning { border: 1px solid #f59e0b; color: #fbbf24; background: rgba(245, 158, 11, 0.12); }

/* --- BOUNCE SOUND ROWS (global block, library and per-ball cards) --- */
#globalBounceAudioBlock, .snd-block { display: flex; flex-direction: column; gap: 10px; }
.snd-row { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; width: 100%; }
.snd-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 11px;
}
.snd-name {
    flex: 1;
    min-width: 0;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.snd-name.is-set { color: #a3e635; font-weight: 600; }
.snd-remove {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    border: 1px solid #dc2626;
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s, opacity 0.15s;
}
.snd-remove:hover:not(:disabled) { filter: brightness(1.2); }
.snd-remove:disabled { opacity: 0.35; cursor: not-allowed; }
.snd-pick-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; width: 100%; }
.snd-pick-btn { padding: 5px 10px; font-size: 11px; white-space: nowrap; }
.snd-lib-select { width: 120px; flex: 1; min-width: 0; padding: 5px 8px; font-size: 11px; }
.snd-mode-select { width: 180px; padding: 6px 8px; }
.snd-note {
    background: var(--bg-input);
    border: 1px dashed var(--border-hover);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-dim);
}

/* Phones / touch: bigger tap targets for the buttons and dropdowns added to the panel */
@media (max-width: 800px), (pointer: coarse) {
    .snd-remove { min-height: 34px; padding: 6px 12px; font-size: 11px; }
    .snd-pick-btn { min-height: 36px; padding: 8px 14px; font-size: 12px; }
    .snd-lib-select, .snd-mode-select, #secExport select { min-height: 36px; font-size: 13px; }
    .export-name-input { min-height: 36px; font-size: 13px; }
    .advanced-toggle-row { min-height: 44px; }
    .wall-notice, .snd-note { font-size: 12px; }
    .app-menu-item, .app-menu-sub > summary { padding-top: 12px; padding-bottom: 12px; }
    .acc-btn { min-height: 44px; }
}

/* --- VIDEO EXPORT SECTION --- */
.export-name-input {
    width: 150px;
    background: var(--bg-panel);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    box-sizing: border-box;
}
.export-name-input:focus { border-color: var(--accent); }
#secExport select { width: 150px; }
#secExport select:disabled, #secExport input:disabled { opacity: 0.5; cursor: not-allowed; }
.export-summary {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
}
.export-note { font-size: 10px; color: var(--text-dim); line-height: 1.4; }
#brand-footer {
    width: 100%;
    text-align: center;
    padding: 14px 0 10px 0;
    user-select: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 8px;
}

.brand-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.brand-footer-logo {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
}

.brand-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.brand-footer-link {
    color: var(--accent);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.brand-footer-link:hover { opacity: 1; text-decoration: underline; }

.brand-footer-sep {
    color: var(--text-dim);
    opacity: 0.5;
}

.brand-footer-copy {
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0.45;
    letter-spacing: 0.2px;
}

/* ===== NAV HOME BUTTON ===== */
.nav-btn-home {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-dim);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}
.nav-btn-home:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn-home svg { display: block; }

/* ===== SIDE PANELS ===== */
.sidebar-wrap {
    position: fixed;
    top: 70px;
    z-index: 90;
    display: flex;
    align-items: flex-start;
}

#left-sidebar-wrap {
    left: 0;
    flex-direction: row;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#left-sidebar-wrap.closed { transform: translateX(-240px); }

#right-sidebar-wrap {
    right: 0;
    flex-direction: row-reverse;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#right-sidebar-wrap.closed { transform: translateX(240px); }

.side-panel {
    width: 240px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: rgba(9, 11, 20, 0.97);
    border: 1px solid var(--border);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
#left-sidebar-wrap .side-panel { border-radius: 0 12px 12px 0; border-left: none; }
#right-sidebar-wrap .side-panel { border-radius: 12px 0 0 12px; border-right: none; }

.side-panel::-webkit-scrollbar { width: 4px; }
.side-panel::-webkit-scrollbar-track { background: transparent; }
.side-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.side-panel::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.sidebar-tab {
    width: 26px;
    height: 56px;
    background: rgba(9, 11, 20, 0.97);
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    line-height: 1;
    padding: 0;
}
.sidebar-tab:hover { color: var(--accent); border-color: var(--accent); }
#left-sidebar-wrap .sidebar-tab { border-radius: 0 8px 8px 0; border-left: none; margin-left: -1px; }
#right-sidebar-wrap .sidebar-tab { border-radius: 8px 0 0 8px; border-right: none; margin-right: -1px; }

/* Side panel inner sections */
.sp-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px;
    background: var(--bg-input);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.sp-preset-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Single-row preset entry */
.sp-preset-row {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}
.sp-preset-row:hover { border-color: var(--accent); background: var(--bg-input); }

.sp-preset-name {
    flex: 1;
    font-size: 11px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-preset-action {
    flex-shrink: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    font-family: inherit;
    color: var(--text-dim);
}
.sp-preset-row:hover .sp-preset-action { opacity: 1; }
.sp-preset-rename:hover { color: var(--accent); }
.sp-preset-del:hover { color: #ef4444; }

/* Save / Load buttons */
.sp-file-row { display: flex; gap: 5px; margin-bottom: 6px; }
.sp-file-btn {
    flex: 1; padding: 6px 0; font-size: 10px;
    border: 1px solid var(--border); background: var(--bg-panel);
    color: var(--text-dim); border-radius: 5px; cursor: pointer;
    font-family: inherit; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.sp-file-btn-save { border-color: rgba(34,197,94,0.3); color: #4ade80; }
.sp-file-btn-save:hover { background: rgba(34,197,94,0.08); border-color: #22c55e; color: #22c55e; }
.sp-file-btn-load { border-color: var(--border-hover); color: var(--accent); }
.sp-file-btn-load:hover { background: var(--accent-glow); border-color: var(--accent); }

/* Selected preset state */
.sp-preset-row.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.sp-preset-row.selected .sp-preset-name { color: var(--accent); }

/* "+" add row */
.sp-preset-add-row {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 7px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 300;
    color: var(--text-dim);
    transition: border-color 0.2s, color 0.2s;
    font-family: inherit;
}
.sp-preset-add-row:hover { border-color: var(--accent); color: var(--accent); }

/* Hotkey table */
.sp-hotkey-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}
.sp-hotkey-table tr { border-bottom: 1px solid var(--border); }
.sp-hotkey-table tr:last-child { border-bottom: none; }
.sp-hotkey-table td { padding: 4px 2px; color: var(--text-dim); }
.sp-hotkey-table td:first-child {
    font-family: monospace;
    color: var(--accent);
    font-size: 9px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 5px;
    white-space: nowrap;
    width: 1%;
}

.sp-input {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}
.sp-input:focus { border-color: var(--accent); outline: none; }

.sp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-dim);
}

.sp-row-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-dim);
}
.sp-row-col input[type=range] { width: 100%; }

.sp-stat-value {
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.sp-hotkey-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dim);
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}
.sp-hotkey-row:last-child { border-bottom: none; }

.sp-kbd {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 10px;
    color: #fff;
}

.sp-community-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 11px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.sp-community-link:hover { border-color: var(--accent); color: var(--accent); }

.sp-changelog-item {
    font-size: 10px;
    color: var(--text-dim);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.sp-changelog-item:last-child { border-bottom: none; }

.sp-changelog-badge {
    display: inline-block;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--accent-glow);
    color: var(--accent);
    margin-right: 4px;
    font-weight: 700;
}

/* ===== FREE vs CREATOR PRO ===== */
/* Lock chips and the tap-to-upgrade overlay only exist while the Free plan is active (body.plan-free). */
.pro-badge {
    display: none; align-items: center; margin-left: 4px; vertical-align: middle; white-space: nowrap;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
    font-size: 9px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
    border-radius: 4px; padding: 1px 5px;
}
body.plan-free .pro-badge { display: inline-flex; }
.free-only { display: none; }
body.plan-free .free-only { display: block; }
/* small "get more" link beside a control that Free may use up to a limit (opens Pricing only when clicked) */
.pro-more {
    display: none; margin-left: 8px; padding: 0; background: none; border: none; font: inherit; font-size: 10px; font-weight: 700;
    color: var(--accent); text-decoration: underline; cursor: pointer;
}
body.plan-free .pro-more { display: inline; }
.pro-more:hover { filter: brightness(1.25); }
.pro-hint {
    font-size: 10px; line-height: 1.4; color: var(--text-dim);
    background: var(--bg-input); border: 1px dashed var(--border-hover); border-radius: 6px; padding: 6px 8px;
}
body.plan-free .pro-feature { position: relative; cursor: pointer; }
body.plan-free .pro-feature > *:not(.pro-badge) { opacity: 0.55; transition: opacity 0.15s; }
body.plan-free .pro-feature:hover > *:not(.pro-badge) { opacity: 0.8; }
body.plan-free .pro-feature::after { content: ''; position: absolute; inset: 0; z-index: 4; cursor: pointer; }

.nav-pro-chip {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
    font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
}
.nav-btn-login { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

/* --- Hamburger menu: only what the navbar doesn't already show --- */
.theme-menu-content.app-menu { min-width: 230px; width: 250px; max-width: calc(100vw - 20px); padding: 8px; }
.theme-menu-details[open] .theme-menu-content.app-menu { max-height: min(78vh, 660px); overflow-y: auto; }
.app-menu-user { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.app-menu-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; color: #fff; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
}
/* guests get a neutral person icon, logged-in users their initial */
body.logged-in .app-menu-avatar-icon { display: none; }
body:not(.logged-in) #menuAvatarLetter { display: none; }
.app-menu-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.app-menu-user-text b { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-menu-user-text small { color: var(--text-dim); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-menu-chip {
    font-family: inherit; font-size: 9px; font-weight: 800; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 20px;
    background: none; border: 1px solid var(--border-hover); color: var(--text-dim); cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.app-menu-chip:hover { border-color: var(--accent); color: var(--accent); }
.app-menu-chip.pro { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-color: transparent; }
.app-menu-chip.pro:hover { color: #fff; filter: brightness(1.1); }
.app-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
    color: #e4e4e7; font-size: 12px; font-family: inherit; padding: 9px 10px; border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.app-menu-item:hover { background: rgba(255,255,255,0.07); color: var(--accent); }
/* one line-icon style for every entry instead of mixed emoji */
.app-menu-ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.app-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.app-menu-sub > summary {
    list-style: none; cursor: pointer; user-select: none; color: #e4e4e7; font-size: 12px;
    padding: 9px 10px; border-radius: 8px; display: flex; justify-content: flex-start; align-items: center; gap: 10px;
}
.app-menu-sub > summary::-webkit-details-marker { display: none; }
.app-menu-sub > summary::after { content: '▾'; margin-left: auto; color: var(--text-dim); transition: transform 0.2s; }
.app-menu-sub[open] > summary::after { transform: rotate(180deg); }
.app-menu-sub > summary:hover { background: rgba(255,255,255,0.07); color: var(--accent); }
.app-menu-sub .theme-options { padding: 4px 4px 6px; }
.app-menu .theme-option { justify-content: flex-start; }
/* logged-in only entries (Account settings, Log out) */
.app-menu .auth-only { display: none; }
body.logged-in .app-menu .app-menu-item.auth-only { display: flex; }
body.logged-in .app-menu .app-menu-sep.auth-only { display: block; }
/* Pricing / Contact / Feedback live in the navbar on desktop, so they show here on phones only */
.app-menu-mobile { display: none; }
@media (max-width: 800px) { .app-menu-mobile { display: block; } }

/* --- Toast + inline messages --- */
.sl-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 9500;
    background: var(--bg-panel); color: #fff; font-size: 13px; line-height: 1.4;
    border: 1px solid var(--border-hover); border-left: 4px solid var(--accent); border-radius: 10px;
    padding: 11px 16px; width: max-content; max-width: min(92vw, 460px); box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
.sl-toast.show { opacity: 1; transform: translate(-50%, 0); }
.sl-toast.ok { border-left-color: #22c55e; }
.sl-toast.warn { border-left-color: #f59e0b; }
.sl-msg {
    margin: 0; font-size: 12px; line-height: 1.45; border-radius: 8px; padding: 8px 10px;
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim);
}
.sl-msg.ok { border-color: #16a34a; color: #4ade80; background: rgba(34,197,94,0.08); }
.sl-msg.err { border-color: #dc2626; color: #fca5a5; background: rgba(220,38,38,0.1); }
.sl-msg.info { border-color: var(--accent); color: var(--accent); }
.sl-note { margin: 0; font-size: 11px; line-height: 1.45; color: var(--text-dim); }

/* --- Pricing window (Creator Pro) --- */
.gp-locked-reason {
    background: var(--accent-glow); border: 1px solid var(--accent); color: #fff;
    border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 700; margin-bottom: 14px;
    animation: gpReason 0.45s ease;
}
@keyframes gpReason { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gp-features li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.gp-check { color: var(--accent); font-weight: 800; flex-shrink: 0; }
.gp-free { display: block; color: var(--text-dim); font-size: 11px; font-style: normal; margin-top: 1px; }
.gp-cta-note { font-size: 11px; color: var(--text-dim); text-align: center; margin-top: 8px; line-height: 1.4; }
.gp-free-summary { margin: 14px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-dim); text-align: center; }

/* --- Account settings window --- */
.acc-box { max-width: 500px; padding-top: 24px; }
.acc-box .game-modal-title { margin-bottom: 14px; }
.acc-hero {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-glow), transparent 70%), var(--bg-input);
    border: 1px solid var(--border-hover); border-radius: 14px;
}
.acc-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; color: #fff; font-size: 18px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); display: flex; align-items: center; justify-content: center;
}
.acc-hero-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.acc-hero-text b { color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-hero-text small { color: var(--text-dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-pill {
    font-size: 10px; font-weight: 800; letter-spacing: 0.8px; padding: 4px 10px; border-radius: 20px;
    border: 1px solid var(--border-hover); color: var(--text-dim);
}
.acc-pill.pro { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-color: transparent; }

.acc-section { margin-top: 18px; }
.acc-section-title { margin: 0 0 6px 2px; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.acc-row { border-bottom: 1px solid var(--border); }
.acc-row:last-of-type { border-bottom: none; }
.acc-row-main { display: flex; align-items: center; gap: 12px; padding: 11px 2px; }
.acc-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.acc-row-label { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.acc-row-value { font-size: 14px; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.acc-row-value.pro { color: var(--accent); }
.acc-row-value.acc-dots { letter-spacing: 2px; color: var(--text-dim); font-weight: 400; }
.acc-row-hint { font-size: 11px; line-height: 1.45; color: var(--text-dim); white-space: pre-line; overflow-wrap: anywhere; }
.acc-row-hint:empty { display: none; }
.acc-row-buttons { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.acc-edit-btn {
    background: none; border: 1px solid var(--border-hover); color: #e4e4e7; border-radius: 8px; padding: 6px 12px;
    font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.acc-edit-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.acc-edit-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; color: #fff; }
.acc-edit-btn.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.1); }
.acc-edit-btn.danger { border-color: rgba(220,38,38,0.45); color: #fca5a5; }
.acc-edit-btn.danger:hover:not(:disabled) { border-color: #ef4444; color: #ef4444; }
.acc-edit-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.acc-row.open .acc-edit-btn[data-toggle] { border-color: var(--accent); color: var(--accent); }

/* the little form / confirmation under a row */
.acc-edit { display: none; flex-direction: column; gap: 10px; margin: 0 0 12px; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; }
.acc-row.open > .acc-edit { display: flex; animation: accOpen 0.18s ease; }
@keyframes accOpen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.acc-edit { text-align: left; }
.acc-edit .game-form-label { align-items: stretch; text-align: left; }
.acc-edit .game-form-input { background: var(--bg-panel); }
.acc-edit .sl-msg, .game-modal-box .acc-edit .sl-msg { margin-bottom: 0; }
.acc-edit-actions { display: flex; gap: 8px; }
.acc-save-btn {
    flex: 1; padding: 10px 12px; border: none; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); transition: filter 0.2s, transform 0.2s;
}
.acc-save-btn { text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.acc-save-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.acc-save-btn.danger { background: #b91c1c; }
.acc-save-btn:disabled { opacity: 0.6; cursor: wait; }
.acc-btn {
    background: var(--bg-input); border: 1px solid var(--border-hover); color: #e4e4e7; border-radius: 10px;
    padding: 10px 14px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.acc-btn:hover { border-color: var(--accent); color: var(--accent); }
.acc-secure { margin-top: 10px; }
#accSubMsg { margin-top: 8px; }
.acc-row.danger .acc-row-label { color: #fca5a5; }
@media (max-width: 480px) {
    .acc-box { padding: 22px 16px; }
    .acc-edit-btn { min-height: 38px; }
    /* rows that can carry two buttons (plan, card) put them under the text on phones */
    .acc-row-main.stack-sm { flex-wrap: wrap; }
    .acc-row-main.stack-sm .acc-row-text { flex-basis: 100%; }
    .acc-row-main.stack-sm .acc-row-buttons { width: 100%; justify-content: flex-start; }
    .acc-row-main.stack-sm .acc-row-buttons:not(:has(> :not([style*="display: none"]))) { display: none; }   /* no visible button: no empty line */
}

/* --- Sign-up / login window --- */
.sl-nick-status { font-size: 11px; font-weight: 500; min-height: 14px; color: var(--text-dim); }
.sl-nick-status.ok { color: #4ade80; }
.sl-nick-status.err { color: #fca5a5; }
.auth-terms { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.45; color: var(--text-dim); cursor: pointer; }
.auth-terms input { margin-top: 2px; }
.auth-terms a { color: var(--accent); }
.auth-switch { margin: 14px 0 6px; font-size: 12px; color: var(--text-dim); text-align: center; }
.auth-switch-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
.game-modal-box .sl-msg { margin-bottom: 12px; }

/* --- Presets: name box + Add button --- */
.sp-preset-input-row { display: flex; gap: 5px; align-items: center; }
.sp-preset-input-row .sp-input { flex: 1; min-width: 0; }
.sp-file-btn-add { flex: 0 0 auto; padding: 6px 10px; border-color: var(--accent); color: var(--accent); font-weight: 700; }
.sp-file-btn-add:hover { background: var(--accent-glow); }
.sp-preset-count { margin-left: auto; color: var(--text-dim); font-weight: 600; letter-spacing: 0; }
.sp-preset-hint { display: none; font-size: 10px; line-height: 1.4; color: #fbbf24; margin-bottom: 4px; }

@media (max-width: 800px) {
    .sidebar-wrap { display: none; }
}
