body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg, #F2F2F2);
    margin: 0;
    font-family: var(--font, 'Inter', system-ui, sans-serif);
}

.game-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.instruction-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--radius, 10px);
    padding: 12px 16px;
    max-width: 420px;
    width: calc(100% - 40px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
}


.start-button {
    margin-top: 6px;
    padding: 10px 16px;
    font-size: 1rem;
    border: none;
    background-color: var(--primary, #2563EB);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    align-self: center;
    transition: background-color 0.15s ease;
}

.start-button:hover {
    background-color: var(--primary-hover, #1D4ED8);
}

.header {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#timer {
    font-size: 1.2rem;
    color: #333;
}

.game-area {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    position: relative;
    height: 150px;
}

.ball {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: transform 0.1s;
}

.center {
    margin-top: -30px;
}

.button-container {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
}

.game-button {
    padding: 20px 40px;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    background-color: var(--primary, #2563EB);
    color: white;
    border-radius: var(--radius, 10px);
    transition: background-color 0.15s ease;
}

.game-button:hover {
    background-color: var(--primary-hover, #1D4ED8);
}

.end-screen {
    background-color: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    padding: 20px;
    border-radius: var(--radius, 10px);
    text-align: center;
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.08));
}

.end-screen table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
}

.end-screen th,
.end-screen td {
    padding: 8px;
    border: 1px solid var(--border, #E5E7EB);
}

.end-screen th {
    background-color: var(--primary, #2563EB);
    color: #fff;
}

.end-screen td {
    background-color: var(--surface, #FFFFFF);
}

#end-screen {
    background-color: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    padding: 20px;
    border-radius: var(--radius, 10px);
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.08));
}

#end-screen h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

#end-screen p {
    margin: 10px 0;
}

#end-screen .button {
    font-size: 1.2em;
    margin-top: 20px;
    padding: 10px 20px;
    border-radius: 5px;
}

.score-breakdown {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--radius, 10px);
    margin-top: 10px;
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.08));
}

.column {
    flex: 1;
    padding: 10px;
}

.column h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.column p {
    font-size: 18px;
}

.instruction-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.instruction-card {
    max-width: 420px;
    background: var(--surface, #FFFFFF);
    color: var(--text, #1F2933);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.08));
    border: 1px solid var(--border, #E5E7EB);
    text-align: left;
}

.instruction-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 22px;
}

.instruction-card p {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
}

.primary-start-button {
    margin-top: 16px;
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: var(--primary, #2563EB);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.primary-start-button:hover {
    background: var(--primary-hover, #1D4ED8);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .game-container { max-width: 100%; padding: 0 12px; }
    .instruction-box { width: calc(100% - 24px); font-size: 0.9em; }
    .game-area { height: 110px; }
    .ball { width: 60px; height: 60px; }
    .center { margin-top: -20px; }
    .game-button { padding: 16px 24px; font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .header { font-size: 1.2rem; }
    #timer { font-size: 1rem; }
    .game-area { height: 100px; }
    .ball { width: 50px; height: 50px; }
    .center { margin-top: -15px; }
    .button-container { flex-direction: column; gap: 10px; }
    .game-button { padding: 14px 20px; font-size: 1rem; width: 100%; }
    .end-screen, #end-screen { padding: 16px; margin: 12px; }
    #end-screen h2 { font-size: 1.5em; }
    .score-breakdown { flex-direction: column; padding: 12px; }
    .column h2 { font-size: 20px; }
    .instruction-card { max-width: calc(100% - 32px); }
    .instruction-card h2 { font-size: 18px; }
}
