/* ===== SITE SETTINGS (gear in the bottom dock) ===== */
.dock-item.yy-settings-btn .dock-face svg { transition: transform 0.4s ease; }
.dock-item.yy-settings-btn:hover .dock-face svg { transform: rotate(60deg); }

.yy-modal { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.2s ease; }
.yy-modal.hidden { display: none; }
.yy-modal-card { width: 100%; max-width: 820px; height: min(620px, 92vh); display: flex; background: color-mix(in srgb, var(--bg-2) 92%, transparent); border: 1px solid color-mix(in srgb, var(--bright-text) 8%, transparent); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); color: var(--text); font-family: 'Poppins', sans-serif; }
.yy-tabs { width: 200px; flex-shrink: 0; background: color-mix(in srgb, var(--bright-text) 2%, transparent); border-right: 1px solid color-mix(in srgb, var(--bright-text) 5%, transparent); padding: 18px 10px; display: flex; flex-direction: column; gap: 4px; }
.yy-tabs h3 { color: var(--bright-text); font-weight: 600; font-size: 1rem; padding: 0 10px 12px; display: flex; align-items: center; gap: 8px; }
.yy-tab { background: none; border: none; color: color-mix(in srgb, var(--bright-text) 55%, transparent); font-family: inherit; font-size: 0.85rem; text-align: left; padding: 9px 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; transition: background 0.15s, color 0.15s; }
.yy-tab:hover { background: color-mix(in srgb, var(--bright-text) 5%, transparent); color: var(--bright-text); }
.yy-tab.active { background: color-mix(in srgb, var(--bright-text) 9%, transparent); color: var(--bright-text); }
.yy-tab.yy-tab-gold.active, .yy-tab.yy-tab-gold:hover { color: #ffd76a; }
.yy-panel-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yy-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid color-mix(in srgb, var(--bright-text) 5%, transparent); }
.yy-panel-head h4 { color: var(--bright-text); font-weight: 600; font-size: 1.05rem; }
.yy-close { background: color-mix(in srgb, var(--bright-text) 5%, transparent); border: 1px solid color-mix(in srgb, var(--bright-text) 6%, transparent); color: color-mix(in srgb, var(--bright-text) 70%, transparent); width: 32px; height: 32px; border-radius: 50%; font-size: 0.9rem; }
.yy-close:hover { background: color-mix(in srgb, var(--bright-text) 12%, transparent); color: var(--bright-text); }
.yy-panel { display: none; padding: 18px 20px 24px; overflow-y: auto; flex: 1; flex-direction: column; gap: 18px; }
.yy-panel.active { display: flex; }
.yy-panel::-webkit-scrollbar { width: 4px; }
.yy-panel::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--bright-text) 8%, transparent); border-radius: 4px; }

.yy-group { display: flex; flex-direction: column; gap: 10px; }
.yy-group-title { color: color-mix(in srgb, var(--bright-text) 45%, transparent); font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.yy-hint { color: color-mix(in srgb, var(--bright-text) 40%, transparent); font-size: 0.75rem; line-height: 1.5; }
.yy-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: color-mix(in srgb, var(--bright-text) 3%, transparent); border: 1px solid color-mix(in srgb, var(--bright-text) 5%, transparent); border-radius: 12px; padding: 12px 14px; }
.yy-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yy-row-text b { color: var(--bright-text); font-weight: 500; font-size: 0.88rem; }
.yy-row-text span { color: color-mix(in srgb, var(--bright-text) 40%, transparent); font-size: 0.74rem; }

/* Toggle switch */
.yy-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.yy-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.yy-switch span { position: absolute; inset: 0; background: color-mix(in srgb, var(--bright-text) 12%, transparent); border-radius: 24px; transition: background 0.2s; }
.yy-switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.yy-switch input:checked + span { background: #3ddc84; }
.yy-switch input:checked + span::before { transform: translateX(18px); }
.yy-switch input:focus-visible + span { outline: 2px solid color-mix(in srgb, var(--bright-text) 50%, transparent); outline-offset: 2px; }

/* Palettes & presets */
.yy-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.yy-swatch, .yy-preset { background: color-mix(in srgb, var(--bright-text) 3%, transparent); border: 2px solid color-mix(in srgb, var(--bright-text) 5%, transparent); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: color-mix(in srgb, var(--bright-text) 65%, transparent); font-family: inherit; font-size: 0.72rem; transition: border-color 0.15s, background 0.15s; }
.yy-swatch:hover, .yy-preset:hover { background: color-mix(in srgb, var(--bright-text) 6%, transparent); }
.yy-swatch.active, .yy-preset.active { border-color: var(--accent); color: var(--bright-text); }
.yy-swatch i { display: block; width: 100%; height: 26px; border-radius: 8px; }
.yy-preset img, .yy-preset .yy-preset-icon { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.yy-engine-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.yy-engine-grid .yy-preset { align-items: flex-start; text-align: left; padding: 12px 14px; gap: 4px; }
.yy-engine-grid .yy-preset b { color: var(--bright-text); font-weight: 600; font-size: 0.88rem; display: flex; align-items: center; gap: 6px; }
.yy-engine-grid .yy-preset span { font-size: 0.72rem; line-height: 1.4; }
.yy-engine-grid .yy-preset em { font-style: normal; font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--bright-text); }
.yy-colors { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.yy-colors input[type="color"] { width: 44px; height: 34px; border: none; background: none; padding: 0; border-radius: 8px; }

.yy-field { display: flex; flex-direction: column; gap: 6px; }
.yy-field label { color: color-mix(in srgb, var(--bright-text) 55%, transparent); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.yy-input { background: color-mix(in srgb, var(--bright-text) 4%, transparent); border: 1px solid color-mix(in srgb, var(--bright-text) 8%, transparent); border-radius: 10px; color: var(--bright-text); padding: 10px 12px; font-family: inherit; font-size: 0.85rem; outline: none; width: 100%; }
.yy-input:focus { border-color: color-mix(in srgb, var(--bright-text) 25%, transparent); background: color-mix(in srgb, var(--bright-text) 6%, transparent); }
.yy-btn { background: color-mix(in srgb, var(--bright-text) 6%, transparent); border: 1px solid color-mix(in srgb, var(--bright-text) 10%, transparent); color: var(--bright-text); padding: 9px 16px; border-radius: 10px; font-family: inherit; font-size: 0.82rem; font-weight: 500; transition: background 0.15s; }
.yy-btn:hover { background: color-mix(in srgb, var(--bright-text) 12%, transparent); }
.yy-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.yy-key { min-width: 90px; font-family: Consolas, monospace; }
.yy-key.listening { border-color: #ffd76a; color: #ffd76a; }

/* Gold "Customize Profile" */
.yy-gold-hero { position: relative; overflow: hidden; border-radius: 16px; padding: 22px; background: linear-gradient(135deg, rgba(255, 215, 106, 0.14), rgba(184, 134, 11, 0.08)); border: 1px solid rgba(255, 215, 106, 0.3); display: flex; flex-direction: column; gap: 12px; }
.yy-gold-hero h5 { font-size: 1.15rem; font-weight: 700; background: linear-gradient(90deg, #fff1a8, #ffd76a, #d4a017); -webkit-background-clip: text; background-clip: text; color: transparent; }
.yy-gold-btn {
    align-self: flex-start; border: none; border-radius: 12px; padding: 13px 26px; font-family: inherit; font-size: 0.95rem; font-weight: 700; color: #3b2a00; letter-spacing: 0.3px;
    background: linear-gradient(110deg, #b8860b 0%, #ffd76a 30%, #fff1a8 50%, #ffd76a 70%, #b8860b 100%); background-size: 220% 100%;
    box-shadow: 0 6px 22px rgba(255, 196, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: yy-gold-shine 3.5s linear infinite; transition: transform 0.15s, box-shadow 0.15s;
}
.yy-gold-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 196, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
@keyframes yy-gold-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.yy-perks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.yy-perk { background: color-mix(in srgb, var(--bg) 25%, transparent); border: 1px solid rgba(255, 215, 106, 0.12); border-radius: 10px; padding: 10px 12px; font-size: 0.78rem; color: color-mix(in srgb, var(--bright-text) 80%, transparent); display: flex; gap: 8px; align-items: flex-start; }
.yy-perk b { color: #ffd76a; font-weight: 600; display: block; font-size: 0.8rem; }

/* Applied preferences */
html.yy-no-cursor, html.yy-no-cursor *, html.yy-no-cursor *::before, html.yy-no-cursor *::after { cursor: revert !important; }
html.yy-reduce-motion *, html.yy-reduce-motion *::before, html.yy-reduce-motion *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; scroll-behavior: auto !important; }
html.yy-reduce-motion .cc-pfx { display: none; }
html.yy-no-bg #liquidEtherBg { display: none; }

@media (max-width: 640px) {
    .yy-modal { padding: 0; align-items: stretch; }
    .yy-modal-card { flex-direction: column; height: 100%; max-height: none; border-radius: 0; }
    .yy-tabs { width: 100%; flex-direction: row; overflow-x: auto; padding: 10px; border-right: none; border-bottom: 1px solid color-mix(in srgb, var(--bright-text) 5%, transparent); }
    .yy-tabs h3 { display: none; }
    .yy-tab { white-space: nowrap; }
}

/* Theme picker: accent bar over the theme's background (colours come from themes.css via data-theme) */
.yy-theme-grid { max-height: 252px; overflow-y: auto; padding-right: 4px; }
.yy-theme-grid::-webkit-scrollbar { width: 4px; }
.yy-theme-grid::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--bright-text) 8%, transparent); border-radius: 4px; }
.yy-theme-swatch i { height: 34px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); }
.yy-theme-swatch i span { width: 46%; height: 10px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
