:root {
  --red: #d04f40;
  --ink: #111111;
  --muted: #5c5c5c;
  --line: #111111;
  --paper: #ffffff;
  --font: "Lato", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  font-synthesis: none;
}

.deco { position: fixed; pointer-events: none; z-index: 0; }
.deco-chevrons {
  right: 1.4rem;
  bottom: 1.3rem;
  width: 9.5rem;
  height: 1.6rem;
  color: var(--ink);
}
.deco svg { width: 100%; height: 100%; display: block; }

.nav {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.95rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1.5px solid var(--ink);
  background: var(--paper);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.nav-star {
  width: 0.92em;
  height: 0.92em;
  color: var(--red);
  flex-shrink: 0;
  display: block;
}
.nav-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.nav-right {
  justify-self: end;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}
.nav-avatar {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.logo-mark {
  width: 2.3rem;
  height: 2.3rem;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.logo-name {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  max-width: 11.5rem;
}

.stage {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.75rem 5rem;
}

.page-head { margin: 0 0 1.85rem; padding: 0.2rem 0 0.3rem; }
.page-head h1 {
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0;
}
.lede {
  max-width: 40rem;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 1.2rem;
}

.action {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 2.4rem;
  padding: 1.15rem 1.35rem 1.25rem;
  margin: 0 auto 1.75rem;
  max-width: 640px;
}
.action h2 {
  font-weight: 900;
  font-size: 1.35rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}
.action p { margin: 0 0 0.8rem; color: var(--muted); }
.action.quiet {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
  margin: 0 auto 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.action.quiet .err { margin: 0; }
.identity {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.identity-name {
  font-weight: 700;
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12.5rem;
}
.identity input[type="text"] {
  width: 12rem;
  padding: 0.35rem 0.85rem;
  font-size: 1.1rem;
}
.nav .identity button.small {
  padding: 0.35rem 0.8rem;
  font-size: 1rem;
}
.row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.row.name-row { align-items: flex-end; }
label.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
  min-width: 12rem;
}
input[type="text"],
input[type="password"],
input[type="number"] {
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
}
input:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(208, 79, 64, 0.28);
}
textarea {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 1rem;
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
  line-height: 1.4;
}

button, .btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 0.38rem 0.38rem 0.38rem 1.1rem;
  border-radius: 999px;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
}
button::after, .btn::after {
  content: "";
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.2 2.2 9 6l-4.8 3.8' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.55rem no-repeat;
  flex-shrink: 0;
}
button:hover, .btn:hover { background: #f7f7f7; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.ghost, .btn.ghost {
  background: transparent;
  padding: 0.55rem 1rem;
}
button.ghost::after, .btn.ghost::after,
button.small::after, button.danger::after { content: none; width: 0; height: 0; }
button.gold { background: #fff; color: var(--ink); font-weight: 400; }
button.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  padding: 0.55rem 1rem;
}
button.small {
  padding: 0.4rem 0.85rem;
  font-size: 0.88rem;
}

.progress {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.err { color: var(--red); margin: 0.4rem 0 0; font-size: 0.92rem; font-weight: 700; }
.ok { color: var(--ink); font-weight: 700; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}

.download {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 1.85rem;
  padding: 1.15rem 1.25rem 1.3rem;
  margin: 1.75rem 0 0;
  max-width: 640px;
}
.download h2 {
  font-weight: 900;
  font-size: 1.35rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}
.download p { margin: 0 0 0.85rem; color: var(--muted); }

.card {
  position: relative;
  background: #fff;
  color: var(--ink);
  border-radius: 1.85rem;
  padding: 1.2rem 1.25rem 1.25rem;
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1.5px solid var(--ink);
}
.card.mine { box-shadow: inset 5px 0 0 var(--red); }
.card.dim { opacity: 0.55; }
.card h3 {
  font-weight: 900;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.meta {
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card-desc {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.4;
}
.card-roster {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card-roster.ruled {
  padding-top: 0.75rem;
  border-top: 1.5px solid var(--ink);
}
.members {
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
}
.members li {
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  padding: 0;
}
.members li::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
}
.members li.you::before { background: var(--red); }

.stamp {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: grid;
  place-items: center;
  transform: none;
  border: 0;
  padding: 0;
}
.stamp.place-1 { background: var(--red); }
.stamp.place-2 { background: #111; }
.stamp.place-3 { background: #111; }
.score {
  margin-top: auto;
  font-weight: 900;
  font-size: 1.15rem;
}

.vote-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.vote-btns button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.admin-controls {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 1.85rem;
  padding: 1.15rem 1.25rem 1.3rem;
  margin-bottom: 1.25rem;
}
.admin-controls h2 {
  font-weight: 900;
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.proj-block { margin-bottom: 0.85rem; }
.proj-edit {
  display: grid;
  grid-template-columns: 1fr 5.5rem auto;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  align-items: center;
}
.hint { color: var(--muted); font-size: 0.88rem; margin: 0.5rem 0 0; }

.roster {
  margin-top: 2rem;
  border: 1.5px solid var(--ink);
  border-radius: 1.85rem;
  padding: 1rem 1.15rem;
}
.roster h2 { font-weight: 900; margin: 0 0 0.6rem; font-size: 1.2rem; }
.roster table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.roster th, .roster td {
  text-align: left;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid #e6e6e6;
}
.roster th { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }

@media (max-width: 720px) {
  .deco-chevrons { width: 6.5rem; }
  .logo-name { display: none; }
  .nav-title { font-size: 1.22rem; }
  .identity-name { max-width: 8rem; }
}
@media (max-width: 560px) {
  .proj-edit { grid-template-columns: 1fr 1fr; }
  .proj-edit button { grid-column: 1 / -1; }
}
