:root {
  --red: #d9262b;
  --red-dark: #b31e22;
  --ink: #2d2d2d;
  --muted: #6b6b6b;
  --line: #e6e2df;
  --bg: #faf8f7;
  --card: #ffffff;
  --ok: #1e8e3e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

header.app-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 28px;
  background: var(--card);
  border-bottom: 3px solid var(--red);
}

header.app-header img.logo { height: 44px; width: auto; }

header.app-header .titles h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

header.app-header .titles p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

.step-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.step-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 20px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.team-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.06s;
  position: relative;
}

.team-card:hover:not(:disabled) { border-color: var(--red); box-shadow: 0 2px 10px rgba(217, 38, 43, 0.12); }
.team-card:active:not(:disabled) { transform: scale(0.99); }
.team-card:disabled { opacity: 0.45; cursor: not-allowed; }

.team-card .t-name { font-weight: 700; font-size: 1.02rem; }
.team-card .t-idea { color: var(--red); font-size: 0.88rem; font-weight: 600; margin-top: 2px; }
.team-card .t-members { color: var(--muted); font-size: 0.78rem; margin-top: 8px; line-height: 1.45; }

.team-card.selected {
  border-color: var(--red);
  background: #fff5f5;
  box-shadow: 0 2px 10px rgba(217, 38, 43, 0.15);
}

.team-card .tick {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.team-card.selected .tick { display: flex; }

.own-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--bg);
}

.votebar {
  position: sticky;
  bottom: 0;
  margin-top: 26px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.06);
}

.votebar .count { font-weight: 700; }
.votebar .count .n { color: var(--red); font-size: 1.2rem; }

button.primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

button.primary:hover:not(:disabled) { background: var(--red-dark); }
button.primary:disabled { background: #d8cfcd; cursor: not-allowed; }

button.ghost {
  background: none;
  border: 2px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

button.ghost:hover { border-color: var(--ink); }

.banner {
  background: #fff7e6;
  border: 1px solid #f0d9a8;
  color: #7a5b13;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.banner.error { background: #fdecec; border-color: #f0b6b8; color: #8c1d20; }

.success-box {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  max-width: 560px;
  margin: 40px auto;
}

.success-box .big-tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.success-box h2 { margin-bottom: 8px; }
.success-box p { color: var(--muted); margin-bottom: 6px; }
.success-box .chosen { font-weight: 700; color: var(--ink); margin: 14px 0 24px; font-size: 1.05rem; }

.hidden { display: none !important; }

.backlink { margin-bottom: 18px; }
