:root {
  --ink: #e8eef4;
  --muted: rgba(232, 238, 244, 0.62);
  --deep: #0e1a24;
  --panel: rgba(18, 32, 44, 0.82);
  --line: rgba(232, 238, 244, 0.12);
  --ember: #f0a04b;
  --ember-deep: #c4742a;
  --ice: #5ec8ff;
  --win: #3dd68c;
  --danger: #ff6b6b;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font-display: "Barlow Condensed", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(240, 160, 75, 0.22), transparent 42%),
    radial-gradient(ellipse at 88% 8%, rgba(94, 200, 255, 0.14), transparent 38%),
    linear-gradient(165deg, #0a1219 0%, #0e1a24 45%, #122433 100%);
  background-attachment: fixed;
  padding: 1.25rem 1rem 3rem;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.app {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.15rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.35rem 0.1rem 0.4rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 11vw, 4.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.88;
  text-transform: uppercase;
}

.brand span {
  color: var(--ember);
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36ch;
  margin-top: 0.45rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.sync-status {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.sync-status.ok {
  color: var(--win);
  border-color: rgba(61, 214, 140, 0.35);
}

.sync-status.warn {
  color: var(--ember);
  border-color: rgba(240, 160, 75, 0.4);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.admin-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--deep);
  background: var(--ice);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.hidden {
  display: none !important;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.stat-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  box-shadow: var(--shadow);
}

.stat-chip.accent {
  border-color: rgba(240, 160, 75, 0.45);
  background: linear-gradient(160deg, rgba(240, 160, 75, 0.18), rgba(18, 32, 44, 0.9));
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat-chip strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.2rem;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin-bottom: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.add-row input,
.log-form select,
.log-form input,
.goals-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.55);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  outline: none;
}

.add-row input:focus,
.log-form select:focus,
.log-form input:focus,
.goals-form input:focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(240, 160, 75, 0.2);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--ember);
  color: var(--deep);
}

.btn-primary:hover:not(:disabled) {
  background: #f5b56a;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.scope-select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  padding-right: 1.6rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.roster {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.roster li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.35);
}

.roster li.active {
  border-color: rgba(94, 200, 255, 0.35);
  background: rgba(94, 200, 255, 0.08);
}

.roster .name {
  flex: 1;
  font-weight: 600;
}

.roster .pts {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ember);
  font-weight: 700;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.toggle input {
  accent-color: var(--ice);
}

.log-form {
  display: grid;
  gap: 0.75rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.activity-btn {
  display: grid;
  gap: 0.15rem;
  place-items: center;
  padding: 0.85rem 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.activity-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(94, 200, 255, 0.45);
  background: rgba(94, 200, 255, 0.1);
}

.activity-btn.hot:hover:not(:disabled) {
  border-color: rgba(240, 160, 75, 0.55);
  background: rgba(240, 160, 75, 0.14);
}

.activity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.act-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.act-pts {
  font-size: 0.78rem;
  color: var(--ember);
  font-weight: 600;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.qty-row input {
  width: 5.5rem;
  text-align: center;
}

.goals {
  display: grid;
  gap: 0.75rem;
}

.goal-row {
  display: grid;
  gap: 0.35rem;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.goal-top strong {
  color: var(--ink);
}

.goal-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ice), var(--ember));
  transition: width 0.35s ease;
}

.goal-fill.done {
  background: var(--win);
}

.goals-edit {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.goals-edit summary {
  cursor: pointer;
  user-select: none;
}

.goals-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.goals-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.goals-form .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.leaderboard {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  counter-reset: rank;
}

.leaderboard li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.35);
}

.leaderboard li::before {
  content: "#" counter(rank);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 2.2rem;
}

.leaderboard li.podium-1 {
  border-color: rgba(240, 160, 75, 0.5);
  background: linear-gradient(120deg, rgba(240, 160, 75, 0.16), rgba(8, 14, 20, 0.4));
}

.leaderboard li.podium-1::before {
  color: var(--ember);
}

.leaderboard li.podium-2::before,
.leaderboard li.podium-3::before {
  color: var(--ice);
}

.lb-name {
  font-weight: 700;
}

.lb-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

.lb-score {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ember);
}

.feed {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  max-height: 420px;
  overflow: auto;
}

.feed li {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.3);
}

.feed .feed-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.feed .meta {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.feed .pts-pill {
  color: var(--ember);
  font-weight: 700;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.5rem 0.15rem;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0 1rem;
}

.site-footer a {
  color: var(--ice);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-sm {
  font-size: clamp(2.2rem, 8vw, 3.2rem);
}

.text-link {
  color: inherit;
  text-decoration: none;
}

.text-link:hover {
  color: var(--ember);
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.game-card {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.4);
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.game-card .hint {
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
}

.game-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge.official {
  color: var(--deep);
  background: var(--ember);
  border-color: transparent;
}

.badge.community {
  color: var(--ice);
  border-color: rgba(94, 200, 255, 0.4);
}

.badge.type {
  color: var(--ink);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter.active {
  border-color: var(--ember);
  color: var(--ember);
}

.how-list {
  margin-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.45rem;
}

.how-list li {
  padding-left: 0.25rem;
}

.add-form,
.setup-form {
  display: grid;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea,
.setup-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.55);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  outline: none;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(240, 160, 75, 0.2);
}

.add-extra {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.play-layout {
  display: grid;
  gap: 1rem;
}

.play-hud .hud-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.play-hud h2 {
  margin-bottom: 0;
}

.timer {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ice);
  line-height: 1;
}

.timer.urgent {
  color: var(--danger);
}

.rep-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.45);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.pill.active {
  border-color: var(--ember);
  background: rgba(240, 160, 75, 0.16);
  color: var(--ember);
}

.live-board {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  counter-reset: rank;
}

.live-board li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.35);
}

.live-board li::before {
  content: "#" counter(rank);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 2.2rem;
}

.live-board li.podium-1 {
  border-color: rgba(240, 160, 75, 0.5);
  background: linear-gradient(120deg, rgba(240, 160, 75, 0.16), rgba(8, 14, 20, 0.4));
}

.live-board li.podium-1::before {
  color: var(--ember);
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.bingo-cell {
  min-height: 4.2rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.5);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
}

.bingo-cell.marked {
  background: rgba(61, 214, 140, 0.22);
  border-color: rgba(61, 214, 140, 0.55);
  color: var(--win);
}

.bingo-cell:disabled {
  opacity: 0.85;
  cursor: default;
}

.boss-hp {
  margin-bottom: 0.9rem;
}

.boss-bar {
  height: 14px;
}

.objection-card {
  padding: 1.25rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(240, 160, 75, 0.35);
  background: linear-gradient(160deg, rgba(240, 160, 75, 0.12), rgba(8, 14, 20, 0.55));
  margin-bottom: 0.85rem;
  min-height: 8rem;
}

.objection-text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-top: 0.35rem;
}

.end-screen h2 {
  margin-bottom: 0.5rem;
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.setup-panel .btn {
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .hero-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .activity-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bingo-cell {
    min-height: 3.4rem;
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
