/* ==========================================================================
   1. Core Reset & Global Layout Variables
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --text-primary: #111111;
    --text-secondary: #666666;
    --text-muted: #718096;
    --color-accent: #e67e22;
    --color-primary: #0070f3;
    --color-primary-hover: #0051b3;
    --color-success: #2ecc71;
    --color-success-hover: #27ae60;
    --color-reset: #666666;
    --color-reset-hover: #444444;
    --color-disabled: #cbd5e1;
    --color-disabled-text: #94a3b8;
    --border-shop: #edf2f7;
    --border-dashed: #e2e8f0;
}

/* Centering framework setup */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-primary);
    padding: 20px;
}

/* ==========================================================================
   2. Main Container Card
   ========================================================================== */
.card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    max-width: 400px;
    width: 100%;
    /* Hardware accelerated transition for smooth 90Hz background shifting */
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background-color;
}

h1 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ==========================================================================
   3. Score & Progress Metric Elements
   ========================================================================== */
.high-score-text {
    font-size: 14px;
    font-weight: bold;
    color: var(--color-accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.04);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* Progress bar container structure */
.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dynamic moving linear-gradient bar fill */
#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #00c6ff);
    transition: width 0.1s linear, background 0.3s ease;
    will-change: width;
}

/* ==========================================================================
   4. Action Interactive Buttons
   ========================================================================== */
.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Blue primary play action configuration */
.btn:not(.btn-reset) {
    background-color: var(--color-primary);
}

.btn:not(.btn-reset):hover {
    background-color: var(--color-primary-hover);
}

.btn:not(.btn-reset):active {
    transform: scale(0.98);
}

/* Grey alternative administrative reset action */
.btn-reset {
    background-color: var(--color-reset);
}

.btn-reset:hover {
    background-color: var(--color-reset-hover);
}

/* ==========================================================================
   5. Interactive Shop Sub-System View
   ========================================================================== */
.shop-container {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-dashed);
    text-align: left;
}

.shop-container h2 {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-shop);
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.item-cost {
    font-size: 12px;
    color: var(--text-muted);
}

/* Green upgrade commercial transaction button */
.btn-shop {
    padding: 6px 12px;
    font-size: 12px;
    background-color: var(--color-success);
}

.btn-shop:hover {
    background-color: var(--color-success-hover);
}

.btn-shop:disabled {
    background-color: var(--color-disabled);
    color: var(--color-disabled-text);
    cursor: not-allowed;
    transform: none !important;
}
