/* Modern CSS Design System - Zufallshelfer Dark Theme */

:root {
    --bg-dark: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    /* Neon Gradients */
    --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --grad-secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --shadow-neon: 0 0 20px rgba(139, 92, 246, 0.3);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.3);
    
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 15px;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Glowing Elements */
.background-glows {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #030712 100%);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Header */
.app-header {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 5px;
}

.app-header .logo {
    font-size: 3rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.app-header .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Section Cards (Glassmorphism) */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    border-left: 3px solid #8b5cf6;
    padding-left: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    margin-bottom: 0;
}

/* --- BUTTONS --- */
button {
    font-family: var(--font-main);
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

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

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

.btn-glow:hover::after {
    left: 120%;
    top: 120%;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 20px;
    font-size: 0.95rem;
}

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

.btn-text-danger {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.btn-text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Quick Grid Button */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Make Lotto full-width in the grid */
.quick-grid button:last-child {
    grid-column: span 2;
}

.btn-quick {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 18px 14px;
    flex-direction: column;
    gap: 8px;
    color: var(--text-primary);
    border-radius: 18px;
}

.btn-quick .icon {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.btn-quick .label {
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-quick:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.btn-quick:hover .icon {
    transform: scale(1.15) rotate(5deg);
}

/* --- DYNAMIC INPUTS --- */
.dynamic-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#inputs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.25s ease-out;
}

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

.input-row input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: 12px;
    color: white;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.input-row input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: rgba(0, 0, 0, 0.45);
}

.btn-remove {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

/* Save Group */
.save-set-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.save-set-group input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: 12px;
    color: white;
    font-family: var(--font-main);
    font-size: 0.9rem;
}

.save-set-group input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.save-set-group button {
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 0 16px;
}

/* Saved Sets Grid */
.saved-sets-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar Styling */
.saved-sets-grid::-webkit-scrollbar {
    width: 6px;
}
.saved-sets-grid::-webkit-scrollbar-track {
    background: transparent;
}
.saved-sets-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.saved-set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.saved-set-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-load-set {
    flex-grow: 1;
    background: none;
    border: none;
    justify-content: flex-start;
    text-align: left;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 0;
}

.btn-load-set .set-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
}

.placeholder-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding: 15px 0;
}

/* --- VIEWS --- */
.view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.view.hidden {
    display: none !important;
}

/* --- DECISION SCREEN (ZUFALLS-ANSICHT) --- */
.decision-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
}

/* Mode Switcher Tabs */
.mode-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 4px;
}

.mode-tab {
    flex: 1;
    padding: 10px 4px;
    font-size: 0.85rem;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
}

.mode-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mode-tab:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Visualization Box */
.visualization-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.visual-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.3s ease-out;
}

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

/* 1. GLÜCKSRAD SPECIFIC */
#container-wheel {
    position: relative;
    padding: 20px;
}

.wheel-pointer {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    color: #ec4899;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

#wheel-canvas {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

/* 2. TICKER SPECIFIC */
.ticker-box {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-neon);
    border-radius: 16px;
    padding: 40px 20px;
    width: 80%;
    max-width: 320px;
    text-align: center;
    overflow: hidden;
}

#ticker-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    word-break: break-word;
    display: inline-block;
    transition: transform 0.1s ease;
}

/* 3. COIN SPECIFIC (3D Coin Setup) */
.coin-wrapper {
    perspective: 1000px;
    width: 160px;
    height: 160px;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 3.5s cubic-bezier(0.1, 0.8, 0.1, 1);
}

.coin-side {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.2);
    border: 6px solid #f1c40f;
}

.coin-front {
    background: radial-gradient(circle, #f39c12, #d35400);
    color: white;
    transform: rotateY(0deg);
}

.coin-back {
    background: radial-gradient(circle, #f1c40f, #f39c12);
    color: #2c3e50;
    transform: rotateY(180deg);
    border-color: #f39c12;
}

/* Ergebnis Display (Bottom) */
.ergebnis-wrapper {
    background: rgba(16, 185, 129, 0.1);
    border: 1.5px solid #10b981;
    border-radius: 16px;
    padding: 16px 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ergebnis-wrapper.highlight-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.ergebnis-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

#ergebnis-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    word-break: break-word;
}

/* Actions Row in decision view */
.decision-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-large {
    width: 100%;
    padding: 16px;
}

/* General Animations classes */
.blur-animate {
    animation: textBlur 0.15s infinite alternate;
}

@keyframes textBlur {
    0% { filter: blur(0px); opacity: 1; }
    100% { filter: blur(4px); opacity: 0.5; }
}

.bounce-light {
    animation: bounce 0.6s ease-out;
}

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

/* Responsive adjust */
@media (max-width: 400px) {
    .app-header h1 {
        font-size: 1.8rem;
    }
    .btn-quick .icon {
        font-size: 1.5rem;
    }
    .visualization-box {
        min-height: 320px;
    }
    #wheel-canvas {
        width: 260px;
        height: 260px;
    }
    .coin-wrapper {
        width: 130px;
        height: 130px;
    }
}