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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Styles */
.logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: white;
}

.logo-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid white;
    background: white;
}

.logo-print {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
    border: 3px solid #1a237e;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #1a237e 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="2"/></svg>');
    background-size: 50px;
    pointer-events: none;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.header .tagline {
    font-style: italic;
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.header .subtitle {
    opacity: 0.85;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.small-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.small-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Saved Panel */
.saved-panel {
    position: fixed;
    top: 0;
    left: -350px;
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.saved-panel.active {
    left: 0;
}

.panel-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.1rem;
}

.close-panel {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.saved-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.saved-match-item {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #1a237e;
}

.saved-match-item:hover {
    background: #e8eaf6;
    transform: translateX(5px);
}

.saved-match-item h4 {
    color: #1a237e;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.saved-match-item p {
    font-size: 0.8rem;
    color: #666;
}

.saved-match-item .match-score {
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.saved-match-item .delete-match {
    float: right;
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 5px;
}

.btn-clear-all {
    margin: 15px;
    padding: 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.saved-btn-container {
    padding: 15px 25px 0;
}

.btn-saved {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #7c4dff 0%, #651fff 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-saved:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(101, 31, 255, 0.4);
}

/* Auto-save indicator */
.auto-save-indicator {
    position: absolute;
    top: 70px;
    right: 15px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.auto-save-indicator.show {
    opacity: 1;
}

/* Setup Form */
.setup-form {
    padding: 25px;
}

.setup-form h2 {
    color: #1a237e;
    margin-bottom: 20px;
    border-bottom: 2px solid #1a237e;
    padding-bottom: 10px;
}

.setup-form h3 {
    color: #333;
    margin: 25px 0 15px 0;
    font-size: 1.1rem;
}

.form-row {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.form-row label {
    font-weight: 600;
    color: #444;
    min-width: 150px;
}

.form-row input,
.form-row select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    flex: 1;
    min-width: 150px;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.1);
}

/* Teams Container */
.teams-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .teams-container {
        grid-template-columns: 1fr;
    }
}

/* Team Section */
.team-section {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.team-section:hover {
    border-color: #1a237e;
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.1);
}

.team-a-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f5f5 100%);
}

.team-b-section {
    background: linear-gradient(135deg, #fce4ec 0%, #f5f5f5 100%);
}

.team-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(26, 35, 126, 0.1);
}

.team-header i {
    font-size: 1.5rem;
    color: #1a237e;
}

.team-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    color: #1a237e;
}

.team-header .player-count {
    background: #1a237e;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Player Inputs */
.player-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Player Input Row */
.player-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.player-input-row:hover {
    border-color: #90caf9;
}

.player-input-row.focused {
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.player-input-row.filled {
    border-color: #4caf50;
    background: #f1f8e9;
}

.player-input-row.filled .player-number {
    background: #4caf50;
}

.player-number {
    width: 28px;
    height: 28px;
    background: #1a237e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.player-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 8px 0;
    background: transparent;
}

.player-input::placeholder {
    color: #9e9e9e;
}

.role-hint {
    background: #fff3e0;
    color: #e65100;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Quick Fill Button */
.quick-fill-btn {
    background: linear-gradient(135deg, #7c4dff 0%, #651fff 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.quick-fill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 77, 255, 0.3);
}

.quick-fill-btn i {
    font-size: 1rem;
}

.btn-start {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(26, 35, 126, 0.4);
}

.btn-start i {
    font-size: 1.4rem;
}

.btn-start:active {
    transform: translateY(-1px);
}

/* Scoring Screen */
.innings-info {
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #1a237e;
    font-size: 1.1rem;
    border-bottom: 3px solid #1a237e;
}

.live-score {
    padding: 25px;
    text-align: center;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
    border-bottom: 1px solid #eee;
    position: relative;
}

.score-big {
    font-size: 5rem;
    font-weight: 800;
    color: #1a237e;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.overs-info {
    font-size: 1.4rem;
    color: #555;
    margin-top: 8px;
    font-weight: 500;
}

.target-info {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    padding: 12px 20px;
    border-radius: 10px;
    margin-top: 15px;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Current Players */
.current-players {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.batsmen-box,
.bowler-box {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.batsmen-box h4,
.bowler-box h4 {
    color: #1a237e;
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.batsman-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.striker-mark {
    width: 20px;
    height: 20px;
    font-weight: bold;
    color: white;
    background: #1a237e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.batsman-row select,
.bowler-box select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.batsman-row select:focus,
.bowler-box select:focus {
    border-color: #1a237e;
    outline: none;
}

.bat-stats,
.bowl-stats {
    font-weight: 700;
    color: #1a237e;
    min-width: 70px;
    text-align: right;
    font-size: 1rem;
}

.bowl-stats {
    margin-top: 10px;
    font-size: 1.2rem;
    background: #e8eaf6;
    padding: 8px 12px;
    border-radius: 8px;
}

/* Scoring Buttons */
.scoring-buttons {
    padding: 20px;
    background: linear-gradient(180deg, #f5f5f5 0%, #eeeeee 100%);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.runs-group button {
    flex: 1;
    min-width: 55px;
}

.btn-run {
    padding: 20px 12px;
    border: none;
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(145deg, #e8eaf6 0%, #c5cae9 100%);
    color: #1a237e;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-run:hover {
    background: linear-gradient(145deg, #c5cae9 0%, #9fa8da 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-run:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-four {
    background: linear-gradient(145deg, #66bb6a 0%, #43a047 100%);
    color: white;
}

.btn-four:hover {
    background: linear-gradient(145deg, #43a047 0%, #2e7d32 100%);
}

.btn-six {
    background: linear-gradient(145deg, #ab47bc 0%, #8e24aa 100%);
    color: white;
}

.btn-six:hover {
    background: linear-gradient(145deg, #8e24aa 0%, #6a1b9a 100%);
}

.btn-extra {
    flex: 1;
    padding: 14px 10px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff3e0;
    color: #e65100;
    transition: all 0.2s;
}

.btn-extra:hover {
    background: #ffe0b2;
}

.btn-wicket {
    flex: 2;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background: #f44336;
    color: white;
    transition: all 0.2s;
}

.btn-wicket:hover {
    background: #d32f2f;
}

.btn-swap,
.btn-undo {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: #607d8b;
    color: white;
    transition: all 0.2s;
}

.btn-swap:hover,
.btn-undo:hover {
    background: #455a64;
}

.btn-end-innings {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background: #ff9800;
    color: white;
    transition: all 0.2s;
}

.btn-end-innings:hover {
    background: #f57c00;
}

/* This Over */
.this-over {
    padding: 12px 15px;
    background: #e3f2fd;
    border-top: 1px solid #bbdefb;
    font-size: 0.95rem;
}

.this-over span {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.recent-commentary {
    padding: 12px 15px;
    background: #fff;
    border-top: 1px solid #eee;
    max-height: 80px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #666;
}

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

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    color: #1a237e;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.btn-confirm:hover {
    background: #388e3c;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: #9e9e9e;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #757575;
}

/* New Bowler Modal */
.over-summary {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.over-complete-info strong {
    display: block;
    font-size: 1.1rem;
    color: #2e7d32;
    margin-bottom: 8px;
}

.over-balls {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a237e;
    letter-spacing: 3px;
    margin: 8px 0;
}

.over-runs {
    font-size: 0.95rem;
    color: #666;
}

.bowler-note {
    font-size: 0.85rem;
    color: #f57c00;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: #fff3e0;
    border-radius: 6px;
}

.bowler-note i {
    margin-right: 5px;
}

#new-bowler-modal .modal-content h3 {
    color: #2e7d32;
}

#new-bowler-modal .modal-content h3 i {
    margin-right: 8px;
}

/* Scoresheet */
.scoresheet {
    padding: 30px;
    background: white;
}

.sheet-header {
    text-align: center;
    border-bottom: 3px solid #1a237e;
    padding-bottom: 20px;
    margin-bottom: 25px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    padding-top: 20px;
}

.sheet-header h1 {
    color: #1a237e;
    font-size: 1.8rem;
    margin-top: 10px;
}

.sheet-header .sheet-tagline {
    font-style: italic;
    color: #b71c1c;
    font-size: 1rem;
    margin: 5px 0;
}

.sheet-header p {
    color: #666;
    font-size: 0.9rem;
}

.match-info {
    margin-bottom: 20px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    background: #fafafa;
}

.info-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
}

/* Innings Section */
.innings-section {
    margin-bottom: 30px;
    page-break-inside: avoid;
}

.innings-section h2 {
    background: #1a237e;
    color: white;
    padding: 10px 15px;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.innings-section h3 {
    background: #e8eaf6;
    color: #1a237e;
    padding: 8px 15px;
    font-size: 0.95rem;
    margin-top: 15px;
}

/* Tables */
.batting-table,
.bowling-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.batting-table th,
.batting-table td,
.bowling-table th,
.bowling-table td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.batting-table th,
.bowling-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.col-name {
    text-align: left !important;
    min-width: 120px;
}

.col-how {
    text-align: left !important;
    min-width: 150px;
}

.col-bowler {
    text-align: left !important;
    min-width: 80px;
}

.col-num {
    width: 45px;
}

.batting-table td:first-child,
.bowling-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.batting-table .not-out {
    color: #1a237e;
    font-weight: 600;
}

/* Extras & Total */
.extras-total-row {
    padding: 10px 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-top: none;
}

.total-row {
    background: #e8eaf6;
    font-size: 1.1rem;
}

/* Fall of Wickets */
.fow-section {
    padding: 12px 15px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    margin-top: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Match Result */
.match-result {
    text-align: center;
    padding: 20px;
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
    margin: 20px 0;
}

.match-result h2 {
    color: #2e7d32;
    font-size: 1.3rem;
}

/* Signatures */
.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.sig-box {
    text-align: center;
    flex: 1;
}

.sig-line {
    width: 120px;
    height: 1px;
    background: #333;
    margin: 0 auto 10px auto;
}

.sig-box p {
    font-size: 0.85rem;
    color: #666;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 25px;
    justify-content: center;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
}

.btn-print {
    padding: 15px 30px;
    background: linear-gradient(145deg, #1a237e 0%, #283593 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-print:hover {
    background: linear-gradient(145deg, #283593 0%, #3949ab 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
}

.btn-export {
    padding: 15px 25px;
    background: linear-gradient(145deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-export:hover {
    background: linear-gradient(145deg, #388e3c 0%, #2e7d32 100%);
    transform: translateY(-2px);
}

.btn-export-sheets {
    padding: 15px 25px;
    background: linear-gradient(145deg, #0f9d58 0%, #0b8043 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-export-sheets:hover {
    background: linear-gradient(145deg, #34a853 0%, #0f9d58 100%);
    transform: translateY(-2px);
}

.btn-save {
    padding: 15px 25px;
    background: linear-gradient(145deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: linear-gradient(145deg, #ffa726 0%, #ff9800 100%);
    transform: translateY(-2px);
}

.btn-new {
    padding: 15px 30px;
    background: linear-gradient(145deg, #607d8b 0%, #455a64 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-new:hover {
    background: linear-gradient(145deg, #78909c 0%, #607d8b 100%);
    transform: translateY(-2px);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 2000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ============================================
   CELEBRATION ANIMATIONS
   ============================================ */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    pointer-events: none;
}

.celebration-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.celebration-content {
    text-align: center;
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.celebration-icon {
    font-size: 8rem;
    margin-bottom: 20px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.celebration-text {
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Four Animation */
.celebration-overlay.four .celebration-icon {
    color: #4caf50;
    animation: pulse 0.5s ease-in-out infinite;
}

.celebration-overlay.four .celebration-text {
    color: #fff;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Six Animation */
.celebration-overlay.six .celebration-icon {
    color: #ff9800;
    animation: sixBounce 0.5s ease-in-out infinite;
}

.celebration-overlay.six .celebration-text {
    color: #fff;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Wicket Animation */
.celebration-overlay.wicket .celebration-icon {
    color: #f44336;
    animation: wicketShake 0.5s ease-in-out;
}

.celebration-overlay.wicket .celebration-text {
    color: #fff;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confettiFall 3s ease-in-out forwards;
}

.confetti.circle {
    border-radius: 50%;
}

.confetti.square {
    border-radius: 2px;
}

.confetti.triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid currentColor;
    background: none !important;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes sixBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(-10deg); }
    75% { transform: translateY(-20px) rotate(10deg); }
}

@keyframes wicketShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    20% { transform: translateX(-10px) rotate(-5deg); }
    40% { transform: translateX(10px) rotate(5deg); }
    60% { transform: translateX(-10px) rotate(-5deg); }
    80% { transform: translateX(10px) rotate(5deg); }
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        border-radius: 0;
    }

    .no-print {
        display: none !important;
    }

    .scoresheet {
        padding: 20px;
    }

    .sheet-header {
        border-bottom: 3px solid #1a237e;
    }

    .innings-section {
        page-break-inside: avoid;
    }

    .batting-table,
    .bowling-table {
        font-size: 0.8rem;
    }

    .batting-table th,
    .batting-table td,
    .bowling-table th,
    .bowling-table td {
        padding: 6px 4px;
    }

    .logo-print {
        display: block !important;
    }
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .logo {
        width: 70px;
        height: 70px;
    }

    .score-big {
        font-size: 3.5rem;
    }

    .current-players {
        flex-direction: column;
    }

    .btn-run {
        padding: 16px 10px;
        font-size: 1.2rem;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row label {
        min-width: auto;
        margin-bottom: 5px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
        justify-content: center;
    }

    .batting-table,
    .bowling-table {
        font-size: 0.75rem;
    }

    .batting-table th,
    .batting-table td,
    .bowling-table th,
    .bowling-table td {
        padding: 6px 3px;
    }

    .col-how {
        min-width: 100px;
    }

    .signatures {
        flex-direction: column;
        gap: 20px;
    }
}

/* ============================================
   LOGIN SCREEN STYLES
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
    animation: slideUp 0.5s ease-out;
}

.login-header {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #1a237e 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header .logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.login-body {
    padding: 40px 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #1a237e;
}

.toggle-password:focus {
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.4);
}

.login-error {
    background: #fff5f5;
    border: 1px solid #fc8181;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 0.9rem;
}

.login-error.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #666;
    font-size: 0.85rem;
}

.login-footer code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* User Info in Header */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.user-info i {
    margin-right: 5px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-admin {
    background: #ffc107;
    color: #1a237e;
    font-weight: 600;
}

.btn-admin:hover {
    background: #ffca28;
    transform: translateY(-1px);
}

/* ============================================
   AUTH MODAL STYLES (Login, User Mgmt, Sheets Config)
   ============================================ */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal .modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal .modal-header {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal .modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.auth-modal .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.auth-modal .modal-close:hover {
    opacity: 1;
}

.auth-modal .modal-body {
    padding: 24px;
}

.auth-modal .modal-body h4 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.auth-modal .modal-body .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.auth-modal .modal-body .form-row > div {
    flex: 1;
}

.auth-modal .modal-body input,
.auth-modal .modal-body select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.auth-modal .modal-body input:focus,
.auth-modal .modal-body select:focus {
    outline: none;
    border-color: #1a237e;
}

.auth-modal .modal-body label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

/* User List */
.user-list {
    margin-top: 20px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.user-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-item-info i {
    font-size: 1.5rem;
    color: #1a237e;
}

.user-item-info span {
    font-weight: 500;
}

.user-item-info small {
    display: block;
    color: #666;
    font-size: 0.8rem;
}

/* Google Sheets Config */
.sheets-config-section {
    margin-bottom: 25px;
}

.sheets-config-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sheets-config-section h4 i {
    color: #0f9d58;
}

.code-box {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-box::-webkit-scrollbar {
    width: 8px;
}

.code-box::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.config-steps {
    list-style: none;
    counter-reset: steps;
}

.config-steps li {
    counter-increment: steps;
    padding: 10px 0 10px 40px;
    position: relative;
    border-bottom: 1px solid #eee;
}

.config-steps li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 10px;
    width: 26px;
    height: 26px;
    background: #1a237e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.config-steps li:last-child {
    border-bottom: none;
}

.url-input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.url-input-group input {
    flex: 1;
}

.btn-test {
    background: #0f9d58;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-test:hover {
    background: #0b8043;
}

.connection-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    display: none;
}

.connection-status.success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.connection-status.error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.connection-status i {
    font-size: 1.2rem;
}

/* Settings button in saved panel */
.btn-settings {
    background: linear-gradient(135deg, #0f9d58 0%, #0b8043 100%);
    color: white;
}

.btn-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(15, 157, 88, 0.3);
}

/* PWA Install Button */
.btn-install {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    animation: pulse-install 2s infinite;
}

.btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

@keyframes pulse-install {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 107, 53, 0);
    }
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff9800;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .header {
        padding-top: calc(30px + env(safe-area-inset-top));
    }
}

/* iOS specific adjustments */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}
