:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  color: #f3f1eb;
  background: #111515;
  --surface: #191e1e;
  --surface-raised: #202626;
  --line: #2e3635;
  --muted: #a6b0aa;
  --gold: #e8bd78;
  --green: #88c6a2;
  --radius: 15px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.05rem, 4.3vw, 3.1rem); line-height: 1.07; letter-spacing: -.045em; }
h2 { font-size: 1.15rem; font-weight: 690; letter-spacing: -.02em; }
h3 { font-size: 1.08rem; font-weight: 680; line-height: 1.3; }
[hidden] { display: none !important; }
.loading { padding: 3rem; color: var(--muted); }

.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 27px 19px 21px;
  border-right: 1px solid #29302f;
  background: #161b1b;
}
.brand-link { display: block; width: max-content; margin: 0 0 42px 7px; }
.brand { display: inline-flex; align-items: center; gap: 11px; white-space: nowrap; font-size: 1.18rem; font-weight: 760; letter-spacing: -.05em; }
.brand-system { color: var(--gold); }
.brand-symbol {
  width: 36px; aspect-ratio: 1; display: grid; place-items: center;
  font-family: Georgia, serif; font-size: 1.42rem; color: #202018;
  border-radius: 10px; background: linear-gradient(145deg, #f4cc90, #c39148);
}
.nav-group { margin-bottom: 30px; }
.nav-label { padding-left: 11px; margin: 0 0 8px; color: #a6afa8; font-size: .76rem; font-weight: 660; text-transform: uppercase; letter-spacing: .08em; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 11px;
  margin-bottom: 3px; border: 1px solid transparent; border-radius: 9px; color: #aeb8b3; font-size: .91rem; font-weight: 620;
}
.nav-link:hover { background: #202827; color: #f7f3e8; }
.nav-link.selected { color: #f0c98c; background: #2c2a24; border-color: #463b29; }
.icon { display: inline-grid; place-items: center; min-width: 1.2em; color: inherit; font-size: 1.2em; line-height: 1; }
.sidebar-footer { margin-top: auto; padding-top: 17px; border-top: 1px solid #303836; }
.account { display: flex; gap: 10px; margin: 0 4px 15px; align-items: center; }
.avatar { flex: none; display: grid; width: 35px; aspect-ratio: 1; place-items: center; border-radius: 50%; background: #31483e; color: #d3e7d9; font-size: .83rem; font-weight: 720; }
.account strong, .account small { display: block; }
.account strong { font-size: .9rem; }
.account small { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.demo-choice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: .79rem; color: var(--muted); }
.demo-choice select { max-width: 108px; padding: 5px 6px; min-height: 32px; font-size: .8rem; }

.workspace { min-width: 0; }
.topbar { min-height: 67px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #252d2b; background: #151919; }
.breadcrumb, .topbar-meta { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: .88rem; }
.breadcrumb strong { color: #e9eae4; font-weight: 660; }
.connection { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #435047; border-radius: 7px; font-size: .8rem; white-space: nowrap; color: #e6ba7b; }
.connection::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.connection[data-online="true"] { color: #9bd2ae; background: #1c2c23; border-color: #31473a; }
.page { width: min(100%, 1440px); margin: 0 auto; padding: 29px 32px 45px; }
.hero {
  min-height: 253px; display: flex; align-items: center; padding: 33px 35px;
  border-radius: var(--radius); border: 1px solid #394638;
  background: linear-gradient(90deg, #192d24 0%, #172b22ee 28%, #172b2266 58%, #14221b12 100%),
    #1a2d25 url("/assets/club-table.png") center 53% / cover no-repeat;
}
.hero-content { max-width: 520px; }
.hero-location, .kicker { color: #c7d3c5; font-size: .84rem; line-height: 1.3; letter-spacing: .05em; font-weight: 650; }
.hero h1 { margin-top: 9px; font-size: clamp(2.65rem, 5.1vw, 4.55rem); }
.hero p { color: #d3dbd1; margin: 10px 0 19px; line-height: 1.48; }
.button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border: 1px solid #3b4542; border-radius: 8px; color: #e9ece6;
  background: #222a28; font-size: .89rem; font-weight: 650; line-height: 1.2;
}
.button:not(:disabled):hover { background: #2d3934; border-color: #667266; }
.button.primary { background: #eabd79; color: #221c13; border-color: #eabd79; }
.button.primary:not(:disabled):hover { background: #f4cc94; border-color: #f4cc94; }
.button.subtle { background: transparent; color: var(--muted); }
.button.small { font-size: .79rem; padding: 6px 8px; min-height: 33px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 17px 0 23px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.metric { min-height: 91px; padding: 13px 16px; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #aeb9b1; }
.metric-label .icon { color: var(--gold); }
.metric strong { display: block; margin-top: 6px; color: #f2f1e9; font-size: 1.68rem; font-weight: 740; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric small { display: block; color: var(--muted); }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 325px); align-items: start; gap: 19px; }
.page-rail { display: grid; gap: 15px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading h2 { font-size: 1.28rem; }
.tabs {
  display: inline-flex; gap: 4px; align-items: center; padding: 4px;
  border: 1px solid #303a36; border-radius: 9px; background: #171d1b; margin-bottom: 12px;
}
.tabs button { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 7px 11px; color: #aeb8b1; font-size: .86rem; font-weight: 650; }
.tabs button:hover { color: #f3f1e9; }
.tabs button[aria-pressed="true"] { background: #29372e; border-color: #3c4b40; color: #e6efe8; }
.game-list { display: grid; gap: 8px; }
.game-row {
  display: grid; grid-template-columns: 50px minmax(0, 1fr) 66px auto;
  gap: 12px; align-items: center; min-width: 0; min-height: 90px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.game-main { min-width: 0; }
.game-main h3 { overflow-wrap: anywhere; }
.suit-tile {
  width: 46px; height: 51px; display: grid; place-items: center;
  border-radius: 8px; background: #222d28; border: 1px solid #33463b; font-size: 1.44rem; color: #a9c7b4;
}
.suit-tile.bounty { border-color: #554431; background: #322a22; color: #e0b374; }
.suit-tile.mystery { border-color: #3d3a53; background: #282738; color: #bdb5e2; }
.suit-tile.big_bounty { border-color: #513732; background: #352625; color: #e6a693; }
.game-category { font-size: .79rem; color: #d9b57e; margin-bottom: 2px; }
.game-meta { color: #b2bcb4; font-size: .855rem; line-height: 1.4; margin-top: 3px; }
.game-meta span { color: #829187; padding: 0 2px; }
.game-capacity { color: #9eaaa0; font-size: .81rem; font-variant-numeric: tabular-nums; }
.game-capacity strong { color: #e6eee6; }
progress { display: block; width: 100%; height: 4px; margin: 5px 0 0; overflow: hidden; background: #344139; border: none; border-radius: 20px; }
progress::-webkit-progress-bar { background: #344139; }
progress::-webkit-progress-value { background: #9fbba2; }
progress::-moz-progress-bar { background: #9fbba2; }
.panel { padding: 16px; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.pill { display: inline-flex; align-items: center; width: max-content; min-height: 24px; padding: 3px 7px; border: 1px solid #524630; border-radius: 6px; color: #e3c798; background: #302a22; font-size: .76rem; font-weight: 620; white-space: nowrap; }
.pill.live { color: #a7ddb4; background: #24382c; border-color: #375843; }
.mini-board { background: linear-gradient(140deg, #242d27, #191f1e 60%); }
.mini-clock { margin-top: 12px; padding: 12px; border: 1px solid #35423b; border-radius: 10px; background: #151b18; text-align: center; }
.mini-clock p { color: #d9e1d7; font-weight: 640; font-size: .92rem; }
.mini-clock strong, .desk-clock-face strong {
  display: block; color: #f4e7ca; font-variant-numeric: tabular-nums; letter-spacing: -.052em; line-height: 1.12;
}
.mini-clock strong { margin: 4px 0; font-size: clamp(2.3rem, 4.2vw, 3.5rem); }
.mini-clock span { color: #a9b8ad; font-size: .82rem; }
.mini-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.mini-actions .button { flex: 1 0 auto; text-align: center; }
.text-link { color: var(--gold); font-size: .8rem; font-weight: 650; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.rank-row { display: grid; grid-template-columns: 23px 1fr auto; gap: 8px; align-items: center; font-size: .87rem; padding: 9px 0; border-bottom: 1px solid #303936; }
.rank-row:last-child { border: none; padding-bottom: 1px; }
.rank-row strong { overflow-wrap: anywhere; }
.rank-row small { color: #a5b3a7; }
.rank-number { color: var(--gold); font-weight: 710; }
.empty { color: #b6c0b7; text-align: center; padding: 24px 12px; border: 1px dashed #3e4841; border-radius: 9px; }
.panel .empty { margin-top: 13px; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 6px 0 22px; }
.page-heading p { color: var(--muted); margin-top: 8px; }
.page-heading .kicker { margin: 0 0 7px; color: var(--gold); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.template-card .icon { font-size: 1.5rem; color: var(--gold); }
.template-card h3 { margin: 13px 0 4px; }
.template-card p { color: var(--muted); font-size: .88rem; }
.template-heading { margin-top: 24px; }
.template-actions, .clock-actions, .row-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.template-actions { margin-top: 16px; }
.template-row { grid-template-columns: 50px minmax(0, 1fr) auto; }
.template-row .template-actions { margin-top: 0; justify-content: flex-end; }
.desk-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(258px, 1fr); gap: 13px; }
.desk-heading .compact { min-width: min(230px, 100%); }
.desk-clock-face { padding: 17px 15px; margin: 12px 0; border-radius: 10px; border: 1px solid #34443b; background: #151d18; text-align: center; }
.desk-clock-face span, .desk-clock-face p { color: #b4c6b7; font-size: .96rem; }
.desk-clock-face strong { font-size: clamp(3.1rem, 7vw, 6rem); }
.summary-stats { margin: 9px 0 14px; }
.summary-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #303936; }
.summary-stats span { color: var(--muted); font-size: .87rem; }
.summary-stats strong { font-size: .91rem; }
.roster-panel, .rating-panel { margin-top: 15px; }
.roster-panel .panel-top { margin-bottom: 12px; }
.rating-panel .panel-top { margin-bottom: 15px; }
.rating-panel .tabs { margin: 0; }
.period-control { display: flex; align-items: center; gap: 10px; }
.period-control strong { font-size: .92rem; }
.history-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.history-row time, .history-row small { color: var(--muted); }
.profile-metrics, .detail-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.achievement-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.achievement { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid #37423a; border-radius: 9px; padding: 9px; font-size: .88rem; }
.achievement > span:first-child { color: var(--gold); font-size: 1.2rem; }

.table-wrap { overflow: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; font-size: .89rem; }
thead th { font-size: .8rem; color: var(--muted); font-weight: 680; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.your-row { background: #27372e; }
td:last-child { min-width: max-content; }
td .row-controls { min-width: 160px; }
.inline-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.report-form .field { flex: 1 1 125px; }

.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-heading h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.modal-heading p { margin-top: 5px; color: var(--muted); font-size: .88rem; }
.modal-body { display: grid; }
.inline-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.game-detail-time { color: #cbd8ce; }
.description { color: #c0cec4; white-space: pre-wrap; }
.detail-metrics { margin: 0; gap: 8px; }
.detail-metrics .metric { padding: 9px 11px; min-height: 60px; }
.detail-metrics .metric strong { font-size: 1.1rem; }
.structure-details { padding: 10px; border: 1px solid #3a483f; border-radius: 9px; }
.structure-details summary { cursor: pointer; font-weight: 650; }
.structure-details p { color: var(--muted); padding: 8px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 5px; font-size: .88rem; color: #ccd9cf; min-width: 0; }
input, select, textarea {
  color: #eff1e9; background: #151c19; border: 1px solid #435047; border-radius: 7px;
  min-height: 39px; padding: 6px 8px; min-width: 0; max-width: 100%;
}
select { cursor: pointer; }
textarea { resize: vertical; }
.field input, .field select, .field textarea { width: 100%; }
.check { display: flex; align-items: center; gap: 7px; color: #c8d1c9; font-size: .88rem; }
.check input { min-height: 0; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 3px; }
.inline-error { color: #ffc5a8; }
.edit-table input { width: 100%; min-width: 56px; padding-inline: 5px; }
.edit-table th, .edit-table td { padding: 5px; }
.edit-table td .row-controls { min-width: 100px; }
.finish-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.finish-row input { width: 68px; }
.toast { position: fixed; z-index: 20; right: 20px; bottom: 20px; max-width: min(430px, calc(100% - 40px)); padding: 11px 13px; color: #e3f0e5; background: #253b2e; border: 1px solid #52735a; border-radius: 9px; box-shadow: 0 9px 25px #0006; }
.toast[data-error="true"] { background: #402a24; border-color: #7c5247; color: #ffe0cd; }


@media (max-width: 1180px) {
  .layout { grid-template-columns: 204px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .page, .topbar { padding-inline: 23px; }
  .columns { grid-template-columns: minmax(0, 1fr) minmax(240px, 285px); gap: 13px; }
  .game-row { gap: 8px; padding-inline: 10px; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 173px minmax(0, 1fr); }
  .brand { font-size: 1.04rem; gap: 8px; }
  .brand-symbol { width: 30px; }
  .sidebar { padding-inline: 11px; }
  .columns { grid-template-columns: 1fr; }
  .page-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-top { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 13px 9px; gap: 5px; border-right: 0; border-bottom: 1px solid #323c37; }
  .brand-link { margin: 0 0 4px; }
  .sidebar nav, .nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
  .nav-label { display: none; }
  .nav-link { margin: 0; min-height: 36px; padding: 5px 8px; gap: 4px; font-size: .83rem; }
  .sidebar-footer { padding: 0; border: 0; }
  .account { display: none; }
  .demo-choice { justify-content: flex-start; gap: 7px; }
  .topbar { min-height: 43px; padding-inline: 13px; }
  .topbar-date { display: none; }
  .page { padding: 13px 12px 32px; }
  .hero { min-height: 222px; padding: 20px; background-position: 64% center; }
  .hero h1 { font-size: 2.8rem; }
  .metrics { gap: 6px; margin: 12px 0 17px; }
  .metric { min-height: 72px; padding: 9px; }
  .metric-label { font-size: .78rem; gap: 4px; }
  .metric-label .icon { display: none; }
  .metric strong { font-size: 1.35rem; }
  .page-rail { grid-template-columns: 1fr; }
  .desk-heading, .roster-panel .panel-top { align-items: flex-start; flex-direction: column; }
  .template-row .template-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .profile-metrics, .detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 435px) {
  .game-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .suit-tile { width: 35px; height: 47px; }
  .game-capacity { display: none; }
  .game-row .button { padding-inline: 8px; }
  .game-row h3 { font-size: .97rem; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-panel .panel-top { align-items: flex-start; flex-direction: column; }
}
