/* Sequence Recall Game Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #8B5CF6;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --tile-1: #EF4444;
    --tile-2: #3B82F6;
    --tile-3: #22C55E;
    --tile-4: #EAB308;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #1E1B4B 0%, #4C1D95 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 450px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
    border-bottom: 1px solid #E5E7EB;
}

.game-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.stats {
    display: flex;
    gap: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

#game-area {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.instruction {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
    padding: 12px 24px;
    background: #F3F4F6;
    border-radius: 12px;
}

.sequence-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tile {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    opacity: 0.6;
}

.tile[data-index="0"] {
    background: var(--tile-1);
}

.tile[data-index="1"] {
    background: var(--tile-2);
}

.tile[data-index="2"] {
    background: var(--tile-3);
}

.tile[data-index="3"] {
    background: var(--tile-4);
}

.tile.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 30px currentColor;
}

.tile[data-index="0"].active {
    box-shadow: 0 0 30px var(--tile-1);
}

.tile[data-index="1"].active {
    box-shadow: 0 0 30px var(--tile-2);
}

.tile[data-index="2"].active {
    box-shadow: 0 0 30px var(--tile-3);
}

.tile[data-index="3"].active {
    box-shadow: 0 0 30px var(--tile-4);
}

.tile:hover:not(.disabled) {
    opacity: 0.8;
}

.tile.disabled {
    pointer-events: none;
}

.btn-start {
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.btn-start.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

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

.stars {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.result-label {
    font-size: 14px;
    color: var(--text-muted);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid #E5E7EB;
}

@media (max-width: 400px) {
    .tile {
        width: 90px;
        height: 90px;
    }

    .sequence-display {
        gap: 12px;
    }
}