/* Sum Up Game Styles */

.sumup-container {
    max-width: 600px;
}

/* Target Display */
.target-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.target-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.target-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.target-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    min-width: 60px;
    text-align: center;
}

.sum-display {
    text-align: center;
}

.sum-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-sum {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.sum-display.correct .current-sum {
    color: var(--success);
}

.sum-display.over .current-sum {
    color: var(--error);
}

.target-timer {
    flex: 1;
    max-width: 150px;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.target-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.1s linear;
    border-radius: 3px;
}

/* Game Area */
.sumup-area {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
}

.sumup-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 280px;
}

.sumup-row {
    position: relative;
    flex: 1;
    background: var(--bg-elevated);
    overflow: hidden;
}

.sumup-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, var(--bg-elevated), transparent);
    pointer-events: none;
    z-index: 5;
}

.sumup-row::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, var(--bg-elevated), transparent);
    pointer-events: none;
    z-index: 5;
}

/* Number Tiles */
.sumup-row .number-tile {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    z-index: 1;
}

.sumup-row .number-tile:hover {
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.05);
    z-index: 2;
}

.sumup-row .number-tile.selected {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
    z-index: 3;
}

.sumup-row .number-tile.correct {
    background: var(--success) !important;
    border-color: transparent !important;
    color: white !important;
    animation: correctPop 0.3s ease forwards;
}

.sumup-row .number-tile.incorrect {
    background: var(--error) !important;
    border-color: transparent !important;
    color: white !important;
    animation: shake 0.3s ease;
}

@keyframes correctPop {
    0% { transform: translateY(-50%) scale(1.1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.3); }
    100% { transform: translateY(-50%) scale(0); opacity: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateY(-50%); }
    20%, 60% { transform: translateY(-50%) translateX(-5px); }
    40%, 80% { transform: translateY(-50%) translateX(5px); }
}

/* Start Overlay */
.start-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 15;
}

.start-overlay.active {
    display: flex;
}

.start-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.start-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.start-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* Pause Overlay */
.pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
    border-radius: 16px;
}

.pause-overlay.active {
    display: flex;
}

.pause-overlay i {
    font-size: 3rem;
    color: var(--primary);
}

.pause-overlay span {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Light mode */
[data-theme="light"] .sumup-area {
    background: #e7e5e4;
}

[data-theme="light"] .sumup-row {
    background: #f5f5f4;
}

[data-theme="light"] .sumup-row::before {
    background: linear-gradient(to right, #f5f5f4, transparent);
}

[data-theme="light"] .sumup-row::after {
    background: linear-gradient(to left, #f5f5f4, transparent);
}

[data-theme="light"] .sumup-row .number-tile {
    background: white;
    border-color: #d6d3d1;
}

[data-theme="light"] .target-section {
    background: #f5f5f4;
}

[data-theme="light"] .start-overlay {
    background: #f5f5f4;
}

/* Responsive */
@media (max-width: 480px) {
    .sumup-rows {
        height: 240px;
    }
    
    .sumup-row .number-tile {
        width: 46px;
        height: 46px;
        font-size: 1.3rem;
    }
    
    .target-number {
        font-size: 2rem;
    }
    
    .target-section {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .target-timer {
        order: 3;
        max-width: 100%;
        flex: 1 1 100%;
    }
}
