/* A plain first client for the game server. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c2330;
  --muted: #6b7484;
  --line: #e2e5ea;
  --accent: #1f6f50;
  --accent-text: #ffffff;
  --bad: #b3261e;
  --row: #f1f3f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --panel: #1a2029;
    --text: #e6e9ee;
    --muted: #97a0ad;
    --line: #2c3440;
    --accent: #3fa57a;
    --accent-text: #0d1a14;
    --bad: #f2867f;
    --row: #212833;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

header a { color: var(--text); text-decoration: none; }
.brand { font-weight: 700; }
nav a { color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }

h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

button, input, select {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
}

button { cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
input[type=number] { width: 64px; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 4px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child, th.left, td.left { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tbody tr:nth-child(even) { background: var(--row); }
table.compact { width: auto; }
td.muted { opacity: .45; }

.tag { font-size: 12px; padding: 1px 6px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.tag.tired { color: var(--bad); border-color: var(--bad); }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 6px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
#toast.show { opacity: 1; }
#toast.bad { background: var(--bad); color: #fff; }
.panel > h2:first-child { margin-top: 0; }

.signin { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.signin button { min-width: 220px; padding: 9px 14px; font-weight: 600; border: none; }
button.kakao { background: #FEE500; color: #191919; }
button.naver { background: #03C75A; color: #fff; }
details.panel > summary { cursor: pointer; color: var(--muted); }
details.panel[open] > summary { margin-bottom: 8px; }
