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

body {
    font-family: Arial, sans-serif;
    background-color: #000000;
    color: white;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Public Toggle Switch */
.public-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    width: 50px;
    height: 26px;
    margin-right: 10px;
}

.public-toggle input {
    display: none;
}

.public-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid #555;
}

.public-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #666;
    transition: 0.3s;
    border-radius: 50%;
}

.public-toggle input:checked + .public-toggle-slider {
    background-color: #ff8800;
    border-color: #ff6600;
}

.public-toggle input:checked + .public-toggle-slider:before {
    transform: translateX(24px);
    background-color: #fff;
}

.public-toggle-status {
    font-weight: bold;
    font-size: 12px;
    min-width: 30px;
    color: #ccc;
}

.live-link-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #444;
}

.live-link-text {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: monospace;
    color: #ff8800;
    cursor: pointer;
    user-select: text;
    transition: all 0.2s;
    text-align: center;
}

.live-link-text:hover {
    background-color: #2a2a2a;
    border-color: #555;
    color: #ffaa33;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff4444;
    color: white;
    text-align: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

.tracker-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 10px;
}

/* === SECTION 1: COURT === */
.court-section {
    background-color: #000000;
    padding: 2px;
    margin-bottom: 2px;
}

#basketball-court {
    display: block;
    margin: 0 auto;
    cursor: crosshair;
    border: 2px solid #333;
    width: 100%;
    height: auto;
    max-width: 600px;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.shot-marker {
    pointer-events: none;
}


/* === SECTION 2: PLAYER SCROLL === */
.player-scroll-section {
    background-color: #0a0a0a;
    padding: 5px 6px;
    padding-bottom: 2px;
    margin-bottom: 2px;
    min-height: 120px;
}

.team-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.stat-selector {
    display: flex;
    gap: 5px;
    margin-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 2px;
}

.stat-selector::-webkit-scrollbar {
    display: none;
}

.stat-btn {
    flex: 0 0 auto;
    padding: 5px 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #aaa;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.stat-btn.active {
    background: #ff6b00;
    border-color: #ff6b00;
    color: white;
}

.stat-btn:active {
    transform: scale(0.95);
}

.team-switch-btn {
    flex: 1;
    padding: 6px 12px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.team-switch-btn.active {
    background: linear-gradient(135deg, #ff6b00 0%, #e65100 100%);
    border-color: #ff6b00;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
}

.team-switch-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 0.3px;
}

.team-switch-btn.active .team-switch-name {
    color: rgba(255, 255, 255, 0.95);
}

.team-switch-score {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.player-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 5px 8px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-height: 90px;
    touch-action: pan-x;
}

.player-scroll::-webkit-scrollbar {
    display: none;
}

.player-card {
    flex: 0 0 auto;
    width: 80px;
    min-height: 80px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 6px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}


/* Starters (first 5) - light green border */
.player-scroll .player-card:nth-child(-n+5) {
    border: 2px solid #4CAF50;
}

/* Visual separator after 5th starter */
.player-scroll .player-card:nth-child(5) {
    margin-right: 16px;
    position: relative;
}

.player-scroll .player-card:nth-child(5)::after {
    content: '';
    position: absolute;
    right: -11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(76, 175, 80, 0.3);
}

.player-card.selected {
    background: #00c853;
    border-color: #00c853;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 200, 83, 0.4);
}

.player-card.swap-mode {
    border-color: #ffeb3b;
    background: #2a2a00;
    box-shadow: 0 4px 12px rgba(255, 235, 59, 0.5);
    animation: swapModeCardPulse 1.5s ease-in-out infinite;
}

@keyframes swapModeCardPulse {
    0%, 100% {
        border-color: #ffeb3b;
        box-shadow: 0 4px 12px rgba(255, 235, 59, 0.5);
    }
    50% {
        border-color: #ffc107;
        box-shadow: 0 6px 20px rgba(255, 235, 59, 0.8);
    }
}

.player-card-number {
    font-size: 12px;
    font-weight: 900;
    color: #ff6b00;
    line-height: 1.1;
}

.player-card.selected .player-card-number {
    color: white;
}

.player-card-name {
    font-size: 9px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.player-name-line {
    font-weight: 700;
    color: #ddd;
}

.player-surname-line {
    color: #999;
    font-weight: 600;
}

.player-card.selected .player-name-line,
.player-card.selected .player-surname-line {
    color: white;
}

.player-card-stats {
    font-size: 14px;
    font-weight: 900;
    color: #FF8C42;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    position: relative;
}

.player-card.selected .player-card-stats {
    color: white;
}

.stat-quick-actions {
    display: flex;
    gap: 3px;
}

.stat-btn-minus,
.stat-btn-plus {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 3px;
    background: #333;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.stat-btn-minus:active,
.stat-btn-plus:active {
    background: #555;
}

.stat-btn-minus {
    background: #c0392b;
}

.stat-btn-plus {
    background: #27ae60;
}

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

.quick-shot-modal-content {
    background: #2a2a2a;
    border: 3px solid #FF8C42;
    border-radius: 12px;
    padding: 20px;
}

.quick-shot-header {
    text-align: center;
    margin-bottom: 15px;
}

.quick-shot-player-number {
    font-size: 24px;
    font-weight: 900;
    color: #FF8C42;
    margin-bottom: 5px;
}

.quick-shot-player-name {
    font-size: 16px;
    font-weight: 700;
    color: #ddd;
    margin-bottom: 8px;
}

.quick-shot-status {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.quick-shot-status.made {
    background: #27ae60;
    color: white;
}

.quick-shot-status.miss {
    background: #c0392b;
    color: white;
}

.quick-shot-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.quick-shot-btn {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 8px;
    background: #FF8C42;
    color: white;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    transition: transform 0.1s;
}

.quick-shot-btn:active {
    transform: scale(0.9);
}

.quick-shot-btn.highlighted {
    background: #27ae60;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.6);
}

.quick-shot-btn.greyed {
    background: #666;
    opacity: 0.5;
}

.no-players-msg {
    color: #999;
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

/* === SECTION 3: ACTION BUTTONS === */
.action-buttons-section {
    position: relative;
    padding: 12px 16px;
    background-color: #0a0a0a;
    min-height: 300px;
    margin-bottom: 20px;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}

.action-buttons-section.has-selection {
    cursor: pointer;
    background-color: #1a0000;
}

.action-buttons-section.has-selection:hover {
    background-color: #2a0000;
}
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-circle {
    position: relative;
    width: 300px;
    height: 300px;
    pointer-events: none;
}

.button-circle > * {
    pointer-events: auto;
}

.action-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    left: 50%;
    top: 50%;
    margin-left: -30px;
    margin-top: -30px;
    background: transparent;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.action-btn-front {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 1;
    transition: transform 600ms cubic-bezier(.3, .7, .4, 1);
}

.action-btn:hover .action-btn-front {
    transform: translateY(-6px);
    transition: transform 250ms cubic-bezier(.3, .7, .4, 1.5);
}

.action-btn:active .action-btn-front {
    transform: translateY(-2px);
    transition: transform 34ms;
}

.action-btn:focus:not(:focus-visible) {
    outline: none;
}

.action-btn.selected .action-btn-front {
    box-shadow: 0 0 25px currentColor, 0 0 40px currentColor, 0 4px 12px rgba(0,0,0,0.5);
    border: 3px solid white;
    animation: btnPulse 0.3s ease-out;
}

@keyframes btnPulse {
    0% { transform: translateY(-4px) scale(1); }
    50% { transform: translateY(-4px) scale(1.2); }
    100% { transform: translateY(-4px) scale(1.1); }
}

.action-label {
    font-size: 11px;
    font-weight: 900;
}

.action-icon {
    font-size: 19px;
}

/* Perfect circle positioning using CSS transforms */
/* 10 buttons evenly spaced at 36° intervals, radius = 120px */

/* MAKE - 0° (top) */
.btn-shot-made {
    transform: rotate(0deg) translate(120px) rotate(-0deg);
}
.btn-shot-made .action-btn-front {
    background: #4CAF50;
}

/* AST - 36° */
.btn-assist {
    transform: rotate(36deg) translate(120px) rotate(-36deg);
}
.btn-assist .action-btn-front {
    background: #2196F3;
}

/* FT✓ - 72° */
.btn-ft-made {
    transform: rotate(72deg) translate(120px) rotate(-72deg);
}
.btn-ft-made .action-btn-front {
    background: #4CAF50;
}

/* STL - 108° */
.btn-steal {
    transform: rotate(108deg) translate(120px) rotate(-108deg);
}
.btn-steal .action-btn-front {
    background: #FF9800;
}

/* BLK - 144° */
.btn-block {
    transform: rotate(144deg) translate(120px) rotate(-144deg);
}
.btn-block .action-btn-front {
    background: #9C27B0;
}

/* FT✗ - 180° (bottom) */
.btn-ft-miss {
    transform: rotate(180deg) translate(120px) rotate(-180deg);
}
.btn-ft-miss .action-btn-front {
    background: #f44336;
}

/* MISS - 216° */
.btn-shot-miss {
    transform: rotate(216deg) translate(120px) rotate(-216deg);
}
.btn-shot-miss .action-btn-front {
    background: #f44336;
}

/* REB - 252° */
.btn-rebound {
    transform: rotate(252deg) translate(120px) rotate(-252deg);
}
.btn-rebound .action-btn-front {
    background: #00BCD4;
}

/* REB sub-buttons (DEF / OFF) */
.reb-sub-buttons {
    position: absolute;
    display: none;
    gap: 8px;
    z-index: 10;
    left: 50%;
    top: 50%;
    transform: translate(-42px, -140px);
    pointer-events: auto;
}
.reb-sub-buttons.visible {
    display: flex;
    animation: rebSubPop 0.15s ease-out;
}
@keyframes rebSubPop {
    0% { opacity: 0; transform: translate(-42px, -140px) scale(0.7); }
    100% { opacity: 1; transform: translate(-42px, -140px) scale(1); }
}
.reb-sub-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: transform 0.15s ease;
}
.reb-sub-btn:active {
    transform: scale(0.9);
}
.reb-sub-def {
    background: #00BCD4;
}
.reb-sub-off {
    background: #0097A7;
}

/* TO - 288° */
.btn-turnover {
    transform: rotate(288deg) translate(120px) rotate(-288deg);
}
.btn-turnover .action-btn-front {
    background: #795548;
}

/* FOUL - 324° */
.btn-foul {
    transform: rotate(324deg) translate(120px) rotate(-324deg);
}
.btn-foul .action-btn-front {
    background: #FFC107;
}

.action-btn.selected {
    box-shadow: 0 0 20px currentColor !important;
}

/* Action button progress ring for long press */
.action-progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin-top: -28px;
    margin-left: -28px;
    transform: rotate(-90deg);
    pointer-events: none;
    z-index: 0;
}

.action-progress-circle {
    fill: none;
    stroke: #00d4ff;
    stroke-width: 3;
    stroke-dasharray: 172.79;  /* 2 * π * r where r = 27.5 */
    stroke-dashoffset: 172.79;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.8));
}

.action-btn.long-pressing .action-progress-circle {
    stroke-dashoffset: 0;
}

/* Center game clock - 20% bigger than original */
.game-clock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 102px;     /* 85 * 1.2 = 102px */
    height: 102px;    /* 85 * 1.2 = 102px */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 4px solid #ff6b00;  /* 3 * 1.2 ≈ 4px */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
    transition: all 0.2s;
}

.game-clock:active {
    transform: translate(-50%, -50%) scale(0.92);
}

.game-clock.running {
    border-color: #00c853;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.6);
}

.game-clock.running:active {
    box-shadow: 0 2px 6px rgba(0, 200, 83, 0.6);
}

/* Long press loading indicator */
.clock-progress-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 102px;
    height: 102px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.clock-progress-circle {
    fill: none;
    stroke: #00d4ff;
    stroke-width: 4;
    stroke-dasharray: 314.16;  /* 2 * π * r where r = 50 */
    stroke-dashoffset: 314.16;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.8));
}

.game-clock.long-pressing .clock-progress-circle {
    stroke-dashoffset: 0;
}

.clock-time {
    font-size: 22px;   /* 18 * 1.2 ≈ 22px */
    font-weight: 900;
    color: white;
}

.clock-label {
    font-size: 13px;   /* 11 * 1.2 ≈ 13px */
    color: #999;
    font-weight: 700;
}

/* Quarter Selector Overlay */
.quarter-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: safe center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top, 16px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.quarter-selector-overlay.show {
    display: flex;
}

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

.quarter-selector {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #ff6b00;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(255, 107, 0, 0.5);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    margin: auto;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.quarter-selector-title {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b00;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quarter-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.quarter-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.quarter-partial {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.quarter-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #333;
    background: #0f172a;
    color: white;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quarter-btn:hover {
    border-color: #ff6b00;
    background: #1e293b;
    transform: scale(1.05);
}

.quarter-btn.active {
    border-color: #ff6b00;
    background: linear-gradient(135deg, #ff6b00 0%, #e65100 100%);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.6);
    transform: scale(1.1);
}

.quarter-btn:active {
    transform: scale(0.95);
}

.quarter-selector-close {
    margin-top: 20px;
    text-align: center;
}

.quarter-close-btn {
    background: #334155;
    border: 2px solid #475569;
    color: white;
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.quarter-close-btn:hover {
    background: #475569;
    border-color: #64748b;
}

.quarter-close-btn:active {
    transform: scale(0.95);
}

/* Options Section */
.options-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6b00, transparent);
    margin: 20px 0;
}

.option-group {
    margin-bottom: 15px;
}

.option-label {
    font-size: 12px;
    color: #999;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.option-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #333;
    background: #0f172a;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.option-btn:hover {
    border-color: #ff6b00;
    background: #1e293b;
}

.option-btn.active {
    border-color: #ff6b00;
    background: linear-gradient(135deg, #ff6b00 0%, #e65100 100%);
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

.option-btn:active {
    transform: scale(0.95);
}

/* Action Toggle Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.action-toggle-btn {
    padding: 10px 8px;
    border-radius: 8px;
    border: 2px solid #333;
    background: #0f172a;
    color: #666;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.action-toggle-btn:hover {
    border-color: #555;
    background: #1e293b;
}

.action-toggle-btn.active {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.action-toggle-btn:active {
    transform: scale(0.95);
}

.action-toggle-icon {
    font-size: 12px;
    font-weight: 900;
}

/* === CONFIRM BAR === */
.confirm-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2a2a2a;
    padding: 15px;
    display: none;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #444;
    z-index: 1000;
}

.confirm-bar.show {
    display: flex;
}

.confirm-info {
    flex: 1;
}

.confirm-player {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.confirm-action {
    color: #ccc;
    font-size: 14px;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
}

.confirm-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.confirm-accept {
    background: #4CAF50;
    color: white;
}

.confirm-deny {
    background: #f44336;
    color: white;
}

.confirm-btn:active {
    transform: scale(0.9);
}

/* Confirm button progress ring for long press */
.confirm-progress-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.confirm-progress-circle {
    fill: none;
    stroke: #00d4ff;
    stroke-width: 4;
    stroke-dasharray: 179.07;  /* 2 * π * r where r = 28.5 */
    stroke-dashoffset: 179.07;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.8));
}

.confirm-accept.long-pressing .confirm-progress-circle {
    stroke-dashoffset: 0;
}

/* Confirm accept animation */
.confirm-accept.accepting {
    animation: acceptPulse 0.6s ease-out;
}

@keyframes acceptPulse {
    0% {
        transform: scale(1);
        background: #4CAF50;
    }
    50% {
        transform: scale(1.3);
        background: #66BB6A;
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Points feedback overlay - Made shots (right side) */
.points-feedback {
    position: absolute;
    bottom: 10px;
    right: 10px;
    transform: scale(0);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.points-feedback-number {
    font-size: 36px;
    font-weight: 900;
    color: #4CAF50;
    text-shadow: 0 0 30px rgba(76, 175, 80, 0.8), 0 0 60px rgba(76, 175, 80, 0.5);
    line-height: 1;
}

.points-feedback-player {
    font-size: 12px;
    font-weight: 700;
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    text-align: right;
}

.points-feedback.show {
    animation: pointsFeedback 2.2s ease-out;
}

@keyframes pointsFeedback {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    15% {
        transform: scale(1.2);
        opacity: 1;
    }
    25% {
        transform: scale(1);
        opacity: 1;
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

/* Miss feedback overlay - Missed shots (left side) */
.miss-feedback {
    position: absolute;
    bottom: 10px;
    left: 10px;
    transform: scale(0);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.miss-feedback-number {
    font-size: 36px;
    font-weight: 900;
    color: #f44336;
    text-shadow: 0 0 30px rgba(244, 67, 54, 0.8), 0 0 60px rgba(244, 67, 54, 0.5);
    line-height: 1;
}

.miss-feedback-player {
    font-size: 12px;
    font-weight: 700;
    color: #f44336;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
    text-align: left;
}

.miss-feedback.show {
    animation: missFeedback 2.2s ease-out;
}

@keyframes missFeedback {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    15% {
        transform: scale(1.2);
        opacity: 1;
    }
    25% {
        transform: scale(1);
        opacity: 1;
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

/* Confirm bar slide out animation */
.confirm-bar.hiding {
    animation: slideOut 0.4s ease-out forwards;
}

@keyframes slideOut {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* === UTILITY BUTTONS === */
.utility-btn {
    position: absolute;
    top: 0;
    width: 70px;
    height: 55px;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.utility-btn:active {
    opacity: 0.8;
}

.btn-undo {
    left: 0;
    top: 0;
    background: #FFC107;
    clip-path: polygon(0% 0%, 100% 0%, 70% 100%, 0% 100%);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    padding-left: 0;
    padding-right: 15px;
    border-right: 2px solid rgba(0,0,0,0.3);
}

.btn-undo:active {
    opacity: 0.8;
}

.undo-hint {
    position: absolute;
    top: 60px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #FFC107;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
    z-index: 100;
}

.undo-hint.fade-out {
    opacity: 0;
}


.btn-stats {
    right: 0;
    background: #ff6b00;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 30% 100%);
    box-shadow: -4px 4px 8px rgba(0,0,0,0.3);
    padding-right: 0;
    padding-left: 15px;
    border-left: 2px solid rgba(0,0,0,0.3);
}

.btn-stats:active {
    opacity: 0.8;
}

.btn-icon {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

.btn-icon-circle {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}


/* === ACTIONS LOG === */
.actions-log-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.98);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.actions-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #9C27B0;
}

.actions-log-header h3 {
    color: #9C27B0;
    font-size: 24px;
    font-weight: 900;
    margin: 0;
}

.actions-log-close {
    width: 40px;
    height: 40px;
    background: #9C27B0;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.actions-log-close:active {
    transform: scale(0.9);
}

.actions-log-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-log-entry {
    background: #1a1a1a;
    border-left: 3px solid #9C27B0;
    padding: 6px 10px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-log-entry.made {
    border-left-color: #4CAF50;
}

.action-log-entry.miss {
    border-left-color: #f44336;
}

.action-log-timestamp {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    min-width: 45px;
}

.action-log-time {
    font-size: 10px;
    color: #888;
    font-weight: 600;
    min-width: 22px;
}

.action-log-player {
    font-size: 13px;
    color: white;
    font-weight: 700;
    min-width: 120px;
}

.action-log-description {
    font-size: 12px;
    color: #ccc;
    flex: 1;
}

.action-log-points {
    font-size: 14px;
    font-weight: 900;
    min-width: 30px;
    text-align: right;
}

.action-log-entry.made .action-log-points {
    color: #4CAF50;
}

.action-log-entry.miss .action-log-points {
    color: #f44336;
}

/* === STATS TABLE === */
.stats-table-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.stats-actions-log-btn {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 50px;
    height: 50px;
    padding: 0;
    background: #d22bec;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(210, 43, 236, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-actions-log-btn:active {
    background: #b01fc7;
    transform: scale(0.95);
}

.stats-back-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    padding: 0;
    background: #2196F3;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-back-btn:active {
    background: #1976D2;
    transform: scale(0.95);
}

.stats-table-scroll {
    flex: 1;
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.live-stats-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    color: white;
}

.live-stats-table th {
    background: #1a1a1a;
    padding: 8px 6px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #333;
    white-space: nowrap;
}

.live-stats-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.live-stats-table th.player-col {
    text-align: left;
    padding-left: 8px;
}

.live-stats-table th.sticky-col,
.live-stats-table td.sticky-col {
    position: sticky;
    background: #1a1a1a;
    z-index: 15;
}

.live-stats-table th.sticky-col {
    z-index: 25;
}

.live-stats-table th.sticky-col:first-child,
.live-stats-table td.sticky-col:first-child {
    left: 0;
    min-width: 35px;
}

.live-stats-table th.sticky-col:nth-child(2),
.live-stats-table td.sticky-col:nth-child(2) {
    left: 35px;
    min-width: 90px;
}

.live-stats-table td {
    padding: 6px 6px;
    text-align: center;
    border: 1px solid #333;
    background: #1a1a1a;
    white-space: nowrap;
}

.live-stats-table td.player-col {
    text-align: left;
    padding-left: 8px;
    font-weight: 600;
}

.live-stats-table tr:hover td {
    background: #2a2a2a;
}

.live-stats-table tr:hover td.sticky-col {
    background: #2a2a2a;
}

/* === SWAP MODE OVERLAY === */
.swap-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, rgba(255, 235, 59, 0.9) 0%, rgba(255, 193, 7, 0.9) 100%);
    padding: 8px;
    text-align: center;
    z-index: 2000;
    animation: slideDownFromTop 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(255, 235, 59, 0.6);
}

@keyframes slideDownFromTop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.swap-mode-text {
    font-size: 14px;
    font-weight: 900;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* === DRAG SYSTEM === */
#touch-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.touch-light {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.8) 0%, rgba(255, 107, 0, 0) 70%);
    pointer-events: none;
    animation: touchPulse 0.6s ease-out;
}

@keyframes touchPulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

#drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

#drag-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.drag-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 107, 0, 0.6);
    pointer-events: none;
    animation: fadeDot 1s ease-out forwards;
}

@keyframes fadeDot {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

#finger-indicator {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #ff6b00;
    background: rgba(255, 107, 0, 0.2);
    pointer-events: none;
    display: none;
    transform: translate(-50%, -50%);
}

.zone-locked {
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.8) !important;
    border-color: #ff6b00 !important;
}

.greyed-out {
    opacity: 0.25 !important;
    pointer-events: none !important;
}

#quick-confirm-btn {
    position: fixed;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: 4px solid white;
    color: white;
    font-size: 36px;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
    z-index: 10000;
    cursor: pointer;
    animation: confirmBtnAppear 0.3s ease-out;
}

@keyframes confirmBtnAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#quick-confirm-btn:active {
    transform: scale(0.9);
}



/* === CONFIRMATION MODAL === */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-modal-content {
    background: #2a2a2a;
    border: 3px solid #ff6b00;
    border-radius: 12px;
    padding: 20px;
    min-width: 300px;
    max-width: 90%;
}

.confirmation-header {
    text-align: center;
    margin-bottom: 15px;
}

.confirmation-header h3 {
    font-size: 22px;
    font-weight: 900;
    color: #ff6b00;
    margin: 0;
}

.confirmation-body {
    text-align: center;
    margin-bottom: 20px;
}

.confirmation-body p {
    font-size: 16px;
    font-weight: 600;
    color: #ddd;
    margin: 0;
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirmation-btn {
    width: 80px;
    height: 50px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-no {
    background: #f44336;
    color: white;
}

.confirm-no:active {
    transform: scale(0.95);
    background: #d32f2f;
}

.confirm-yes {
    background: #4CAF50;
    color: white;
}

.confirm-yes:active {
    transform: scale(0.95);
    background: #45a049;
}

/* ==========================================================
   SMALL PORTRAIT PHONES (iPhone 13 mini, SE, etc.)
   Scale down the action buttons section to fit above Safari's
   URL bar. Court and player sections stay the same size.
   ========================================================== */
@media (orientation: portrait) and (max-height: 750px) {
    .action-buttons-section {
        transform: scale(0.8);
        transform-origin: top center;
        /* Scale makes it 80% wide — expand to 125% so it fills screen edges */
        width: 125%;
        margin-left: -12.5%;
        /* Compensate layout box height */
        margin-bottom: -68px;
        margin-top: 2px;
        padding: 12px 0;
    }
}

/* ==========================================================
   LANDSCAPE PHONE ADAPTATION
   When phone is rotated to landscape, height is very limited
   (~375px on iPhone). We need to compress everything vertically
   and optionally show court + players side-by-side.
   ========================================================== */

/* Landscape on phones (short height + wide) */
@media (orientation: landscape) and (max-height: 500px) {
    body {
        overflow-y: auto;
    }

    .tracker-container {
        padding-top: 2px;
    }

    /* Shrink court */
    .court-section {
        padding: 2px;
        margin-bottom: 0;
    }

    #basketball-court {
        max-width: 350px;
    }

    /* Compress player scroll */
    .player-scroll-section {
        padding: 3px 4px;
        margin-bottom: 0;
        min-height: 70px;
    }

    .team-switcher {
        margin-bottom: 3px;
    }

    .team-switch-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .team-switch-score {
        font-size: 18px;
    }

    .stat-selector {
        margin-bottom: 3px;
    }

    .player-scroll {
        min-height: 60px;
        padding: 3px 5px;
        gap: 4px;
    }

    .player-card {
        width: 65px;
        min-height: 60px;
        padding: 4px 3px;
    }

    .player-card-number {
        font-size: 11px;
    }

    .player-card-name {
        font-size: 8px;
    }

    .player-card-stats {
        font-size: 12px;
    }

    /* Shrink action button circle */
    .action-buttons-section {
        min-height: 220px;
        padding: 8px 12px;
        margin-top: 4px;
        margin-bottom: 10px;
    }

    .button-circle {
        width: 220px;
        height: 220px;
    }

    /* Reduce button circle radius from 120px to 90px */
    .btn-shot-made { transform: rotate(0deg) translate(90px) rotate(-0deg); }
    .btn-assist { transform: rotate(36deg) translate(90px) rotate(-36deg); }
    .btn-ft-made { transform: rotate(72deg) translate(90px) rotate(-72deg); }
    .btn-steal { transform: rotate(108deg) translate(90px) rotate(-108deg); }
    .btn-block { transform: rotate(144deg) translate(90px) rotate(-144deg); }
    .btn-ft-miss { transform: rotate(180deg) translate(90px) rotate(-180deg); }
    .btn-shot-miss { transform: rotate(216deg) translate(90px) rotate(-216deg); }
    .btn-rebound { transform: rotate(252deg) translate(90px) rotate(-252deg); }
    .btn-turnover { transform: rotate(288deg) translate(90px) rotate(-288deg); }
    .btn-foul { transform: rotate(324deg) translate(90px) rotate(-324deg); }
    .reb-sub-buttons { transform: translate(-30px, -100px); }
    @keyframes rebSubPop {
        0% { opacity: 0; transform: translate(-30px, -100px) scale(0.7); }
        100% { opacity: 1; transform: translate(-30px, -100px) scale(1); }
    }
    .reb-sub-btn { width: 52px; height: 52px; font-size: 13px; }

    .action-btn {
        width: 48px;
        height: 48px;
        margin-left: -24px;
        margin-top: -24px;
    }

    .action-label {
        font-size: 9px;
    }

    .action-icon {
        font-size: 15px;
    }

    /* Shrink game clock */
    .game-clock {
        width: 78px;
        height: 78px;
    }

    .clock-time {
        font-size: 17px;
    }

    .clock-label {
        font-size: 10px;
    }

    .clock-progress-ring {
        width: 78px;
        height: 78px;
    }

    /* Utility buttons */
    .utility-btn {
        width: 55px;
        height: 42px;
        font-size: 18px;
    }

    .btn-icon, .btn-icon-circle {
        width: 22px;
        height: 22px;
    }


    /* Quarter buttons */
    .quarter-btn {
        width: 48px;
        height: 48px;
        font-size: 15px;
    }

    /* Quick shot modal */
    .quick-shot-btn {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .quick-shot-player-number {
        font-size: 20px;
    }

    .quick-shot-player-name {
        font-size: 14px;
    }

    /* Confirm bar */
    .confirm-bar {
        padding: 8px;
    }

    .confirm-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Very short landscape (iPhone SE, etc.) */
@media (orientation: landscape) and (max-height: 380px) {
    #basketball-court {
        max-width: 280px;
    }

    .player-scroll {
        min-height: 50px;
    }

    .player-card {
        width: 55px;
        min-height: 50px;
    }

    .action-buttons-section {
        min-height: 190px;
    }

    .button-circle {
        width: 190px;
        height: 190px;
    }

    .btn-shot-made { transform: rotate(0deg) translate(75px) rotate(-0deg); }
    .btn-assist { transform: rotate(36deg) translate(75px) rotate(-36deg); }
    .btn-ft-made { transform: rotate(72deg) translate(75px) rotate(-72deg); }
    .btn-steal { transform: rotate(108deg) translate(75px) rotate(-108deg); }
    .btn-block { transform: rotate(144deg) translate(75px) rotate(-144deg); }
    .btn-ft-miss { transform: rotate(180deg) translate(75px) rotate(-180deg); }
    .btn-shot-miss { transform: rotate(216deg) translate(75px) rotate(-216deg); }
    .btn-rebound { transform: rotate(252deg) translate(75px) rotate(-252deg); }
    .btn-turnover { transform: rotate(288deg) translate(75px) rotate(-288deg); }
    .btn-foul { transform: rotate(324deg) translate(75px) rotate(-324deg); }
    .reb-sub-buttons { transform: translate(-24px, -80px); }
    @keyframes rebSubPop {
        0% { opacity: 0; transform: translate(-24px, -80px) scale(0.7); }
        100% { opacity: 1; transform: translate(-24px, -80px) scale(1); }
    }
    .reb-sub-btn { width: 47px; height: 47px; font-size: 12px; }

    .action-btn {
        width: 42px;
        height: 42px;
        margin-left: -21px;
        margin-top: -21px;
    }

    .game-clock {
        width: 65px;
        height: 65px;
    }

    .clock-time {
        font-size: 14px;
    }

    .clock-label {
        font-size: 9px;
    }
}

/* iPad Portrait (min-width: 768px) */
@media (min-width: 768px) {
    /* Court ~10% smaller than before (was 750px) */
    #basketball-court {
        max-width: 675px;
    }

    /* Player cards bigger */
    .player-card {
        width: 100px;
        min-height: 100px;
    }

    .player-card-number {
        font-size: 28px;
    }

    .player-card-name {
        font-size: 11px;
    }

    .player-card-stats {
        font-size: 12px;
    }

    /* Team switcher buttons bigger */
    .team-switch-btn {
        padding: 10px 24px;
        font-size: 15px;
    }

    /* Stat selector bigger */
    .stat-btn {
        padding: 8px 14px;
        font-size: 14px;
    }

    /* Action buttons section bigger */
    .action-buttons-section {
        min-height: 350px;
    }

    .button-circle {
        width: 340px;
        height: 340px;
    }

    .action-btn {
        width: 72px;
        height: 72px;
        margin-left: -36px;
        margin-top: -36px;
        font-size: 11px;
    }

    /* Increase radius for action buttons to avoid overlap */
    .btn-shot-made { transform: rotate(0deg) translate(145px) rotate(-0deg); }
    .btn-assist { transform: rotate(36deg) translate(145px) rotate(-36deg); }
    .btn-ft-made { transform: rotate(72deg) translate(145px) rotate(-72deg); }
    .btn-steal { transform: rotate(108deg) translate(145px) rotate(-108deg); }
    .btn-block { transform: rotate(144deg) translate(145px) rotate(-144deg); }
    .btn-ft-miss { transform: rotate(180deg) translate(145px) rotate(-180deg); }
    .btn-shot-miss { transform: rotate(216deg) translate(145px) rotate(-216deg); }
    .btn-rebound { transform: rotate(252deg) translate(145px) rotate(-252deg); }
    .btn-turnover { transform: rotate(288deg) translate(145px) rotate(-288deg); }
    .btn-foul { transform: rotate(324deg) translate(145px) rotate(-324deg); }
    .reb-sub-buttons { transform: translate(-48px, -170px); }
    @keyframes rebSubPop {
        0% { opacity: 0; transform: translate(-48px, -170px) scale(0.7); }
        100% { opacity: 1; transform: translate(-48px, -170px) scale(1); }
    }

    /* Game clock bigger */
    .game-clock {
        width: 110px;
        height: 110px;
    }

    .clock-time {
        font-size: 28px;
    }

    .clock-label {
        font-size: 11px;
    }

    /* Quarter buttons bigger */
    .quarter-btn {
        width: 64px;
        height: 64px;
        font-size: 16px;
    }

    /* Utility buttons bigger */
    .utility-btn {
        width: 80px;
        height: 60px;
        font-size: 24px;
    }

    /* Confirm bar bigger */
    .confirm-bar {
        padding: 14px;
    }

    .confirm-btn {
        width: 66px;
        height: 66px;
        font-size: 26px;
    }
}

/* iPad Landscape / Desktop (min-width: 1024px) */
@media (min-width: 1024px) {
    /* Court ~30% smaller than before (was 850px) */
    #basketball-court {
        max-width: 595px;
    }

    /* Even larger player cards */
    .player-card {
        width: 110px;
        min-height: 110px;
    }

    .player-card-number {
        font-size: 32px;
    }

    .player-card-name {
        font-size: 12px;
    }

    /* Action buttons section bigger */
    .action-buttons-section {
        min-height: 400px;
    }

    .button-circle {
        width: 380px;
        height: 380px;
    }

    .action-btn {
        width: 78px;
        height: 78px;
        margin-left: -39px;
        margin-top: -39px;
        font-size: 12px;
    }

    /* Bigger radius */
    .btn-shot-made { transform: rotate(0deg) translate(160px) rotate(-0deg); }
    .btn-assist { transform: rotate(36deg) translate(160px) rotate(-36deg); }
    .btn-ft-made { transform: rotate(72deg) translate(160px) rotate(-72deg); }
    .btn-steal { transform: rotate(108deg) translate(160px) rotate(-108deg); }
    .btn-block { transform: rotate(144deg) translate(160px) rotate(-144deg); }
    .btn-ft-miss { transform: rotate(180deg) translate(160px) rotate(-180deg); }
    .btn-shot-miss { transform: rotate(216deg) translate(160px) rotate(-216deg); }
    .btn-rebound { transform: rotate(252deg) translate(160px) rotate(-252deg); }
    .btn-turnover { transform: rotate(288deg) translate(160px) rotate(-288deg); }
    .btn-foul { transform: rotate(324deg) translate(160px) rotate(-324deg); }
    .reb-sub-buttons { transform: translate(-52px, -185px); }
    @keyframes rebSubPop {
        0% { opacity: 0; transform: translate(-52px, -185px) scale(0.7); }
        100% { opacity: 1; transform: translate(-52px, -185px) scale(1); }
    }

    /* Game clock bigger */
    .game-clock {
        width: 120px;
        height: 120px;
    }

    .clock-time {
        font-size: 32px;
    }

    /* Quarter buttons */
    .quarter-btn {
        width: 72px;
        height: 72px;
        font-size: 18px;
    }

    /* Team switcher */
    .team-switch-btn {
        padding: 12px 28px;
        font-size: 16px;
    }

    /* Stat selector */
    .stat-btn {
        padding: 10px 16px;
        font-size: 15px;
    }

    /* Utility buttons */
    .utility-btn {
        width: 90px;
        height: 66px;
        font-size: 26px;
    }

    /* Confirm bar */
    .confirm-bar {
        padding: 16px;
    }

    .confirm-btn {
        width: 72px;
        height: 72px;
        font-size: 28px;
    }
}
