* { box-sizing: border-box; }
body {
    font-family: Arial, sans-serif;
    background: #111;
    color: #fff;
    margin: 0;
    padding: 16px;
}
.container {
    max-width: 960px;
    margin: 0 auto;
}
h1 { font-size: 28px; margin-bottom: 4px; }
h2 { font-size: 20px; color: #ccc; font-weight: normal; margin-top: 0; }
.card {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.meta { color: #999; font-size: 14px; margin-bottom: 16px; }
label { display: block; margin: 10px 0 4px; color: #ccc; }
input, select {
    width: 100%;
    font-size: 18px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
}
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
    vertical-align: middle;
    margin: 0 6px 0 0;
}
label:has(input[type="checkbox"]) { display: flex; align-items: center; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }
.btn {
    display: inline-block;
    margin-top: 16px;
    padding: 16px 32px;
    font-size: 20px;
    font-weight: bold;
    background: #0979f9;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #0a5fcf; }
.btn-danger { background: #cc0000; }
.btn-danger:hover { background: #a00; }
.btn-confirm { background: #1a8a3d; }
.btn-confirm:hover { background: #146b2e; }
.btn-small { padding: 6px 14px; font-size: 14px; margin: 0; }
.btn-timeout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
    background: #ffcc00;
    color: #111;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
.btn-timeout:hover { background: #e0b400; }
.btn-timeout-used,
.btn-timeout:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}
.errors { background: #401010; border: 1px solid #cc0000; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.wins { font-size: 22px; text-align: center; margin-bottom: 8px; }
.wins b { font-size: 32px; }
.scoreboard { display: flex; justify-content: space-between; gap: 20px; margin: 20px 0; }
.player { position: relative; width: 48%; padding: 20px; background: #000; border-radius: 10px; text-align: center; }
.player .team-name { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.player h3 { margin: 0 0 8px; font-size: 22px; }
.player .points { font-size: 100px; font-weight: bold; line-height: 1; }
.player .sets { font-size: 28px; margin-top: 8px; color: #aaa; }
.server-badge { display: inline-block; margin-top: 10px; padding: 6px 12px; background: #333; border-radius: 6px; font-size: 14px; }
.serve-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffcc00;
    border-radius: 50%;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 2;
}
table.games { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.games th, table.games td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #333; font-size: 14px; }
table.games .code { font-weight: bold; width: 60px; }
.history { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.history li { background: #222; border-radius: 6px; padding: 4px 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.history li.voided { opacity: 0.35; text-decoration: line-through; }
.history form { margin: 0; }
.void-btn { background: none; border: none; color: #ff6666; cursor: pointer; font-size: 13px; padding: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #333; }
.badge-finished { background: #1a5c1a; }
.badge-pending { background: #444; }
.badge-progress { background: #5c4a1a; }
.badge-skipped { background: #333; color: #777; }
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.table-card {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: #fff;
    display: block;
}
.table-card:hover { border-color: #0979f9; }
.table-number {
    display: inline-block;
    background: #0979f9;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 13px;
    margin-bottom: 8px;
}
.table-card h3 { margin: 0 0 8px; font-size: 18px; }
.table-card .live-points { font-size: 40px; font-weight: bold; text-align: center; }
.table-card .live-names { display: flex; justify-content: space-between; font-size: 14px; color: #ccc; }
.table-sides { display: flex; gap: 8px; margin-top: 10px; }
.table-side { position: relative; flex: 1; background: #000; border-radius: 8px; padding: 10px 6px; text-align: center; }
.table-side .team-name { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.table-side .name { font-size: 15px; font-weight: bold; }
.table-side .pts { font-size: 48px; font-weight: bold; line-height: 1.1; }
.table-side .sets { font-size: 13px; color: #aaa; margin-top: 2px; }
.table-side .serve-indicator { width: 20px; height: 20px; font-size: 11px; }
.ticker-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.ticker-header .teams { font-size: 18px; }
.ticker-header .wins { margin: 0; font-size: 18px; }
.ticker-header .toggle-icon { color: #666; font-size: 14px; margin-left: 12px; }
.ticker-body { margin-top: 14px; }
.live-list { display: flex; flex-direction: column; gap: 6px; }
.live-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
}
.live-row .live-row-points { font-weight: bold; font-size: 18px; }
.side-dnd { display: flex; gap: 16px; margin: 16px 0; touch-action: none; }
.side-zone {
    flex: 1;
    background: #111;
    border: 2px dashed #444;
    border-radius: 10px;
    padding: 12px;
    min-height: 100px;
}
.side-zone-label { color: #888; font-size: 13px; text-transform: uppercase; text-align: center; margin-bottom: 8px; }
.side-slot { min-height: 60px; display: flex; align-items: center; justify-content: center; }
.chip {
    background: #0979f9;
    color: #fff;
    font-weight: bold;
    padding: 16px 20px;
    border-radius: 10px;
    text-align: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
    width: 100%;
}
.swap-overlay {
    background: #2a1c00;
    border: 2px solid #ffcc00;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}
.swap-overlay-compact { padding: 10px; margin: 10px 0 0; }
.swap-overlay-compact .swap-anim { height: 44px; gap: 10px; }
.swap-overlay-compact .swap-chip { width: 32px; height: 32px; font-size: 13px; }
.swap-overlay-compact .swap-chip-a { animation-name: swap-move-a-compact; }
.swap-overlay-compact .swap-chip-b { animation-name: swap-move-b-compact; }
.swap-overlay-compact .swap-arrows { font-size: 20px; }
.swap-overlay-compact .swap-title { font-size: 16px; margin: 4px 0 2px; }
@keyframes swap-move-a-compact {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(40px); }
}
@keyframes swap-move-b-compact {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-40px); }
}
.swap-title { text-align: center; font-size: 22px; font-weight: bold; color: #ffcc00; margin: 8px 0 4px; }
.swap-anim { display: flex; align-items: center; justify-content: center; gap: 16px; height: 70px; }
.swap-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    color: #111;
    animation: swap-move 1.4s ease-in-out infinite;
}
.swap-chip-a { background: #0979f9; color: #fff; animation-name: swap-move-a; }
.swap-chip-b { background: #ffcc00; animation-name: swap-move-b; }
.swap-arrows { font-size: 30px; color: #ffcc00; animation: swap-pulse 1.4s ease-in-out infinite; }
@keyframes swap-move-a {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(64px); }
}
@keyframes swap-move-b {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-64px); }
}
@keyframes swap-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}
