@font-face { font-family: "Open Sans"; src: url("/fonts/OpenSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("/fonts/OpenSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("/fonts/OpenSans-Bold.ttf") format("truetype"); font-weight: 700 900; font-style: normal; font-display: swap; }
:root {
  color-scheme: light;
  --forest: #0b2b22;
  --forest-2: #12372c;
  --forest-3: #1d493b;
  --milk: #f4efe4;
  --paper: #fffdf8;
  --ink: #18241f;
  --muted: #66736c;
  --sage: #b9c8bd;
  --line: #dcd7cb;
  --gold: #c6a15b;
  --gold-dark: #9d7938;
  --danger: #9c3e38;
  --success: #297157;
  --radius: 18px;
  --shadow: 0 12px 36px rgba(8, 28, 22, .12);
  font-family: "Open Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--milk); color: var(--ink); }
body { font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(198,161,91,.48); outline-offset: 2px; }
.app { min-height: 100vh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 70px; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: white; background: var(--forest);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand > div { min-width: 0; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(198,161,91,.72), 0 6px 18px rgba(0,0,0,.2); }
.brand-title { font: 700 17px/1.1 "Open Sans", Arial, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--sage); font-size: 11px; margin-top: 3px; letter-spacing: .06em; text-transform: uppercase; }
.mode-switch { min-height: 38px; display: flex; align-items: center; padding: 7px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 11px; color: white; background: transparent; font-size: 12px; font-weight: 700; }
.mode-switch:active { background: rgba(255,255,255,.08); }
.hero { color: white; background: var(--forest); padding: 24px 20px 28px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 220px; height: 110px; right: -55px; bottom: -34px; border: 1px solid rgba(198,161,91,.18); border-radius: 50%; transform: rotate(-20deg); }
.eyeline { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--sage); font-size: 13px; }
h1 { font: 700 clamp(29px, 8vw, 48px)/1.08 "Open Sans", Arial, sans-serif; letter-spacing: -.035em; margin: 10px 0 12px; max-width: 700px; }
.hero-meta { color: #dfe6e1; font-size: 14px; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: #dbe8df; }
.status-dot::before { content: ""; width: 8px; height: 8px; background: #70bf91; border-radius: 50%; box-shadow: 0 0 0 4px rgba(112,191,145,.14); }
.page { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }
.section { margin-bottom: 26px; }
.section-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; margin: 0 2px 13px; }
.section-head h2 { margin: 0; font: 700 23px/1.1 "Open Sans", Arial, sans-serif; letter-spacing: -.02em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.link-btn { color: var(--forest); border: 0; background: none; padding: 6px 0; font-weight: 800; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary { padding: 18px; display: grid; gap: 17px; }
.summary-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.round-number { font: 700 24px "Open Sans", Arial, sans-serif; }
.summary-meta { color: var(--muted); margin-top: 4px; }
.progress { height: 5px; background: #e6e2d8; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
.btn { min-height: 48px; border: 1px solid var(--forest); border-radius: 13px; padding: 11px 15px; font-weight: 800; background: transparent; color: var(--forest); transition: transform .12s, background .12s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--gold); color: #1f281f; border-color: var(--gold); }
.btn.dark { background: var(--forest); color: white; }
.btn.soft { border-color: var(--line); background: var(--paper); }
.btn.danger { color: var(--danger); border-color: #d8aaa6; }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.auto-next { min-height: 58px; border: 1px solid #b8cdbf; border-radius: 13px; padding: 10px 13px; background: #edf7f1; color: var(--forest); display: grid; align-content: center; }
.auto-next b { font-size: 13px; }
.auto-next span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.toolbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.filter { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 8px 13px; font-size: 13px; white-space: nowrap; font-weight: 700; }
.filter.active { background: var(--forest); border-color: var(--forest); color: white; }
.match-list { border-top: 1px solid var(--line); }
.match-row { display: grid; grid-template-columns: 49px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.match-row:last-child { border-bottom: 0; }
.table-no { width: 47px; height: 47px; border-radius: 13px; background: var(--forest); color: white; display: grid; place-items: center; }
.table-no strong { font: 700 21px/1 "Open Sans", Arial, sans-serif; }
.table-no small { font-size: 8px; text-transform: uppercase; color: var(--sage); letter-spacing: .07em; }
.match-main { min-width: 0; }
.player-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 750; }
.player-line + .player-line { margin-top: 4px; }
.player-line span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target { color: var(--gold-dark); font-size: 12px; white-space: nowrap; }
.match-note { margin-top: 7px; color: var(--muted); font-size: 12px; }
.match-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.state { font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.state.submitted { color: var(--gold-dark); }
.state.confirmed { color: var(--success); }
.score { font: 700 22px "Open Sans", Arial, sans-serif; color: var(--forest); }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--forest); display: grid; place-items: center; font-weight: 900; }
.score-action { min-height: 38px; border: 0; border-radius: 10px; padding: 8px 11px; color: white; background: var(--forest); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pending-row { background: #fbf4e3; }
.confirm { background: var(--success); border: 0; color: white; border-radius: 10px; padding: 9px 11px; font-weight: 850; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stat { padding: 15px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 700 21px "Open Sans", Arial, sans-serif; }
.stat span { color: var(--muted); font-size: 11px; }
.participant { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.participant:last-child { border-bottom: 0; }
.avatar { width: 42px; height: 42px; border-radius: 50%; color: var(--forest); background: #e5e9df; display: grid; place-items: center; font: 700 15px "Open Sans", Arial, sans-serif; }
.participant-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.arrival { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 8px 10px; font-weight: 800; color: var(--muted); }
.arrival.arrived { color: var(--success); border-color: #a8cabc; background: #edf7f1; }
.participant-actions { display: flex; align-items: center; gap: 6px; }
.edit-player { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--forest); font-weight: 900; }
.participant-add-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.table-wrap { overflow-x: auto; }
.table-hint { display: none; margin: -5px 2px 10px; color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; font-size: 13px; }
th { padding: 11px 10px; text-align: right; background: var(--forest); color: var(--sage); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; }
tr:last-child td { border-bottom: 0; }
.rank { font: 700 17px "Open Sans", Arial, sans-serif; color: var(--gold-dark); }
.player-cell { font-weight: 800; }
.points { font-weight: 900; color: var(--forest); }
.podium { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.podium-item { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.podium-item:first-child { grid-column: 1 / -1; color: white; background: var(--forest); border-color: var(--forest); }
.podium-place { color: var(--gold); font: 700 13px "Open Sans", Arial, sans-serif; }
.podium-name { font: 700 20px "Open Sans", Arial, sans-serif; margin-top: 5px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; min-height: calc(68px + env(safe-area-inset-bottom)); padding: 7px 7px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5,1fr); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.nav-btn { border: 0; background: none; color: var(--muted); padding: 7px 2px; border-radius: 10px; font-size: 10px; font-weight: 750; display: grid; gap: 3px; place-items: center; }
.nav-btn span:first-child { font-size: 19px; line-height: 1; }
.nav-btn.active { color: var(--forest); background: #e9e9df; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font: 700 20px "Open Sans", Arial, sans-serif; margin-bottom: 6px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 800; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); padding: 11px 12px; outline: none; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.16); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(4,18,14,.68); display: grid; align-items: end; }
.modal { width: 100%; max-height: 91vh; overflow-y: auto; background: var(--milk); border-radius: 24px 24px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.modal h2 { margin: 0; font: 700 25px "Open Sans", Arial, sans-serif; }
.modal-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.set-grid { display: grid; grid-template-columns: minmax(0,1fr) 56px 15px 56px; gap: 7px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.set-grid input { width: 56px; height: 48px; text-align: center; border: 1px solid var(--line); border-radius: 11px; font-weight: 900; font-size: 18px; }
.score-head { padding-top: 2px; color: var(--muted); font-size: 10px; }
.score-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.notice { border-left: 3px solid var(--gold); padding: 12px 14px; background: #fbf4e3; color: #5f4c29; border-radius: 0 12px 12px 0; font-size: 13px; }
.export-box { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: white; white-space: pre-wrap; font-family: inherit; min-height: 140px; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 15px); background: var(--forest); color: white; border: 1px solid rgba(255,255,255,.15); box-shadow: var(--shadow); border-radius: 12px; padding: 11px 15px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 28px); text-align: center; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.public-banner { padding: 10px 16px; text-align: center; color: #59471f; background: #e9d7ad; font-size: 12px; font-weight: 800; }
.more-list button { width: 100%; min-height: 56px; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); color: var(--ink); text-align: left; padding: 13px 16px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.more-list button:last-child { border-bottom: 0; }
.backup-note { color: var(--muted); font-size: 12px; margin-top: 12px; }
.bulk-names { min-height: 210px !important; }
.checkbox { display: flex; align-items: center; gap: 10px; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--forest); }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--forest); color: white; }
.boot-logo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(198,161,91,.72), 0 14px 34px rgba(0,0,0,.3); }
.boot p { color: var(--sage); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: var(--forest); }
.login-panel { width: min(100%, 430px); background: var(--milk); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.login-logo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(198,161,91,.62), 0 10px 24px rgba(11,43,34,.2); }
.login-brand-title { color: var(--forest); font: 700 20px/1.1 "Open Sans", Arial, sans-serif; }
.login-brand-sub { margin-top: 5px; color: var(--gold-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-panel h1 { color: var(--forest); font-size: 34px; margin-bottom: 10px; }
.login-panel p { color: var(--muted); margin: 0 0 24px; }
.sync-line { display: inline-flex; align-items: center; gap: 6px; color: var(--sage); font-size: 11px; }
.sync-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #70bf91; }
.admin-link { color: var(--sage); font-size: 12px; text-decoration: none; border-bottom: 1px solid rgba(185,200,189,.4); }
.public-top-actions { display: flex; align-items: center; gap: 12px; }
.error-page { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 20px; }
.error-page h1 { color: var(--forest); }
.danger-zone { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pending-count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--gold); color: var(--forest); font-size: 11px; font-weight: 900; }
.search { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); padding: 10px 13px; margin-bottom: 12px; }
.public-help { color: var(--muted); font-size: 13px; margin: -4px 2px 14px; }
.offline { background: #9c3e38; color: white; text-align: center; padding: 7px 12px; font-size: 12px; font-weight: 800; }
@media (min-width: 700px) {
  .topbar { padding-inline: 28px; }
  .hero { padding: 40px max(28px, calc((100vw - 1088px)/2)); }
  .page { padding: 28px 24px 60px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 22px; align-items: start; }
  .bottom-nav { left: 50%; right: auto; width: min(680px, calc(100% - 30px)); transform: translateX(-50%); bottom: 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding-bottom: 7px; }
  .modal-backdrop { align-items: center; justify-items: center; padding: 20px; }
  .modal { max-width: 620px; border-radius: 22px; padding: 24px; }
  .podium { grid-template-columns: repeat(3,1fr); }
  .podium-item:first-child { grid-column: auto; }
}
@media (max-width: 380px) {
  .brand-sub { display: none; }
  .mode-switch button { padding: 8px 7px; }
  .match-row { grid-template-columns: 43px minmax(0,1fr) auto; gap: 9px; padding-inline: 12px; }
  .table-no { width: 43px; height: 43px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .public-top-actions { gap: 9px; }
  .public-top-actions .sync-line { width: 8px; min-width: 8px; gap: 0; overflow: hidden; font-size: 0; }
  .public-top-actions .sync-line::before { width: 8px; height: 8px; flex: 0 0 auto; }
  .mode-public .match-row { grid-template-columns: 43px minmax(0,1fr); }
  .mode-public .match-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .participant-heading { align-items: flex-start; flex-direction: column; }
  .participant-add-actions { justify-content: flex-start; }
  .participant.player-admin { grid-template-columns: 42px minmax(0,1fr); }
  .participant.player-admin > :last-child { grid-column: 2; justify-self: stretch; }
  .participant-actions .arrival { flex: 1; }
  .table-hint { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
