:root {
  color-scheme: light;
  --bg: #f4f0e7;
  --ink: #18231f;
  --muted: #66736c;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(24, 35, 31, 0.13);
  --green: #0c7a6e;
  --green-2: #075f56;
  --gold: #e3aa35;
  --blue: #1d71d4;
  --red: #d94a4a;
  --shadow: 0 18px 60px rgba(16, 24, 20, 0.16);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121715;
  --ink: #f2f2ed;
  --muted: #abb7b1;
  --panel: rgba(25, 33, 30, 0.86);
  --line: rgba(255, 255, 255, 0.13);
  --green: #18a897;
  --green-2: #11796e;
  --gold: #f0bf57;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 20% 12%, rgba(227, 170, 53, 0.28), transparent 30rem),
    linear-gradient(135deg, rgba(12, 122, 110, 0.12), transparent 42rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#app {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  position: relative;
}

.home {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.home-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0.16;
}

.home-art i {
  font-size: min(76vw, 430px);
}

.brand {
  position: relative;
  text-align: center;
  display: grid;
  gap: 20px;
  justify-items: center;
}

.logo-mark {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--green), var(--green-2));
  color: #fff;
  box-shadow: 0 18px 50px rgba(12, 122, 110, 0.32);
  border: 4px solid color-mix(in srgb, var(--gold) 78%, white);
}

.logo-mark .fa-earth-africa {
  font-size: 4.9rem;
}

.logo-mark .fa-users,
.logo-mark .fa-bolt {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #18231f;
  background: var(--gold);
  border: 3px solid var(--bg);
}

.logo-mark .fa-users {
  width: 44px;
  height: 44px;
  right: 2px;
  bottom: 12px;
  font-size: 1.32rem;
}

.logo-mark .fa-bolt {
  width: 36px;
  height: 36px;
  left: 8px;
  top: 13px;
  font-size: 1.18rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(4rem, 20vw, 9rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.8rem, 8vw, 3.2rem);
  line-height: 1;
}

h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle {
  color: var(--muted);
  font-weight: 650;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.icon-btn i {
  font-size: 1.18rem;
}

.top-right {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 5;
}

.bottom-right {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 5;
}

.primary,
.secondary,
.danger {
  min-height: 54px;
  border-radius: 8px;
  padding: 0 22px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 16px 36px rgba(12, 122, 110, 0.28);
}

.primary.big {
  min-width: min(78vw, 330px);
  min-height: 72px;
  font-size: 1.35rem;
}

.secondary.big {
  min-width: min(78vw, 330px);
  min-height: 62px;
  font-size: 1.05rem;
}

.home-actions {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger {
  background: var(--red);
  color: white;
}

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.bar h2 {
  flex: 1;
}

.wrap {
  width: min(100%, 980px);
  margin: 0 auto;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.toggle-row,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.switch {
  width: 62px;
  height: 34px;
  border-radius: 999px;
  padding: 4px;
  background: var(--line);
}

.switch span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  transition: transform 160ms ease;
}

[data-theme="dark"] .switch span {
  transform: translateX(28px);
  background: var(--green);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 56px;
}

.chip,
.person {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 800;
}

.person.selected {
  outline: 3px solid var(--gold);
}

.person.done {
  background: color-mix(in srgb, var(--green) 18%, var(--panel));
}

.person.filling {
  background: color-mix(in srgb, var(--gold) 22%, var(--panel));
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent);
}

.ok {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.72rem;
}

.team {
  min-height: 180px;
  border-top: 7px solid var(--blue);
}

.team.red {
  border-top-color: var(--red);
}

.code {
  position: fixed;
  left: 14px;
  top: max(14px, env(safe-area-inset-top));
  z-index: 6;
  min-width: 58px;
  min-height: 48px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 950;
}

.players-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.center-bottom {
  position: sticky;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  margin-top: 18px;
}

.timer {
  text-align: center;
  font-size: clamp(2.4rem, 13vw, 5rem);
  font-weight: 950;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.word {
  min-height: 42vh;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: clamp(3rem, 17vw, 8rem);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.scoreline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.score {
  border-radius: 8px;
  padding: 14px;
  color: white;
  font-weight: 900;
}

.score.blue {
  background: var(--blue);
}

.score.red {
  background: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(100%, 430px);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 680px) {
  .grid.two,
  .scoreline {
    grid-template-columns: 1fr;
  }

  .screen {
    padding-inline: 14px;
  }

  .team {
    min-height: 132px;
  }
}
