*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #0e1117;
  --panel: #121826;
  --card: #151d2f;
  --muted: #9aa5b1;
  --text: #e5e7eb;
  --accent: #6ee7b7;
  --accent-strong: #22d3ee;
  --border: #1f2937;
  --danger: #f43f5e;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(120% 120% at 0% 0%, #172033 0%, #0b0f17 45%, #0b0f17 100%),
    radial-gradient(90% 90% at 100% 0%, rgba(34, 211, 238, 0.15) 0%, rgba(34, 211, 238, 0) 55%);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-size: 17px;
  line-height: 1.5;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px max(16px, env(safe-area-inset-left)) 72px
    max(16px, env(safe-area-inset-right));
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 32px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.app-header.header-hidden {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

h1,
h2,
h3 {
  margin: 4px 0 8px;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 6px;
}

.muted {
  color: var(--muted);
  margin: 8px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 240px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.round-container {
  display: grid;
  gap: 12px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.field span {
  font-weight: 600;
}

.field p.eyebrow {
  margin-bottom: 0;
}

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

.toggles {
  gap: 10px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1423;
  color: var(--text);
  font-size: 1rem;
}

button {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  touch-action: manipulation;
  font-size: 1rem;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #062024;
  padding: 14px 18px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.25);
}

.start-button {
  width: 100%;
  min-height: 64px;
  font-size: 1.08rem;
}

.secondary {
  background: #11182a;
  color: var(--text);
  padding: 14px 18px;
  border: 1px solid var(--border);
}

.ghost {
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  border: 1px dashed var(--border);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #101726;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.pill-info {
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--accent-strong);
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.note {
  margin-top: 12px;
  padding: 14px;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: 12px;
  color: var(--text);
}

.message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.message-hidden {
  display: none;
}

.message-error {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
  color: #fecdd3;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 300px;
}

.imposter-card {
  background: #2a0f1d;
  border-color: #f43f5e;
  box-shadow: 0 16px 36px rgba(244, 63, 94, 0.35);
}

.card h3 {
  margin: 0 0 8px;
}

.role-badge {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1.02rem;
}

.detail-list li {
  background: #0f1724;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
}

.detail-list strong {
  color: var(--accent);
}

.highlight-word {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.highlight-clue {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fef3c7;
}

.role-imposter {
  color: #fda4af;
}

.role-crewmate {
  color: var(--accent);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stretch {
  width: 100%;
}

.ghost + .ghost {
  margin-left: 0;
}

.pill.ghost {
  padding: 6px 10px;
}

.is-hidden {
  display: none;
}

.focus-card:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.safe-area-hint {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.small {
  font-size: 0.95rem;
}

.role-title {
  font-size: 1.6rem;
  line-height: 1.3;
}

.big-action {
  min-height: 80px;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 14px;
}

.danger-text {
  color: #f87171;
  font-weight: 700;
}

.starter-result {
  font-size: 1.05rem;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pill-group {
    flex-wrap: wrap;
  }

  .panel {
    padding: 14px;
  }

  .card {
    padding: 14px;
  }

  .primary,
  .secondary,
  .ghost {
    min-height: 52px;
    font-size: 1rem;
  }

  .app-shell {
    padding-top: 24px;
    padding-bottom: 48px;
  }
}
