/* RSC TEST CRICKET 3 - Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 6px;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.game-header {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 9px;
    margin-bottom: 12px;
    text-align: center;
}

.game-header h1 {
    font-size: 1.35rem;
    margin-bottom: 9px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-bottom-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.resources-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 11.25px;
    border-radius: 15px;
    font-size: 0.675rem;
}

.resource-icon {
    font-size: 0.9rem;
}

.resource-value {
    font-weight: bold;
    color: #ffd700;
}

.high-scores-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.high-score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.15);
    padding: 6px 11.25px;
    border-radius: 15px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.high-score-label {
    color: #cccccc;
}

.high-score-value {
    font-weight: bold;
    color: #ffd700;
}

/* Main Game Area */
.game-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Lineup Section */
.lineup-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 12px;
}

.instructions {
    font-size: 0.675rem;
    color: #cccccc;
    margin-bottom: 0;
}

.lineup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 9px;
}

.batter-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 7px;
    transition: all 0.3s ease;
    position: relative;
}

.batter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Four border color states */
.batter-card.out {
    opacity: 0.6;
    border-color: #f44336;
    border-width: 2.5px;
    background: rgba(244, 67, 54, 0.25);
}

.batter-card.on-strike {
    border-color: #ffd700;
    border-width: 3px;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.batter-card.off-strike {
    border-color: #2196f3;
    border-width: 2.5px;
    background: rgba(33, 150, 243, 0.15);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.4);
}

.batter-card.to-bat {
    border-color: #9e9e9e;
    border-width: 2px;
    background: rgba(158, 158, 158, 0.1);
}

.batter-tier-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1rem;
    line-height: 1;
    z-index: 10;
}

.out-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    background: #f44336;
    color: white;
    font-size: 0.5625rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 11;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.strike-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 0.5625rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 11;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.on-strike-badge {
    background: #ffd700;
    color: #000;
    border: 1px solid rgba(255, 215, 0, 0.8);
}

.off-strike-badge {
    background: #2196f3;
    color: white;
    border: 1px solid rgba(33, 150, 243, 0.8);
}

.batter-card.on-strike {
    border-color: #ffd700;
    border-width: 3px;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.batter-card.off-strike {
    border-color: #2196f3;
    border-width: 2.5px;
    background: rgba(33, 150, 243, 0.15);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.4);
}

.batter-order {
    font-weight: bold;
    font-size: 0.825rem;
    color: #ffd700;
    margin-bottom: 3.75px;
}

.batter-name {
    font-size: 0.675rem;
    margin-bottom: 3.75px;
    font-weight: 500;
}

.batter-tier {
    font-size: 0.5625rem;
    color: #cccccc;
    margin-bottom: 2.25px;
}

.batter-resource {
    font-size: 0.5625rem;
    color: #ffd700;
    margin-bottom: 2.25px;
    font-weight: 500;
}

.batter-stats {
    font-size: 0.75rem;
    color: #ffd700;
    margin-top: 3.75px;
    font-weight: bold;
}

.ability-btn-small {
    margin-top: 6px;
    padding: 3.75px 7.5px;
    background: #ffd700;
    color: #000;
    border: none;
    border-radius: 3.75px;
    font-size: 0.5625rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.ability-btn-small:hover {
    background: #ffed4e;
}

/* Game Controls */
.game-controls {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.game-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 3.75px;
}

.score-label {
    font-size: 0.675rem;
    color: #cccccc;
}

.score-value {
    font-size: 1.125rem;
    font-weight: bold;
    color: #ffd700;
}

.current-batters {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.batter-info {
    display: flex;
    flex-direction: column;
    gap: 3.75px;
}

.batter-label {
    font-size: 0.675rem;
    color: #cccccc;
}

.batter-name {
    font-size: 0.825rem;
    font-weight: bold;
    color: #4caf50;
}

/* Actions Section */
.actions-section {
    margin-top: 12px;
    margin-bottom: 9px;
}

.actions-section h3 {
    color: #ffd700;
    margin-bottom: 9px;
    font-size: 0.9rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 9px;
}

.action-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.action-card:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4caf50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #f44336;
}

.action-card:active:not(.disabled) {
    transform: translateY(0);
}

.action-name {
    font-weight: bold;
    font-size: 0.75rem;
    color: #ffd700;
    margin-bottom: 5px;
}

.action-description {
    font-size: 0.5625rem;
    color: #cccccc;
    margin-bottom: 5px;
}

.action-cost {
    font-size: 0.5625rem;
    color: #4caf50;
    font-weight: 500;
}

.ball-outcome {
    min-height: 18px;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.ball-outcome.wicket {
    background: rgba(244, 67, 54, 0.3);
    color: #ff5252;
}

.ball-outcome.runs {
    background: rgba(76, 175, 80, 0.3);
    color: #81c784;
}

/* Team Stats */
.team-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 9px;
    flex-wrap: wrap;
}

.team-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
}

.team-stat-label {
    color: #cccccc;
}

.team-stat-value {
    font-weight: bold;
    color: #ffd700;
}

/* Bowler Stats */
.bowler-stats-section {
    margin-top: 12px;
    margin-bottom: 9px;
}

.bowler-stats-section h3 {
    color: #ffd700;
    margin-bottom: 9px;
    font-size: 0.9rem;
}

.bowler-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 9px;
}

.bowler-stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 7px;
    text-align: center;
}

.bowler-name {
    font-weight: bold;
    font-size: 0.75rem;
    color: #ffd700;
    margin-bottom: 3px;
}

.bowler-type {
    font-size: 0.5625rem;
    color: #cccccc;
    margin-bottom: 5px;
}

.bowler-stat {
    font-size: 0.675rem;
    color: #ffffff;
    margin-bottom: 2px;
}

/* Field Settings */
.field-settings-section {
    margin-top: 12px;
    margin-bottom: 9px;
}

.field-settings-section h3 {
    color: #ffd700;
    margin-bottom: 9px;
    font-size: 0.9rem;
}

.field-settings-grid {
    display: flex;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
}

.field-setting-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.field-setting-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4caf50;
}

.field-setting-btn.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    color: #ffd700;
    font-weight: bold;
}

/* Ability Section */
.ability-section {
    background: rgba(255, 215, 0, 0.15);
    border: 1.5px solid rgba(255, 215, 0, 0.4);
    border-radius: 6px;
    padding: 9px 11.25px;
    text-align: center;
    min-width: 150px;
    flex-shrink: 0;
}

.ability-section h3 {
    margin-bottom: 6px;
    color: #ffd700;
    font-size: 0.75rem;
}

.ability-btn {
    background: #ffd700;
    color: #000;
    border: none;
    padding: 6px 15px;
    font-size: 0.675rem;
    font-weight: bold;
    border-radius: 4.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5.625px;
    width: 100%;
}

.ability-btn:hover {
    background: #ffed4e;
    transform: scale(1.05);
}

.ability-info {
    font-size: 0.5625rem;
    color: #cccccc;
    line-height: 1.3;
}

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

.modal-content {
    background: #1e3c72;
    border: 1.5px solid #ffd700;
    border-radius: 7.5px;
    padding: 22.5px;
    max-width: 375px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    color: #ffd700;
    margin-bottom: 15px;
}

.final-stats {
    display: flex;
    flex-direction: column;
    gap: 11.25px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 7.5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3.75px;
}

.stat-item.highlight {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.5);
    font-weight: bold;
}

.new-record {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffd700;
    margin-top: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.new-game-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 9px 22.5px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-game-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.05rem;
    }

    .header-bottom-row {
        flex-direction: column;
        gap: 9px;
    }

    .resources-display {
        flex-direction: column;
        align-items: center;
    }

    .high-scores-display {
        flex-direction: column;
        align-items: center;
    }

    .ability-section {
        width: 100%;
        min-width: auto;
    }

    .lineup-grid {
        grid-template-columns: repeat(auto-fill, minmax(112.5px, 1fr));
        gap: 7.5px;
    }

    .game-info-row {
        flex-direction: column;
        gap: 12px;
    }

    .score-display {
        gap: 11.25px;
    }

    .score-value {
        font-size: 0.9rem;
    }

    .current-batters {
        flex-direction: column;
        gap: 11.25px;
    }

    .next-ball-btn {
        padding: 9px 22.5px;
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 3.75px;
    }

    .game-header {
        padding: 7.5px;
    }

    .game-header h1 {
        font-size: 0.9rem;
    }

    .lineup-grid {
        grid-template-columns: 1fr;
    }

    .batter-card {
        padding: 7.5px;
    }
}
