:root {
    --green: #1b4332;
    --green-dark: #10281e;
    --gold: #d4af37;
    --gold-light: #f2d675;
    --bg: #0e1512;
    --card: #16211c;
    --text: #eef2ee;
    --muted: #9db3a6;
    --danger: #c65b5b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top, var(--green) 0%, var(--bg) 60%);
    color: var(--text);
    min-height: 100vh;
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

header.site {
    text-align: center;
    margin-bottom: 28px;
}

header.site h1 {
    font-size: 1.9rem;
    letter-spacing: 0.5px;
    margin: 0;
}

header.site .ball {
    font-size: 2rem;
}

.card {
    background: var(--card);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    margin-bottom: 24px;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
    color: var(--gold-light);
}

input[type=text], input[type=date], input[type=time], select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2c3b32;
    background: #0f1712;
    color: var(--text);
    font-size: 1rem;
}

input:focus, select:focus {
    outline: 2px solid var(--gold);
}

.row {
    display: flex;
    gap: 12px;
}
.row > div { flex: 1; }

button, .btn {
    display: inline-block;
    background: var(--gold);
    color: #16211c;
    border: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 22px;
    transition: transform .1s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); }

.btn.secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold-light);
}

.team-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
@media (max-width: 520px) {
    .team-inputs { grid-template-columns: 1fr; }
    .row { flex-direction: column; }
}

.notice {
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.4);
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.notice.danger {
    background: rgba(198,91,91,0.12);
    border-color: rgba(198,91,91,0.5);
    color: #f0c9c9;
}

.link-box {
    background: #0f1712;
    border: 1px dashed rgba(212,175,55,0.5);
    padding: 12px 14px;
    border-radius: 8px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 8px 0 18px;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 28px 0;
    flex-wrap: wrap;
}
.countdown .unit {
    background: var(--green-dark);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 12px;
    padding: 16px 18px;
    min-width: 84px;
    text-align: center;
}
.countdown .unit .num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gold-light);
    line-height: 1;
}
.countdown .unit .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-top: 6px;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    counter-reset: pick;
}
.results-list li {
    counter-increment: pick;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--green-dark);
    border: 1px solid rgba(212,175,55,0.2);
    margin-bottom: 8px;
    font-size: 1.05rem;
    animation: pop .35s ease both;
    transition: background .5s ease, border-color .5s ease;
}
.results-list li::before {
    content: counter(pick);
    background: var(--gold);
    color: #16211c;
    font-weight: 800;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
@keyframes pop {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Placeholder slots shown before each pick is revealed */
.results-list li.placeholder {
    color: var(--muted);
    opacity: 0.55;
    font-style: italic;
}
.results-list li.placeholder::before {
    background: transparent;
    border: 1px dashed var(--gold);
    color: var(--gold);
}

/* Flash highlight the instant a pick is revealed */
.results-list li.just-revealed {
    background: rgba(212, 175, 55, 0.22);
    border-color: var(--gold);
    animation: reveal-flash .6s ease;
}
@keyframes reveal-flash {
    0%   { transform: scale(1.04); box-shadow: 0 0 0 2px rgba(212,175,55,0.6); }
    100% { transform: scale(1); box-shadow: none; }
}

/* Teaser text shown before the reveal begins ("THIS IS IT!", "3", "2", "1"...) */
.teaser {
    text-align: center;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--gold-light);
    font-size: 2.6rem;
    margin: 40px 0;
    min-height: 60px;
    text-shadow: 0 0 24px rgba(212,175,55,0.5);
}
.teaser.pulse {
    animation: teaser-pulse .85s ease both;
}
@keyframes teaser-pulse {
    0%   { opacity: 0; transform: scale(0.7); }
    30%  { opacity: 1; transform: scale(1.12); }
    60%  { transform: scale(1); }
    100% { opacity: 1; transform: scale(1); }
}

#skip-btn {
    display: block;
    margin: 18px auto 0;
}

.email-results {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(212,175,55,0.2);
}
.email-results label {
    margin-top: 0;
}
.email-results button {
    margin-top: 0;
    padding: 10px 20px;
}
.email-results .row {
    align-items: flex-start;
}
.muted.success { color: var(--gold-light); }
.muted.error { color: var(--danger); }

/* Newspaper-clipping style card for the rotating trash-talk headlines */
.newspaper {
    position: relative;
    margin: 18px auto 0;
    max-width: 480px;
    background: #f4ecd8;
    color: #241d14;
    border-radius: 4px;
    padding: 18px 22px 20px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.08);
    transform: rotate(-1deg);
}

.newspaper-ribbon {
    position: absolute;
    top: -12px;
    right: -10px;
    background: #b3261e;
    color: #fdf3e6;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 800;
    font-style: italic;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    border-radius: 3px;
    transform: rotate(6deg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.newspaper-masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
}

.newspaper-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.newspaper-tagline {
    font-size: 0.7rem;
    font-style: italic;
    letter-spacing: 0.5px;
    color: #5a4c36;
    margin-top: 2px;
}

.newspaper-rule {
    border-top: 3px double #241d14;
    margin: 10px 0 14px;
}

.newspaper-headline {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1.35;
    text-align: center;
    min-height: 2.7em;
    margin: 0;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .35s ease, transform .35s ease;
}
.newspaper-headline.show {
    opacity: 1;
    transform: translateY(0);
}
.newspaper-headline strong {
    color: #7a1f1a;
}

@media (max-width: 520px) {
    .newspaper { transform: rotate(0deg); padding: 16px 16px 18px; }
    .newspaper-headline { font-size: 1.12rem; }
}

.muted { color: var(--muted); font-size: 0.9rem; }

footer.site {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.7;
    margin-top: 40px;
}

footer.site a {
    color: var(--gold-light);
    font-weight: 600;
}

a { color: var(--gold-light); }

.remove-team {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 4px;
    padding: 0;
}

/* ===== Draft date picker additions (same tokens, new components) ===== */

.date-option-inputs { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.date-option-row { display: flex; gap: 10px; align-items: center; }
.date-option-row .row { flex: 1; margin: 0; }
.date-option-row .remove-option {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 6px 8px;
    flex-shrink: 0;
}

.date-options { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.date-option {
    position: relative;
    overflow: hidden;
    background: var(--green-dark);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.date-option.leading { border-color: var(--gold); }
.date-option > * { position: relative; z-index: 1; }
.date-option .tally-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: rgba(212, 175, 55, 0.15);
    z-index: 0;
    transition: width .4s ease;
}
.date-option label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin: 0;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}
.date-option input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
    flex-shrink: 0;
}
.date-option .option-label { flex: 1; }
.date-option .vote-count {
    color: var(--gold-light);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.team-btn-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 520px) { .team-btn-list { grid-template-columns: 1fr; } }
.team-btn {
    background: #0f1712;
    border: 1px solid #2c3b32;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}
.team-btn:hover { border-color: var(--gold); }
.team-btn .badge {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    color: var(--muted);
}

/* ===== Overview page: stat bar, transparency matrix, participants list ===== */

.stat-bar { display: flex; flex-wrap: wrap; gap: 20px; }
.stat-section { flex: 1; min-width: 180px; text-align: center; padding: 0 10px; }
.stat-section + .stat-section { border-left: 1px solid rgba(212, 175, 55, 0.2); }
.stat-section .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold-light);
    font-weight: 700;
    margin-bottom: 6px;
}
.stat-section .stat-value { font-size: 1.1rem; font-weight: 700; color: var(--text); }
@media (max-width: 640px) {
    .stat-section { flex: 1 1 100%; border-left: none !important; border-top: 1px solid rgba(212,175,55,0.2); padding-top: 12px; }
    .stat-section:first-child { border-top: none; padding-top: 0; }
}

.progress-track {
    position: relative;
    background: #0f1712;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 999px;
    height: 26px;
    overflow: hidden;
    margin-top: 2px;
}
.progress-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--green), var(--gold));
    transition: width .4s ease;
}
.progress-label {
    position: relative;
    z-index: 1;
    line-height: 26px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 14px; border-radius: 10px; }
.matrix-table { border-collapse: collapse; width: auto; min-width: 100%; font-size: 0.85rem; }
.matrix-table th, .matrix-table td {
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}
.matrix-table th.corner, .matrix-table td.team-name {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--card);
    z-index: 2;
}
.matrix-table td.team-name { color: var(--text); font-weight: 600; }
.matrix-table .col-weekday {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 1px 8px;
    border-radius: 999px;
}
.matrix-table .col-date { display: block; font-weight: 700; color: var(--text); margin: 3px 0; font-size: 0.82rem; }
.matrix-table .col-time {
    display: inline-block;
    background: var(--gold);
    color: #16211c;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
}
.matrix-table .vote-count-cell { color: var(--muted); font-size: 0.78rem; }
.matrix-table th.winner-col, .matrix-table td.winner-col { background: rgba(212, 175, 55, 0.12); }
.matrix-cell-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
}
.matrix-cell-box.mx-yes { background: #6fbf7f; color: #10281e; font-weight: 800; }
.matrix-cell-box.mx-no { background: rgba(198, 91, 91, 0.3); }
.matrix-table tr.matrix-row:nth-child(odd) td:not(.team-name) { background: rgba(255, 255, 255, 0.015); }

.matrix-table.editable .matrix-cell-box { background: transparent; padding: 0; }
.matrix-table.editable input[type=checkbox] {
    width: 24px;
    height: 24px;
    accent-color: var(--gold);
    cursor: pointer;
}

.participants-table td, .participants-table th { padding: 10px; }
.status-chip { padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.status-chip.responded { background: rgba(212, 175, 55, 0.2); color: var(--gold-light); }
.status-chip.pending { background: rgba(157, 179, 166, 0.15); color: var(--muted); }
.status-chip.failed { background: rgba(198, 91, 91, 0.15); color: var(--danger); }
.btn-select { padding: 7px 18px; margin: 0; font-size: 0.85rem; }

.personal-panel-header { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 6px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--gold-light); font-size: 0.9rem; }

.inline-claim-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.inline-claim-row input[type=email] { flex: 0 1 280px; min-width: 200px; }
.inline-claim-row button {
    margin-top: 0;
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ===== Shared table chrome (used on view.php, admin.php, dashboard.php) ===== */
.table-wrap { overflow-x: auto; }
table.activity { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.92rem; }
table.activity th, table.activity td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(212,175,55,0.15); }
table.activity th { color: var(--gold-light); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.status-pill { padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status-pill.done { background: rgba(212,175,55,0.2); color: var(--gold-light); }
.status-pill.pending { background: rgba(157,179,166,0.15); color: var(--muted); }
.status-pill.archived { background: rgba(198,91,91,0.12); color: var(--danger); }

/* ===== Inline participant claim (select-in-place) ===== */
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.inline-claim-cell { padding: 6px 0; text-align: left; white-space: normal; max-width: 560px; }
.inline-claim-label { display: block; margin: 0 0 8px; font-weight: 600; color: var(--gold-light); font-size: 0.92rem; }

/* ===== Merged claim/vote grid (Claim -> inline email -> inline checkboxes -> Save) ===== */
.matrix-table th.action-header, .matrix-table td.action-cell {
    position: sticky;
    right: 0;
    background: var(--card);
    z-index: 2;
    text-align: center;
    min-width: 130px;
}
.action-cell .btn { display: block; width: 100%; margin: 0 0 5px; }
.action-cell .finish-later-btn { font-size: 0.72rem; padding: 5px 10px; }
.matrix-table tr.matrix-row:nth-child(odd) td.action-cell { background: var(--card); }
.matrix-table .team-name .status-chip { margin-left: 8px; vertical-align: middle; }
.matrix-table tr.editing input[type=checkbox] {
    width: 24px;
    height: 24px;
    accent-color: var(--gold);
    cursor: pointer;
}
.matrix-table tr.claiming td { background: rgba(212, 175, 55, 0.06); }
.save-row-status { display: block; margin-top: 4px; font-size: 0.72rem; }

/* ===== Home page link, shown at the top of every header ===== */
.home-link {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}
.home-link:hover { color: var(--gold-light); }

/* ===== Scroll affordance for the wide matrix table ===== */
.scroll-hint { font-size: 0.8rem; margin: 0 0 8px; }
.scroll-shadow-wrap { position: relative; }
.scroll-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.scroll-fade.visible { opacity: 1; }
.scroll-fade-left { left: 0; background: linear-gradient(to right, var(--card) 20%, transparent); }
.scroll-fade-right { right: 0; background: linear-gradient(to left, var(--card) 20%, transparent); }

/* ===== Admin countdown controls: two distinct action blocks ===== */
.control-block { margin-top: 16px; }
.control-block-title { font-weight: 700; color: var(--text); margin: 0 0 4px; font-size: 0.95rem; }
.control-block-desc { margin: 0 0 12px; font-size: 0.85rem; }
.control-divider { border-top: 1px solid rgba(212, 175, 55, 0.15); margin: 22px 0; }
.hours-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hours-row input[type=number] { width: 70px; margin: 0; }
.hours-row button { margin: 0; padding: 8px 18px; font-size: 0.85rem; }

/* ===== Mobile list layout (replaces the wide grid below the breakpoint) ===== */
#mobile-list { display: none; }

@media (max-width: 700px) {
    .scroll-shadow-wrap, #scroll-hint { display: none !important; }
    #mobile-list { display: block; }
}

.mobile-dates-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.mobile-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--green-dark);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
}
.mobile-date-row.winner-col { border-color: var(--gold); background: rgba(212, 175, 55, 0.12); }
.mobile-date-label { font-weight: 600; font-size: 0.92rem; }
.mobile-date-count { color: var(--gold-light); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }

.mobile-team-card {
    background: var(--green-dark);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.mobile-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.mobile-team-name { font-weight: 700; }
.mobile-team-card > .btn { width: 100%; margin: 0; }

.mobile-vote-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.mobile-vote-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 400;
    margin: 0;
    cursor: pointer;
}
.mobile-vote-item input[type=checkbox] {
    width: 22px;
    height: 22px;
    accent-color: var(--gold);
    flex-shrink: 0;
}
.mobile-vote-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mobile-vote-actions .btn { width: 100%; margin: 0; }
.mobile-vote-actions .finish-later-btn { font-size: 0.8rem; padding: 8px 16px; }
