:root {
  --bg: #f6f3ee;
  --dots: #e2d9cc;
  --card: #ffffff;
  --ink: #161412;
  --muted: #57534e;
  --faint: #78716c;
  --line: #e7dfd3;
  --field: #ffffff;
  --field-line: #d6cfc4;
  --btn: #161412;
  --btn-ink: #ffffff;
  --accent: #e8553d;
  --accent-soft: #fde8e3;
  --accent-ink: #b83b24;
  --ok-bg: #e6f6f3;
  --ok-ink: #1f7a6f;
  --lock-bg: #f1efec;
  --lock-ink: #57534e;
  --teal: #2a9d8f;
  --shadow: rgba(22, 20, 18, 0.3);
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #141210;
  --dots: #2a2623;
  --card: #1d1b18;
  --ink: #f5f1ea;
  --muted: #b9b1a5;
  --faint: #9c9489;
  --line: #37322c;
  --field: #141210;
  --field-line: #4a433b;
  --btn: #f5f1ea;
  --btn-ink: #141210;
  --accent-soft: rgba(255, 122, 92, 0.16);
  --accent-ink: #ffab95;
  --ok-bg: #1c3530;
  --ok-ink: #9fd9cf;
  --lock-bg: #2b2722;
  --lock-ink: #b9b1a5;
  --shadow: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 24px 24px;
}
button { font: inherit; cursor: pointer; transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; }
input, select, textarea {
  font: inherit;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
}
textarea { padding: 10px 14px; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 85, 61, 0.15); }
label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
p { margin: 0; line-height: 1.55; }
a { color: var(--accent-ink); }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 85%, transparent);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.who { font-size: 14px; color: var(--muted); }
.pill {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.container { max-width: 1100px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -22px var(--shadow); }
.card.link { text-decoration: none; color: inherit; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 14px; }
.faint { color: var(--faint); font-size: 13px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

.btn {
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { box-shadow: 0 10px 24px -10px var(--shadow); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--field-line); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

.chip { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--lock-bg); color: var(--lock-ink); }
.chip.free { background: var(--ok-bg); color: var(--ok-ink); }
.chip.mine { background: var(--accent-soft); color: var(--accent-ink); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 6px; }
.dot.pulse { animation: pulse 2s ease-out infinite; }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; }
.hidden { display: none !important; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding-top: 24px; }
.login-card { width: min(460px, 100%); align-items: center; text-align: center; padding: 36px; }
.login-card .btn { width: 100%; height: 52px; font-size: 16px; }

.progress { height: 10px; border-radius: 999px; background: var(--lock-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; transform-origin: left; animation: grow 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; }

.admin-box { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-box .wide { grid-column: 1 / -1; }
.invite { word-break: break-all; font-family: ui-monospace, monospace; font-size: 13px; padding: 12px; background: var(--lock-bg); border-radius: 10px; }

.rise { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.5); } 100% { box-shadow: 0 0 0 8px rgba(42, 157, 143, 0); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 720px) {
  .admin-box { grid-template-columns: 1fr; }
  .container { padding: 20px; }
}
