/* Penalty Box Timer - Tablet optimized styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --color-bg: #1a1a2e;
    --color-surface: #16213e;
    --color-accent: #e94560;
    --color-accent-light: #ff6b8a;
    --color-text: #eaeaea;
    --color-text-dim: #888;
    --color-success: #4ecca3;
    --color-warning: #ffd93d;
    --color-danger: #ff6b6b;
    --color-disabled: #333;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header with clocks */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.clock-group {
    display: flex;
    gap: 2rem;
}

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

.clock-label {
    font-size: 0.875rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clock-time {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.jam-clock .clock-time {
    color: var(--color-accent);
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.jam-controls {
    display: flex;
    gap: 0.5rem;
}

.period-controls {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    font-size: 1.125rem;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    min-height: 48px;
    min-width: 48px;
}

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

.btn-start {
    background: var(--color-success);
    color: #000;
}

.btn-stop {
    background: var(--color-danger);
    color: #fff;
}

.btn-adjust {
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-accent);
}

.btn-pause {
    background: var(--color-warning);
    color: #000;
}

.btn-cancel {
    background: var(--color-danger);
    color: #fff;
}

.btn-close {
    background: var(--color-accent);
    color: #fff;
    width: 100%;
    margin-top: 1rem;
}

.btn-period {
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-warning);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.hidden {
    display: none !important;
}

/* Main penalty area */
.penalty-area {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    min-height: 0;
}

/* Team sections */
.team {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-name {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-accent-light);
}

/* Seat cards */
.seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 10px;
    padding: 1rem;
    min-height: 80px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: 2px solid transparent;
    position: relative;
}

.seat:active:not(.disabled) {
    transform: scale(0.98);
}

.seat.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.seat.running {
    border-color: var(--color-accent);
    background: rgba(233, 69, 96, 0.15);
}

.seat.paused {
    border-color: var(--color-warning);
    background: rgba(255, 217, 61, 0.15);
}

.seat.warning-stand {
    background: var(--color-warning) !important;
    border-color: var(--color-warning);
}

.seat.warning-stand .timer,
.seat.warning-stand .position-label {
    color: #000 !important;
}

.seat.warning-release {
    background: var(--color-danger) !important;
    border-color: var(--color-danger);
}

.seat.warning-release .timer,
.seat.warning-release .position-label {
    color: #fff !important;
}

.position-label {
    font-size: 0.875rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timer {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.seat.running .timer {
    color: var(--color-accent-light);
}

/* Popup overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.popup-overlay.hidden {
    display: none;
}

.popup {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    min-width: 320px;
    max-width: 90%;
}

.popup-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-accent-light);
}

.popup-time {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.popup-time span {
    font-weight: 700;
    color: var(--color-accent);
}

.popup-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }

    .clock-time {
        font-size: 2rem;
    }

    .timer {
        font-size: 1.5rem;
    }

    .seat {
        min-height: 70px;
        padding: 0.75rem;
    }
}

@media (max-height: 600px) {
    .app {
        padding: 0.5rem;
    }

    .header {
        padding: 0.5rem 1rem;
        margin-bottom: 0.5rem;
    }

    .team {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .seat {
        min-height: 60px;
        padding: 0.5rem;
    }

    .timer {
        font-size: 1.25rem;
    }
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0.5rem;
    right: 0.75rem;
    z-index: 10;
}

.credit {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    opacity: 0.6;
}
