:root {
    --cosmic-deep: #1a0a2e;
    --cosmic-mid: #2d1b69;
    --cosmic-light: #3d2b7a;
    --neon-green: #39ff14;
    --neon-pink: #ff006e;
    --neon-cyan: #00f5ff;
    --amber: #ffbe0b;
    --glow-green: 0 0 20px rgba(57,255,20,0.3);
    --glow-pink: 0 0 20px rgba(255,0,110,0.3);
    --glow-cyan: 0 0 20px rgba(0,245,255,0.3);
}

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

body {
    background: var(--cosmic-deep);
    color: #e0d8f0;
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .title-text {
    font-family: 'Fredoka', sans-serif;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-1deg) scale(1); }
    25% { transform: rotate(1deg) scale(1.02); }
    50% { transform: rotate(-0.5deg) scale(1); }
    75% { transform: rotate(0.5deg) scale(1.01); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce-in {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.wobble-text {
    animation: wobble 3s ease-in-out infinite;
    display: inline-block;
}

.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

.float-anim {
    animation: float 3s ease-in-out infinite;
}

.slide-in {
    animation: slide-in 0.4s ease-out;
}

.bounce-in {
    animation: bounce-in 0.5s ease-out;
}

.neon-border {
    border: 2px solid var(--neon-green);
    box-shadow: var(--glow-green), inset 0 0 10px rgba(57,255,20,0.05);
}

.pink-border {
    border: 2px solid var(--neon-pink);
    box-shadow: var(--glow-pink), inset 0 0 10px rgba(255,0,110,0.05);
}

.cyan-border {
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--glow-cyan), inset 0 0 10px rgba(0,245,255,0.05);
}

.panel {
    background: linear-gradient(135deg, rgba(45,27,105,0.8), rgba(26,10,46,0.9));
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(57,255,20,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-green), #20cc10);
    color: var(--cosmic-deep);
    font-weight: 700;
    border-radius: 12px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s;
    font-size: 14px;
}
.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-green);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--neon-pink), #cc0058);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s;
    font-size: 14px;
}
.btn-secondary:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-pink);
}

.btn-cyan {
    background: linear-gradient(135deg, var(--neon-cyan), #00bbcc);
    color: var(--cosmic-deep);
    font-weight: 600;
    border-radius: 12px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s;
    font-size: 14px;
}
.btn-cyan:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-cyan);
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.input-field {
    background: rgba(26,10,46,0.8);
    border: 1px solid rgba(57,255,20,0.3);
    border-radius: 12px;
    padding: 10px 14px;
    color: #e0d8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}
.input-field:focus {
    border-color: var(--neon-green);
    box-shadow: var(--glow-green);
}

.input-field::placeholder {
    color: rgba(224,216,240,0.3);
}

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2339ff14' fill='none' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.input-field option {
    background: #1a0a2e;
    color: #e0d8f0;
}

textarea.input-field {
    resize: vertical;
    min-height: 60px;
}

.tag {
    display: inline-block;
    background: rgba(57,255,20,0.15);
    border: 1px solid rgba(57,255,20,0.3);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 11px;
    margin: 2px;
    color: var(--neon-green);
    cursor: pointer;
    transition: all 0.2s;
}
.tag:hover { background: rgba(57,255,20,0.3); }
.tag.selected {
    background: var(--neon-green);
    color: var(--cosmic-deep);
    font-weight: 600;
}

.tag-pink {
    background: rgba(255,0,110,0.15);
    border-color: rgba(255,0,110,0.3);
    color: var(--neon-pink);
}
.tag-pink.selected {
    background: var(--neon-pink);
    color: white;
}

.card {
    background: linear-gradient(135deg, rgba(61,43,122,0.6), rgba(45,27,105,0.4));
    border-radius: 16px;
    border: 1px solid rgba(57,255,20,0.1);
    padding: 16px;
    transition: all 0.3s;
}
.card:hover {
    border-color: rgba(57,255,20,0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.nav-tab {
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(224,216,240,0.6);
    white-space: nowrap;
}
.nav-tab:hover {
    background: rgba(57,255,20,0.1);
    color: #e0d8f0;
}
.nav-tab.active {
    background: rgba(57,255,20,0.15);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: var(--glow-green);
}

.slider-container {
    position: relative;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(57,255,20,0.2);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--neon-green);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(57,255,20,0.5);
}

input[type="color"] {
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(57,255,20,0.3);
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }

.chat-bubble {
    border-radius: 16px;
    padding: 10px 14px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.5;
}
.chat-user {
    background: linear-gradient(135deg, rgba(57,255,20,0.2), rgba(57,255,20,0.1));
    border: 1px solid rgba(57,255,20,0.2);
    margin-left: auto;
}
.chat-npc {
    background: linear-gradient(135deg, rgba(255,0,110,0.2), rgba(255,0,110,0.1));
    border: 1px solid rgba(255,0,110,0.2);
}

.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(57,255,20,0.3);
    border-radius: 3px;
}

.face-canvas {
    border: 2px solid rgba(57,255,20,0.3);
    border-radius: 12px;
    cursor: crosshair;
    background: #0d0520;
    touch-action: none;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #2d1b69, #1a0a2e);
    border: 1px solid rgba(57,255,20,0.3);
    border-radius: 20px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--glow-green);
}

.timeline-node {
    position: relative;
    padding-left: 30px;
    padding-bottom: 24px;
    border-left: 2px solid rgba(57,255,20,0.2);
    margin-left: 10px;
}
.timeline-node::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 10px rgba(57,255,20,0.5);
}

.map-land {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    padding: 4px;
    word-break: break-word;
    line-height: 1.1;
}
.map-land:hover {
    transform: scale(1.1);
    z-index: 10;
    border-color: var(--neon-green);
}

@media (max-width: 768px) {
    .nav-tab { font-size: 11px; padding: 6px 10px; }
    .modal-content { padding: 16px; width: 95%; }
}