/* STYLE.CSS - Dice Probability Simulator (Würfel-Labor) */

/* 1. CORE DESIGN SYSTEM & TOKENS */
:root {
    --bg-primary: #08060f;
    --bg-secondary: #120e24;
    --card-bg: rgba(20, 16, 38, 0.55);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-glow: rgba(139, 92, 246, 0.15);
    
    --text-primary: #f3f1f7;
    --text-secondary: #9f9cb6;
    --text-muted: #64607d;
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.4);
    --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    
    --danger: #f43f5e;
    --danger-gradient: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* 2. BACKGROUND DECORATIONS (AMBIENT GLOWS) */
.app-container {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.45;
    pointer-events: none;
    animation: blob-float 25s infinite alternate ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
    animation-duration: 30s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
    top: 40%;
    left: 45%;
    animation-delay: -10s;
    animation-duration: 20s;
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.1); }
    100% { transform: translate(-20px, -50px) scale(0.95); }
}

/* 3. GLASSMORPHISM STYLES */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4), inset 0 0 1px 1px rgba(255, 255, 255, 0.08), 0 0 20px var(--card-glow);
}

.glass-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.glass-input:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* 4. BUTTONS & CONTROLS */
button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--primary-glow), 0 0 15px rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-danger-outline {
    background: rgba(244, 63, 94, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.btn-danger-outline:hover {
    background: var(--danger-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
    transform: translateY(-1px);
}

.btn-icon-only {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.btn-preset {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 12px;
}

.btn-preset:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.btn-preset.active {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* 5. SLIDER & SWITCH CONTROLS */
.slider-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22d3ee;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
    transition: transform 0.1s;
}

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

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.toggle-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.switch input:checked + .slider {
    background-color: var(--primary);
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

.switch .slider.round {
    border-radius: 34px;
}

.switch .slider.round:before {
    border-radius: 50%;
}

/* 6. SETUP SCREEN & CARD SPECIFICS */
.view-screen {
    display: none;
    width: 100%;
    max-width: 680px;
    z-index: 10;
}

.view-screen.active {
    display: block;
}

#simulator-screen.view-screen {
    max-width: 1200px;
}

.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.setup-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.setup-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

#btn-start {
    width: 100%;
    padding: 1.1rem;
    font-size: 1.1rem;
    border-radius: 18px;
    margin-top: 0.5rem;
}

.info-card {
    padding: 1.75rem 2rem;
    border-color: rgba(139, 92, 246, 0.15);
}

.info-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #22d3ee;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.info-card p:last-child {
    margin-bottom: 0;
}

/* 7. SIMULATOR SCREEN & LAYOUT */
.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
    gap: 1rem;
}

.sim-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sim-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

#active-dice-badge {
    text-transform: uppercase;
}

.simulator-layout {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 2rem;
    width: 100%;
}

/* 8. DICE ARENA & 3D STYLING */
.dice-arena {
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 24px;
}

.dice-container {
    perspective: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 180px;
}

/* 3D Cube Dice */
.dice-3d {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(45deg);
    transition: transform var(--transition-normal);
}

.dice-face {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(28, 22, 54, 0.9) 0%, rgba(14, 10, 31, 0.95) 100%);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.08), 0 5px 25px rgba(0, 0, 0, 0.4);
    display: block;
    backdrop-filter: blur(4px);
}

/* 3D Dice Sides Transforms */
.face-front { transform: rotateY(0deg) translateZ(50px); }
.face-back { transform: rotateY(180deg) translateZ(50px); }
.face-right { transform: rotateY(90deg) translateZ(50px); }
.face-left { transform: rotateY(-90deg) translateZ(50px); }
.face-top { transform: rotateX(90deg) translateZ(50px); }
.face-bottom { transform: rotateX(-90deg) translateZ(50px); }

/* Dot patterns for D6 */
.dice-face .dot {
    position: absolute;
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), inset 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
}

.dot.center { top: 50%; left: 50%; }
.dot.top-left { top: 25%; left: 25%; }
.dot.top-right { top: 25%; left: 75%; }
.dot.middle-left { top: 50%; left: 25%; }
.dot.middle-right { top: 50%; left: 75%; }
.dot.bottom-left { top: 75%; left: 25%; }
.dot.bottom-right { top: 75%; left: 75%; }

/* Polyhedral / Custom Dice (SVG-based D20 shape) */
.poly-dice-wrapper {
    width: 140px;
    height: 140px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
}

.poly-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

.poly-bg {
    fill: rgba(18, 14, 36, 0.8);
    stroke: var(--accent);
    stroke-width: 1.5;
}

.poly-edge {
    fill: none;
    stroke: rgba(6, 182, 212, 0.35);
    stroke-width: 1;
}

.poly-value {
    position: absolute;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 12px var(--accent-glow);
    z-index: 2;
}

/* Animations for Dice Rolling */
.rolling {
    animation: rolling-tumble 0.5s infinite linear;
}

.rolling-poly {
    animation: rolling-scale 0.5s infinite ease-in-out alternate;
}

@keyframes rolling-tumble {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

@keyframes rolling-scale {
    0% { transform: scale(0.9) rotate(0deg); }
    100% { transform: scale(1.15) rotate(180deg); }
}

.last-roll-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.last-roll-banner .value {
    font-size: 1.4rem;
    color: #fff;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.1rem 0.75rem;
    border-radius: 8px;
    min-width: 40px;
    text-align: center;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* 9. CONTROL PANEL CARD */
.control-panel {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.control-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.control-row button {
    flex: 1;
    min-width: 0;
}

.control-row.sliders {
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.btn-play {
    flex-grow: 1;
}

.btn-play:hover {
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-play.playing {
    background: var(--accent-gradient);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-play.playing:hover {
    box-shadow: 0 6px 24px var(--accent-glow);
}

/* 10. RECENT ROLLS TAPE */
.recent-rolls-container {
    padding: 1.25rem 1.5rem;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.recent-rolls-container h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.recent-rolls-tape {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.4rem 0.2rem;
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.recent-rolls-tape::-webkit-scrollbar {
    height: 4px;
}

.recent-rolls-tape::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.empty-tape-msg {
    color: var(--text-muted);
    font-size: 0.85rem;
    align-self: center;
}

.roll-bubble {
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    animation: slide-in-roll 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.roll-bubble:first-child {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

@keyframes slide-in-roll {
    from {
        opacity: 0;
        transform: translateX(-15px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 11. STATS OVERVIEW MINI-CARDS */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-mini-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    border-radius: 20px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
}

/* 12. LIVE CHART VIEW (Vertical Custom CSS Bars) */
.chart-container {
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.chart-mode-selectors {
    display: flex;
    gap: 1rem;
}

.chart-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-color.expected {
    border: 1px dashed var(--danger);
    background: rgba(244, 63, 94, 0.1);
}

.legend-color.actual {
    background: var(--accent-gradient);
}

.chart-visual {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    position: relative;
}

.chart-placeholder {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    align-self: center;
}

/* Chart bar column structure */
.chart-bar-col {
    flex-grow: 1;
    flex-basis: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.bar-track {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Actual frequency bar styling */
.bar-actual {
    width: 22px;
    background: var(--accent-gradient);
    border-radius: 6px 6px 0 0;
    min-height: 2px;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    transition: height var(--transition-fast) ease-out;
    z-index: 2;
}

/* Theoretical percentage indicator line */
.bar-expected-line {
    position: absolute;
    width: 32px;
    height: 2px;
    background: var(--danger);
    box-shadow: 0 0 5px rgba(244, 63, 94, 0.8);
    transition: bottom var(--transition-fast) ease-out;
    z-index: 3;
}

.bar-expected-line::after {
    content: "";
    position: absolute;
    left: -4px;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 1px dashed var(--danger);
    opacity: 0.6;
}

.bar-value {
    position: absolute;
    top: -24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

.col-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 13. STATS DATA TABLE */
.table-container {
    padding: 1.75rem;
}

.table-container h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.stats-table th {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.stats-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.text-center {
    text-align: center;
}

/* Percentage progress cells */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 200px;
}

.progress-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    width: 0;
    transition: width var(--transition-fast) ease-out;
}

/* Deviation indicator badges */
.deviation-badge {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.deviation-badge.neg {
    background: rgba(244, 63, 94, 0.1);
    color: #f87171;
}

.deviation-badge.pos {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.deviation-badge.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

/* 14. RESPONSIVENESS & MEDIA QUERIES */
@media (max-width: 1024px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
    
    .sim-column-left {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 0.75rem;
    }
    
    .setup-card {
        padding: 1.5rem;
    }
    
    .setup-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .stats-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .sim-header {
        flex-wrap: wrap;
    }
    
    .control-row {
        flex-direction: column;
    }
    
    .btn-preset {
        flex-grow: 1;
        text-align: center;
    }
}

/* 15. INTRO ANIMATIONS */
.animate-fade-in {
    animation: fadeIn 0.8s var(--transition-normal) forwards;
}

.animate-slide-up {
    opacity: 0;
    animation: slideUp 0.8s var(--transition-normal) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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