/* Cute pastel monospace theme, no animations */

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

body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    background: linear-gradient(180deg, #e6f6ff 0%, #e6f6ff 35%, #e9fbea 35%, #e9fbea 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: #374151;
}

/* Cricket field background (static, decorative) */
.cricket-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

.cricket-field::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(34, 197, 94, 0.15) 0px,
        rgba(34, 197, 94, 0.15) 80px,
        rgba(16, 185, 129, 0.15) 80px,
        rgba(16, 185, 129, 0.15) 160px
    );
}

.wickets {
    position: absolute;
    bottom: 20%;
    left: 10%;
    width: 4px;
    height: 60px;
    background: #8b5e34;
    box-shadow:
        8px 0 0 #8b5e34,
        16px 0 0 #8b5e34;
}

.wickets::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -2px;
    width: 22px;
    height: 4px;
    background: #8b5e34;
}

.boundary {
    position: absolute;
    bottom: 10%;
    right: 15%;
    width: 200px;
    height: 100px;
    border: 3px dotted #7dbb7d;
    border-radius: 50%;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    z-index: 10;
}

.logo {
    font-size: 2.2rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.typing-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
    max-width: 1100px;
    width: 100%;
    position: relative;
    border: 2px dashed #c7f0d8;
}

/* Two-column layout inside typing container */
.content-row {
    display: flex;
    gap: 1.25rem;
}

.left-pane {
    flex: 1 1 60%;
    min-width: 0;
}

.right-pane {
    flex: 1 1 40%;
    min-width: 260px;
}

/* removed old stats blocks from left side */

.text-display {
    font-family: inherit;
    font-size: 1.5rem;
    line-height: 2.4rem;
    color: #4b5563;
    margin-bottom: 1rem;
    padding: 1.25rem 1.25rem 1.5rem;
    background: #f7fff7;
    border-radius: 12px;
    border: 2px dotted #dbeafe;
    height: calc(2.4rem * 5 + 1.25rem);
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
}

/* Worm chart container */
.worm-chart {
    margin-top: 1rem;
    background: #fbfcff;
    border-radius: 12px;
    border: 2px dotted #dbeafe;
    padding: 0.75rem 1rem;
    overflow: hidden;
}

.score-summary-right {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f5fbf7;
    border: 1px solid #d8f5e3;
    border-radius: 8px;
    font-weight: 600;
    color: #256c2c;
}

/* Hide scrollbar visually (keep scroll functionality) */
.text-display::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}
.text-display {
    scrollbar-width: none; /* Firefox */
}

.char {
    position: relative;
}

.char.correct {
    color: #1e7a31;
    background: #d9fbe5;
    border-radius: 3px;
}

.char.incorrect {
    color: #7a0f0f;
    background: #ffd6d6;
    border-radius: 3px;
}

.char.current {
    background: #e7f3ff;
    color: #111827;
    border-radius: 3px;
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    animation: blink 1s infinite;
}

.controls {
    text-align: center;
    margin-top: 1rem;
}

.btn {
    background: #86efac;
    color: #064e3b;
    border: 2px solid #34d399;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin: 0 0.5rem;
}

.btn:hover {
    background: #6ee7b7;
}

.btn:active {
    background: #74d39a;
}

.instructions {
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: #f0fdf4;
    border-radius: 10px;
    border-left: 4px solid #86efac;
}

.completed {
    text-align: center;
    color: #1e7a31;
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #e8fff0;
    border-radius: 10px;
    border: 2px solid #b9f3cf;
}


@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.35; }
}

/* Scoreboard */
.scoreboard {
    margin-top: 0;
    background: #fbfff5;
    border: 2px dashed #d9f99d;
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.95rem;
}

.scoreboard h3 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.scoreboard table {
    width: 100%;
    border-collapse: collapse;
}

.scoreboard th, .scoreboard td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px dotted #fef3c7;
}

.scoreboard tfoot td {
    font-weight: 700;
}

/* Highlight current partnership rows */
.scoreboard tr.current-partnership td {
    background: #f0fdf4;
}

/* removed score-summary block, score shown inline in stats */

/* Responsiveness: stack on small screens */
@media (max-width: 820px) {
    .content-row {
        flex-direction: column;
    }
    .right-pane {
        min-width: 0;
    }
}

/* Modal styles */
.modal.hidden { display: none; }
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    width: 100%;
    max-width: 520px;
    border: 2px dashed #c7f0d8;
}
.modal-content h3 {
    margin-bottom: 0.75rem;
}
.modal-content label {
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}
.helper { color: #6b7280; font-size: 0.85rem; margin-top: 0.25rem; }
.error { color: #7a0f0f; background: #ffe4e6; border: 1px solid #fecdd3; padding: 6px 8px; border-radius: 6px; margin-top: 0.5rem; }
.modal-content input, .modal-content select, .modal-content textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
