/* Tai Kun shared look (hub + city). The match board (game.html) has its own copy of these tokens. */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@500;700;800&display=swap');
:root {
  --night: #1f2a5a; --paper: #fff7e8; --paper-2: #f3e6cc; --ink: #1c2247; --ink-soft: #5a6088;
  --mango: #ffb627; --coral: #ff5e5b; --leaf: #7bc950; --sky: #3fa7d6; --grass: #3f9b63; --grass-gap: #2c7a4b;
  --road: #626b8c; --wood: #c4813f; --wood-dark: #7a4419;
  --display: 'Baloo 2', ui-rounded, system-ui, sans-serif; --body: 'Nunito', ui-rounded, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; font-family: var(--body); color: var(--paper);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 182, 39, .16), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(255, 94, 91, .12), transparent 60%),
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, .07) 1.5px, transparent 0) 0 0 / 26px 26px,
    var(--night);
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: #ffd27a; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--mango); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); transform: rotate(-6deg); }
.brand h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; }
.brand p { margin: 2px 0 0; font-size: 13px; color: #c5cbef; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 2px solid rgba(255, 255, 255, .14); font-weight: 800; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 12px; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.1; text-decoration: none;
  background: var(--mango); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--paper); }
.btn.danger { background: var(--coral); color: #fff; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 13px 18px; font-size: 19px; border-radius: 16px; box-shadow: 0 5px 0 var(--ink); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.topbar .btn.ghost { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, .35); box-shadow: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 4px 24px 48px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.panel { background: var(--paper); color: var(--ink); border-radius: 20px; padding: 16px 18px; border: 3px solid var(--ink); box-shadow: 0 5px 0 rgba(10, 14, 40, .55); }
.panel h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.panel h3 { margin: 14px 0 6px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.panel-h h2 { margin: 0; }
.muted { color: var(--ink-soft); font-size: 14px; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
label { font-size: 13px; font-weight: 800; color: var(--ink-soft); display: flex; flex-direction: column; gap: 4px; }
input, select, textarea { background: #fff; color: var(--ink); border: 2px solid #d9c9a8; border-radius: 10px; padding: 8px 10px; font-size: 15px; font-weight: 700; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
.big-num { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat small { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 14px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed #e0cfab; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; font-family: var(--display); font-size: 16px; line-height: 1.15; }
.list-item small { color: var(--ink-soft); font-weight: 700; font-size: 12px; }
.av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; background: #fff; border: 3px solid var(--pc, var(--mango)); }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink); }
.tag.green { background: #d8f2c4; color: #2f6b14; }
.tag.red { background: #ffd9d6; color: #a3221f; }
.error { color: #c0302c; font-weight: 800; font-size: 14px; min-height: 18px; margin: 6px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px dashed #e0cfab; vertical-align: middle; }
th { font-size: 12px; color: var(--ink-soft); }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 16px; background: var(--ink); color: var(--paper); border: 2px solid rgba(255, 255, 255, .18); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); font-weight: 700; font-size: 14px; }
.toast span { font-size: 20px; }

.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(14, 18, 48, .62); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(100%, 680px); max-height: 88vh; overflow: auto; }

@media (max-width: 600px) { .wrap { padding: 4px 12px 40px; } .topbar { padding: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
