body { min-height: 100vh; min-width: fit-content; padding-bottom: 48px; font-size: 1.3em; }

/* Connection dot */
.conn-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
}
.conn-dot.connected { display: none; }

/* Header bar */
.tracker-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px 32px;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
    min-width: 100%;
}
.tracker-header .stat-item {
    font-size: 0.9em;
    color: var(--text-secondary);
    white-space: nowrap;
}
.tracker-header .stat-item span { color: var(--accent); font-weight: bold; }
.tracker-header .stat-item .muted { color: var(--text-secondary); font-weight: normal; }
.tracker-footer {
    font-family: 'Oswald', sans-serif;
    font-size: 1em;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
}
.tracker-footer .ticker-track {
    display: inline-flex;
    animation: ticker var(--ticker-speed, 40s) linear infinite;
}
.tracker-footer .ticker-half {
    flex-shrink: 0;
}
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.2s;
    background: rgba(0, 0, 0, 0.25);
    padding: 18px 32px;
    margin: -18px -32px -18px auto;
}
.tracker-header.collapsed { justify-content: center; }
.tracker-header.collapsed .header-controls { opacity: 0; pointer-events: none; position: absolute; right: 12px; margin-left: 0; }
.header-controls button {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-controls button svg { display: block; width: 14px; height: 14px; }
.header-controls button:hover { border-color: var(--accent); color: var(--text); }
.hdr-sep {
    width: 1px;
    height: 16px;
    background: var(--border-light);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Main display */
.display { text-align: center; padding: 40px 32px 16px; flex: 1; }

.timer {
    font-family: 'Staatliches', sans-serif;
    font-size: clamp(6rem, 12vw, 12rem);
    letter-spacing: 0.05em;
    color: var(--text);
    line-height: 1;
    margin: 8px 0;
}
.timer.warning { }

/* Progress bar */
.progress-wrap {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
    height: 8px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.2s linear;
}

/* Blinds display */
.blinds-current {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    margin: 8px 0;
    white-space: nowrap;
}
.blinds-sub {
    font-family: 'Staatliches', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: var(--accent);
    letter-spacing: 2px;
}

.next-level {
    margin-top: 16px;
    font-size: 1.2em;
    color: var(--text-muted);
}
.next-level span { color: var(--text-secondary); }

/* Blind structure table */
.structure-wrap {
    max-width: 100%;
    margin: 0;
    padding: 0;
}
.structure-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}
.structure-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85em;
    letter-spacing: 1px;
}
.structure-table th:first-child { text-align: center; }
.structure-table td {
    text-align: right;
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
}
.structure-table td:first-child { text-align: center; }
.structure-table tr.current-level td {
    color: var(--accent);
    font-weight: bold;
    background: rgba(255, 179, 0, 0.08);
}
.structure-table tr.past-level {
    display: none;
}
.structure-table tr.break-row td {
    color: var(--green);
    background: rgba(74, 222, 128, 0.04);
}
.structure-table tr.break-row.current-level td {
    color: var(--green);
    background: rgba(74, 222, 128, 0.08);
}
.break-label {
    font-size: 0.8em;
    opacity: 0.7;
    font-weight: normal;
}

/* Fish */
.fish-container {
    width: 420px;
    height: 260px;
    margin: 10px auto 0;
}
.fish-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
#fish-container-winners {
    width: 420px;
    height: 260px;
    margin: 20px auto 0;
}
#fish-container-winners canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Break state */
.blinds-current.on-break { color: var(--green); }
.progress-bar.on-break { background: var(--green); }

/* Pause state */
.blinds-current.on-pause { color: var(--accent); }
.timer.paused { color: var(--accent); }


/* Break message */
.break-message {
    font-family: 'Staatliches', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 2px;
    color: var(--accent);
    margin-top: 20px;
    text-align: center;
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 20px 32px;
    display: inline-block;
    animation: break-pulse 2s ease-in-out infinite;
}
@keyframes break-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255,179,0,0.2); }
    50% { box-shadow: 0 0 24px rgba(255,179,0,0.6), 0 0 48px rgba(255,179,0,0.3); }
}
.break-message-rest {
    font-size: 0.5em;
}

/* Payout section */
.payout-section {
    min-width: 360px;
    max-width: 100%;
    margin: 0;
    padding: 0;
}
.payout-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}
.payout-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85em;
    letter-spacing: 1px;
}
.payout-table th:first-child { text-align: center; }
.payout-table td {
    text-align: right;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
}
.payout-table td:first-child { text-align: center; }

/* Players remaining */
.players-remaining {
    text-align: center;
    padding: 16px 0;
}
.players-remaining-count {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 2.5em;
    color: var(--accent);
    letter-spacing: 2px;
    line-height: 1;
}
.players-remaining-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Winner banner */
.winner-banner {
    text-align: center;
    padding: 32px 20px;
    margin: auto;
    max-width: 600px;
    width: 100%;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.winner-banner .winner-label {
    font-family: 'Staatliches', sans-serif;
    font-size: 2.1em;
    letter-spacing: 4px;
    color: var(--text-muted);
}
.winner-entry {
    font-family: 'Staatliches', sans-serif;
    letter-spacing: 3px;
    margin-top: 8px;
    line-height: 1.3;
}
.winner-entry .place { color: var(--text-muted); }
.winner-entry .name { color: var(--accent); }
.winner-entry .payout { color: var(--text-muted); }
.winner-entry:first-child {
    font-size: clamp(3.2rem, 10vw, 6.5rem);
}
.winner-entry:nth-child(2) {
    font-size: clamp(2.3rem, 6.5vw, 4rem);
}
.winner-entry:nth-child(n+3) {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
}

/* Three-column layout */
.main-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    max-width: 1920px;
    margin: 0 auto;
}
.sidebar-left { order: 0; }
.sidebar-right { order: 2; }
.display { order: 1; }
.winner-banner { order: 1; max-width: 100%; }
.sidebar-left,
.sidebar-right {
    display: block;
    flex-shrink: 0;
    padding: 16px 24px;
}
.sidebar-left { width: 440px; }
.sidebar-right { width: 440px; padding-right: 48px; }

/* Table tabs (in header controls) */
.table-tabs {
    display: flex;
    gap: 3px;
    margin-right: 6px;
}
.table-tab {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, opacity 0.15s;
    opacity: 0.45;
}
.table-tab:hover { opacity: 0.75; }
.table-tab.active { border-color: #fff; opacity: 1; }

/* Seating section (inside right sidebar) */
.seating-section {
    padding-top: 0;
    margin-top: 0;
}
.seating-table-visual {
    position: relative;
    aspect-ratio: 1.5;
    overflow: visible;
}
.seating-section .seating-table-visual {
    width: 100%;
    margin: 100px auto 30px;
}
.seating-table-surface {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.seating-table-surface.oval {
    width: 72%;
    height: 45%;
    border-radius: 999px;
    border: 2px solid;
}
.seating-table-surface.rect {
    width: 58%;
    height: 48%;
    border-radius: 8px;
    border: 2px solid;
}
.seating-table-name {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'Staatliches', sans-serif;
    font-size: 0.85em;
    letter-spacing: 2px;
    opacity: 0.5;
    white-space: nowrap;
    pointer-events: none;
}
.seating-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transform: translate(-50%, -50%);
}
.seating-seat-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Staatliches', sans-serif;
    font-size: 1em;
    color: var(--text-muted);
    background: var(--bg-card);
}
.seating-seat.occupied .seating-seat-num {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,179,0,0.1);
}
.seating-seat-name {
    font-size: 0.85em;
    color: var(--text);
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.seating-seat.empty .seating-seat-name {
    color: var(--text-muted);
    opacity: 0.4;
}
.seating-seat.locked .seating-seat-num {
    border-color: var(--red);
    color: var(--red);
    background: rgba(248,113,113,0.08);
    opacity: 0.4;
}
.seating-seat.locked .seating-seat-name {
    color: var(--red);
    opacity: 0.3;
}
.seating-seat.last-placed .seating-seat-num {
    animation: last-placed-fade 4s ease-out forwards;
}
.seating-seat.last-placed .seating-seat-name {
    animation: last-placed-fade 4s ease-out forwards;
}
@keyframes last-placed-fade {
    0%, 30% { background: rgba(255,179,0,0.35); box-shadow: 0 0 12px rgba(255,179,0,0.5); }
    100% { background: rgba(255,179,0,0.1); box-shadow: none; }
}

/* Rules overlay */
.rules-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--bg);
    overflow-y: auto;
    padding: 100px 48px 48px;
}
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 32px;
    max-width: 1600px;
    margin: 0 auto;
}
.rules-section-title {
    font-family: 'Staatliches', sans-serif;
    font-size: 1.4em;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.rule-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.rule-pill {
    display: block;
    margin-top: 8px;
    font-size: 0.75em;
    letter-spacing: 1px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    padding: 4px 14px;
    width: fit-content;
}
.rule-card.active .rule-pill {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    text-shadow: none;
}
.rule-card:hover {
    color: #888;
    border-color: #555;
}
.rule-card.active {
    color: var(--accent);
    background: linear-gradient(135deg, #1e1a10, #222);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(255,179,0,0.25), 0 0 40px rgba(255,179,0,0.08);
    text-shadow: 0 0 12px rgba(255,179,0,0.3);
    animation: rule-glow-pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.rule-card.active::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,179,0,0.08), transparent);
    animation: rule-shimmer 5s ease-in-out infinite;
}
.rule-card.active:hover {
    box-shadow: 0 0 28px rgba(255,179,0,0.45), 0 0 60px rgba(255,179,0,0.18);
}
@keyframes rule-glow-pulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255,179,0,0.25), 0 0 40px rgba(255,179,0,0.08); }
    50% { box-shadow: 0 0 24px rgba(255,179,0,0.4), 0 0 60px rgba(255,179,0,0.15); }
}
@keyframes rule-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Wall indicators (hatched) */
.seating-wall {
    position: absolute;
    z-index: 0;
    background: repeating-linear-gradient(
        45deg,
        var(--text-muted),
        var(--text-muted) 2px,
        transparent 2px,
        transparent 5px
    );
    opacity: 0.5;
}
.seating-wall-top    { top: -42px; left: 10%; right: 10%; height: 8px; }
.seating-wall-bottom { bottom: -42px; left: 10%; right: 10%; height: 8px; }
.seating-wall-left   { left: -42px; top: 10%; bottom: 10%; width: 8px; }
.seating-wall-right  { right: -42px; top: 10%; bottom: 10%; width: 8px; }

/* Knockout feed */
.knockout-feed {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.knockout-toast {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    padding: 12px 20px;
    font-family: 'Staatliches', sans-serif;
    font-size: 1.3em;
    letter-spacing: 2px;
    color: var(--text);
    white-space: nowrap;
    animation: knockout-in 0.4s ease-out;
}
.knockout-toast.entry {
    border-left-color: var(--green);
}
.knockout-toast .knockout-payout {
    color: var(--accent);
}
.knockout-toast.removing {
    animation: knockout-out 0.4s ease-in forwards;
}
@keyframes knockout-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes knockout-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50%); }
}

/* Level countdown overlay */
.level-countdown {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20%;
    z-index: 50;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}
#countdown-number {
    font-family: 'Staatliches', sans-serif;
    font-size: clamp(8rem, 14vw, 16rem);
    color: var(--accent);
    text-shadow: 0 0 40px rgba(255, 179, 0, 0.6), 0 0 80px rgba(255, 179, 0, 0.3);
    line-height: 1;
}
#countdown-number.pop {
    animation: countdown-pop 0.4s ease-out;
}
@keyframes countdown-pop {
    from { transform: scale(1.3); opacity: 0.7; }
    to { transform: scale(1); opacity: 1; }
}

