/* ========================================
   LOTTO SIMULATOR - DESIGN SYSTEM
   ======================================== */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2847;
    --bg-input: #0d1220;

    --text-primary: #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted: #5a6478;

    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-orange: #f97316;

    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-gold: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-blue: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
    --gradient-purple: linear-gradient(135deg, #7B1FA2 0%, #E040FB 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.3);
    --shadow-glow-gold: 0 0 30px rgba(245, 175, 25, 0.3);
    --shadow-glow-green: 0 0 30px rgba(16, 185, 129, 0.3);

    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-xs: 6px;

    --font-main: 'Outfit', 'Noto Sans KR', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Header === */
.header {
    text-align: center;
    padding: 40px 0 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 2.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
}

.top-nav {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-link:hover {
    color: var(--accent-blue);
    transform: translateX(-4px);
}

/* === Panel Base === */
.panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-body {
    padding: 24px;
}

/* === Settings Panel === */
.setting-group {
    margin-bottom: 24px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.amount-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.amount-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.amount-btn:hover {
    background: var(--accent-blue);
    transform: scale(1.05);
}

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

.amount-display {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 0 16px;
    height: 48px;
    transition: var(--transition);
}

.amount-display:focus-within {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

.amount-display input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    width: 100%;
}

.amount-display input::-webkit-inner-spin-button,
.amount-display input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.amount-display .currency {
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.amount-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

#gameCount {
    color: var(--accent-blue);
    font-weight: 600;
}

.quick-amounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.quick-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

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

/* Speed Control */
.speed-group {
    padding-top: 4px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.speed-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

#speedControl {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#speedControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

#speedControl::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

/* === Control Panel === */
.control-panel {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: transparent;
    border: none;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-start {
    flex: 1;
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

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

.btn-stop {
    flex: 1;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
}

.btn-reset {
    padding: 14px 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-reset:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value.negative {
    color: var(--accent-red);
}

.stat-value.positive {
    color: var(--accent-green);
}

/* === Prize Grid === */
.prize-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 20px 24px;
}

.prize-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: 16px 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.prize-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.prize-1st::before {
    background: var(--gradient-gold);
}

.prize-2nd::before {
    background: var(--gradient-purple);
}

.prize-3rd::before {
    background: var(--gradient-blue);
}

.prize-4th::before {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
}

.prize-5th::before {
    background: linear-gradient(90deg, var(--text-muted), var(--text-secondary));
}

.prize-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.prize-rank {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.prize-1st .prize-rank {
    color: var(--accent-yellow);
}

.prize-2nd .prize-rank {
    color: var(--accent-purple);
}

.prize-3rd .prize-rank {
    color: var(--accent-blue);
}

.prize-4th .prize-rank {
    color: var(--accent-cyan);
}

.prize-5th .prize-rank {
    color: var(--text-secondary);
}

.prize-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.prize-match {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.prize-money {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.prize-count {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Prize card win animation */
.prize-card.won {
    animation: prizeFlash 1s ease;
}

.prize-1st.won {
    border-color: var(--accent-yellow);
    box-shadow: var(--shadow-glow-gold);
}

.prize-2nd.won {
    border-color: var(--accent-purple);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.prize-3rd.won {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

@keyframes prizeFlash {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* === Round Panel === */
.round-badge {
    background: var(--bg-secondary);
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.round-content {
    padding: 24px;
}

.winning-numbers-section {
    margin-bottom: 24px;
}

.winning-numbers-section h3,
.my-tickets-section h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 16px;
}

.winning-numbers {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Lotto Balls === */
.ball {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    position: relative;
    transition: var(--transition);
}

.ball.placeholder {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

/* Ball colors by number range */
.ball.range-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.ball.range-2 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.ball.range-3 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.ball.range-4 {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.ball.range-5 {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.ball.matched {
    animation: ballPulse 0.6s ease;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    outline: 3px solid var(--accent-green);
    outline-offset: 3px;
}

@keyframes ballPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.bonus-separator {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
    margin: 0 4px;
}

.ball.bonus {
    border: 2px solid rgba(236, 72, 153, 0.5);
}

.ball.bonus.matched {
    outline-color: var(--accent-pink);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}

/* === Tickets === */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.tickets-list::-webkit-scrollbar {
    width: 6px;
}

.tickets-list::-webkit-scrollbar-track {
    background: transparent;
}

.tickets-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ticket-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

.ticket-row.has-prize {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
}

.ticket-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 20px;
}

.ticket-balls {
    display: flex;
    gap: 6px;
    flex: 1;
}

.ticket-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.ticket-ball.matched {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
    animation: ballPulse 0.5s ease;
}

.ticket-ball.bonus-matched {
    outline: 2px solid var(--accent-pink);
    outline-offset: 2px;
}

.ticket-prize {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.ticket-prize.prize-1 {
    background: rgba(245, 175, 25, 0.2);
    color: var(--accent-yellow);
}

.ticket-prize.prize-2 {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple);
}

.ticket-prize.prize-3 {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.ticket-prize.prize-4 {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.ticket-prize.prize-5 {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.ticket-no-prize {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-tickets,
.empty-history {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 0.9rem;
}

/* === History Panel === */
.history-list {
    padding: 16px 24px;
    max-height: 300px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xs);
    margin-bottom: 8px;
    border-left: 3px solid;
    transition: var(--transition);
}

.history-item:hover {
    transform: translateX(4px);
}

.history-item.h-1st {
    border-left-color: var(--accent-yellow);
}

.history-item.h-2nd {
    border-left-color: var(--accent-purple);
}

.history-item.h-3rd {
    border-left-color: var(--accent-blue);
}

.history-item.h-4th {
    border-left-color: var(--accent-cyan);
}

.history-item.h-5th {
    border-left-color: var(--text-secondary);
}

.history-round {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-prize-rank {
    font-size: 0.85rem;
    font-weight: 700;
}

.history-prize-money {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.footer-info {
    text-align: left;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-info h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-info ul {
    list-style: none;
    padding-left: 0;
}

.footer-info li {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.footer-info li strong {
    color: var(--accent-blue);
}

.disclaimer {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.odds {
    font-size: 0.85rem;
}

.odds strong {
    color: var(--accent-yellow);
}

.footer p {
    margin-bottom: 6px;
}

.footer strong {
    color: var(--accent-yellow);
}

/* === Celebration Overlay === */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.celebration-content {
    text-align: center;
    padding: 48px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    animation: scaleIn 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-emoji {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: celebrateBounce 1s ease infinite;
}

@keyframes celebrateBounce {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.2) rotate(-10deg);
    }

    75% {
        transform: scale(1.2) rotate(10deg);
    }
}

.celebration-content h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.celebration-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.8;
}

.btn-close-celebration {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-celebration:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

/* === Confetti Animation === */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 1001;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .app {
        padding: 0 12px;
    }

    .logo h1 {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }

    .prize-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 16px;
    }

    .prize-grid .prize-card:nth-child(4),
    .prize-grid .prize-card:nth-child(5) {
        grid-column: span 1;
    }

    .winning-numbers {
        gap: 6px;
    }

    .ball {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .ticket-ball {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .control-panel {
        flex-wrap: wrap;
    }

    .btn-start,
    .btn-stop {
        flex: 1 1 60%;
    }

    .btn-reset {
        flex: 1 1 30%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .prize-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-amounts {
        justify-content: center;
    }
}

/* === Running animation for settings panel === */
.settings-panel.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* === Pulse animation for active simulation === */
@keyframes activePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

.round-panel.active {
    border-color: rgba(59, 130, 246, 0.3);
    animation: activePulse 2s ease-in-out infinite;
}

/* === Number matching highlight flash === */
@keyframes matchFlash {
    0% {
        background: rgba(16, 185, 129, 0.3);
    }

    100% {
        background: transparent;
    }
}

.ticket-row.flash {
    animation: matchFlash 1s ease;
}