/* Approved final directions: N2-B matte graphite, S1-A satin titanium, R2 imperial amethyst. */
body[data-theme="theme-neon"] {
    --t-page:#060515;--t-deep:#060719;--t-surface:#0b1022;--t-raised:#151a35;
    --t-text:#f5f8ff;--t-muted:#bbd5f6;--t-dim:#91a6c9;--t-line:#39cbff;
    --t-accent:#30dcff;--t-secondary:#e33dff;--t-success:#62f2c1;--t-danger:#ff87c3;
    --t-button:#8c42ea;--t-button-ink:#ffffff;
    --t-metal-high:#c4faff;--t-metal-mid:#cc50ff;--t-metal-low:#101e3c;
    --theme-panel:linear-gradient(115deg,#0b1827e8,#070b1be8 55%,#20102ae8),url("assets/graphite-grain.svg");
    --theme-frame:inset 0 0 0 1px #b7f9ffb0,inset 0 0 0 3px #046a8f88,inset 0 0 18px #0da4d220;
    --theme-glow:-3px 0 14px #00cfff66,3px 0 17px #de20ff66,0 0 4px #7be9ff80;
    --theme-page-image:radial-gradient(ellipse at 0% 35%,#0088cd3d,transparent 65%),radial-gradient(ellipse at 100% 55%,#a307cd45,transparent 65%),linear-gradient(#050d20,#0d0520);
    --theme-page-size:100% 100%,100% 100%,100% 100%;
}
body[data-theme="theme-slate"] {
    --t-page:#10171d;--t-deep:#0d141b;--t-surface:#1c2731;--t-raised:#2c3944;
    --t-text:#f2f5fa;--t-muted:#c7d1de;--t-dim:#99a9ba;--t-line:#a4b1be;
    --t-accent:#c5d6e7;--t-secondary:#79c6f1;--t-success:#69e2c3;
    --t-button:#b3c4d3;--t-button-ink:#14212d;
    --t-metal-high:#f5fcff;--t-metal-mid:#9aafc0;--t-metal-low:#243744;
    --theme-panel:url("assets/brushed-titanium.svg"),linear-gradient(115deg,#2a3641,#14202a 45%,#28343f);
    --theme-frame:inset 0 1px 0 #fff,inset 0 0 0 2px #bcc8d3,inset 0 0 0 3px #34424f,inset 0 0 0 4px #d2dce780,inset 0 -5px 5px #0008;
    --theme-glow:0 4px 9px #0009;
    --theme-page-image:url("assets/brushed-titanium.svg"),radial-gradient(ellipse at 50% 0%,#405161,#10171e 78%);
    --theme-page-size:100% 100%,100% 100%;
}
body[data-theme="theme-ace-gold"] {
    --t-page:#1d0729;--t-deep:#16051e;--t-surface:#2d103d;--t-raised:#41174d;
    --t-text:#fff8df;--t-muted:#ead9b6;--t-dim:#c8b18c;--t-line:#d5a947;
    --t-accent:#f8d57c;--t-secondary:#c75bf0;--t-success:#98e5bc;--t-danger:#ff9aad;
    --t-success-bg:#213a2d;--t-danger-bg:#4d173e;
    --t-button:#d9a43a;--t-button-ink:#2e1b06;
    --t-metal-high:#fff0a4;--t-metal-mid:#e2b44f;--t-metal-low:#62400f;
    --theme-panel:linear-gradient(125deg,#16021cbb,#23012bb3 60%,#5a155377),url("assets/royal/amethyst-velvet.png"),linear-gradient(#341140,#1b0525);
    --theme-frame:inset 0 0 0 1px #fff1b0,inset 0 0 0 3px #bb852a,inset 0 0 0 4px #fff1a7,inset 0 0 0 5px #5a310a,inset 0 0 0 6px #eac260;
    --theme-glow:0 0 13px #e5a72d36,0 7px 18px #0009;
    --theme-page-image:linear-gradient(#15051c99,#15051ca3),url("assets/royal/amethyst-velvet.png"),linear-gradient(#2d0b3d,#14051d);
    --theme-page-size:100% 100%,420px 420px,100% 100%;
}

/* Paint-only decorations share the original boxes and never take layout space or pointer input. */
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) :is(.rpg-header,.card,.modal-card,.comment-modal-card,.account-flyout-card,.prv-modal-bubble,.prv-header-bubble) {
    background:var(--theme-panel);background-size:auto,320px 320px,auto;
    border-color:var(--t-line);box-shadow:var(--theme-frame),var(--theme-glow);outline:none;
}
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .pressure-spire-svg-wrap rect[fill="url(#spire-grid)"] { display:none; }
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .rpg-prv-slot::before { display:none; }
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .rpg-header {border-radius:4px;}
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .modal-card {border-radius:12px;}

/* N2-B: white-hot cyan/violet light channels in matte graphite. */
body[data-theme="theme-neon"] :is(.rpg-header,.card,.modal-card,.comment-modal-card,.account-flyout-card,.prv-modal-bubble,.prv-header-bubble,.option-btn)::before {
    content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:1;
    border:2px solid transparent;background:linear-gradient(105deg,#b9ffff,#00d8ff 18%,#249aff 46%,#b630ff 74%,#ff7bff) border-box;
    -webkit-mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor;mask-composite:exclude;
}
body[data-theme="theme-neon"][data-designed-theme] .option-btn {background:var(--theme-panel);border-color:#49d9ff;border-radius:12px;box-shadow:inset 0 0 0 1px #b9faff55,-2px 0 8px #00d9ff77,2px 0 9px #dc30ff88;}
body[data-theme="theme-neon"] .option-btn .opt-letter {background:linear-gradient(130deg,#082d4f,#131230);border-color:#61eaff;color:#fff;box-shadow:0 0 7px #05d8ff99,inset 0 0 9px #085f9c77;}
body[data-theme="theme-neon"] .option-btn .opt-letter::after {background:#67d9ff;}
body[data-theme="theme-neon"] .option-btn:hover:not(:disabled) {box-shadow:inset 0 0 15px #a231ee22,-3px 0 11px #00eaffaa,3px 0 13px #ed34ffaa;}
body[data-theme="theme-neon"] .option-btn:is(.correct,.wrong)::before {opacity:0;}
body[data-theme="theme-neon"] .questions-fill {background:linear-gradient(90deg,#00d9ff,#a4faff);box-shadow:0 0 9px #00d9ff;}
body[data-theme="theme-neon"] #quiz-card .xp-fill {background:linear-gradient(90deg,#8d3cff,#f385ff) !important;box-shadow:0 0 9px #c42cff;}
body[data-theme="theme-neon"] .rpg-skill-badge.badge-apprentice {color:#36e6ff !important;background:#06325b !important;box-shadow:inset 0 0 0 1px #1ba7f9,0 0 5px #00b9ff66;}
body[data-theme="theme-neon"] #rpg-psi-container {border-color:#4deaff !important;box-shadow:0 0 9px #00c9ff88,inset 0 0 12px #2247ff33;}
body[data-theme="theme-neon"] .rpg-prv-slot #prv-companion-layer #prv-svg-container {filter:drop-shadow(-1px 0 1px #00eaff) drop-shadow(1px 0 1px #dd3aff);}
body[data-theme="theme-neon"] .prv-blueprint-art [stroke] {stroke:#88efff;}
body[data-theme="theme-neon"] .prv-blueprint-art > g:nth-child(even) [stroke],body[data-theme="theme-neon"] #prv-spring .prv-blueprint-art [stroke] {stroke:#e169ff;}

/* S1-A: brushed satin, inset silver rails, silver keycaps, and miniature fasteners. */
body[data-theme="theme-slate"][data-designed-theme] .option-btn {background:var(--theme-panel);background-size:100% 100%,100% 100%;background-repeat:no-repeat;border-color:#bdc7d0;border-radius:7px;box-shadow:inset 0 0 0 1px #fff8,inset 0 0 0 3px #73838f,inset 0 0 0 4px #0d1720,0 3px 5px #0008;}
body[data-theme="theme-slate"] .opt-letter {background:url("assets/brushed-titanium.svg"),linear-gradient(115deg,#b9c1c8,#f4f5f3 42%,#949fa8 68%,#d4dce1);color:#111b23;border-color:#f0f6fc;box-shadow:inset 0 0 0 1px #4b5966,0 2px 3px #0009;border-radius:7px;}
body[data-theme="theme-slate"] .option-btn:hover:not(:disabled) .opt-letter {color:#111b23;background:linear-gradient(115deg,#d0dbe2,#fff 42%,#a0b0bd 68%,#e2ebf1);}
body[data-theme="theme-slate"] .opt-letter::after {background:#8799a8;}
body[data-theme="theme-slate"] :is(.card,.modal-card,.comment-modal-card,.option-btn,.opt-letter,.account-flyout-card,.prv-modal-bubble,.prv-header-bubble) {background-size:100% 100%,100% 100%;background-repeat:no-repeat;}
body[data-theme="theme-slate"] .rpg-header {background-image:url("assets/titanium-fastener.svg"),url("assets/titanium-fastener.svg"),url("assets/titanium-fastener.svg"),url("assets/titanium-fastener.svg"),var(--theme-panel);background-position:left 2px top 2px,right 2px top 2px,left 2px bottom 2px,right 2px bottom 2px,center,center;background-repeat:no-repeat;background-size:10px 10px,10px 10px,10px 10px,10px 10px,100% 100%,100% 100%;}
body[data-theme="theme-slate"] .rpg-skill-badge.badge-apprentice {color:#d8edff !important;background:linear-gradient(#344554,#172633) !important;box-shadow:inset 0 0 0 1px #becbd8,0 1px 3px #0009;}
body[data-theme="theme-slate"] #rpg-psi-container {background:linear-gradient(#263f51,#142431) !important;border-color:#c2d1df !important;box-shadow:inset 0 0 0 1px #637b90,0 1px 3px #0009;}
body[data-theme="theme-slate"] .questions-fill {background:linear-gradient(90deg,#75c9fc,#b5e8ff);}
body[data-theme="theme-slate"] #quiz-card .xp-fill {background:#68e6c9 !important;}
body[data-theme="theme-slate"] .rpg-prv-slot #prv-companion-layer #prv-svg-container {filter:drop-shadow(0 1px 1px #0009);}

/* R2: amethyst velvet, gilded mouldings, hand-carved leaves, and inset gemstones. */
body[data-theme="theme-ace-gold"] .modal-card::after {display:none;}
.theme-ornament-layer {display:none;}
body[data-theme="theme-ace-gold"] .theme-ornament-layer {display:block;position:absolute;inset:0;pointer-events:none;z-index:1;--corner-size:38px;}
.theme-ornament-layer :is(i,span) {position:absolute;display:block;pointer-events:none;}
.theme-ornament-layer .royal-corner {width:var(--corner-size);height:var(--corner-size);background:url("assets/royal/gold-amethyst-corner.png") center/contain no-repeat;}
.theme-ornament-layer .royal-tl {left:0;top:0;}
.theme-ornament-layer .royal-tr {right:0;top:0;transform:scaleX(-1);}
.theme-ornament-layer .royal-bl {left:0;bottom:0;transform:scaleY(-1);}
.theme-ornament-layer .royal-br {right:0;bottom:0;transform:scale(-1);}
.theme-ornament-layer .royal-finial {width:64px;height:18px;background:url("assets/royal/amethyst-finial.svg") center/contain no-repeat;left:50%;transform:translateX(-50%);}
.theme-ornament-layer .royal-top {top:0;}
.theme-ornament-layer .royal-bottom {bottom:0;transform:translateX(-50%) scaleY(-1);}
body[data-theme="theme-ace-gold"] #quiz-card > .theme-ornament-layer {--corner-size:62px;}
body[data-theme="theme-ace-gold"] .rpg-header > .theme-ornament-layer {--corner-size:42px;}
body[data-theme="theme-ace-gold"] :is(.rpg-header,.option-btn,.account-flyout-card,.prv-header-bubble,.prv-modal-bubble) > .theme-ornament-layer .royal-finial {display:none;}
body[data-theme="theme-ace-gold"] :is(.account-flyout-card,.prv-header-bubble,.prv-modal-bubble) > .theme-ornament-layer {--corner-size:22px;}
body[data-theme="theme-ace-gold"][data-designed-theme] .option-btn {background:linear-gradient(110deg,#100718,#25102f);border-radius:8px;border-color:#ffdc85;box-shadow:inset 0 0 0 1px #764211,inset 0 0 0 3px #f0c16d,inset 0 0 0 4px #58310e,0 0 7px #f4b12c55,0 2px 4px #0009;}
body[data-theme="theme-ace-gold"] .option-btn > .theme-ornament-layer {--corner-size:15px;}
body[data-theme="theme-ace-gold"] .option-btn .royal-corner {background-image:url("assets/royal/amethyst-gem.svg");width:10px;height:10px;top:calc(50% - 5px);bottom:auto;}
body[data-theme="theme-ace-gold"] .option-btn .royal-tl {left:3px;}
body[data-theme="theme-ace-gold"] .option-btn .royal-tr {right:3px;}
body[data-theme="theme-ace-gold"] .option-btn :is(.royal-bl,.royal-br) {display:none;}
body[data-theme="theme-ace-gold"] .opt-letter {background:linear-gradient(120deg,#382112,#0c0809 60%,#33152f);color:#fff4d1;border-color:#ffe795;box-shadow:inset 0 0 0 1px #6e3909,inset 0 0 0 2px #efc26b,0 1px 4px #000a;border-radius:5px;}
body[data-theme="theme-ace-gold"][data-designed-theme] .option-btn:hover:not(:disabled) {background:linear-gradient(110deg,#291035,#411b4e);box-shadow:inset 0 0 0 1px #ffe8a5,inset 0 0 0 3px #eec46f,0 0 12px #eebd5866;}
body[data-theme="theme-ace-gold"] .option-btn:hover:not(:disabled) .opt-letter {background:linear-gradient(115deg,#55391b,#171019);color:#fff4d1;}
body[data-theme="theme-ace-gold"] .opt-letter::after {background:#e5b856;}
body[data-theme="theme-ace-gold"] .rpg-skill-badge.badge-apprentice {background:#1d0827 !important;color:#ffe18c !important;box-shadow:inset 0 0 0 1px #f0c565,0 0 3px #dba63d66;}
body[data-theme="theme-ace-gold"] .rpg-avatar {background:#2f0b42 !important;border-color:#ffe58d !important;box-shadow:0 0 7px #d5a33f88 !important;}
body[data-theme="theme-ace-gold"] .rpg-avatar:has(img[src=""]) > span {color:transparent !important;background:url("assets/royal/crown.svg") center/contain no-repeat;width:27px;height:27px;}
body[data-theme="theme-ace-gold"] #rpg-psi-container {background:#2c0a3b !important;border-color:#f0c264 !important;box-shadow:inset 0 0 0 1px #6c4117,0 0 5px #eebf5c55;}
body[data-theme="theme-ace-gold"] #rpg-psi-value {color:#ffe497 !important;}
body[data-theme="theme-ace-gold"] .questions-fill,body[data-theme="theme-ace-gold"] #quiz-card .xp-fill {background:linear-gradient(90deg,#ddb459,#fff0b4) !important;box-shadow:0 0 5px #f4cc7780;}
body[data-theme="theme-ace-gold"] .rpg-prv-slot #prv-companion-layer #prv-svg-container {filter:drop-shadow(0 0 2px #eeb33a99);}

/* Feedback semantics win over ornamental paints, and decorations cannot intercept controls. */
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .option-btn.correct {background:var(--t-success-bg) !important;}
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .option-btn.wrong {background:var(--t-danger-bg) !important;}
body[data-theme="theme-ace-gold"] .option-btn:is(.correct,.wrong) > .theme-ornament-layer {opacity:.35;}
body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .progress-labels {opacity:.86;}
@media(max-width:480px) {
    body[data-theme="theme-ace-gold"] #quiz-card > .theme-ornament-layer {--corner-size:32px;}
    body[data-theme="theme-ace-gold"] .modal-card > .theme-ornament-layer {--corner-size:28px;}
    body[data-theme="theme-ace-gold"] .rpg-header > .theme-ornament-layer {--corner-size:22px;}
    /* In the captured mobile CSS these scales touched the card edge; clear the thicker frames without moving the quiz. */
    body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .dual-progress-container {position:relative;top:8px;}
    body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .progress-labels {padding-inline:10px;}
    body:is([data-theme="theme-neon"],[data-theme="theme-slate"],[data-theme="theme-ace-gold"]) .progress-track {width:calc(100% - 20px);margin-inline:10px;}
}
