:root {
    --primary-color: #2563eb;
    /* Blue */
    --secondary-color: #3b82f6;
    --accent-color: #fbbf24;
    --background-color: #eff6ff;
    --text-color: #1e3a8a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#game-header {
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-title {
    font-size: 1.5rem;
    font-weight: bold;
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
    color: white;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

.stat-value {
    font-weight: bold;
    font-family: monospace;
    font-size: 1.2rem;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.number-display {
    font-size: 6rem;
    font-weight: bold;
    color: var(--text-color);
    letter-spacing: 10px;
    margin-bottom: 20px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#progress-bar-container {
    width: 200px;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 30px;
}

#progress-bar {
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    transform-origin: left;
    transition: transform linear;
}

.instruction {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #6b7280;
}

.display-input {
    font-size: 3rem;
    min-height: 60px;
    min-width: 200px;
    border-bottom: 2px solid var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 5px;
    color: var(--text-color);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.key {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    color: #374151;
    cursor: pointer;
    box-shadow: 0 4px 0 #e5e7eb;
    transition: all 0.1s;
}

.key:active {
    transform: translateY(4px);
    box-shadow: 0 0 0;
}

.key.action {
    background: #f3f4f6;
    font-size: 1.5rem;
}

#submit {
    background: var(--primary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 0 var(--secondary-color);
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 320px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 15px;
}

.btn-secondary {
    background-color: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
}