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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    background: #f8f9fa;
    border: 8px solid #444;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}



/* Main Title */
.main-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 2px;
    color: #2c3e50;
}

/* Shot Clock Display */
.shot-clock-display {
    background: #000000 !important;
    border: 4px solid #333;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

/* Force remove all borders from shot clock buttons */
button.control-btn,
.control-btn button,
.button-row button {
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
}

.time-display {
    font-family: 'Orbitron', monospace;
    font-size: 60px;
    font-weight: 900;
    color: #ff0000 !important;
    text-shadow: 0 0 25px #ff0000, 0 0 40px #ff0000;
    line-height: 1;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    background: transparent !important;
}

.time-display.expired {
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Control Panel */
.control-panel {
    margin-bottom: 15px;
    background: #e8e8e8;
    border: 3px solid #ccc;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
}

.button-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px;
    flex-wrap: wrap;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.control-btn {
    width: 80px;
    height: 60px;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    outline: none !important;
}

.control-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    outline: none !important;
}

.control-btn.pressed {
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-text {
    color: #333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.btn-small-text {
    color: #333;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.7;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Button Colors */
.stop-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
}

.stop-btn:hover {
    background: linear-gradient(145deg, #ec7063, #e74c3c);
}

.start-btn {
    background: linear-gradient(145deg, #27ae60, #229954);
}

.start-btn:hover {
    background: linear-gradient(145deg, #58d68d, #27ae60);
}

.reset-btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
}

.reset-btn:hover {
    background: linear-gradient(145deg, #5dade2, #3498db);
}

.alt-reset-btn {
    background: linear-gradient(145deg, #f1c40f, #d68910);
}

.alt-reset-btn:hover {
    background: linear-gradient(145deg, #f7dc6f, #f1c40f);
}

/* Instructions */
.instructions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.instruction-left,
.instruction-right {
    flex: 1;
    padding: 0 10px;
}

.instruction-right {
    text-align: right;
}

/* Keyboard Controls */
.keyboard-controls {
    margin-top: 15px;
    padding: 12px;
    background: rgba(50, 50, 50, 0.05);
    border-radius: 8px;
    border: 1px solid #ccc;
}

.keyboard-controls h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    text-align: center;
    color: #333;
    font-weight: 600;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.key {
    background: #333;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    font-size: 11px;
}

.action {
    color: #555;
    font-size: 11px;
}



/* Mobile Notice */
.mobile-notice {
    text-align: center;
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

/* Practice Tip */
.practice-tip {
    text-align: center;
    font-size: 11px;
    color: #2c5530;
    margin-top: 10px;
    padding: 10px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
    border-left: 4px solid #28a745;
    line-height: 1.4;
}

.practice-tip strong {
    color: #1e4d23;
    font-weight: 700;
}

/* Rules Section */
.rules-section {
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 100, 200, 0.05);
    border-radius: 6px;
    border: 1px solid #ddd;
}

.rules-section p {
    margin: 0;
    font-size: 12px;
    color: #333;
}

.rules-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.rules-link:hover {
    text-decoration: underline;
    color: #0052a3;
}

/* Support Section */
.support-section {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border: 1px solid #ddd;
}

.support-title {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #333;
    font-weight: 600;
}

.support-story {
    margin: 8px 0 0 0;
    font-size: 10px;
    color: #666;
    line-height: 1.4;
    font-style: italic;
}

.support-link {
    display: inline-block;
    background: linear-gradient(145deg, #f39c12, #e67e22);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.support-link:hover {
    background: linear-gradient(145deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}



/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 10px;
        margin: 5px;
    }

    .main-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .shot-clock-display {
        padding: 10px;
        margin-bottom: 5px;
    }

    .time-display {
        font-size: 45px;
        min-height: 45px;
    }

    .button-row {
        gap: 6px;
        padding: 8px;
    }

    .control-btn {
        height: 60px;
        font-size: 11px;
    }

    .btn-small-text {
        font-size: 8px;
    }

    .instructions {
        font-size: 10px;
        margin-bottom: 10px;
    }

    .keyboard-controls {
        margin-top: 10px;
        padding: 8px;
    }

    .keyboard-controls h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .controls-grid {
        gap: 6px;
        margin-bottom: 8px;
    }

    .control-item {
        font-size: 10px;
        gap: 6px;
    }

    .key {
        font-size: 9px;
        padding: 2px 4px;
        min-width: 16px;
    }

    .action {
        font-size: 9px;
    }



    .mobile-notice {
        font-size: 10px;
        margin-top: 8px;
        padding: 6px;
    }

    .practice-tip {
        font-size: 10px;
        margin-top: 8px;
        padding: 8px;
    }

    .rules-section {
        margin-top: 8px;
        padding: 6px;
    }

    .rules-section p {
        font-size: 11px;
    }

    .support-section {
        margin-top: 8px;
        padding: 8px;
    }

    .support-title {
        font-size: 11px;
    }

    .support-story {
        font-size: 9px;
    }

    .support-link {
        font-size: 11px;
        padding: 6px 12px;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 8px;
        margin: 2px;
    }

    .main-title {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .time-display {
        font-size: 35px;
        min-height: 35px;
    }

    .shot-clock-display {
        padding: 8px;
        margin-bottom: 3px;
    }

    .control-btn {
        height: 50px;
        font-size: 10px;
    }

    .btn-small-text {
        font-size: 7px;
    }

    .button-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 4px;
        padding: 6px;
        justify-content: center;
        justify-items: center;
    }

    .instructions {
        font-size: 9px;
        margin-bottom: 8px;
    }

    .keyboard-controls {
        margin-top: 6px;
        padding: 6px;
    }

    .keyboard-controls h4 {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .controls-grid {
        gap: 4px;
        margin-bottom: 6px;
    }

    .control-item {
        font-size: 9px;
        gap: 4px;
    }

    .key {
        font-size: 8px;
        padding: 1px 3px;
        min-width: 14px;
    }

    .action {
        font-size: 8px;
    }



    .mobile-notice {
        font-size: 9px;
        margin-top: 6px;
        padding: 4px;
    }

    .practice-tip {
        font-size: 9px;
        margin-top: 6px;
        padding: 6px;
    }

    .rules-section {
        margin-top: 6px;
        padding: 5px;
    }

    .rules-section p {
        font-size: 10px;
    }

    .support-section {
        margin-top: 6px;
        padding: 6px;
    }

    .support-title {
        font-size: 10px;
    }

    .support-story {
        font-size: 8px;
    }

    .support-link {
        font-size: 10px;
        padding: 5px 10px;
    }
}

/* Animation for button feedback */
.control-btn.active {
    animation: buttonPress 0.1s ease;
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Enhanced Mobile Touch Support */
.control-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Landscape Mobile Optimizations */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }
    
    .container {
        max-width: 90vw;
        padding: 15px;
        margin: 5px auto;
    }
    
    .main-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .shot-clock-display {
        padding: 15px;
        margin-bottom: 8px;
    }
    
    .time-display {
        font-size: 50px;
        min-height: 50px;
    }
    
    .control-panel {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .button-row {
        gap: 12px;
        padding: 8px;
    }
    
    .control-btn {
        height: 55px;
        width: 75px;
        font-size: 11px;
    }
    
    .instructions {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .keyboard-controls {
        margin-top: 8px;
        padding: 10px;
    }
    
    .controls-grid {
        gap: 6px;
    }
    
    .practice-tip,
    .rules-section,
    .support-section {
        margin-top: 8px;
        padding: 8px;
    }
}

/* Ultra Small Landscape - Very Compact */
@media screen and (max-width: 600px) and (orientation: landscape) and (max-height: 450px) {
    .container {
        padding: 10px;
        max-width: 95vw;
    }
    
    .main-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .shot-clock-display {
        padding: 10px;
        margin-bottom: 5px;
    }
    
    .time-display {
        font-size: 40px;
        min-height: 40px;
    }
    
    .control-panel {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .button-row {
        gap: 8px;
        padding: 6px;
    }
    
    .control-btn {
        height: 45px;
        width: 65px;
        font-size: 10px;
    }
    
    .btn-small-text {
        font-size: 7px;
    }
    
    .instructions {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .keyboard-controls {
        margin-top: 6px;
        padding: 6px;
    }
    
    .keyboard-controls h4 {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .controls-grid {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .control-item {
        font-size: 9px;
    }
    
    .practice-tip,
    .rules-section,
    .support-section {
        margin-top: 6px;
        padding: 6px;
        font-size: 10px;
    }
}

/* Basketball Court Navigation Styles */
.main-menu {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    font-family: 'Roboto', sans-serif;
    padding: 20px;
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.menu-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.menu-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.2em;
    font-weight: 400;
    margin: 0 0 20px 0;
    color: #fff;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.menu-header p {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.9;
}

.basketball-court {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.court-container {
    position: relative;
    background: #d2691e;
    border: 4px solid white;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.court-half {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.court-half:hover {
    transform: scale(1.02);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.2);
}

.front-court {
    background: linear-gradient(180deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 4px 4px 0 0;
}

.back-court {
    background: linear-gradient(0deg, #4a90e2 0%, #357abd 100%);
    border-radius: 0 0 4px 4px;
}

.court-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
}

.court-label {
    font-size: 0.9em;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.training-option h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.training-option p {
    font-size: 1em;
    margin: 0 0 15px 0;
    opacity: 0.9;
    line-height: 1.4;
}

.court-icon {
    font-size: 2em;
    margin-top: 10px;
}

.center-line {
    position: relative;
    height: 4px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-circle {
    width: 60px;
    height: 60px;
    border: 3px solid white;
    border-radius: 50%;
    background: #d2691e;
    position: absolute;
}

.center-circle-white {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

.menu-footer {
    margin-top: 40px;
    text-align: center;
}

.menu-footer p {
    margin: 0 0 15px 0;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Buy Me a Coffee button styling is handled by external script */

/* Back Navigation */
.back-nav {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 100;
}

.back-btn {
    background: rgba(44, 62, 80, 0.8);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2);
    opacity: 0.9;
}

.back-btn:hover {
    background: rgba(52, 73, 94, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(44, 62, 80, 0.3);
    opacity: 1;
}

/* Ensure shot clock page home button uses correct colors */
.container .back-btn,
.shot-clock .back-btn,
.back-nav .back-btn,
button.back-btn {
    background: rgba(44, 62, 80, 0.8) !important;
    background-color: rgba(44, 62, 80, 0.8) !important;
    color: white !important;
    border: none !important;
}

.container .back-btn:hover,
.shot-clock .back-btn:hover,
.back-nav .back-btn:hover,
button.back-btn:hover {
    background: rgba(52, 73, 94, 0.9) !important;
    background-color: rgba(52, 73, 94, 0.9) !important;
}

/* Custom home button class to override all styling */
.home-button-custom {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 100;
    background: rgba(44, 62, 80, 0.8) !important;
    background-color: rgba(44, 62, 80, 0.8) !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 0.75em !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2) !important;
    opacity: 0.9 !important;
    outline: none !important;
}

.home-button-custom:hover {
    background: rgba(52, 73, 94, 0.9) !important;
    background-color: rgba(52, 73, 94, 0.9) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 12px rgba(44, 62, 80, 0.3) !important;
    opacity: 1 !important;
}

/* Mobile Responsive for Basketball Court */
@media (max-width: 768px) {
    .main-menu {
        padding: 15px;
    }
    
    .menu-header h1 {
        font-size: 2em;
    }
    
    .menu-header h2 {
        font-size: 1em;
    }
    
    .court-container {
        min-height: 350px;
    }
    
    .training-option h2 {
        font-size: 1.5em;
    }
    
    .training-option p {
        font-size: 0.9em;
    }
    
    .court-content {
        padding: 25px 15px;
    }
    
    .court-half {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Basketball Court Landscape Optimizations */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .main-menu {
        padding: 10px;
        min-height: 100vh;
    }
    
    .menu-header {
        margin-bottom: 20px;
    }
    
    .menu-header h1 {
        font-size: 1.8em;
        margin-bottom: 5px;
    }
    
    .menu-header h2 {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .court-container {
        min-height: 280px;
        max-height: 320px;
    }
    
    .court-content {
        padding: 15px 10px;
    }
    
    .training-option h2 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }
    
    .training-option p {
        font-size: 0.85em;
        margin-bottom: 10px;
    }
    
    .court-icon {
        font-size: 1.5em;
        margin-top: 5px;
    }
    
    .menu-footer {
        margin-top: 20px;
    }
    
    .menu-footer p {
        font-size: 0.8em;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .main-menu {
        padding: 10px;
    }
    
    .menu-header h1 {
        font-size: 1.8em;
    }
    
    .menu-header h2 {
        font-size: 0.9em;
    }
    
    .court-container {
        min-height: 300px;
    }
    
    .training-option h2 {
        font-size: 1.3em;
    }
    
    .court-content {
        padding: 20px 10px;
    }
    
    .center-circle {
        width: 40px;
        height: 40px;
    }
    
    .center-circle-white {
        width: 40px;
        height: 40px;
    }
    
    .back-nav {
        top: 10px;
        left: 10px;
    }
    
    .back-btn {
        padding: 5px 10px;
        font-size: 0.7em;
    }
}

/* Scoreboard Trainer Styles */
.scoreboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    font-family: 'Roboto', sans-serif;
    padding: 20px;
    position: relative;
}

/* Scoreboard-specific time display - black text, no glow */
.scoreboard-container .time-display {
    font-family: 'Digital-7 Mono', 'DSEG7 Classic', 'Orbitron', monospace;
    font-size: 2.2em;
    font-weight: normal;
    color: #000000 !important;
    background: #d3d3d3;
    padding: 4px 3px;
    border-radius: 3px;
    text-align: center;
    text-shadow: none !important;
    letter-spacing: 0.05em;
    text-rendering: optimizeSpeed;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.scoreboard-title {
    text-align: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.8em;
    font-weight: 700;
    margin: 40px 0 15px 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Simple LCD Display */
.lcd-container {
    max-width: 800px;
    margin: 0 auto 0 auto;
    background: #c0c0c0;
    border: 6px solid #666;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    padding: 1px 4px 0px 4px;
    transform: scaleY(1.1);
}

.lcd-header-row {
    display: grid;
    grid-template-columns: 100px 80px 120px 100px 140px 80px;
    gap: 12px;
    text-align: center;
    font-size: 0.7em;
    font-weight: 900;
    color: #000;
    margin: 0;
    background: #a8a8a8;
    padding: 6px 0;
    border-radius: 2px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 10;
}

.lcd-screen {
    background: #d3d3d3;
    padding: 0px 4px;
    border-radius: 3px;
    margin: 0;
}

.team-row-a, .team-row-b {
    display: grid;
    grid-template-columns: 100px 80px 120px 100px 140px 80px;
    gap: 12px;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: 0.6;
    min-height: 40px;
    height: 40px;
    position: relative;
    z-index: 1;
}

.team-row-b {
    transform: translateY(-4px);
    min-height: 40px;
    height: 40px;
}

.team-label-yellow {
    background: #ffd700;
    color: #333;
    padding: 4px;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.8em;
    text-align: center;
    line-height: 1;
    margin: 0 0 3px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.team-label-orange {
    background: #ff8c00;
    color: white;
    padding: 4px;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.8em;
    text-align: center;
    line-height: 1;
    margin: 3px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.number-display {
    font-family: 'Digital-7 Mono', 'DSEG7 Classic', 'Orbitron', monospace;
    font-size: 2.0em;
    font-weight: normal;
    color: #000000;
    background: #d3d3d3;
    padding: 4px 2px;
    border-radius: 2px;
    text-align: center;
    min-width: 40px;
    letter-spacing: 0.05em;
    text-rendering: optimizeSpeed;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transform: translateY(-20%);
}

/* Specific positioning for B Dark row numbers */
.team-row-b .number-display {
    transform: translateY(-8%);
}

.time-display {
    font-family: 'Digital-7 Mono', 'DSEG7 Classic', 'Orbitron', monospace;
    font-size: 2.4em;
    font-weight: normal;
    color: #000000;
    background: #d3d3d3;
    padding: 4px 6px;
    border-radius: 2px;
    text-align: center;
    letter-spacing: 0.05em;
    text-rendering: optimizeSpeed;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: static;
    grid-column: auto;
    grid-row: auto;
}

.possession-section {
    font-size: 3em;
    color: #000000;
    text-align: center;
}

.period-spacer {
    /* Empty spacer to maintain grid alignment for Team B row */
}

/* Possession arrow buttons - same size as all others */
.possession-arrow-btn {
    font-size: 1.35em !important; /* 50% larger than base 0.9em */
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
}

.possession-buttons-group {
    display: contents;
}



.bottom-labels {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    font-size: 0.7em;
    color: #00cc00;
    font-weight: 600;
}



.possession-with-siren {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.siren-button {
    background: #007bff;
    color: white;
    border: 4px outset #0056b3;
    border-radius: 8px;
    padding: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.7em;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 50px;
}

.siren-button:active {
    border: 4px inset #0056b3;
    transform: translateY(2px);
}

.siren-button:active {
    border: 3px inset #0056b3;
}

/* 7x3 Button Matrix on White Background */
.button-matrix {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 15px;
    border: 6px solid #666;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.labels-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.7em;
    font-weight: 700;
    color: #333;
}

.labels-row-with-offset {
    display: grid;
    grid-template-columns: 25px repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.7em;
    font-weight: 700;
    color: #333;
    align-items: center;
}

.label-spacer {
    min-width: 25px;
}



.wrapped-label {
    line-height: 1.1;
}

.possession-label {
    text-align: center;
}

.matrix-row-with-label {
    display: grid;
    grid-template-columns: 25px repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.row-label {
    font-size: 0.7em;
    font-weight: 700;
    color: #333;
    min-width: 25px;
    text-align: left;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    width: 100%;
}

.matrix-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.team-letter, .timer-label {
    font-size: 1.5em;
    font-weight: 900;
    color: #333;
    text-align: center;
}

/* Simple Button Styles */
.btn-yellow, .btn-orange, .btn-green, .btn-blue, .btn-red, .btn-gray {
    border: 4px outset #ccc;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    height: 45px;
    padding: 6px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-yellow, .btn-orange, .btn-green, .btn-blue, .btn-red, .btn-gray:active {
    border: 4px inset #ccc;
    transform: translateY(2px);
}

.btn-yellow {
    background: #ffd700;
    color: #333;
}

.btn-orange {
    background: #ff8c00;
    color: white;
}

.btn-green {
    background: #28a745;
    color: white;
}

.btn-blue {
    background: #007bff;
    color: white;
}

.btn-red {
    background: #dc3545;
    color: white;
}

.btn-gray {
    background: #6c757d;
    color: white;
    opacity: 0.6;
    cursor: not-allowed;
}

.adjust-labels {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 10px 0;
    text-align: center;
    font-size: 0.7em;
    font-weight: 600;
    color: #333;
}

.bottom-functions {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.next-arrow {
    font-size: 0.8em;
    color: #333;
    font-weight: 600;
    text-align: center;
}

.section-label {
    font-size: 0.7em;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.yes-no-label {
    font-size: 0.6em;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.sub-labels, .bottom-labels-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 8px;
    text-align: center;
}

.adjust-label, .yes-no-small, .timer-label-small, .timeout-label, .program-label {
    font-size: 0.6em;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.extra-functions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.function-btn {
    padding: 12px 15px;
    border: 4px outset #ccc;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    min-height: 45px;
}

.function-btn:active {
    border: 4px inset #ccc;
    transform: translateY(2px);
}

/* Instructions */
.scoreboard-instructions {
    max-width: 800px;
    margin: 30px auto;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
}

.scoreboard-instructions h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    font-family: 'Orbitron', monospace;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.instruction-item {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.instruction-item strong {
    color: #28a745;
    display: block;
    margin-bottom: 5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .scoreboard-container {
        padding: 15px;
    }
    
    .scoreboard-title {
        font-size: 1.8em;
        margin: 40px 0 20px 0;
    }
    
    .lcd-main {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .possession-arrow {
        position: static;
        transform: none;
        margin-top: 15px;
    }
    
    .control-panel-scoreboard {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .team-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timer-controls {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .function-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .instruction-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lcd-header {
        font-size: 0.7em;
        padding: 5px;
    }
    
    .score {
        font-size: 2.5em;
        padding: 8px;
    }
    
    .game-time {
        font-size: 2em;
        padding: 12px;
    }
    
    .control-btn {
        padding: 12px 8px;
        font-size: 0.8em;
    }
}

/* Scoreboard Landscape Mobile Optimizations */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .scoreboard-container {
        padding: 10px;
    }
    
    .scoreboard-title {
        font-size: 1.6em;
        margin: 20px 0 15px 0;
    }
    
    .lcd-container {
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .lcd-header-row {
        font-size: 0.7em;
        padding: 6px;
        margin-bottom: 12px;
    }
    
    .team-row-a, .team-row-b {
        margin-bottom: 12px;
    }
    
    .number-display {
        font-size: 1.5em;
        padding: 4px;
    }
    
    .time-display {
        font-size: 1.8em;
        padding: 6px;
    }
    
    .button-matrix {
        padding: 15px;
    }
    
    .labels-row {
        font-size: 0.7em;
        margin-bottom: 12px;
        gap: 8px;
    }
    
    .labels-row-with-offset {
        font-size: 0.7em;
        margin-bottom: 12px;
        gap: 8px;
    }
    
    .matrix-row-with-label {
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .matrix-btn {
        height: 35px;
        font-size: 0.7em;
        padding: 2px 4px;
    }
    
    .footer-message {
        margin-top: 15px;
        padding: 8px;
        font-size: 9px;
    }
}

/* Ultra Small Landscape for Scoreboard */
@media screen and (max-width: 600px) and (orientation: landscape) and (max-height: 450px) {
    .scoreboard-container {
        padding: 8px;
    }
    
    .scoreboard-title {
        font-size: 1.4em;
        margin: 15px 0 10px 0;
    }
    
    .lcd-container {
        margin-bottom: 10px;
        padding: 8px;
        border-width: 4px;
    }
    
    .lcd-header-row {
        font-size: 0.6em;
        padding: 4px;
        margin-bottom: 8px;
    }
    
    .team-row-a, .team-row-b {
        margin-bottom: 8px;
    }
    
    .number-display {
        font-size: 1.2em;
        padding: 3px;
    }
    
    .time-display {
        font-size: 1.4em;
        padding: 4px;
    }
    
    .button-matrix {
        padding: 10px;
    }
    
    .labels-row {
        font-size: 0.6em;
        margin-bottom: 8px;
        gap: 6px;
    }
    
    .labels-row-with-offset {
        font-size: 0.6em;
        margin-bottom: 8px;
        gap: 6px;
    }
    
    .matrix-row-with-label {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .matrix-btn {
        height: 30px;
        font-size: 0.6em;
        padding: 1px 3px;
    }
    
    .footer-message {
        margin-top: 10px;
        padding: 6px;
        font-size: 8px;
    }
}

/* Mobile Fix for Number Cutoff - Priority Override */
@media screen and (max-width: 768px) {
    .lcd-screen .team-row-a,
    .lcd-screen .team-row-b {
        height: 50px !important;
        min-height: 50px !important;
        padding: 8px 0 !important;
        margin: 2px 0 !important;
        grid-template-columns: 95px 60px 70px 90px 80px 50px !important;
        gap: 6px !important;
        align-items: center !important;
    }
    
    .lcd-screen .team-row-b {
        transform: none !important;
    }
    

}

/* Mobile Only - Portrait: Proper fit without horizontal scroll */
@media screen and (max-width: 768px) and (orientation: portrait) {
    html, body {
        overflow-x: hidden !important;
    }
    
    .lcd-header-row {
        grid-template-columns: 95px 60px 70px 90px 80px 50px !important;
        gap: 6px !important;
        font-size: 0.7rem !important;
        text-align: center !important;
        font-weight: bold !important;
    }
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .scoreboard-container {
        width: 100% !important;
        max-width: 100vw !important;
        transform: none !important;
        margin: 0 !important;
        padding: 5px !important;
        box-sizing: border-box !important;
    }
    
    .scoreboard-display {
        width: 100% !important;
        max-width: none !important;
        height: 35vh !important;
        padding: 8px !important;
        overflow: hidden !important;
    }
    
    .scoreboard-container .scoreboard-display .display-grid {
        gap: 0px !important;
        grid-template-rows: 15px 1fr 1fr !important;
        grid-template-columns: 80px 50px 60px 70px 70px 40px !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    
    .team-row-a,
    .team-row-b {
        grid-template-columns: 60px 38px 45px 53px 50px 28px !important;
        gap: 2px !important;
        font-size: 0.6rem !important;
    }
    
    .lcd-screen .team-label-yellow,
    .lcd-screen .team-label-orange {
        font-size: 0.75rem !important;
        font-weight: bold !important;
        padding: 8px !important;
        min-height: 30px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }
    
    .lcd-screen .number-display {
        font-size: 1.3rem !important;
        font-weight: bold !important;
        padding: 4px 2px !important;
        min-height: 30px !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .lcd-screen .time-display {
        font-size: 1.3rem !important;
        font-weight: bold !important;
        padding: 4px 2px !important;
        min-height: 30px !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .button-matrix {
        width: 100% !important;
        padding: 5px !important;
        height: 65vh !important;
    }
    
    .control-btn {
        font-size: 0.55rem !important;
        padding: 6px 2px !important;
        min-height: 32px !important;
    }
    
    .labels-row {
        font-size: 0.5rem !important;
        margin-bottom: 4px !important;
    }
}

/* Mobile Only - Landscape: Proper fit without horizontal scroll */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .scoreboard-container {
        width: 100% !important;
        max-width: 100vw !important;
        transform: none !important;
        margin: 0 !important;
        padding: 3px !important;
        box-sizing: border-box !important;
    }
    
    .scoreboard-display {
        width: 100% !important;
        max-width: none !important;
        min-height: 80px !important;
        padding: 4px !important;
    }
    
    .display-grid {
        gap: 1px !important;
        grid-template-rows: auto auto auto !important;
        grid-template-columns: repeat(6, 1fr) !important;
        width: 100% !important;
    }
    
    .team-labels {
        font-size: 0.5rem !important;
        padding: 1px !important;
    }
    
    .number-display {
        font-size: 0.75rem !important;
        padding: 1px !important;
        min-height: 20px !important;
    }
    
    .time-display {
        font-size: 0.75rem !important;
        padding: 1px !important;
        min-height: 20px !important;
    }
    
    .button-matrix {
        width: 100% !important;
        padding: 3px !important;
    }
    
    .control-btn {
        font-size: 0.45rem !important;
        padding: 4px 1px !important;
        min-height: 25px !important;
    }
    
    .labels-row {
        font-size: 0.4rem !important;
        margin-bottom: 2px !important;
    }
}

    
    .console-container {
        padding: 15px;
        border-width: 6px;
    }
    
    .scoreboard-title {
        font-size: 1.8em;
        margin: 40px 0 20px 0;
    }
    
    .lcd-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 15px;
        text-align: center;
    }
    
    .team-labels {
        grid-column: 1;
        grid-row: 1;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }
    
    .display-area {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    

    
    .bottom-labels {
        grid-column: 1;
        grid-row: 4;
        justify-content: center;
        gap: 20px;
    }
    
    .siren-button-top {
        grid-column: 1;
        grid-row: 5;
        margin-top: 10px;
    }
    
    .control-row {
        gap: 5px;
        margin-bottom: 10px;
    }
    
    .row-1, .row-2, .row-3 {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .row-4 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .timer-section, .adjust-section, .timer-section-right, .right-controls {
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 8px 6px;
        font-size: 0.7em;
        min-height: 35px;
    }
    
    .display-number {
        font-size: 2em;
        padding: 6px 10px;
        min-width: 50px;
    }
    
    .main-time {
        font-size: 2.2em;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .console-container {
        padding: 10px;
        border-width: 4px;
    }
    
    .lcd-header {
        font-size: 0.65em;
        padding: 5px;
    }
    
    .display-number {
        font-size: 1.8em;
        padding: 4px 8px;
        min-width: 40px;
    }
    
    .main-time {
        font-size: 2em;
        padding: 10px 14px;
    }
    
    .btn {
        padding: 6px 4px;
        font-size: 0.65em;
        min-height: 30px;
    }
    
    .section-label {
        font-size: 0.6em;
    }
    
    .team-letter {
        font-size: 1em;
    }
}

/* Mobile Responsive for CC-10 Console */
@media (max-width: 768px) {
    .cc10-console {
        padding: 15px;
        border-width: 6px;
    }
    
    .lcd-screen {
        padding: 15px;
    }
    
    .team-row {
        grid-template-columns: auto repeat(4, 1fr);
        gap: 8px;
    }
    
    .display-number {
        font-size: 2em;
        padding: 6px 10px;
        min-width: 60px;
    }
    
    .main-time {
        font-size: 2.5em;
        padding: 10px 15px;
    }
    
    .section-labels, .button-row {
        grid-template-columns: auto repeat(6, 1fr);
        gap: 5px;
    }
    
    .control-btn {
        padding: 8px 4px;
        font-size: 0.7em;
        min-height: 40px;
    }
    
    .bottom-controls {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .timer-group, .adjust-group, .timeout-group, .program-group {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .cc10-console {
        padding: 10px;
        border-width: 4px;
    }
    
    .lcd-header {
        font-size: 0.6em;
        padding: 5px;
    }
    
    .display-number {
        font-size: 1.5em;
        padding: 4px 8px;
        min-width: 50px;
    }
    
    .main-time {
        font-size: 2em;
        padding: 8px 12px;
    }
    
    .control-btn {
        padding: 6px 3px;
        font-size: 0.6em;
        min-height: 35px;
    }
    
    .section-label, .group-label {
        font-size: 0.6em;
    }
    
    .team-letter {
        font-size: 1.2em;
    }
}

/* CRITICAL MOBILE HEADER FIX - MATCH DESKTOP EXACTLY */
@media screen and (max-width: 768px) {
    .lcd-screen .lcd-header-row {
        grid-template-columns: 100px 80px 120px 100px 140px 80px !important;
        gap: 12px !important;
        font-size: 0.8rem !important;
        text-align: center !important;
        font-weight: 700 !important;
        padding: 0 !important;
        margin: 0 !important;
        color: #333 !important;
    }
    
    .lcd-screen .team-row-a,
    .lcd-screen .team-row-b {
        grid-template-columns: 100px 80px 120px 100px 140px 80px !important;
        gap: 12px !important;
        height: 45px !important;
        align-items: center !important;
        min-height: 45px !important;
    }
    
    .lcd-screen .number-display,
    .lcd-screen .time-display {
        font-size: 1.4rem !important;
        font-weight: bold !important;
        text-align: center !important;
        padding: 4px 2px !important;
        line-height: 1.1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}
