:root, [data-theme="mist"] {
    --bg: #f0f4f8;
    --white: #1a2a3a;
    --white-dim: rgba(30, 50, 70, 0.7);
    --white-ghost: rgba(40, 70, 100, 0.35);
    --white-whisper: rgba(60, 90, 120, 0.12);
    --border: rgba(60, 100, 140, 0.15);
    --border-active: rgba(50, 90, 140, 0.35);
    --surface: rgba(60, 100, 150, 0.06);
    --surface-hover: rgba(60, 100, 150, 0.1);
    --particle: 50, 100, 160;
    --moon: #4a7a9f;
    --forest: #5a8aaa;
    --fog-bg: rgba(240, 244, 248, 0.7);
}

[data-theme="ink"] {
    --bg: #f5f5f5;
    --white: #111111;
    --white-dim: rgba(20, 20, 20, 0.7);
    --white-ghost: rgba(30, 30, 30, 0.3);
    --white-whisper: rgba(40, 40, 40, 0.1);
    --border: rgba(0, 0, 0, 0.1);
    --border-active: rgba(0, 0, 0, 0.3);
    --surface: rgba(0, 0, 0, 0.03);
    --surface-hover: rgba(0, 0, 0, 0.06);
    --particle: 60, 60, 60;
    --moon: #333333;
    --forest: #444444;
    --fog-bg: rgba(245, 245, 245, 0.7);
}

[data-theme="aurora"] {
    --bg: #f0f8f4;
    --white: #1a3a2a;
    --white-dim: rgba(20, 60, 40, 0.7);
    --white-ghost: rgba(30, 80, 55, 0.35);
    --white-whisper: rgba(40, 100, 70, 0.12);
    --border: rgba(40, 140, 90, 0.15);
    --border-active: rgba(40, 160, 100, 0.35);
    --surface: rgba(40, 150, 90, 0.05);
    --surface-hover: rgba(40, 160, 100, 0.09);
    --particle: 50, 150, 100;
    --moon: #3a9a6a;
    --forest: #408a60;
    --fog-bg: rgba(240, 248, 244, 0.7);
}

[data-theme="dream"] {
    --bg: #f5f0fa;
    --white: #2a1a3a;
    --white-dim: rgba(50, 30, 70, 0.7);
    --white-ghost: rgba(70, 40, 100, 0.35);
    --white-whisper: rgba(90, 60, 130, 0.12);
    --border: rgba(120, 80, 180, 0.12);
    --border-active: rgba(130, 80, 200, 0.3);
    --surface: rgba(120, 80, 180, 0.05);
    --surface-hover: rgba(130, 90, 190, 0.09);
    --particle: 120, 80, 180;
    --moon: #7a50b0;
    --forest: #8060a0;
    --fog-bg: rgba(245, 240, 250, 0.7);
}

[data-theme="amber"] {
    --bg: #faf6f0;
    --white: #3a2a1a;
    --white-dim: rgba(60, 40, 20, 0.7);
    --white-ghost: rgba(80, 55, 30, 0.35);
    --white-whisper: rgba(100, 70, 30, 0.12);
    --border: rgba(160, 120, 50, 0.15);
    --border-active: rgba(180, 130, 50, 0.35);
    --surface: rgba(170, 130, 50, 0.05);
    --surface-hover: rgba(180, 140, 60, 0.09);
    --particle: 160, 120, 50;
    --moon: #a08030;
    --forest: #907040;
    --fog-bg: rgba(250, 246, 240, 0.7);
}
[data-theme="cyber"] {
    --bg: #0a0a0a;
    --white: #f0f0f0;
    --white-dim: rgba(240, 240, 240, 0.8);
    --white-ghost: rgba(200, 200, 200, 0.45);
    --white-whisper: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.15);
    --border-active: rgba(255, 255, 255, 0.5);
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --particle: 220, 230, 255;
    --moon: #e0e8ff;
    --forest: #a0b0c0;
    --fog-bg: rgba(10, 10, 10, 0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Inter", "Noto Sans SC", -apple-system, sans-serif;
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 300;
    transition: background-color 0.4s ease, color 0.3s ease;
    letter-spacing: -0.01em;
}

#bgCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.app { position: relative; z-index: 1; }

.page {
    display: none;
    min-height: 100vh;
    padding: 30px 32px;
    animation: fadeIn 0.6s ease;
}
.page.active { display: flex; flex-direction: column; align-items: center; }

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

/* === PAGE 1: WORLD === */
.page-world { position: relative; }
.geo-accent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vmin;
    height: 70vmin;
    pointer-events: none;
    opacity: 1;
    animation: geoSpin 180s linear infinite;
}
.geo-svg { width: 100%; height: 100%; color: var(--white); }
@keyframes geoSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.world-header {
    text-align: center;
    margin-bottom: 48px;
    padding-top: 80px;
    width: 100%;
    max-width: 600px;
}
.overline {
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.35em;
    color: var(--white-ghost);
    text-transform: uppercase;
    margin-bottom: 8px;
}
.logo {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 8rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.8;
}
.subtitle {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    color: var(--white-dim);
    margin-top: 16px;
    text-transform: uppercase;
}

.world-mode-switch {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    width: 100%;
    max-width: 500px;
}
.mode-btn {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    padding: 14px 0;
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border);
    color: var(--white-ghost);
    cursor: pointer;
    transition: all 0.4s;
    text-align: center;
}
.mode-btn.active { border-bottom-color: var(--white); color: var(--white); }
.mode-btn:hover { color: var(--white-dim); }

.world-random {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 500px;
}
.world-random-card {
    width: 100%;
    min-height: 160px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 30px;
    transition: all 0.4s;
    cursor: pointer;
}
.world-random-card:hover {
    border-bottom-color: var(--border-active);
    background: var(--surface);
}
.random-hint {
    font-size: 0.7rem;
    color: var(--white-ghost);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}
.world-random-card .world-name {
    font-size: 2.8rem;
    font-weight: 100;
    letter-spacing: 0.1em;
    line-height: 1.1;
    text-align: center;
}
.world-random-card .world-category {
    font-size: 0.6rem;
    color: var(--white-ghost);
    letter-spacing: 0.2em;
    margin-top: 10px;
    text-transform: uppercase;
}
.world-random-actions { display: flex; gap: 12px; justify-content: center; }

/* Choose mode */
.world-choose { width: 100%; max-width: 600px; }
.world-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0;
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}
.world-item {
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.2s;
}
.world-item:hover { background: var(--white); color: var(--bg); }
.world-item.selected { background: var(--white); color: var(--bg); }
.world-item-name { font-size: 0.75rem; font-weight: 400; letter-spacing: 0.05em; }

/* === BUTTONS === */
.btn-main {
    padding: 14px 40px;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    border: 2px solid var(--white);
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.btn-main:hover { background: var(--white); color: var(--bg); }
.btn-main:disabled { opacity: 0.2; pointer-events: none; }

.btn-secondary {
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 200;
    letter-spacing: 0.3em;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--white-ghost);
    cursor: pointer;
    transition: all 0.6s;
}
.btn-secondary:hover { border-color: var(--border-active); color: var(--white-dim); }

.btn-back {
    font-family: inherit;
    font-size: 0.7rem;
    color: var(--white-ghost);
    background: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: color 0.4s;
}
.btn-back:hover { color: var(--white); }

/* === PAGE 2: DRAW === */
.draw-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
    padding: 0 10px;
    gap: 12px;
    position: relative;
}
.draw-header .btn-back {
    position: absolute;
    top: 0;
    left: 10px;
}
.oc-name-row {
    width: 100%;
    display: flex;
    justify-content: center;
}
.oc-name-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--white);
    font-size: 20px;
    font-family: "Noto Serif SC", serif;
    font-weight: 400;
    text-align: center;
    padding: 8px 16px;
    width: 60%;
    max-width: 240px;
    outline: none;
    letter-spacing: 2px;
    transition: border-color 0.3s;
}
.oc-name-input:focus {
    border-bottom-color: var(--white);
}
.oc-name-input::placeholder {
    color: var(--white-ghost);
    font-weight: 300;
}
.current-world {
    font-size: 0.78rem;
    color: var(--white-dim);
    letter-spacing: 0.2em;
}

.river {
    position: relative;
    max-width: 600px;
    width: 100%;
    padding: 20px 0;
    margin: 0 auto;
}
.river::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.08) 10%, rgba(255,255,255,0.08) 90%, transparent);
    transform: translateX(-50%);
}

.river-node {
    position: relative;
    padding: 20px 0;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.node-geo {
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    transform: translate(-50%, -50%);
    z-index: 3;
    opacity: 0.25;
    transition: all 0.6s;
    color: var(--white);
}
.node-geo svg { width: 100%; height: 100%; }
.river-node:hover .node-geo { opacity: 0.6; }
.river-node.drawn .node-geo { opacity: 0.9; }
.river-node.locked .node-geo { opacity: 1; color: rgba(180,160,100,0.9); }

.river-node:nth-child(odd) .node-content { margin-right: calc(50% + 24px); text-align: right; }
.river-node:nth-child(even) .node-content { margin-left: calc(50% + 24px); text-align: left; }

.node-content {
    padding: 16px 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(8px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}
.river-node:hover .node-content { border-color: var(--border-active); background: var(--surface-hover); }
.river-node.locked .node-content { border-color: rgba(180,160,100,0.3); }

.node-fog {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--fog-bg, rgba(240,244,248,0.7));
    backdrop-filter: blur(3px);
    opacity: 1;
    transition: opacity 1s ease;
    z-index: 1;
    pointer-events: none;
}
.river-node.drawn .node-fog { opacity: 0; }

.node-label {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 0.7rem;
    font-style: italic;
    color: var(--white-ghost);
    letter-spacing: 0.2em;
    margin-bottom: 6px;
}
.node-title {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--white-dim);
    letter-spacing: 0.15em;
}
.node-result {
    font-size: 1rem;
    color: var(--white);
    line-height: 1.8;
    margin-top: 8px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.8s ease;
}
.river-node.drawn .node-result { opacity: 1; max-height: 80px; }

.node-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.4s;
}
.river-node.drawn .node-actions { opacity: 1; }

.node-btn {
    font-family: inherit;
    font-size: 0.72rem;
    color: var(--white-ghost);
    background: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.08em;
    transition: color 0.3s;
}
.node-btn:hover { color: var(--white); }
.node-btn.lock-btn.active { color: rgba(180,160,100,0.9); }

.draw-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    padding: 40px 0 60px;
    flex-wrap: wrap;
}

/* === PAGE 3: SHARE === */
.page-share { padding-top: 30px; }
.share-header { width: 100%; max-width: 600px; margin-bottom: 24px; }

.share-card { width: 100%; max-width: 480px; margin-bottom: 30px; }
.share-card-inner {
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(8px);
    padding: 36px 28px;
}
.share-card-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 100;
    letter-spacing: 0.5em;
    margin-bottom: 4px;
}
.share-card-world {
    text-align: center;
    font-size: 0.65rem;
    color: var(--white-ghost);
    letter-spacing: 0.3em;
    margin-bottom: 24px;
    font-style: italic;
}
.share-card-list { list-style: none; }
.share-card-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.share-card-list li:last-child { border-bottom: none; }
.share-card-label {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 0.58rem;
    font-style: italic;
    color: var(--white-ghost);
    letter-spacing: 0.12em;
    flex-shrink: 0;
    width: 65px;
}
.share-card-value {
    font-size: 0.72rem;
    color: var(--white);
    text-align: right;
    line-height: 1.5;
}

.share-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* === RESPONSIVE === */
@media (max-width: 700px) {
    .logo { font-size: 2.5rem; }
    .river-node:nth-child(odd) .node-content,
    .river-node:nth-child(even) .node-content {
        margin: 0 0 0 calc(50% + 20px);
        text-align: left;
    }
    .share-actions { flex-direction: column; align-items: center; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* === THEME SWITCHER === */
.theme-switcher {
    position: fixed;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.theme-dot {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.35s ease;
    opacity: 0.6;
}
.theme-dot::after {
    content: attr(title);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    white-space: nowrap;
    color: var(--white);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.theme-dot:hover::after { opacity: 1; }
.theme-dot:hover { opacity: 1; transform: scale(1.25); }
.theme-dot.active {
    opacity: 1;
    transform: scale(1.3);
    border-color: rgba(0,0,0,0.4);
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
}
.theme-dot[data-theme="mist"] { background: #5a9ec8; }
.theme-dot[data-theme="ink"] { background: #aaaaaa; }
.theme-dot[data-theme="aurora"] { background: #50d890; }
.theme-dot[data-theme="dream"] { background: #a870e0; }
.theme-dot[data-theme="amber"] { background: #d8a050; }
.theme-dot[data-theme="cyber"] { background: #0a0a0a; border-color: rgba(255,255,255,0.5); }

/* === MODE SWITCHER === */
.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 12px;
}
.mode-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--white-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: all 0.3s;
}
.mode-icon:hover {
    border-color: var(--border-active);
    background: var(--surface-hover);
    color: var(--white);
}
.mode-icon.active {
    border-color: var(--border-active);
    color: var(--white);
    background: var(--surface-hover);
    box-shadow: 0 0 8px var(--white-whisper);
}
.mode-icon svg { width: 100%; height: 100%; }
.mode-container { flex: 1; overflow-y: auto; padding: 0 16px; width: 100%; align-self: stretch; }

/* === WHEEL MODE === */
.wheel-mode { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 8px; }
.wheel-dim-tabs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 100%; }
.wheel-dim-tab {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--white-dim);
    cursor: pointer;
    transition: all 0.2s;
}
.wheel-dim-tab.active { border-color: var(--border-active); color: var(--white); background: var(--surface-hover); }
.wheel-dim-tab.done { opacity: 0.5; }
.wheel-stage { position: relative; }
.wheel-canvas { display: block; }
.wheel-pointer {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 12px solid var(--white);
}
.wheel-result { text-align: center; min-height: 32px; }
.wheel-result-label { font-size: 11px; color: var(--white-ghost); margin-right: 8px; }
.wheel-result-value { font-size: 16px; color: var(--white); font-weight: 300; }
.wheel-actions { display: flex; gap: 8px; }

/* === CARD MODE === */
.card-mode-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}
.flip-card {
    perspective: 600px;
    height: 66px;
    position: relative;
}
.flip-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
}
.flip-card-front { background: var(--surface); }
.flip-card-back {
    background: var(--surface-hover);
    transform: rotateY(180deg);
    border-color: var(--border-active);
}
.flip-card-geo { width: 20px; height: 20px; color: var(--white-ghost); }
.flip-card-label { font-size: 14px; color: var(--white); }
.flip-card-en { font-size: 10px; color: var(--white-ghost); font-style: italic; }
.flip-card-dim { font-size: 11px; color: var(--white-ghost); }
.flip-card-result { font-size: 15px; color: var(--white); font-weight: 300; text-align: center; }
.flip-card-actions {
    position: absolute;
    bottom: -24px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.flip-card.flipped .flip-card-actions { opacity: 1; }
.flip-card.locked .flip-card-inner { opacity: 0.6; }

/* === SLOT MODE === */
.slot-mode { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; max-width: 500px; width: 100%; margin: 0 auto; }
.slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s;
}
.slot-row.done { border-color: var(--border-active); }
.slot-row.locked { opacity: 0.5; }
.slot-label { min-width: 56px; text-align: right; }
.slot-dim-name { font-size: 14px; color: var(--white); display: block; }
.slot-dim-en { font-size: 10px; color: var(--white-ghost); font-style: italic; }
.slot-window {
    flex: 1;
    height: 36px;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    background: var(--surface);
}
.slot-reel { transition: transform 2.5s cubic-bezier(0.1, 0.7, 0.2, 1); }
.slot-item {
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 15px;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}
.slot-item.final { font-weight: 300; }
.slot-actions { display: flex; gap: 4px; }

/* === SCRATCH MODE === */
.scratch-mode-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}
.scratch-card {
    position: relative;
    height: 64px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.scratch-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--surface);
}
.scratch-dim { font-size: 12px; color: var(--white-ghost); }
.scratch-result { font-size: 15px; color: var(--white); font-weight: 300; }
.scratch-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: crosshair;
    border-radius: 8px;
}
.scratch-card.revealed .scratch-layer { display: none; }
.scratch-card-actions {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}
.scratch-card.revealed .scratch-card-actions { opacity: 1; }
.scratch-card.locked { opacity: 0.5; }

/* === PARTICLE MODE === */
.particle-mode {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 380px;
    overflow: hidden;
}
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    z-index: 5;
}
.particle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 10;
}
.particle-text.visible { opacity: 1; }
.pt-dim {
    font-size: 18px;
    color: var(--white);
    letter-spacing: 3px;
    opacity: 0.7;
}
.pt-value {
    font-size: 36px;
    font-weight: 300;
    color: var(--white);
    letter-spacing: 3px;
    font-family: "Noto Serif SC", serif;
}
.pt-swatch {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--white-whisper);
    margin-bottom: 4px;
}
.pr-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--white-whisper);
    flex-shrink: 0;
}
.pr-color-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}
.pr-swatch-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.pr-swatch-dot:hover { transform: scale(1.15); }
.pr-hex {
    font-size: 11px;
    color: var(--white-dim);
    font-family: monospace;
    letter-spacing: 0.5px;
}
.pr-reroll {
    background: none;
    border: 1px solid var(--border);
    color: var(--white-dim);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.pr-reroll:hover { opacity: 0.7; }
.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.08);
}
.particle-hint {
    position: absolute;
    bottom: 220px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: var(--white-dim);
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
    animation: breathePulse 3s ease-in-out infinite;
}
@keyframes breathePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}
.particle-progress {
    position: absolute;
    top: 80px;
    right: 20px;
    font-size: 11px;
    color: var(--white-ghost);
    z-index: 10;
    pointer-events: none;
}
.particle-result-list {
    width: 100%;
    max-width: 400px;
    margin: 16px auto 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: transparent;
}
.particle-result-list:empty {
    display: none;
}
.particle-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    width: 100%;
    border-bottom: 1px solid var(--border);
}
.particle-result-item:last-child { border-bottom: none; }
.pr-label {
    color: var(--white-dim);
    font-size: 12px;
    min-width: 40px;
    font-weight: 400;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.pr-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--white);
    font-size: 15px;
    font-family: "Noto Serif SC", serif;
    font-weight: 400;
    flex: 1;
    padding: 4px 0;
    outline: none;
    transition: border-color 0.3s;
}
.pr-input:hover {
    border-bottom-color: var(--border);
}
.pr-input:focus {
    border-bottom-color: var(--white-dim);
}
.pr-value { color: var(--white); }

/* === CYBER THEME OVERRIDES === */
[data-theme="cyber"] .particle-result-list {
    background: transparent;
}
[data-theme="cyber"] .particle-result-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
}
[data-theme="cyber"] .particle-result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
[data-theme="cyber"] .pr-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    min-width: 50px;
}
[data-theme="cyber"] .pr-input {
    font-size: 18px;
    font-weight: 200;
    letter-spacing: 1px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    font-family: "Cormorant Garamond", Georgia, serif;
    color: rgba(255, 255, 255, 0.9);
}
[data-theme="cyber"] .pr-hex { color: rgba(255,255,255,0.4); }
[data-theme="cyber"] .pr-reroll { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.4); }
[data-theme="cyber"] .color-dot { border-color: rgba(255,255,255,0.15); }
[data-theme="cyber"] .pt-value {
    font-size: 42px;
    font-weight: 100;
    letter-spacing: 6px;
    text-transform: uppercase;
}
[data-theme="cyber"] .pt-dim {
    font-size: 11px;
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0.5;
}
[data-theme="cyber"] .particle-hint {
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}
[data-theme="cyber"] .node-content {
    border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="cyber"] .mode-icon {
    border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="cyber"] .mode-icon.active {
    border-color: rgba(255, 255, 255, 0.6);
}
[data-theme="cyber"] .slot-row {
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="cyber"] .slot-dim-name {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
}
[data-theme="cyber"] .slot-item.final {
    font-size: 17px;
    font-weight: 200;
    letter-spacing: 1px;
}

/* === EXPORT MODAL === */
.export-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.export-modal {
    background: var(--bg, #1a1a1a);
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 12px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
}
.export-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--white-dim, #aaa);
    font-size: 22px;
    cursor: pointer;
}
.export-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--white, #fff);
    margin-bottom: 12px;
}
.export-modal-text {
    font-size: 14px;
    color: var(--white-dim, #ccc);
    line-height: 1.6;
    margin-bottom: 20px;
}
.export-modal-text strong {
    color: var(--accent, #fff);
}
.export-modal-captcha {
    margin-bottom: 16px;
}
.captcha-hint {
    font-size: 13px;
    color: var(--white-ghost, #888);
    margin-bottom: 10px;
}
.captcha-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border, rgba(255,255,255,0.15));
    border-radius: 6px;
    background: transparent;
    color: var(--white, #fff);
    font-size: 15px;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
}
.captcha-input:focus {
    border-color: var(--accent, #fff);
}
.captcha-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 6px;
}
.export-modal-confirm {
    width: 100%;
    margin-top: 8px;
}
