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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    height: 100vh;
    overflow-x: hidden;
}

.container {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
}

.timer-section {
    width: 100%;
    height: 30vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-bottom: 3px solid #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.timer-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.timer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    width: 100%;
}

.time-presets {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.preset-btn {
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    min-width: 70px;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.preset-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

.pause-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 5px;
}

.pause-btn {
    padding: 8px 20px;
    border: 2px solid rgba(255, 200, 100, 0.5);
    border-radius: 10px;
    background: rgba(255, 150, 0, 0.3);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.pause-btn:hover {
    background: rgba(255, 150, 0, 0.5);
    border-color: rgba(255, 200, 100, 0.7);
    transform: scale(1.05);
}

.pause-btn:active {
    transform: scale(0.95);
    background: rgba(255, 150, 0, 0.6);
}

.pause-stop-container {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.pause-stop-btn {
    padding: 6px 16px;
    border: 2px solid rgba(255, 100, 100, 0.5);
    border-radius: 8px;
    background: rgba(200, 50, 50, 0.4);
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.pause-stop-btn:hover {
    background: rgba(200, 50, 50, 0.6);
    border-color: rgba(255, 100, 100, 0.7);
    transform: scale(1.05);
}

.pause-stop-btn:active {
    transform: scale(0.95);
    background: rgba(200, 50, 50, 0.7);
}

.timer-container {
    cursor: pointer;
    transition: all 0.3s;
    padding: 15px 22px;
    border-radius: 15px;
    user-select: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.timer-container:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.offset-time {
    font-size: 2.2rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    opacity: 0.9;
    line-height: 1;
}

.offset-time.hidden {
    opacity: 0;
    height: 0;
    font-size: 0;
    margin: 0;
    padding: 0;
}

.main-time {
    font-size: 7.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1;
    transition: font-size 0.5s ease-in-out;
}

.main-time.enlarged {
    font-size: 8.5rem;
}

.timer-side-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-container {
    position: relative;
    z-index: 9999;
}

.control-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
}

.control-button:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.menu-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.menu-button:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-dropdown {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.menu-text {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

/* Viewport info - hidden but kept for future debugging
.viewport-info {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
    pointer-events: none;
}
*/


.sets-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    width: 140px;
    z-index: 5;
}

.sets-counter {
    flex: 1;
    display: flex;
    justify-content: center;
}

.sets-counter-left {
    justify-content: flex-end;
    padding-right: 10px;
}

.sets-counter-right {
    justify-content: flex-start;
    padding-left: 10px;
}

.sets-display-small {
    width: 50px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.sets-display-small.clickable {
    cursor: pointer;
    user-select: none;
}

.sets-display-small.clickable:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
}

.sets-display-small.clickable:active {
    transform: scale(0.98);
}

.sets-number-small {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.new-game-btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: #ff6b35;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: auto;
    height: auto;
    min-height: 32px;
}

.new-game-btn-small:hover {
    background: #e55529;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.new-game-btn-small:active {
    transform: scale(0.98);
}


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

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px 25px 25px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.time-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.input-group label {
    font-size: 0.9rem;
    color: #fff;
}

.input-group input {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.2);
}

.offset-description {
    margin-top: 15px;
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.offset-description small {
    color: #bdc3c7;
    line-height: 1.4;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: scale(1.05);
}


.game-area {
    flex: 1;
    display: flex;
    height: 70vh;
    position: relative;
}

.swap-teams-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.swap-btn {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    color: #333;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #333;
}

.swap-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

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

.team-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 40px 20px;
}

.left-team {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border-left: 2px solid #fff;
    border-right: 2px solid #fff;
}

.left-team .score-box {
    background: rgba(140, 45, 30, 0.8);
}

.left-team .minus-box {
    background: rgba(100, 100, 100, 0.4);
}

.right-team {
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-left: 2px solid #fff;
    border-right: 2px solid #fff;
}

.right-team .score-box {
    background: rgba(35, 100, 150, 0.8);
}

.right-team .minus-box {
    background: rgba(100, 100, 100, 0.4);
}

.team-section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 8px;
}

.team-section h2:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.team-name-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.team-name-input {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 5px 10px;
    text-align: center;
    min-width: 200px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.team-name-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
}

.team-name-confirm {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-name-confirm:hover {
    background: #45a049;
    transform: scale(1.1);
}

/* Desktop margins - based on position, not team classes */
@media (min-width: 941px) {
    /* Left team section (first child) - margin away from center */
    .game-area .team-section:first-child h2,
    .game-area .team-section:first-child .score-wrapper {
        margin-right: 80px;
        margin-left: 0;
    }

    /* Right team section (last child) - margin away from center */
    .game-area .team-section:last-child h2,
    .game-area .team-section:last-child .score-wrapper {
        margin-left: 80px;
        margin-right: 0;
    }
}

/* Ensure no margins on smaller screens */
@media (max-width: 940px) {
    .team-section h2,
    .team-section .score-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.score-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}


.score-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px 30px;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.score-box.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.score-box.clickable:hover {
    transform: scale(1.05);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.4), 0 0 20px rgba(255,255,255,0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.score-box.clickable:active {
    transform: scale(0.98);
    box-shadow: inset 0 6px 12px rgba(0,0,0,0.5);
}

.minus-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 8px 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 260px;
    text-align: center;
}

.minus-box.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.minus-box.clickable:hover {
    transform: scale(1.03);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 15px rgba(150,150,150,0.4);
    border-color: rgba(150, 150, 150, 0.5);
    background: rgba(120, 120, 120, 0.3);
}

.minus-box.clickable:active {
    transform: scale(0.97);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
}

.minus-symbol {
    font-size: 2rem;
    font-weight: bold;
    color: #cccccc;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.score-display {
    font-size: 8rem;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    min-width: 200px;
    text-align: center;
    color: white;
}


/* Mobile Portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .timer-section {
        height: 20vh;
        padding: 15px 20px;
    }

    /* Remove horizontal margins in portrait mode */
    .left-team h2,
    .right-team h2,
    .left-team .score-wrapper,
    .right-team .score-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .timer-main {
        justify-content: center;
    }

    .timer-side-controls {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .time-presets {
        gap: 6px;
        left: 10px;
    }

    .preset-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
        min-width: 50px;
    }

    .main-time {
        font-size: 4.5rem;
    }

    .offset-time {
        font-size: 1.7rem;
    }

    .main-time.enlarged {
        font-size: 5.5rem;
    }

    .timer-side-controls button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .menu-button {
        width: 40px;
        height: 40px;
    }

    .control-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .game-area {
        flex-direction: column;
        height: 80vh;
    }

    .team-section {
        padding: 20px 10px;
        min-height: auto;
    }

    .team-section h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .score-display {
        font-size: 4rem;
        min-width: 120px;
    }

    .score-box {
        padding: 15px 20px;
        border-radius: 15px;
    }

    .minus-box {
        padding: 6px 12px;
        border-radius: 10px;
        max-width: 200px;
    }

    .minus-symbol {
        font-size: 1.5rem;
    }

    .score-wrapper {
        gap: 8px;
    }

    .score-container {
        gap: 10px;
    }

    .sets-container {
        position: fixed;
        top: 15px;
        left: 15px;
        transform: none;
        flex-direction: column;
        width: 50px;
        height: 70px;
        gap: 8px;
        justify-content: center;
        align-items: center;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        z-index: 20;
    }

    .sets-counter {
        flex: none;
    }

    .sets-counter-left {
        padding-right: 0;
        justify-content: center;
    }

    .sets-counter-right {
        padding-left: 0;
        justify-content: center;
    }

    .sets-display-small {
        width: 35px;
        height: 25px;
        border-radius: 6px;
    }

    .sets-number-small {
        font-size: 0.9rem;
    }

    .sets-counter {
        order: 1;
    }

    .sets-counter-left {
        order: 0;
    }

    .sets-counter-left .sets-display-small {
        background: linear-gradient(45deg, #e74c3c, #c0392b);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .sets-counter-right .sets-display-small {
        background: linear-gradient(45deg, #3498db, #2980b9);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .swap-teams-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        display: flex;
        justify-content: center;
        margin: 10px 0;
        order: 1;
    }

    .swap-btn {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .left-team {
        border-left: 2px solid #fff;
        border-right: 2px solid #fff;
        border-top: 2px solid #fff;
        border-bottom: 2px solid #fff;
        order: 0;
        background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
    }

    .right-team {
        order: 2;
        border-left: 2px solid #fff;
        border-right: 2px solid #fff;
        border-top: 2px solid #fff;
        border-bottom: 2px solid #fff;
        background: linear-gradient(45deg, #3498db, #2980b9) !important;
    }

    .swap-teams-container {
        display: none;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .timer-section {
        height: 30vh;
        padding: 10px 15px;
    }

    .timer-side-controls {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    .main-time {
        font-size: 3rem;
    }

    .offset-time {
        font-size: 1.2rem;
    }

    .timer-side-controls button {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .time-presets {
        gap: 5px;
        left: 10px;
    }

    .preset-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
        min-width: 45px;
    }

    .menu-button {
        width: 35px;
        height: 35px;
    }

    .control-button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .timer-side-controls {
        gap: 5px;
    }

    .team-section {
        padding: 10px 10px;
    }

    .team-section h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }


    .score-display {
        font-size: 3.5rem;
        min-width: 100px;
    }

    .score-box {
        padding: 10px 15px;
        border-radius: 12px;
    }

    .minus-box {
        padding: 5px 10px;
        border-radius: 8px;
        max-width: 150px;
    }

    .minus-symbol {
        font-size: 1.2rem;
    }

    .score-wrapper {
        gap: 6px;
    }


    .score-container {
        gap: 8px;
    }

    .swap-btn {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
}

/* Small height landscape screens */
@media (max-height: 370px) and (orientation: landscape) {
    .timer-section {
        height: 30vh;
        padding: 10px 20px;
    }

    .timer-side-controls {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    .main-time {
        font-size: 4.5rem;
    }

    .offset-time {
        font-size: 1.7rem;
    }

    .main-time.enlarged {
        font-size: 5.5rem;
    }

    .timer-container {
        padding: 7px 15px;
    }

    .timer-side-controls button {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .timer-side-controls {
        gap: 5px;
    }


    .timer-main {
        margin-bottom: 5px;
    }
}

/* Tablet Landscape - fix swap button positioning */
@media (min-width: 769px) and (max-width: 940px) and (orientation: landscape) {

    .score-display {
        font-size: 6rem;
        min-width: 160px;
    }

    .score-box {
        padding: 18px 25px;
        border-radius: 18px;
    }

    .minus-box {
        padding: 7px 14px;
        border-radius: 12px;
        max-width: 220px;
    }

    .minus-symbol {
        font-size: 1.8rem;
    }

    .score-wrapper {
        gap: 8px;
    }


    .score-container {
        gap: 15px;
    }

    .team-section h2 {
        font-size: 1.8rem;
    }

    .swap-btn {
        width: 65px;
        height: 65px;
        font-size: 2rem;
    }
}

/* Tablet Portrait */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .timer-section {
        height: 22vh;
        padding: 18px 25px;
    }

    .main-time {
        font-size: 5.25rem;
    }

    .offset-time {
        font-size: 1.6rem;
    }

    .score-display {
        font-size: 6rem;
        min-width: 180px;
    }

    .score-box {
        padding: 18px 25px;
        border-radius: 18px;
    }

    .minus-box {
        padding: 7px 14px;
        border-radius: 12px;
        max-width: 240px;
    }

    .minus-symbol {
        font-size: 1.8rem;
    }

    .score-wrapper {
        gap: 8px;
    }

    .sets-container {
        position: fixed;
        top: 20px;
        left: 20px;
        transform: none;
        flex-direction: column;
        width: 60px;
        height: 80px;
        gap: 10px;
        justify-content: center;
        align-items: center;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        z-index: 20;
    }

    .sets-counter {
        flex: none;
    }

    .sets-counter-left {
        padding-right: 0;
        justify-content: center;
    }

    .sets-counter-right {
        padding-left: 0;
        justify-content: center;
    }

    .sets-display-small {
        width: 40px;
        height: 28px;
        border-radius: 7px;
    }

    .sets-number-small {
        font-size: 1rem;
    }

    .sets-counter {
        order: 1;
    }

    .sets-counter-left {
        order: 0;
    }

    .sets-counter-left .sets-display-small {
        background: linear-gradient(45deg, #e74c3c, #c0392b);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .sets-counter-right .sets-display-small {
        background: linear-gradient(45deg, #3498db, #2980b9);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .team-section h2 {
        font-size: 2rem;
    }
}

/* Input control styles for mobile-friendly time settings */
.input-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 3px;
}

.control-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    user-select: none;
}

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

.control-btn:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

.control-btn.minus {
    background: rgba(231, 76, 60, 0.3);
}

.control-btn.minus:hover {
    background: rgba(231, 76, 60, 0.5);
}

.control-btn.plus {
    background: rgba(46, 204, 113, 0.3);
}

.control-btn.plus:hover {
    background: rgba(46, 204, 113, 0.5);
}

.input-control input {
    width: 50px;
    margin: 0;
    background: transparent;
    border: none;
    font-weight: bold;
    cursor: default;
}

.input-control input:focus {
    outline: none;
    border: none;
    background: transparent;
}

/* Very narrow portrait screens - must be after other portrait queries */
@media (max-width: 400px) and (orientation: portrait) {
    .timer-side-controls {
        right: 10px !important;
    }

    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 1.4rem;
    }

    .input-control input {
        width: 55px;
        font-size: 1.1rem;
    }
}