:root {
  --green-900: #2b331a;
  --green-700: #3d4526;
  --green-600: #4e5b31;
  --green-400: #6f7d4a;
  --cream: #f5f2e6;
  --cream-dark: #e7e2cf;
  --ink: #23271a;
  --muted: #6b6f5d;
  --line: #d9d4c2;
  --white: #fffef8;
  --danger: #a3402d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43, 51, 26, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-600); }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--green-700);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand {
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 16px;
  margin-right: auto;
}
.logo-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.logo-chip img { width: 32px; height: 32px; display: block; }

.hero-logo {
  display: block;
  width: 128px;
  height: 128px;
  margin: 8px auto 6px;
}
.hero-logo.sm { width: 96px; height: 96px; }
.topbar a { color: var(--cream); text-decoration: none; opacity: 0.9; font-size: 14px; }
.topbar a:hover { opacity: 1; }
.topbar a.active { text-decoration: underline; text-underline-offset: 4px; opacity: 1; }

.wrap { max-width: 640px; margin: 0 auto; padding: 18px 16px 64px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

h1 { font-size: 22px; margin: 4px 0 2px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--green-700);
  background: var(--green-600);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--green-700); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: transparent; color: var(--green-700); }
.btn.secondary:hover { background: var(--cream-dark); }
.btn.block { width: 100%; }
.btn.big { padding: 15px 22px; font-size: 17px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

/* Leaderboard */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
}
.row:hover { border-color: var(--green-400); }
.row.mine { border-color: var(--green-600); background: #fbfaf2; }
.tagnum {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--green-600);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.tagnum.top { background: var(--green-600); color: var(--cream); }
.holder { flex: 1 1 auto; min-width: 0; }
.holder .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.holder .name.empty { color: var(--muted); font-weight: 500; font-style: italic; }
.held { flex: 0 0 auto; color: var(--muted); font-size: 13px; text-align: right; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-400); color: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: 0 0 auto;
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 700; color: var(--green-700); }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.notice { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin: 12px 0; }
.notice.ok { background: #eef3e0; color: var(--green-700); border: 1px solid #cddba9; }
.notice.err { background: #f6e7e2; color: var(--danger); border: 1px solid #e3c3ba; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: none; }
.timeline .tnum { font-weight: 700; color: var(--green-700); flex: 0 0 auto; width: 34px; }
.timeline .when { color: var(--muted); margin-left: auto; flex: 0 0 auto; font-size: 13px; }

.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
input, select {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--white); color: var(--ink);
}
label.field { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
