/* ════════════════════════════════════════════════════════════════
   Flames Ticket Portal — Consolidated Stylesheet
   ════════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --flames-red: #c8102e;
    --flames-gold: #f1a913;
    --dark: #1a1a2e;
    --light-bg: #f8f9fa;
    --border: #dee2e6;
    --radius: 8px;
}

/* ── Reset & Body ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light-bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--flames-red);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-brand a { color: white; text-decoration: none; font-weight: bold; font-size: 1.2rem; }
.nav-brand a:hover { text-decoration: underline; }
.nav-links a { color: white; text-decoration: none; margin-left: 1rem; opacity: 0.9; }
.nav-links a:hover { opacity: 1; text-decoration: underline; }

/* ── Flash Messages ── */
.flash-messages { padding: 0 2rem; margin-top: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem; border-left: 4px solid; }
.flash-success { background: #d4edda; border-color: #28a745; color: #155724; }
.flash-error { background: #f8d7da; border-color: #dc3545; color: #721c24; }

/* ── Container ── */
.container { max-width: 900px; margin: 2rem auto; padding: 0 2rem; flex: 1; }

/* ── Hero ── */
.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 { font-size: 2.5rem; color: var(--flames-red); margin-bottom: 0.5rem; }
.subtitle { font-size: 1.2rem; color: #555; }
.deadline { font-size: 1rem; color: var(--flames-red); font-weight: 600; margin-top: 0.5rem; }

/* ── Buttons ── */
.btn {
    display: inline-block; padding: 0.6rem 1.5rem; border: none;
    border-radius: var(--radius); cursor: pointer; text-decoration: none;
    font-size: 1rem; margin: 0.5rem; transition: opacity 0.2s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--flames-red); color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: #dc3545 !important; color: white; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; margin: 0.25rem; }
.btn-disabled { background: #ccc !important; cursor: not-allowed !important; }

/* ── Actions Row ── */
.actions { text-align: center; margin-top: 2rem; }

/* ── Form Cards ── */
.form-card {
    max-width: 420px; margin: 2rem auto; padding: 2rem;
    background: white; border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.form-card h2 { text-align: center; color: var(--flames-red); margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.form-group input {
    width: 100%; padding: 0.6rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 1rem;
}
.form-group input:focus { outline: none; border-color: var(--flames-red); }
.form-note { color: #777; font-size: 0.9rem; margin-bottom: 1rem; }
.form-footer { text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* ── Admin Dashboard ── */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}
.stat-card {
    background: white; padding: 1.25rem; border-radius: var(--radius);
    text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
/* Generic stat labels/values (admin dashboard cards) */
.stat-label { display: block; font-size: 0.85rem; color: #777; }
.stat-value { display: block; font-size: 1.8rem; font-weight: bold; color: var(--flames-red); }

.admin-sections {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}
.section-placeholder {
    background: white; padding: 1.5rem; border-radius: var(--radius);
    border: 1px dashed var(--border); text-align: center;
}
.section-placeholder h3 { color: var(--dark); margin-bottom: 0.5rem; }
.section-placeholder p { color: #999; font-size: 0.9rem; }

/* ── Tables ── */
.data-table {
    width: 100%; border-collapse: collapse; margin: 1rem 0;
    background: white; border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.data-table th, .data-table td {
    padding: 0.75rem 1rem; text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th { background: var(--flames-red); color: white; }
.data-table tbody tr:nth-child(even) { background: #f8f9fa; }

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}
.table-wrapper table {
    min-width: 300px; width: 100%; border-collapse: collapse;
}
.table-wrapper table th {
    background: var(--dark); color: white; font-weight: 600;
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px;
}

/* ── Footer ── */
.footer {
    text-align: center; padding: 1rem; color: #999;
    border-top: 1px solid var(--border); margin-top: auto;
}

/* ── Back Link ── */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--flames-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.back-link:hover { text-decoration: underline; }

/* ── Upload Cards ── */
.upload-card {
    max-width: 600px; margin: 2rem auto;
    background: white; padding: 2rem;
    border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.info-banner { background: #e3f2fd; padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: 0.95rem; }
.error-preview {
    background: #fff3e0; border-left: 4px solid #ff9800;
    padding: 1rem; margin-bottom: 1.5rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.file-upload-form {
    margin: 1.5rem 0; padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius); text-align: center;
}
.sample-info { margin-top: 2rem; }
.code-block {
    background: #f4f4f4; padding: 1rem; border-radius: var(--radius);
    overflow-x: auto; font-family: 'Courier New', monospace;
    font-size: 0.85rem; border: 1px solid var(--border);
}
.warning-box {
    background: #fff3cd; border: 1px solid #ffc107;
    padding: 1rem; border-radius: var(--radius);
    margin-top: 1.5rem; font-size: 0.9rem;
}
.danger-zone { margin-top: 2rem; padding-top: 2rem; border-top: 2px solid var(--flames-red); }
.badge-gold { background: var(--flames-gold); color: #1a1a2e; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: bold; }
.empty-state { text-align: center; padding: 3rem; background: white; border-radius: var(--radius); }

/* ════════════════════════════════════════════════════════════════
   FAN PREFERENCES
   ════════════════════════════════════════════════════════════════ */

.preferences-header { text-align: center; margin-bottom: 2rem; }
.preferences-header h2 { color: var(--flames-red); font-size: 2rem; margin-bottom: 0.5rem; }
.preferences-header .subtitle { font-size: 1.1rem; color: #666; }
.preferences-header .deadline { font-size: 1rem; color: var(--flames-red); margin-top: 0.5rem; }

.status-badge {
    display: inline-block; padding: 0.5rem 1rem;
    border-radius: 20px; font-size: 0.9rem; font-weight: 600; margin-top: 1rem;
}
.status-badge.submitted { background: #d4edda; color: #155724; }
.status-badge.pending { background: #fff3cd; color: #856404; }

.instructions {
    background: white; padding: 1.5rem; border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 1.5rem;
}
.instructions h3 { color: var(--dark); margin-bottom: 1rem; }
.instructions ol { margin-left: 1.5rem; color: #555; }
.instructions li { margin-bottom: 0.5rem; }
.instructions .note {
    background: #e3f2fd; border-left: 4px solid #2196f3;
    padding: 1rem; border-radius: 4px; margin-top: 1rem; font-size: 0.9rem;
}

/* ── Stats Bar (red bar on preferences page) ── */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--flames-red);
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.stats-bar .stat-item { text-align: center; }
.stats-bar .stat-label {
    font-size: 0.85rem;
    color: #ffffff;
    opacity: 1;
    display: block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.stats-bar .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
    color: #ffffff;
}
.stats-bar .stat-value.warning { color: #fbbf24; }

#selectionStatus.ready { color: #4ade80; }
#selectionStatus.warning { color: #fb923c; }
#selectionStatus.error { color: #ef4444; }

.preferences-container {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1.5rem; margin-bottom: 1.5rem;
}

.panel {
    background: white; border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden;
}
.panel h3 { background: var(--dark); color: white; padding: 1rem; margin: 0; font-size: 1.1rem; }

.sortable-list {
    min-height: 300px; max-height: 500px;
    overflow-y: auto; padding: 1rem;
    border-top: 1px solid var(--border);
}
.sortable-list[data-empty-msg]:empty::after {
    content: attr(data-empty-msg); display: block;
    text-align: center; color: #999; font-style: italic; padding: 3rem;
}

/* ── Game Items (consolidated) ── */
.game-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 0.25rem;
    background: #f8f9fa;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: grab;
    transition: all 0.2s;
    min-height: 92px;
}
.game-item:hover { background: #e9ecef; border-color: #adb5bd; }
.game-item.dragging { opacity: 0.5; background: #e3f2fd; }

/* Old layout (hidden, superseded) */
.game-item .game-info { display: none; }
.game-item .game-title { display: none; }
.game-item .game-title-row { display: none; }
.team-logo { display: none; }

/* Logo + 3-line layout */
.game-logo-wrap {
    flex-shrink: 0; width: 88px; height: 88px;
    display: flex; align-items: center; justify-content: center;
}
.team-logo-lg { width: 88px; height: 88px; object-fit: contain; }
.logo-placeholder { width: 88px; height: 88px; background: #e9ecef; border-radius: 6px; }

.game-content {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; min-width: 0; gap: 0.2rem;
}
.line-team {
    font-weight: bold; color: #1a1a2e; font-size: 0.95rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.line-game-seats { display: flex; align-items: center; gap: 0.5rem; }
.line-game-seats .game-id { font-weight: bold; color: var(--flames-red); font-size: 1rem; }
.game-content .game-meta {
    font-size: 0.8rem; color: #888; margin-left: 0; padding-left: 0;
}
.game-item .game-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Available game items */
.game-item.available { flex-wrap: wrap; }
.game-item.available.disabled { opacity: 0.45; cursor: not-allowed; }
.game-item.available .seat-badge {
    display: inline-block; background: #e9ecef; color: #666;
    font-size: 0.75rem; padding: 0.15rem 0.4rem; border-radius: 3px; margin-left: 0.5rem;
}
.usage-counter {
    font-size: 0.8rem; font-weight: 600; color: #666;
    background: #e9ecef; padding: 0.2rem 0.5rem;
    border-radius: 4px; min-width: 2.5rem; text-align: center;
}
.usage-counter.maxed { background: #d4edda; color: #155724; }
.add-btn {
    background: var(--flames-red); color: white; border: none;
    width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer; font-size: 1.3rem; line-height: 1;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.add-btn:hover:not(:disabled) { background: #a00d24; transform: scale(1.05); }
.add-btn:disabled { background: #6c757d; cursor: not-allowed; }

/* Priority list items */
.game-item.priority {
    background: linear-gradient(to right, #fff8f0, #fff);
    border-left: 4px solid var(--flames-gold);
}
.game-item.priority .priority-badge {
    background: var(--flames-gold); color: var(--dark);
    font-weight: bold; font-size: 0.85rem;
    padding: 0.25rem 0.6rem; border-radius: 4px;
    min-width: 2.5rem; text-align: center;
}
.game-item.priority .remove-btn {
    background: #dc3545; color: white; border: none;
    width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer; font-size: 1.3rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.7; transition: all 0.15s;
}
.game-item.priority .remove-btn:hover { opacity: 1; background: #b02a37; transform: scale(1.05); }

/* ── Validation Messages ── */
.validation-messages { padding: 0 1rem 1rem; }
.validation-messages .error {
    background: #f8d7da; color: #721c24;
    padding: 0.5rem 1rem; border-radius: 6px;
    margin-bottom: 0.5rem; font-size: 0.9rem;
}
.validation-messages .success {
    background: #d4edda; color: #155724;
    padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem;
}

/* ── Action Buttons ── */
.action-buttons {
    display: flex; gap: 1rem; padding: 1rem;
    border-top: 1px solid var(--border); background: #f8f9fa;
}
.action-buttons .btn { flex: 1; }

/* ════════════════════════════════════════════════════════════════
   ALLOCATION PAGES
   ════════════════════════════════════════════════════════════════ */

.allocations-list { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.allocation-card {
    background: white; padding: 1.5rem; border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-left: 4px solid var(--flames-red);
}
.allocation-card h3 { color: var(--flames-red); margin-bottom: 0.5rem; }
.allocation-card .meta { font-size: 0.9rem; color: #666; margin-bottom: 1rem; }

.detail-header { margin-bottom: 2rem; }
.detail-header .stats-grid { margin-top: 1.5rem; }
.allocation-form .form-control {
    width: 100%; padding: 0.6rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 1rem;
}
.checkbox-group { display: flex; gap: 2rem; margin-top: 1rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.action-bar { margin: 1.5rem 0; display: flex; gap: 1rem; }
.header-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 1.5rem;
}

/* ════════════════════════════════════════════════════════════════
   STEP 5 — RESULTS VIEWER
   ════════════════════════════════════════════════════════════════ */

/* ── Comparison grid ── */
.comparison-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem; margin-bottom: 2rem;
}
.comparison-card {
    background: white; padding: 1.5rem; border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-left: 4px solid var(--flames-red);
}
.comparison-card h3 { color: var(--flames-red); margin-bottom: 1rem; }
.comparison-stats { display: flex; justify-content: space-around; margin-bottom: 1rem; }
.comp-stat { text-align: center; }
.comp-label { display: block; font-size: 0.8rem; color: #777; }
.comp-value { display: block; font-size: 1.4rem; font-weight: bold; color: var(--dark); }
.comp-actions { text-align: center; }

/* ── Comparison table ── */
.comparison-table th:not(:first-child),
.comparison-table td:not(:first-child) { text-align: center; }
.comparison-table .fan-name-cell { font-weight: bold; white-space: nowrap; }
.ticket-count { font-weight: bold; font-size: 1.1rem; color: var(--flames-red); }
.ticket-detail { display: block; font-size: 0.75rem; color: #999; }
.no-tickets { color: #ccc; }

/* ── Section headings ── */
.section-heading {
    margin: 2rem 0 1rem; color: var(--dark);
    border-bottom: 2px solid var(--flames-red); padding-bottom: 0.5rem;
}

/* ── Tab switcher ── */
.tab-switcher { display: flex; gap: 0; margin: 1.5rem 0; border-bottom: 2px solid var(--border); }
.tab-btn {
    padding: 0.75rem 1.5rem; background: none; border: none;
    cursor: pointer; font-size: 1rem; color: #777;
    border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s;
}
.tab-btn:hover { color: var(--flames-red); }
.tab-btn.active { color: var(--flames-red); border-bottom-color: var(--flames-red); font-weight: bold; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Game-by-game grid ── */
.grid-table th { font-size: 0.85rem; }
.grid-table td { font-size: 0.85rem; padding: 0.5rem 0.6rem; }
.seat-filled { background: #e8f5e9; font-weight: 600; white-space: nowrap; }
.seat-empty { background: #fafafa; color: #ccc; text-align: center; }
.seat-na { background: #f0f0f0; }
.seat-tag {
    display: inline-block; font-size: 0.65rem; padding: 0.1rem 0.3rem;
    border-radius: 3px; margin-left: 0.25rem; font-weight: normal;
}
.seat-tag.pick { background: var(--flames-gold); color: var(--dark); }
.seat-tag.random { background: #e0e0e0; color: #555; }

/* ── Per-fan breakdown cards ── */
.fan-ticket-card {
    background: white; border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem; overflow: hidden;
}
.fan-ticket-header {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.5rem; background: var(--dark); color: white;
}
.fan-ticket-header h4 { margin: 0; flex: 1; font-size: 1.1rem; }
.fan-ticket-count {
    background: var(--flames-red); padding: 0.25rem 0.75rem;
    border-radius: 20px; font-size: 0.85rem; font-weight: bold;
}

/* ── Compact table ── */
.compact-table th, .compact-table td { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.no-tickets-row { text-align: center; color: #999; font-style: italic; padding: 1rem; }

/* ── Badges ── */
.badge-pick {
    background: var(--flames-gold); color: var(--dark);
    padding: 0.15rem 0.5rem; border-radius: 4px;
    font-size: 0.72rem; font-weight: bold; flex-shrink: 0;
}
.badge-random {
    background: #eee; color: #666;
    padding: 0.15rem 0.5rem; border-radius: 4px;
    font-size: 0.72rem; font-weight: bold; flex-shrink: 0;
}

/* ── Printable fan ticket page ── */
.printable-ticket { max-width: 800px; margin: 0 auto; }
.ticket-header { text-align: center; margin-bottom: 2rem; }
.ticket-header h1 { color: var(--flames-red); font-size: 2rem; margin-bottom: 0.5rem; }
.ticket-header h2 { color: var(--dark); font-size: 1.5rem; }
.ticket-subtitle { color: #777; font-size: 0.95rem; margin-top: 0.25rem; }
.ticket-summary { display: flex; justify-content: space-around; gap: 1rem; margin-bottom: 2rem; }
.ts-card {
    background: white; padding: 1rem 1.5rem; border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); text-align: center; flex: 1;
}
.ts-label { display: block; font-size: 0.8rem; color: #777; }
.ts-value { display: block; font-size: 1.8rem; font-weight: bold; color: var(--flames-red); }
.ticket-table-wrap { margin-bottom: 2rem; }
.ticket-table th { font-size: 0.85rem; }
.ticket-table td { font-size: 0.9rem; }
.pick-row { background: #fffdf5; }
.random-row { background: #f8f8f8; }
.print-button-area { text-align: center; padding: 2rem 0; }

/* ════════════════════════════════════════════════════════════════
   VOTING
   ════════════════════════════════════════════════════════════════ */

.vote-header { text-align: center; margin-bottom: 2rem; }
.vote-header h2 { color: var(--flames-red); font-size: 2rem; }

.vote-status { text-align: center; padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.vote-status.voted { background: #d4edda; color: #155724; }
.vote-status.pending { background: #fff3cd; color: #856404; }

/* ── Vote tally bar ── */
.vote-tally-bar {
    display: flex; height: 50px; border-radius: var(--radius);
    overflow: hidden; margin: 1.5rem 0 0.5rem;
}
.tally-side {
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 1.1rem;
    transition: width 0.5s ease; min-width: 60px; gap: 0.5rem;
}
.tally-a { background: #2563eb; }
.tally-b { background: #dc2626; }
.tally-winner { box-shadow: 0 0 0 3px #fbc02d inset; }
.tally-total { text-align: center; color: #777; font-size: 0.9rem; margin-bottom: 2rem; }

/* ── Pack cards ── */
.pack-card {
    background: white; border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem; overflow: hidden;
}
.pack-card.selected { border: 3px solid #28a745; }
.pack-header {
    padding: 1rem 1.5rem; color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.pack-header h3 { margin: 0; font-size: 1.3rem; }
.pack-a { background: #2563eb; }
.pack-b { background: #dc2626; }
.pack-score {
    font-size: 0.9rem; background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem; border-radius: 20px;
}
.pack-stats { padding: 0.75rem 1.5rem; color: #555; font-size: 0.9rem; }
.pack-vote-btn { width: 100%; border-radius: 0; font-size: 1.1rem; padding: 1rem; }

/* ── Side-by-side pack comparison ── */
.pack-comparison-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1.5rem; margin-bottom: 2rem;
}

.my-summary { display: flex; gap: 0.5rem; padding: 0.75rem 1.5rem; flex-wrap: wrap; }
.my-badge { font-size: 0.8rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-weight: bold; }
.my-total { background: #e3f2fd; color: #1565c0; }
.my-pick { background: #fff9c4; color: #827717; }
.my-random { background: #f5f5f5; color: #616161; }
.my-top { background: #e8f5e9; color: #2e7d32; }
.no-tickets-msg { padding: 2rem; text-align: center; color: #999; font-style: italic; }

/* ── Compact ticket rows & header ── */
.ticket-list { padding: 0.5rem 0; }
.ticket-list-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.4rem 1rem; background: #f8f8f8;
    border-bottom: 2px solid #ddd; font-weight: bold;
    font-size: 0.75rem; color: #555;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ticket-list-header .t-num { width: 1.5rem; text-align: right; }
.ticket-list-header .t-game { flex: 1; }
.ticket-list-header .t-pick { width: 2rem; text-align: center; }
.ticket-list-header .t-type { min-width: 50px; text-align: right; }

.ticket-row {
    display: flex;
    align-items: center;
    gap: 0.05rem;
    padding: 0.01rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8rem;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row.pick-row { background: #fffdf5; }
.ticket-row.random-row { background: #fafafa; }

.t-num { font-weight: bold; color: #999; width: 1.5rem; text-align: right; flex-shrink: 0; }
.t-logo { width: 64px; height: 64px; flex-shrink: 0; object-fit: contain; }
.t-logo-placeholder { width: 64px; height: 64px; flex-shrink: 0; display: inline-block; }
.t-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.t-team {
    font-weight: 600; color: var(--dark); font-size: 0.95rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-date { font-size: 0.8rem; color: #888; }
.t-pick { font-weight: bold; color: var(--flames-red, #c8102e); width: 2.5rem; text-align: center; flex-shrink: 0; }

/* ── Two-column ticket layout ── */
.ticket-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ════════════════════════════════════════════════════════════════
   WINNER BANNER & FINALIZE
   ════════════════════════════════════════════════════════════════ */

.winner-banner {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border: 2px solid #fbc02d; border-radius: var(--radius);
    padding: 1.5rem; text-align: center; margin-bottom: 1.5rem;
}
.winner-banner h3 { color: #e65100; font-size: 1.5rem; margin-bottom: 0.5rem; }
.winner-banner p { color: #795548; margin-bottom: 1rem; }
.admin-winner { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); border-color: #43a047; }
.admin-winner h3 { color: #2e7d32; }

.compact-winner {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border: 2px solid #fbc02d; border-radius: var(--radius);
    padding: 0.5rem 1.5rem; text-align: center; margin-bottom: 1.5rem;
    font-weight: bold; font-size: 1.2rem; color: #e65100;
}

.finalize-section { margin-bottom: 2rem; }
.finalize-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.finalize-btn { font-size: 1rem; padding: 0.75rem 1.5rem; }

/* ── Admin vote tally table ── */
.vote-tally-header { margin-bottom: 1.5rem; }
.vote-tally-header h2 { color: var(--flames-red); }
.vote-tally-table th, .vote-tally-table td { padding: 0.5rem 0.75rem; font-size: 0.9rem; vertical-align: middle; }
.vote-tally-table tbody tr:nth-child(even) { background: #f9f9f9; }
.vote-tally-table tbody tr:hover { background: #f0f4ff; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .pack-comparison-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .preferences-container { grid-template-columns: 1fr; }
    .game-logo-wrap { width: 64px; height: 64px; }
    .team-logo-lg { width: 64px; height: 64px; }
    .logo-placeholder { width: 64px; height: 64px; }
    .game-item { min-height: 76px; }
    .line-team { white-space: normal; line-height: 1.2; }
    .stats-bar { flex-direction: row; gap: 1rem; padding: 0.75rem; }
    .stats-bar .stat-value { font-size: 1.2rem; }
    .add-btn, .remove-btn { width: 40px; height: 40px; font-size: 1.5rem; }
    .game-item { gap: 0.4rem; padding: 0.4rem 0.4rem 0.4rem 0.2rem; margin-bottom: 0.4rem; }
    .game-content { gap: 0.15rem; }
    .line-team { font-size: 0.85rem; }
    .line-game-seats .game-id { font-size: 0.9rem; }
    .game-meta { font-size: 0.75rem; }
    .usage-counter { font-size: 0.72rem; padding: 0.15rem 0.35rem; min-width: 2rem; }
    .priority-badge { font-size: 0.75rem; padding: 0.15rem 0.4rem; }
    .sortable-list { max-height: 400px; padding: 0.5rem; }
    .instructions { padding: 1rem; }
    .instructions ol { margin-left: 1.2rem; }
}

@media (max-width: 700px) {
    .ticket-columns { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .t-logo { width: 48px; height: 48px; }
    .t-logo-placeholder { width: 48px; height: 48px; }
    .t-team { font-size: 0.82rem; }
    .t-date { font-size: 0.7rem; }
}

/* ════════════════════════════════════════════════════════════════
   PRINT STYLES (all merged into one block)
   ════════════════════════════════════════════════════════════════ */

@media print {
    @page { size: portrait; margin: 0.5in; }

    /* Hide UI elements */
    .navbar, .footer, .back-link, .print-button-area,
    .flash-messages, .finalize-section, .admin-winner form {
        display: none !important;
    }

    body { font-size: 0.75rem !important; }

    /* Printable ticket */
    .printable-ticket { max-width: 100%; margin: 0; padding: 0; }
    .ticket-header h1 { font-size: 1.5rem !important; margin-bottom: 0.25rem !important; }
    .ticket-header h2 { font-size: 1.1rem !important; margin-bottom: 0.25rem !important; }
    .ticket-subtitle { font-size: 0.8rem !important; margin-bottom: 1rem !important; }
    .ticket-summary { margin-bottom: 1rem; gap: 0.5rem; }
    .ts-card { box-shadow: none; border: 1px solid #ddd; padding: 0.5rem; font-size: 0.75rem; }
    .ts-value { font-size: 1.2rem !important; }

    /* Ticket tables */
    .ticket-table th, .ticket-table td {
        padding: 0.25rem 0.3rem !important;
        font-size: 0.7rem !important; white-space: nowrap;
    }
    .ticket-table { margin: 0 !important; page-break-inside: avoid; }
    .ticket-table th {
        background: #333 !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .pick-row { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Compact winner banner */
    .compact-winner {
        padding: 0.5rem 1rem; font-size: 1.1rem; margin-bottom: 1rem;
        background: #fff9c4 !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    /* Vote result logos */
    .vote-result-page .t-logo { width: 48px; height: 48px; }

    /* Ticket rows */
    .ticket-row { padding: 0.1rem 0.8rem; font-size: 0.85rem; page-break-inside: avoid; }

    /* Summary badges */
    .my-summary { gap: 0.3rem; margin-bottom: 0.75rem; }
    .my-badge { font-size: 0.75rem; padding: 0.15rem 0.5rem; }

    /* Ticket info */
    .t-team { font-size: 0.88rem; }
    .t-date { font-size: 0.75rem; }
    .t-pick { width: 2rem; font-size: 0.85rem; }

    /* Two-column layout */
    .ticket-columns { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
}