:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 30px;
    text-align: center;
}

h1 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.8rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-bottom: 12px;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-hover);
}

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

.btn-share {
    background-color: #1877f2;
}

.btn-share:hover {
    background-color: #166fe5;
}

.btn-secondary {
    background-color: #334155;
}

.btn-secondary:hover {
    background-color: #475569;
}

#game-box {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s ease;
    margin-bottom: 20px;
    background-color: #334155;
}

.state-ready {
    background-color: #334155 !important;
}

.state-waiting {
    background-color: #ef4444 !important;
}

.state-click {
    background-color: #10b981 !important;
}

.state-too-fast {
    background-color: #f59e0b !important;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.score-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #38bdf8;
    margin: 10px 0;
}

.rank-badge {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.challenge-banner {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(79, 70, 229, 0.16));
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e0f2fe;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.challenge-banner[hidden],
.challenge-result[hidden] {
    display: none;
}

.challenge-result {
    font-size: 1rem;
    font-weight: 600;
    margin: -6px 0 18px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.32);
    color: #fde68a;
    line-height: 1.4;
}

.challenge-result.won {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

.share-hint {
    font-size: 0.85rem;
    margin: -4px 0 16px;
}

.link-share {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    color: #93c5fd;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
    margin-bottom: 8px;
}

.link-share:hover {
    color: #bfdbfe;
}
