:root {
    --bg:           #f4f5f7;
    --surface:      #ffffff;
    --surface-2:    #f7f7f9;
    --border:       #e2e4e9;
    --text:         #1f2330;
    --text-muted:   #6b7280;
    --primary:      #2d6cdf;
    --primary-text: #ffffff;
    --ok:           #157f3b;
    --error:        #c0392b;
    --radius:       8px;
    --maxw:         1200px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0.1rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { font-weight: 700; font-size: 0.8rem; color: var(--text); }

.brand-both { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.brand-both img { max-height: 55px; width: auto; flex: 0 0 auto; }
.brand-both span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo img { display: block; max-height: 70px; width: auto; max-width: 220px; }
.topnav a { margin-left: 1rem; font-size: 0.8rem; }

.content { max-width: var(--maxw); margin: 1.5rem auto; padding: 0 1rem; }

main { display: flex; flex-direction: column; }
body.layout-1-content .content { order: 1; }
body.layout-2-content .content { order: 2; }
body.layout-3-content .content { order: 3; }
body.layout-1-timeline .after-content { order: 1; }
body.layout-2-timeline .after-content { order: 2; }
body.layout-3-timeline .after-content { order: 3; }
body.layout-1-mail .mailing-block { order: 1; }
body.layout-2-mail .mailing-block { order: 2; }
body.layout-3-mail .mailing-block { order: 3; }

[hidden] { display: none !important; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card-narrow { max-width: 380px; margin: 2rem auto; }

.msg { padding: 0.6rem 0.9rem; border-radius: var(--radius); margin: 0 0 1rem; }
.msg-ok    { background: #e8f6ee; color: var(--ok); }
.msg-error { background: #fdecea; color: var(--error); }
.muted     { color: var(--text-muted); font-size: 0.92rem; }

label { display: block; font-weight: 600; margin: 0.8rem 0 0.25rem; }
input, select, textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}
input[type="checkbox"]{width:auto;}
.gdpr-consent { margin-top: 0.6rem; font-size: 0.9rem; }
.gdpr-consent span { color: var(--text-muted); }
.field-check label { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }
.field-check input { width: auto; }

.btn {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.25;
    background: var(--surface-2);
    color: var(--text);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--border); color: var(--text); text-decoration: none; }

.btn[disabled], .btn[disabled]:hover { opacity: 0.5; cursor: not-allowed; filter: none; }

.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary); color: var(--primary-text); border-color: var(--primary); filter: brightness(0.95); text-decoration: none; }

.admin h1 { font-size: 1.4rem; }
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}
.tab {
    padding: 0.55rem 0.9rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.tab:hover { text-decoration: none; background: var(--surface-2); }
.tab-active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    margin-bottom: -2px;
    font-weight: 600;
}

.tab-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 1.25rem;
}

.options-form fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0 0 1.25rem;
    padding: 0.5rem 1rem 1rem;
}
.options-form legend { font-weight: 700; padding: 0 0.4rem; }
.options-form .field { margin-bottom: 0.5rem; }

.update-log {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
}

.btn-small { margin-top: 0; padding: 0.35rem 0.7rem; font-size: 0.85rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-small:hover { background: var(--border); text-decoration: none; }
.btn-small.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-small.btn-primary:hover { background: var(--primary); color: var(--primary-text); border-color: var(--primary); filter: brightness(0.95); }
.btn-small.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-small.btn-danger:hover { background: var(--error); color: #fff; border-color: var(--error); filter: brightness(0.9); }
.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }

.btn-danger:hover { background: var(--error); border-color: var(--error); color: #fff; filter: brightness(0.9); text-decoration: none; }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.grid th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.nowrap { white-space: nowrap; }

.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.row-actions .inline { display: flex; gap: 0.25rem; align-items: center; }
.row-actions input[type="email"], .row-actions input[type="password"] { width: 11rem; padding: 0.35rem 0.5rem; font-size: 0.85rem; }

.day-block { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; padding: 0.5rem 1rem 1rem; }
.day-block legend { font-weight: 700; padding: 0 0.4rem; }
.day-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
@media (max-width: 560px) { .day-grid { grid-template-columns: 1fr; } }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.thumb-item { margin: 0; text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; }
.thumb-item img { max-width: 100%; height: 110px; object-fit: contain; display: block; margin: 0 auto 0.4rem; }

.log-filter { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.log-filter select { width: auto; min-width: 14rem; }
.link-cell input { font-size: 0.8rem; }

.archive-status { font-weight: 700; }
.archive-row-current > td { background: rgba(21, 127, 59, 0.16); }
.archive-row-deleted > td { background: rgba(192, 57, 43, 0.16); }
.archive-row-deleted .archive-name,
.archive-row-deleted td:first-child { opacity: 0.75; }
.link-cell .copy-btn { margin-top: 0.3rem; }

.event-header{
    padding-bottom:10px;
}
.event-header h1 { margin-bottom: 0.2rem; }
.event-date { color: var(--text-muted); margin-top: 0; margin-bottom:0; font-size:1.1rem;font-weight:700;}

.event-hours { color: var(--text-muted); font-size: 0.9rem; margin: 0.1rem 0 10px; font-weight:600}
.day-tab-hours { display: block; font-size: 0.72rem; color: var(--text-muted); }
.event-msg { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.9rem; }

.day-tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.25rem; border-bottom: 2px solid var(--border); margin: 1rem 0 1.5rem; }

.day-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 1.05rem;
}
.day-tab:hover { background: var(--surface-2); text-decoration: none; }
.day-tab-active { color: var(--text); background: var(--surface); border-color: var(--border); margin-bottom: -2px; font-weight: 600; }

.day-tab-date { display: block; font-size: 0.85rem; color: var(--text-muted); }
.day-tab-num { display: block; font-size: 1.05rem; }
.day-tab-weekday { display: block; font-size: 1.05rem; }
.day-tab-name { display: block; font-size: 0.85rem; }
.fmt-num_weekday_date_hours .day-tab-num { font-size: 0.7rem; color: var(--text-muted); }
.fmt-name .day-tab-name { font-size: 1.05rem; }
.fmt-name_date_hours .day-tab-date { font-size: 1.05rem; color: var(--text); }
.fmt-name_date_hours .day-tab-name { font-size: 0.8rem; color: var(--text-muted); }
.fmt-date .day-tab-date,
.fmt-date_hours .day-tab-date { font-size: 1.05rem; color: var(--text); }

.table-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.table-title { font-size: 1rem; color: var(--text-muted); margin: 0 0 0.75rem; }
.no-games { margin: 0.5rem 0 1rem; }
.add-game-btn { display: block; width: fit-content; margin: 0.5rem auto 0; }
.add-table-form { margin: 1rem 0 2rem; }

.game-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.game-card { display: flex; gap: 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; background: var(--surface-2); }
.game-thumb img { width: 90%; height: auto; object-fit: contain; border-radius: 6px; background: none; }
.game-main { flex: 1; min-width: 0; }
.btn.game-manual:after{content:' ⧉';}
.game-name { margin: 0 0 0.3rem; font-size: 1.1rem; }
.game-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.game-length { color: var(--text-muted); font-size: 0.9rem; }

.game-time { color: var(--primary); font-size: 1.15rem; font-weight: 700; }
.game-time:before {content: '🕑';}
.game-brings, .game-rules, .game-comment { margin: 0.25rem 0; font-size: 0.92rem; }
.game-language {font-size: 0.92rem;}
.game-comment { color: var(--text-muted); }

.weight-badge { display: inline-block; min-width: 2rem; text-align: center; padding: 0.1rem 0.4rem; border-radius: 4px; font-weight: 700; color: #fff; }
.weight-1 { background: #2e9e5b; }
.weight-2 { background: #86b300; }
.weight-3 { background: #d6a400; }
.weight-4 { background: #e0701a; }
.weight-5 { background: #cf3b2e; }

.players {
    margin-top: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.035);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.tpl-dark .players { background: rgba(255, 255, 255, 0.05); }
.players-label { font-size: 0.85rem; color: var(--text-muted); }
.player-list { list-style: none; margin: 0.3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.player { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.88rem; }
.player-reserve { opacity: 0.7; font-style: italic; }
.reserve-tag { color: var(--text-muted); font-size: 0.8rem; }

.gate-buttons { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.btn-big { padding: 0.85rem 1.2rem; font-size: 1.05rem; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.game-form textarea { width: 100%; }

.thumb-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.thumb-opt { display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; }
.thumb-opt img { height: 150px; width: auto; max-width: 150px; object-fit: contain; border: 2px solid transparent; border-radius: 6px; background: var(--surface); }
.thumb-opt input { margin-bottom: 0.25rem; }
.thumb-opt input:checked + img { border-color: var(--primary); }
.thumb-none-box { display: inline-flex; align-items: center; justify-content: center; height: 150px; width: 100px; border: 1px dashed var(--border); border-radius: 6px; color: var(--text-muted); }
.bgg-thumb { max-height: 200px; border-radius: 6px; display: block; }

.bgg-list { list-style: none; margin: 0; padding: 0; }
.bgg-list li a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; border-bottom: 1px solid var(--border); color: var(--text); }
.bgg-list li a:hover { background: var(--surface-2); text-decoration: none; }
.bgg-list img { width: 48px; height: 48px; object-fit: contain; }
.bgg-year { color: var(--text-muted); }

.signup-btn { margin-top: 0.5rem; }
.player { display: inline-flex; align-items: center; gap: 0.35rem; }
.player-del { color: var(--error); font-weight: 700; text-decoration: none; line-height: 1; padding: 0 0.15rem; }
.player-del:hover { text-decoration: none; transform: scale(1.2); }

.poll-card { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 0.75rem; background: #eef3fc; }
.tpl-dark .poll-card { background: #1b2436; }
.poll-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.3rem; }

.poll-tag { margin-left: auto; background: black; color: #cfcfcf; font-size: 0.85rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.03em; }

.poll-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 0.5rem; }
.poll-by { font-size: 0.92rem; }
.poll-options { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.poll-option { position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.6rem 0.45rem; }

.poll-opt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--border); }
.poll-opt-bar > span { display: block; height: 100%; background: var(--primary); transition: width 0.2s ease; }
.poll-opt-bar.is-full > span { background: var(--ok); }
.poll-opt-thumb { height: 50px; width: 50px; object-fit: contain; }

.poll-opt-main { flex: 1; min-width: 0; }
.poll-opt-name { font-weight: 600; }
.poll-opt-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.poll-opt-meta .weight-badge { min-width: 1.7rem; padding: 0 0.3rem; font-size: 0.72rem; }
.poll-opt-votes { color: var(--text-muted); font-size: 0.88rem; white-space: nowrap; }

.poll-candidate-list { list-style: none; margin: 0.3rem 0 1rem; padding: 0; }
.poll-candidate-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.poll-candidate-list .cand-name { flex: 1; font-weight: 600; }
.poll-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gate-poll { margin-top: 0.75rem; }

html { scroll-behavior: smooth; }

.timeline { margin: 1rem 0 2.5rem; padding: 0 1rem; }
.timeline-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.tl-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tl-inner { --tl-pad: 1.6rem; position: relative; min-width: 700px; padding: 0 var(--tl-pad) 0.5rem; }

.tl-bands { position: absolute; top: 0; bottom: 0; left: var(--tl-pad); right: var(--tl-pad); z-index: 0; }
.tl-band  { position: absolute; top: 0; bottom: 0; }
.tl-band:nth-child(odd) { background: rgba(0, 0, 0, 0.065); }

.tl-hours, .tl-lane, .tl-table-no { position: relative; z-index: 1; }

.tl-hours { position: relative; height: 1.6rem; border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.tl-hour { position: absolute; top: 0.3rem; transform: translateX(-50%); font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.tl-hour::before { content: ""; position: absolute; top: -0.3rem; left: 50%; height: 0.3rem; border-left: 1px solid var(--border); }

.tl-table-no { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); background: var(--surface-2); padding: 0.25rem 0.5rem; margin-top: 0.25rem; }
.tl-lane { position: relative; height: 3rem; margin: 0.25rem 0; }
.tl-game { position: absolute; top: 0; height: 100%; min-width: 2.5rem; box-sizing: border-box; overflow: hidden;
           background: var(--primary); color: var(--primary-text); border-radius: 5px; padding: 0.2rem 0.4rem;
           font-size: 0.8rem; line-height: 1.15; text-decoration: none; }
.tl-game:hover { filter: brightness(0.95); text-decoration: none; }
.tl-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { display: block; font-size: 0.72rem; opacity: 0.9; }
.tl-count-full { color: #ffd5d0; font-weight: 700; }
.tl-game { }

.game-name-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.game-actions { display: inline-flex; gap: 0.3rem; }
.game-archived { background: #fbe9e7; border-color: #e6b0aa; opacity: 0.75; }
.tpl-dark .game-archived { background: #3a1f1c; border-color: #6b3b34; }
.game-archived .game-name { text-decoration: line-through; }

.delgame-buttons { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

.poll-form-add { margin: 1rem 0 0.6rem; }
.poll-form-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0; }

.msg-lang-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.msg-lang-code { flex: 0 0 2.4rem; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.06em; }
.msg-lang-row input { flex: 1; min-width: 0; }

.mailing-box { max-width: 640px; margin: 1.5rem auto 2rem; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.mailing-box h2 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.mailing-box .muted { margin: 0 0 0.7rem; font-size: 0.9rem; }
.mailing-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mailing-row input[type="email"] { flex: 1; min-width: 12rem; }
.mailing-row .btn { margin-top: 0; }
.mailing-consent { margin-top: 0.6rem; font-size: 0.85rem; }
.mailing-consent label { display: flex; gap: 0.45rem; align-items: flex-start; }
.mailing-captcha { margin-top: 0.6rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.discussion { margin-top: 0.6rem; border-top: 1px dashed var(--border); padding-top: 0.5rem; }
.comment-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.comment-list li { font-size: 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.5rem; }
.c-name { font-weight: 600; }
.comment-add summary { cursor: pointer; color: var(--primary); font-size: 0.9rem; }
.comment-add form { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.4rem; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.stat-nums { display: flex; gap: 1.5rem; }
.stat-nums span { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-nums small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.profile-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.profile-card h3 { margin-top: 0; font-size: 1rem; }
.reset-sub { font-size: 1rem; }

.msg-icon { text-decoration: none; color: var(--primary); font-size: 1rem; line-height: 1; padding: 0 0.25rem; }
.msg-icon:hover { color: var(--primary-hover, var(--primary)); filter: brightness(0.9); }
.game-name-row .msg-icon { margin-left: 0.25rem; }

.msg-icon-all {  }

.btn-secondary { background: #7d92ac; color: #fff; border-color: #7d92ac; }
.btn-secondary:hover { background: #7d92ac; color: #fff; border-color: #7d92ac; filter: brightness(0.95); text-decoration: none; }
.gate-poll { margin-top: 0.6rem; }
.gate-poll .btn { display: block; text-align: center; margin-top: 0; padding: 0.7rem 1.1rem; font-size: 0.98rem; }
.gate-manual { margin-top: 0.6rem; text-align: center; }
.btn-small-gate { margin-top: 0; padding: 0.45rem 0.9rem; font-size: 0.85rem; }

.tl-game.tl-poll { background: #eef3fc; color: var(--text); border: 1px dashed var(--primary); }
.tl-game.tl-poll .tl-sub { color: var(--text-muted); }
.tpl-dark .tl-game.tl-poll { background: #1b2436; color: var(--text); }

.rules-good { color: #2e9e5b; }
.rules-mid  { color: #b58900; }
.rules-bad  { color: #cf3b2e; }

.comment-list li:nth-child(even) { background: rgba(0, 0, 0, 0.045); }
.tpl-dark .comment-list li:nth-child(even) { background: rgba(255, 255, 255, 0.05); }

.field-note { font-size: 0.8rem; color: var(--text-muted); margin: 0.3rem 0 0; }

.field-warn {
    font-size: 0.82rem;
    color: var(--error);
    margin: 0.35rem 0 0;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--error);
    border-radius: var(--radius);
}
.poll-deadline { font-size: 0.85rem; color: var(--text-muted); margin: 0.35rem 0; }

.game-card.active, .poll-card.active { box-shadow: 0 0 0 3px rgba(43, 108, 196, 0.35); }

.game-list > .game-archived { order: 99; }

.p-acct { font-size: 0.7em; color: var(--text-muted); margin-left: 0.15rem; cursor: help; vertical-align: super; }

.p-signedby { display: block; font-size: 0.62rem; line-height: 1.2; color: var(--text-muted); }

.sitefooter { margin-top: 2rem; padding: 1rem 0; border-top: 1px solid var(--border); }
.footer-prefs { display: flex; gap: 1rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.footer-prefs-item { display: inline-flex; gap: 0.35rem; align-items: center; font-size: 0.8rem; color: var(--text-muted); }
.footer-prefs select { font-size: 0.8rem; padding: 0.15rem 0.25rem; }

.nav-ic { display: inline-flex; align-items: center; }
.nav-svg { width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
.topnav a { display: inline-flex; align-items: center; gap: 0.3rem; }
.topnav .nav-icononly .nav-svg { width: 1.2em; height: 1.2em; }

.tl-game { border-right: 1px solid var(--surface); }

.game-thumb { display: flex; flex-direction: column; gap: 0.45rem; align-items: center; width: 15%; min-width:100px; }
.game-thumb .game-actions { display: flex; flex-direction: column; gap: 0.3rem; width: 90px; }
.game-thumb .game-actions .btn { margin-top: 0; text-align: center; font-size: 0.75rem; padding: 0.25rem 0.5rem; }

.p-knows { font-size: 1em; margin-left: 0.3rem; vertical-align: middle; cursor: help; }

.signup-btn {
    background: #2e9e5b; color: #fff;
    padding: 0.5rem 1.1rem; font-size: 0.95rem;
    margin-top: 0.6rem;
}

.signup-btn:hover { background: #2e9e5b; filter: brightness(0.93); text-decoration: none; }

.table-block { position: relative; }
.table-name { font-size: 0.85em; font-weight: normal; color: var(--text-muted); margin-left: 0.4rem; }
.table-rename-btn {
    position: absolute; top: 0.5rem; right: 0.75rem;
    font-size: 0.8rem; color: var(--text-muted); text-decoration: none;
    opacity: 0.6;
}
.table-rename-btn:hover { opacity: 1; text-decoration: none; }
.table-rename-form { display: flex; gap: 0.4rem; align-items: center; margin: 0 0 0.75rem; flex-wrap: wrap; }
.table-rename-form input[type="text"] { max-width: 220px; }
.add-table-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.add-table-form input[type="text"] { max-width: 220px; }
.add-table-form>* {margin-top:0}

.badge-blocked {
    display: inline-block; padding: 0.05rem 0.4rem; margin-left: 0.3rem;
    font-size: 0.75em; border-radius: 3px;
    background: #c0392b; color: #fff;
}
.users-create { margin-bottom: 1.5rem; max-width: 420px; }

.site-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
}
.site-images > fieldset { margin: 0; }

.icon-section { margin-bottom: 1.5rem; }
.icon-section img { vertical-align: middle; margin-right: 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.icon-upload { margin-top: 0.75rem; }

.event-rename { margin-bottom: 1.5rem; max-width: 420px; }

.footer-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1rem;
    padding: 0.8rem 1rem 0;
    font-size: 0.9rem;
}
#footer_custom {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0.8rem 1rem 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.bgg_logo{display:block;text-align:center;padding:20px 10px;}
.bgg_logo img{width:60%;max-width:300px;height:auto;}

.topbar-prefs { display: flex; align-items: center; gap: 0.4rem; margin-left: 0.6rem; }
.topbar-prefs-item { display: inline-flex; align-items: center; }
.topbar-prefs select {
    font-size: 0.8rem;
    padding: 0.15rem 0.3rem;
    margin: 0;
}

.chat-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    width: 34px;
    height: 54px;
    padding: 0;
    cursor: pointer;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: 0 6px 6px 0;
    font-size: 1.1rem;
    line-height: 1;
}
.chat-toggle-close { display: none; }

body.chat-open .chat-toggle { left: 500px; }
body.chat-open .chat-toggle-open  { display: none; }
body.chat-open .chat-toggle-close { display: inline; }

.chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 500px;
    max-width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: var(--surface);

    color: var(--text);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 14px rgba(0, 0, 0, .35);
}

.chat-panel {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.chat-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.22s ease, visibility 0s linear 0s;
}

.chat-toggle { transition: left 0.22s ease; }

.chat-head { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); }
.chat-title { margin: 0; font-size: 1rem; }

.chat-log {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.6rem 0.9rem;
    min-height: 0;
}
.chat-earlier { display: block; margin: 0 auto 0.6rem; }
.chat-msg { margin: 0 0 0.35rem; font-size: 0.88rem; line-height: 1.35; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-msg-name { font-weight: 700; }

.chat-msg-user  .chat-msg-name { color: var(--primary); }
.chat-msg-admin .chat-msg-name { color: var(--error); }
.chat-msg-time { color: var(--text-muted); font-size: 0.8rem; }
.chat-empty { color: var(--text-muted); font-style: italic; }

.chat-form {
    flex: 0 0 auto;
    padding: 0.6rem 0.9rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.chat-name { width: 100%; box-sizing: border-box; }
.chat-send-row { display: flex; gap: 0.4rem; }
.chat-input { flex: 1 1 auto; min-width: 0; }
.chat-send { flex: 0 0 auto; position: relative; overflow: hidden; }
.chat-send[disabled] { opacity: 1; filter: none; }
.chat-send[disabled]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.85;
    transform-origin: left center;
    animation: chat-cooloff var(--chat-cooloff, 2s) linear forwards;
}
@keyframes chat-cooloff { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.chat-admin-when { white-space: nowrap; }
.chat-when-date { display: inline-block; margin-right: 0.35rem; }
.chat-when-time { color: var(--text-muted); }
.chat-admin-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.02rem 0.3rem;
    margin-left: 0.3rem;
}
.chat-admin-purge { margin-top: 1.2rem; }

.chat-error { margin: 0; color: var(--error); font-size: 0.82rem; }

.event-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;

    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.event-tab { flex: 0 0 auto; }

.event-tab-name { white-space: nowrap; font-size: 0.78rem; }

.event-tabs .day-tab-date { white-space: nowrap; }

.pager { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem; }
.pager-pos { color: var(--text-muted); font-size: 0.85rem; }

.archive-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }

.archive-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.archive-item:first-child { border-top: 1px solid var(--border); }
.archive-name { font-weight: 700; }
.archive-date { color: var(--text-muted); font-size: 0.9rem; }

@media (min-width: 701px) {

    .content{min-width:650px;}

    .archive-item {
        display: grid;
        grid-template-columns: minmax(0, 28rem) 12rem 1fr;
        align-items: baseline;
        gap: 0 1rem;
    }

    .archive-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .archive-badge { justify-self: start; }
}
@media (min-width: 1001px) {
    .content{min-width:950px;}
}
@media (min-width: 1201px) {
    .content{min-width:1150px;}
}
.archive-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.05rem 0.35rem;
}
.archive-item-closed .archive-name { font-weight: 400; }

.card.archive-page { width: auto; max-width: none; }

.archive-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.archive-head h1 { margin: 0; flex: 1 1 auto; }

.cal-bar { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.cal-title { margin: 0; font-size: 1.15rem; text-align: center; flex: 0 1 auto; min-width: 12rem; }

.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th {
    padding: 0.4rem 0.3rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.cal-cell {

    height: 5.5rem;
    vertical-align: top;
    padding: 0.3rem;
    border: 1px solid var(--border);
    overflow: hidden;
}
.cal-day { display: block; font-size: 0.8rem; color: var(--text-muted); }

.cal-outside { background: var(--surface-2); }
.cal-outside .cal-day { opacity: 0.5; }
.cal-today .cal-day { font-weight: 700; color: var(--primary); }
.cal-has { background: var(--surface-2); }
.cal-ev {
    display: block;
    font-size: 0.78rem;
    line-height: 1.25;
    margin-top: 0.15rem;
    padding: 0.1rem 0.25rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-text);
    text-decoration: none;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-ev:hover { text-decoration: none; filter: brightness(1.1); }
.cal-foot { margin-top: 1rem; }

.nav-burger { display: none; }

.tab-scroll { position: relative; }
.tab-scroll::before,
.tab-scroll::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.2rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;

    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.6rem 0.6rem;
}
.tab-scroll::after {
    right: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}
.tab-scroll::before {
    left: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
}
.tab-scroll.can-scroll-right::after,
.tab-scroll.can-scroll-left::before { opacity: 1; }

.opt-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.6rem; background: var(--surface); }
.opt-group-head {
    cursor: pointer;
    padding: 0.7rem 0.9rem;
    font-weight: 700;
    list-style: none;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    background: var(--surface-2);
}
.opt-group-head::-webkit-details-marker { display: none; }
.opt-group-head::before { content: "\25B8"; display: inline-block; transition: transform 0.15s ease; }
.opt-group[open] > .opt-group-head::before { transform: rotate(90deg); }
.opt-group[open] > .opt-group-head { border-bottom: 1px solid var(--border); }
.opt-group-head:hover { background: var(--border); }
.opt-group-note { font-weight: 400; font-size: 0.82rem; color: var(--text-muted); }
.opt-group-body { padding: 0.9rem; }

.archive-actions a, .archive-actions button{
    margin:2px;
}

@media (prefers-reduced-motion: reduce) {
    .chat-panel, .chat-panel.is-open, .chat-toggle { transition: none; }

    .chat-send[disabled]::after { animation: none; opacity: 0.4; }

    .opt-group-head::before { transition: none; }
}

trix-toolbar, trix-editor {
    color-scheme: light;
    color: #16181d;
}
trix-editor {
    background: #ffffff;
    border: 1px solid #c8ccd4;
    border-radius: 6px;
    min-height: 18rem;
    padding: 0.6rem 0.7rem;
}
trix-editor:empty:not(:focus)::before { color: #6b7280; }
trix-editor a { color: #1d4ed8; }
trix-toolbar .trix-button {
    background: #f4f5f7;
    color: #16181d;
    border-bottom: 1px solid #c8ccd4;
}
trix-toolbar .trix-button:not(:first-child) { border-left: 1px solid #c8ccd4; }
trix-toolbar .trix-button:not(:disabled):hover { background: #e4e6ea; }
trix-toolbar .trix-button.trix-active { background: #d3d7de; }
trix-toolbar .trix-button--icon::before { opacity: 0.85; }
trix-toolbar .trix-button--icon:disabled::before { opacity: 0.25; }
trix-toolbar .trix-dialog {
    background: #ffffff;
    color: #16181d;
    border: 1px solid #c8ccd4;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}
trix-toolbar .trix-input--dialog {
    background: #ffffff;
    color: #16181d;
    border: 1px solid #c8ccd4;
}
trix-toolbar .trix-button--dialog {
    background: #f4f5f7;
    color: #16181d;
    border: 1px solid #c8ccd4;
}

@media (max-width: 700px) {
    .site-images { grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1.8rem; }

    .day-tab       { font-size: 0.95rem; }
    .day-tab-date  { font-size: 0.80rem; }
    .day-tab-hours { font-size: 0.68rem; }

    .day-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .day-tab { flex: 0 0 auto; }

    .poll-option { flex-wrap: wrap; row-gap: 0.3rem; }
    .poll-option > .btn,
    .poll-option > form.inline { flex: 1 0 100%; margin-top: 0.1rem; }
    .poll-option > form.inline .btn { width: 100%; }

    .brand-logo img { max-height: 40px; width: auto; max-width: 70px; }
    .chat-panel { width: 100%; }

    body.chat-open .chat-toggle {
        left: auto;
        right: 0;
        border-radius: 6px 0 0 6px;
    }
    body{
        overflow-x:hidden;
    }
    .main{width:100%;}
    .content {padding:0;width:100%}
    .event-tab-name { font-size: 0.72rem; }
    .cal-cell { height: 4rem; padding: 0.15rem; }
    .cal-ev { font-size: 0.65rem; padding: 0.05rem 0.15rem; }
    .cal th { font-size: 0.65rem; }
    .cal-title { min-width: 0; font-size: 1rem; }
    .game-card{flex-direction:column;}
    .game-card .game-thumb{width:100%;}
    .game-card .game-thumb img{width:70%;}

    .nav-burger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 34px;
        padding: 0;
        cursor: pointer;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text);
    }

    .nav-burger-bars,
    .nav-burger-bars::before,
    .nav-burger-bars::after {
        display: block;
        width: 18px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
    }
    .nav-burger-bars { position: relative; }
    .nav-burger-bars::before,
    .nav-burger-bars::after { content: ""; position: absolute; left: 0; }
    .nav-burger-bars::before { top: -6px; }
    .nav-burger-bars::after  { top: 6px; }

    .topbar-inner { flex-wrap: wrap; row-gap: 0.35rem; }

    .brand, .brand-logo { order: 1; flex: 0 1 auto; min-width: 0; overflow: hidden; }
    .brand { text-overflow: ellipsis; white-space: nowrap; }
    .brand-spacer { order: 1; flex: 0 1 auto; }

    .topbar-prefs {
        order: 2;
        flex: 0 1 auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        min-width: 0;
        margin: 0 0 0 auto;
        row-gap: 0.25rem;
    }
    .topbar-prefs select { min-width: 0; max-width: 8rem; }

    .nav-burger { order: 3; flex: 0 0 auto; margin-left: 0.4rem; }

    .topnav {
        display: none;
        order: 4;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 0.4rem;
        border-top: 1px solid var(--border);
    }
    .topnav.is-open { display: flex; }
    .topnav a {
        padding: 0.6rem 0.2rem;
        border-bottom: 1px solid var(--border);
    }

    .topnav a.nav-icononly { text-align: left; }

    .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
    .grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .grid tr {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 0.7rem;
        padding: 0.2rem 0.6rem 0.5rem;
        background: var(--surface);
    }
    .grid td { border-bottom: 0; padding: 0.35rem 0; }
    .grid td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--text-muted);
    }
    .grid td:empty { display: none; }
    .archive-row-current > td, .archive-row-deleted > td { background: none; }
    .archive-row-current { background: rgba(21, 127, 59, 0.16); }
    .archive-row-deleted { background: rgba(192, 57, 43, 0.16); }
    .link-cell input { font-size: 0.75rem; }
    trix-toolbar .trix-button-row { flex-wrap: wrap; overflow-x: visible; overflow-y: hidden; justify-content: flex-start; }
    trix-toolbar .trix-button-group { margin-bottom: 0.3rem; }
    trix-editor { min-height: 12rem; }
}
