:root {
    --maroon-red: #800020;
    --dark-maroon: #4A0012;
    --light-bg: #f4f4f9;
    --white: #ffffff;
    --success-green: #28a745;
    --warning-orange: #fd7e14;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
    color: #333;
}

.header {
    background-color: var(--maroon-red);
    color: var(--white);
    text-align: center;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-bar {
    display: flex;
    justify-content: center;
    background-color: var(--dark-maroon);
    flex-wrap: wrap;
    gap: 5px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 12px 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.nav-btn.active, .nav-btn:hover {
    background-color: var(--maroon-red);
    font-weight: bold;
    border-bottom: 3px solid white;
}

.container {
    max-width: 800px;
    margin: 15px auto;
    padding: 0 10px;
}

.card, .score-card, .rules-poster-card {
    background: var(--white);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.score-card {
    background-color: var(--dark-maroon);
    color: var(--white);
    text-align: center;
    border-left: 8px solid var(--maroon-red);
}

.score-card h1 {
    font-size: 42px;
    margin: 10px 0;
    color: #ffcc00;
}

.target-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 5px;
    margin: 5px 0;
    font-size: 14px;
    display: inline-block;
}

.live-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
}

.detail-box p {
    margin: 4px 0;
}

/* Poster Styling */
#display-poster {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    display: block;
    margin: 0 auto 15px auto;
    border-radius: 8px;
}

/* Inputs & Forms */
input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px;
    margin: 6px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

/* Buttons */
.btn-score, .btn-submit {
    background-color: var(--maroon-red);
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 4px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-score:hover, .btn-submit:hover {
    opacity: 0.9;
}

.btn-wicket {
    background-color: #d9534f;
}

.btn-extra {
    background-color: var(--warning-orange);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

th, td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--maroon-red);
    color: var(--white);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Player Cards Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.player-card {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.player-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
}

.player-card h4 {
    font-size: 13px;
    margin: 4px 0 2px 0;
}

/* Match History Card */
.past-match-card {
    border-left: 5px solid var(--maroon-red);
    margin-bottom: 15px;
}

.pm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.winner-badge {
    background-color: var(--success-green);
    color: white;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
}

/* Ball Dots for Current Over */
.balls-container {
    display: inline-flex;
    gap: 4px;
    margin-left: 5px;
}

.ball-dot {
    display: inline-block;
    min-width: 20px;
    padding: 0 4px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    background: #444;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.ball-dot.four { background: #28a745; }
.ball-dot.six { background: #007bff; }
.ball-dot.wicket { background: #dc3545; }
.ball-dot.extra { background: #fd7e14; }

/* Celebration & Overlay */
#celebration-overlay, .celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.celebration-hidden {
    opacity: 0;
    pointer-events: none;
}

.celebration-show {
    opacity: 1;
    pointer-events: auto;
}

.celebration-content h1 {
    font-size: 50px;
    color: #ffcc00;
    text-shadow: 0 0 20px #ff0000;
}

/* Modal Popup Card */
.modal-card {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.modal-btn {
    background-color: var(--dark-maroon);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
}

.modal-btn:hover {
    background-color: var(--maroon-red);
}
/* Responsive Styles */
@media (max-width: 600px) {
    .score-card h1 {
        font-size: 32px;
    }

    .live-details-grid {
        grid-template-columns: 1fr; /* දුරකථන තිරවලදී තනි තීරුවක් ලෙස පෙන්වීම */
    }

    .nav-btn {
        padding: 10px 12px;
        font-size: 13px;
        flex: 1 1 auto;
    }

    .celebration-content h1 {
        font-size: 36px;
    }
}
.card {
    overflow-x: auto;
}
