.online-shell [hidden] { display: none !important; }
/* .text-button sets no colour, which is fine for <button> but leaves an <a> browser-blue. */
.button-link { display: inline-grid; place-items: center; color: var(--ink); text-decoration: none; }
.online-shell { max-width: 1320px; }
.online-shell main { padding: 34px 0; }
#auth-view, #lobby-view { animation: hall-view-in .22s ease-out; }
@keyframes hall-view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
/* The second column used to demand 520px, so with the 300px first column and the gap the grid
   needed 854px — but it only collapses to one column at 820px. Between those two figures the
   panels ran off the right edge and the fields were cut in half. A zero minimum lets the column
   shrink to whatever is left instead. */
.auth-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 34px; align-items: center; min-height: calc(100vh - 170px); }
.hall-intro h2, .hall-heading h2, .hall-panel h2 { margin: 5px 0 10px; font-family: Cinzel, Georgia, serif; }
.hall-intro h2 { max-width: 600px; font-size: clamp(2rem, 4.5vw, 4.2rem); line-height: 1.02; }
.hall-intro p, .hall-intro li { color: var(--muted); line-height: 1.6; }
.hall-intro ul { padding-left: 20px; }

/* The one line that tells a newcomer they can try the game before committing to an account. */
.hall-intro-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; line-height: 1.7; }
.hall-intro-actions a { color: var(--gold-bright); }
.hall-intro-actions .link-button { padding: 0; color: var(--gold-bright); font-size: inherit; text-decoration: underline; }.auth-panels { display: grid; gap: 14px; }
.hall-panel { padding: 22px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(255,255,255,.025), transparent), var(--panel); box-shadow: var(--shadow); }
.hall-panel form, .hall-panel label, .compact-form { display: grid; gap: 7px; }
.hall-panel label + label { margin-top: 8px; }
.hall-panel label > span, .compact-form label > span { color: var(--gold); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hall-panel input, .hall-panel select { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); border: 1px solid var(--line); background: #0d0c0a; }
.hall-panel select { cursor: pointer; }
.hall-panel form > button { margin-top: 13px; }
.hall-heading, .section-title, .list-card, .match-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.hall-heading { margin-bottom: 15px; }
.hall-heading h2, .section-title h2 { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { min-height: 95px; display: grid; place-content: center; text-align: center; border: 1px solid var(--line); background: var(--panel); }
.stat-card span { color: var(--muted); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.stat-card strong { color: var(--gold-bright); font: 2rem Cinzel, serif; }
.stat-card.won { border-bottom-color: var(--green); }
.stat-card.lost { border-bottom-color: var(--red-bright); }
.weekly-alert { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; padding: 17px 19px; border: 1px solid var(--gold); background: linear-gradient(100deg, rgba(200,167,106,.13), rgba(200,167,106,.025)); box-shadow: var(--shadow); }
.weekly-alert h3 { margin: 4px 0; font-size: 1rem; }
.weekly-alert article { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.weekly-alert article + article { padding-top: 10px; border-top: 1px solid rgba(200,167,106,.28); }
.weekly-alert p { margin: 0; color: var(--muted); font-size: .7rem; }
.weekly-alert .clock { color: var(--gold-bright); font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.weekly-alert .clock.urgent { color: #f0a08c; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.matches-panel { grid-column: 1 / -1; }
.section-title { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-title h2 { font-size: 1.25rem; }
.card-list, .match-list { display: grid; gap: 8px; margin: 13px 0; }
.list-card, .match-card { padding: 11px; border: 1px solid #332d24; background: rgba(255,255,255,.018); }
.list-card h3, .match-card h3 { margin: 0 0 3px; font: .85rem Cinzel, serif; }
.list-card p, .match-card p { margin: 0; color: var(--muted); font-size: .66rem; }
.band-mark { width: 35px; height: 35px; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.28); transform: rotate(45deg); }
.card-main { flex: 1; min-width: 0; }
.list-card { position: relative; }
.card-remove { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--muted); border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: .9rem; line-height: 1; }
.card-remove:hover:not(:disabled) { color: var(--red-bright); border-color: var(--red-bright); }
.card-remove:disabled { opacity: .4; cursor: default; }
.title-count, .tournament-tag { display: inline-block; margin-top: 7px; color: var(--gold-bright); font-size: .56rem; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.title-count::before { content: '◆'; margin-right: 6px; color: var(--gold); }
.tournament-tag { padding: 3px 6px; border: 1px solid rgba(200,167,106,.4); }
.compact-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.compact-form h3 { margin: 0 0 5px; font: .9rem Cinzel, serif; }
.color-field { grid-template-columns: 1fr auto; align-items: center; }
.color-field span { grid-column: 1 / -1; }
.color-field input[type="color"] { width: 100%; padding: 4px; }
.inline-form { grid-template-columns: 1fr auto; align-items: end; }
.inline-form button { margin: 0; }
.match-card { align-items: stretch; }
.match-meta { min-width: 0; flex: 1; }
/* Sits beside .mini-button, so it has to match its height or the pair looks stepped. */
.match-status { align-self: center; display: grid; place-items: center; min-height: 34px; padding: 5px 9px; color: var(--muted); border: 1px solid var(--line); font-size: .56rem; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.match-status.turn { color: #17120b; border-color: var(--gold); background: var(--gold); }
.match-actions { display: flex; align-items: center; gap: 7px; }
.empty-state { padding: 18px; color: var(--muted); border: 1px dashed var(--line); text-align: center; font-size: .7rem; }
/* Used on both <button> and <a>. A button centres its label on its own, but an anchor is inline and
   ignores min-height, leaving the text stuck to the top — hence the explicit grid centring. */
.mini-button { display: inline-grid; place-items: center; min-height: 34px; padding: 0 11px; white-space: nowrap; color: var(--ink); border: 1px solid var(--line); background: #201c16; cursor: pointer; font-size: .62rem; font-weight: 700; text-decoration: none; text-transform: uppercase; }
.mini-button.primary { color: #17120b; border-color: var(--gold); background: var(--gold); }
.mini-button.disabled { color: #675f52; border-style: dashed; background: transparent; cursor: default; }
.list-card .expiring { color: #f0a08c; }
/* Presence is a positive signal only: nothing is drawn for someone who is away. */
.presence-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: #7fd6a4; font-size: .6rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.presence-badge > i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #7fd6a4; box-shadow: 0 0 0 3px rgba(127,214,164,.16); }
/* Filled for present, hollow for away — the shape carries the state as well as the hue, so it
   still reads for anyone who cannot separate red from green. */
.presence-badge.away { color: #c9705f; }
.presence-badge.away > i { background: transparent; border: 2px solid #c9705f; box-shadow: none; animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .presence-badge > i { animation: presence-pulse 2.4s ease-in-out infinite; }
}
@keyframes presence-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(127,214,164,.16); }
  50% { box-shadow: 0 0 0 5px rgba(127,214,164,.05); }
}

@media (max-width: 820px) {
  .auth-layout, .lobby-grid { grid-template-columns: 1fr; }
  .matches-panel { grid-column: auto; }
  .auth-layout { min-height: auto; }
  .match-card { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .online-shell main { padding-top: 18px; }
  .online-shell .masthead { align-items: flex-end; flex-wrap: wrap; padding: 10px 0; }
  .online-shell .header-actions { width: 100%; justify-content: flex-end; }
  .hall-panel { padding: 15px; }
  .inline-form { grid-template-columns: 1fr; }
  .match-actions { width: 100%; }
  .match-actions > * { flex: 1; display: grid; place-items: center; }
  .weekly-alert article { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  #auth-view, #lobby-view { animation: none; }
}
