:root {
  --bg: #EAEFE8; --panel: #FFFFFF; --panel-2: #F3F7F1; --ink: #0E1A16;
  --ink-2: #566860; --ink-3: #8A9A92; --line: #E0E7DD; --volt: #A9DC04;
  --volt-ink: #16200A; --teal: #0C8C7E; --coral: #FF6A3D;
  --shadow: 0 1px 2px rgba(14,26,22,.06), 0 8px 24px rgba(14,26,22,.08);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #091411; --panel: #11211B; --panel-2: #16271F; --ink: #EAF2EC;
    --ink-2: #93A99E; --ink-3: #647A6F; --line: #223029; --volt: #BFF23A;
    --volt-ink: #10180A; --teal: #2CBEAB; --coral: #FF7A52;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); -webkit-font-smoothing: antialiased; line-height: 1.5;
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
}
.hidden { display: none !important; }

.appbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--bg);
  padding-top: calc(14px + env(safe-area-inset-top));
}
.appbar .title { font-weight: 800; font-size: 18px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.appbar .spacer { flex: 1; }
.back { background: none; border: 0; font-size: 26px; color: var(--ink-3); cursor: pointer; line-height: 1; padding: 0 4px 4px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 12px;
  background: linear-gradient(135deg, var(--teal), #1aa);
}
.ball {
  width: 18px; height: 18px; border-radius: 50%; background: var(--volt);
  display: inline-block; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--volt-ink) 25%, transparent);
}

.view { padding: 4px 16px 16px; max-width: 560px; margin: 0 auto; }
.loading { color: var(--ink-3); text-align: center; padding: 40px 0; }
.err { color: var(--coral); text-align: center; padding: 28px 0; }
.empty { color: var(--ink-3); text-align: center; padding: 40px 0; }

.seg {
  display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; margin-bottom: 14px;
}
.seg button {
  flex: 1; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 7px 0; border-radius: 9px;
}
.seg button.on { background: var(--volt); color: var(--volt-ink); }

.daylbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 10px 2px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card .top { display: flex; align-items: flex-start; gap: 12px; }
.time { text-align: center; flex: none; }
.time .hh { font-size: 22px; font-weight: 820; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.time .dur { font-size: 11px; color: var(--ink-2); margin-top: 3px; font-weight: 600; }
.vrule { width: 1px; align-self: stretch; background: var(--line); }
.cinfo { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.chip.club { background: var(--teal); color: #fff; }
.chip.wait { background: color-mix(in srgb, var(--coral) 18%, transparent); color: var(--coral); }
.loc { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; }
.roster { display: flex; align-items: center; gap: -6px; }
.ava {
  width: 26px; height: 26px; border-radius: 50%; margin-right: -6px;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 10px;
  border: 2px solid var(--panel); background: linear-gradient(135deg, var(--teal), #1aa);
}
.roster .count { margin-left: 12px; font-size: 13px; font-weight: 700; }
.roster .count.full { color: var(--coral); }
.slot {
  width: 26px; height: 26px; border-radius: 50%; margin-right: -6px;
  display: grid; place-items: center; border: 2px dashed var(--line); color: var(--ink-3);
  background: var(--panel); font-weight: 700;
}

.btn {
  width: 100%; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 750; font-size: 14px; padding: 12px 0; margin-top: 10px;
}
.btn.primary { background: var(--volt); color: var(--volt-ink); }
.btn.coral { background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); }
.btn.ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--coral); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }

/* detail */
.hero-game { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.hero-game .big { font-size: 20px; font-weight: 820; letter-spacing: -.02em; margin: 6px 0 2px; }
.hero-game .sub { color: var(--ink-2); font-size: 13.5px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; margin-top: 10px; }
.kv:first-of-type { margin-top: 12px; }
.prow { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 0; }
.prow .role { margin-left: auto; font-size: 12px; color: var(--teal); font-weight: 700; }
.prow.empty { color: var(--ink-3); }

/* form */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
.field textarea { resize: vertical; min-height: 64px; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice button {
  flex: 1; min-width: 60px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 9px 0; border-radius: 10px;
}
.choice button.on { background: var(--volt); color: var(--volt-ink); border-color: transparent; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 20;
  border: 0; cursor: pointer; font: inherit; font-weight: 750; font-size: 14px;
  background: var(--teal); color: #fff; padding: 13px 22px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(12,140,126,.35);
}

.toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; z-index: 30; box-shadow: var(--shadow);
}

.stat3 { display: flex; gap: 9px; margin: 14px 0; }
.stat3 .s { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.stat3 .s .v { font-size: 20px; font-weight: 820; }
.stat3 .s .l { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.prof-head { display: flex; align-items: center; gap: 13px; margin-bottom: 4px; }
.prof-head .nm { font-size: 18px; font-weight: 800; }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; background: var(--panel);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: 0; background: none; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 7px; color: var(--ink-3);
}
.tab__ico { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .55; }
.tab__lbl { font-size: 11px; font-weight: 600; }
.tab.on { color: var(--teal); }
.tab.on .tab__ico { filter: none; opacity: 1; }

/* game description note */
.note {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-top: 12px; font-size: 14px; color: var(--ink-2);
  white-space: pre-wrap;
}

/* players list */
.plist { margin-top: 6px; }
.prow.link { cursor: pointer; }
.prow .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pcount { font-size: 13px; color: var(--ink-3); font-weight: 600; flex: none; }

/* profile edit */
.prof-head .editbtn {
  margin-left: auto; border: 0; background: var(--panel-2); cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px;
  display: grid; place-items: center;
}
