/* Mobile-First Responsive Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #a855f7;
    --secondary-color: #0ea5e9;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: radial-gradient(circle at top left, #111827 0%, #020617 60%, #020617 100%);
    --bg-secondary: rgba(15, 23, 42, 0.85);
    --bg-tertiary: rgba(30, 41, 59, 0.55);
    --surface-color: rgba(148, 163, 184, 0.12);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5f5;
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow: 0 25px 45px -25px rgba(14, 165, 233, 0.35);
    --shadow-lg: 0 45px 90px -45px rgba(124, 58, 237, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 100%;
    min-height: 100vh;
    padding: 1rem 1rem 5.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
}

.title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    background: linear-gradient(120deg, var(--primary-light), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: linear-gradient(140deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.02));
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(12px);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    box-shadow: 0 20px 35px -20px rgba(124, 58, 237, 0.75);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 45px -22px rgba(124, 58, 237, 0.85);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.04));
}

.btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.35);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-icon {
    padding: 0.75rem;
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
}

.icon {
    font-size: 1.25rem;
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

#settingsScreen {
    justify-content: center;
    padding: 2rem 1rem;
}

.ad-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 0;
    background: rgba(15, 23, 42, 0.92);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(12px);
}

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

/* Main Menu */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.75rem;
    padding: 2.5rem 1.5rem 3.5rem;
    flex: 1;
    justify-content: center;
    background: var(--surface-color);
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.menu-title {
    font-size: clamp(2rem, 6vw, 2.75rem);
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 15px 35px rgba(14, 165, 233, 0.25);
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 40rem;
}

.mode-btn {
    padding: 1.75rem 1.25rem;
    background: linear-gradient(160deg, rgba(124, 58, 237, 0.12), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 1.5rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.mode-btn:hover {
    border-color: rgba(124, 58, 237, 0.6);
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

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

.mode-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 12px 24px rgba(14, 165, 233, 0.45));
}

.mode-text {
    font-size: 1.05rem;
}

.menu-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.1rem;
    width: 100%;
    max-width: 40rem;
}

.menu-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 20rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(12, 74, 110, 0.18);
    border-radius: 1.1rem;
    font-size: 0.95rem;
    border: 1px solid rgba(14, 165, 233, 0.25);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 35px -22px rgba(14, 165, 233, 0.45);
}

.stat-label {
    color: rgba(203, 213, 225, 0.75);
}

.stat-value {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 1.15rem;
}

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2rem 1.75rem 2.5rem;
    background: var(--surface-color);
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    width: min(600px, 100%);
    margin: 0 auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
}

.toggle-field {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

.field-label {
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.8);
}

.setting-input {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.9rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-input:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.65);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* Level Selection */
.level-container {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--surface-color);
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.level-container .btn {
    flex-shrink: 0;
    margin-top: auto;
}

.screen-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 12px 28px rgba(14, 165, 233, 0.25);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
    gap: 1rem;
    padding: 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 14rem);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(15, 23, 42, 0.3);
}

.level-grid::-webkit-scrollbar {
    width: 0.4rem;
}

.level-grid::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0.5rem;
}

.level-grid::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.6);
    border-radius: 0.5rem;
}

.level-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.8);
}

.level-btn {
    aspect-ratio: 1;
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.18), rgba(14, 165, 233, 0.12));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 1rem;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 35px -28px rgba(124, 58, 237, 0.75);
    backdrop-filter: blur(12px);
}

.level-btn:hover:not(:disabled) {
    border-color: rgba(124, 58, 237, 0.75);
    transform: translateY(-6px) scale(1.05);
}

.level-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.level-btn.completed {
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.25), rgba(14, 165, 233, 0.12));
    border-color: rgba(34, 197, 94, 0.45);
}

.level-btn.current {
    border-color: rgba(124, 58, 237, 0.85);
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
}

/* Game Area */
.game-top-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.12), rgba(124, 58, 237, 0.12));
    border-radius: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1;
    min-width: 280px;
}

.chip {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1.1rem;
    background: rgba(15, 23, 42, 0.65);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    min-width: 110px;
    backdrop-filter: blur(12px);
}

.chip-label {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.7);
}

.chip-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
}

.chip-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(14px);
}

.chip-button:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.6);
    box-shadow: 0 22px 35px -25px rgba(124, 58, 237, 0.7);
}

.game-area {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem 1rem 2.5rem;
    overflow-y: auto;
    min-height: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(165deg, rgba(14, 165, 233, 0.08), rgba(124, 58, 237, 0.08));
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(14px);
    box-shadow: inset 0 40px 60px -50px rgba(14, 165, 233, 0.35);
}

.tube {
    width: 4.25rem;
    min-width: 4.25rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.75rem 0.75rem 0.5rem 0.5rem;
    border-bottom: none;
    padding: 0.35rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.35rem;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    box-shadow: 0 25px 45px -30px rgba(14, 165, 233, 0.45);
    min-height: calc(4 * (100% / 4 + 0.35rem));
    backdrop-filter: blur(12px);
}

.tube:hover {
    border-color: rgba(124, 58, 237, 0.7);
    transform: translateY(-6px);
}

.tube.selected {
    border-color: rgba(124, 58, 237, 0.85);
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
    background: rgba(124, 58, 237, 0.18);
}

.tube.completed {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.18);
}

.tube.empty {
    border-style: dashed;
    border-width: 2px;
    background: rgba(15, 23, 42, 0.55);
    position: relative;
}

.tube.empty:hover {
    border-color: rgba(124, 58, 237, 0.65);
    border-style: solid;
    background: rgba(124, 58, 237, 0.18);
}

.tube.valid-target {
    border-color: rgba(34, 197, 94, 0.65);
    border-style: solid;
    background: rgba(34, 197, 94, 0.18);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.tube.valid-target.empty::before {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.6);
    animation: pulse 1.2s ease-in-out infinite;
}

.tube.has-space:not(.empty) {
    border-style: solid;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.tube::after {
    content: '';
    position: absolute;
    bottom: -0.2rem;
    left: 0;
    right: 0;
    height: 0.3rem;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 0 0 0.6rem 0.6rem;
    z-index: 1;
}

.tube.has-space:not(.empty)::before {
    content: attr(data-empty-slots);
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    background: rgba(124, 58, 237, 0.85);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    z-index: 10;
}

.tube.empty::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 50%;
    border: 2px dashed rgba(124, 58, 237, 0.65);
    animation: pulse 2s ease-in-out infinite;
    z-index: 2;
}

.empty-slot {
    width: 100%;
    aspect-ratio: 1;
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    opacity: 0.3;
    transition: all 0.2s ease;
    pointer-events: none;
}

.tube:hover .empty-slot {
    border-color: rgba(124, 58, 237, 0.8);
    opacity: 0.5;
    background: rgba(124, 58, 237, 0.12);
}

.ball {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 12px 25px -18px rgba(15, 23, 42, 0.8);
}

.ball.moving {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    transform: scale(1.12);
}

.game-controls {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.game-controls .btn {
    flex: 1;
    min-width: 8.5rem;
    max-width: 12.5rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 1rem;
    width: 100%;
    max-width: 25rem;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.modal-content::-webkit-scrollbar {
    width: 0.5rem;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 0.5rem;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-group:last-child {
    border-bottom: none;
}

.setting-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.setting-input {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.toggle {
    width: 3.2rem;
    height: 1.6rem;
    appearance: none;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.toggle:checked {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-color: transparent;
}

.toggle::before {
    content: '';
    position: absolute;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: white;
    top: 0.12rem;
    left: 0.15rem;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 20px -12px rgba(124, 58, 237, 0.6);
}

.toggle:checked::before {
    transform: translateX(1.35rem);
}

.game-result {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.celebration-item {
    min-width: 0;
}

@media (max-width: 640px) {
    .result-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .celebration-item {
        padding: 0.75rem;
    }
    
    .result-icon {
        font-size: 1.5rem;
    }
    
    .result-value {
        font-size: 1rem;
    }
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

/* Celebration Modal */
.celebration-modal {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 90vh;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.celebration-modal::-webkit-scrollbar {
    width: 0.5rem;
}

.celebration-modal::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
}

.celebration-modal::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 0.5rem;
}

.celebration-modal::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.celebration-container {
    position: relative;
    z-index: 10;
    min-height: min-content;
}

.celebration-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

@keyframes confetti {
    0% {
        transform: translateY(-100px) translateX(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(600px) translateX(calc(var(--random-x, 0) * 100px)) rotate(720deg);
        opacity: 0;
    }
}

.celebration-icon {
    font-size: 4rem;
    text-align: center;
    animation: celebration-bounce 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes celebration-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

.celebration-title {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-glow 2s ease-in-out infinite;
    text-align: center;
}

@keyframes title-glow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8));
    }
}

.celebration-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: 0.75rem;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    animation: slideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.result-row:nth-child(1) .celebration-item:nth-child(1) {
    animation-delay: 0.1s;
}

.result-row:nth-child(1) .celebration-item:nth-child(2) {
    animation-delay: 0.2s;
}

.result-row:nth-child(2) .celebration-item:nth-child(1) {
    animation-delay: 0.3s;
}

.result-row:nth-child(2) .celebration-item:nth-child(2) {
    animation-delay: 0.4s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.result-icon {
    font-size: 2rem;
    animation: icon-spin 2s ease-in-out infinite;
}

@keyframes icon-spin {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(10deg) scale(1.1);
    }
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.result-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
    animation: value-pulse 1.5s ease-in-out infinite;
}

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

.celebration-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    animation: button-glow 2s ease-in-out infinite;
}

@keyframes button-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
    }
}

.result-actions,
.pause-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-actions .btn,
.pause-actions .btn {
    width: 100%;
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    .app-container {
        padding: 1rem;
        max-width: 48rem;
        margin: 0 auto;
    }
 
     .title {
         font-size: 2rem;
     }
 
     .menu-title {
         font-size: 2.5rem;
     }
 
    .game-modes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 100%;
    }
 
    .level-grid {
        grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
        gap: 1rem;
    }
 
    .tube {
        width: 5rem;
        min-width: 5rem;
    }
 
    .menu-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
    }
 }

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .app-container {
        max-width: 64rem;
        padding: 2rem;
    }

    .game-modes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .level-grid {
        grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
    }

    .tube {
        width: 5.5rem;
        min-width: 5.5rem;
    }

    .result-actions,
    .pause-actions {
        flex-direction: row;
    }

    .result-actions .btn,
    .pause-actions .btn {
        flex: 1;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.5rem); }
}

.bounce {
    animation: bounce 0.5s ease;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
