:root {
  color-scheme: light;
  --bg-primary: #f2f2f5;
  --bg-secondary: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.45);
  --card-radius: 26px;
  --card-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --card-shadow-strong: 0 20px 50px rgba(15, 23, 42, 0.12);
  --text-primary: #1f2933;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --pill-bg: #eeeeef;
  --pill-active: #111111;
  --pill-text-active: #ffffff;
  --pill-text: #303030;
  --cta-primary: #c9ff2e;
  --cta-primary-text: #101010;
  --cta-secondary: #ffe033;
  --cta-secondary-text: #101010;
  --promo-bg: #fff5d8;
  --promo-border: #f9d87a;
  --switch-off: #d1d5db;
  --switch-on: #111111;
  --danger: #ff3b5c;
  --dark: #0f172a;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.app-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 24px) + 12px) 20px 160px;
}

.hero-area {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hero-spacer {
  width: 44px;
  height: 44px;
}

.hero-title {
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #4b5563;
}

.hero-line {
  display: block;
  font-size: clamp(34px, 8vw, 48px);
}

.hero-line.accent {
  font-size: clamp(38px, 9vw, 54px);
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.icon-button.subtle {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.icon-button.subtle:hover,
.icon-button.ghost:hover {
  transform: scale(1.05);
}

.icon-button.ghost {
  width: 40px;
  height: 40px;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.icon-question::before {
  content: '?';
  font-weight: 700;
  font-size: 20px;
}

.content-scroll {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #8b8f97;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-emoji {
  font-size: 18px;
}

.card-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.card-button {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  color: inherit;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 16px;
  background: var(--pill-bg);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--pill-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.chip.active {
  background: var(--pill-active);
  color: var(--pill-text-active);
}

.chip.locked {
  opacity: 0.4;
}

.pill-group {
  display: flex;
  gap: 12px;
  padding: 4px;
  background: #f1f3f5;
  border-radius: 999px;
}

.pill {
  flex: 1;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--pill-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pill.active {
  background: var(--pill-active);
  color: var(--pill-text-active);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.25);
}

.pill-icon {
  font-size: 18px;
}

.card-chevron::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 15px;
  mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 6 10\"><path fill=\"%23000\" d=\"M.29 1.12a1 1 0 0 1 1.41 0l3 3a1 1 0 0 1 0 1.42l-3 3A1 1 0 0 1 .29 7.12L2.6 4.8.29 2.54a1 1 0 0 1 0-1.42Z\"/></svg>') center/contain no-repeat;
  background: #c6c9d2;
}

.toggle-card {
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--switch-off);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.15);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch input:checked + .slider {
  background: var(--switch-on);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.cta-button {
  padding: 16px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--card-shadow);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cta-button.primary {
  background: var(--cta-primary);
  color: var(--cta-primary-text);
  border-radius: 28px;
  box-shadow: 0 22px 35px rgba(146, 255, 43, 0.45);
}

.cta-button.primary.dark {
  background: #111111;
  color: #ffffff;
  box-shadow: none;
}

.cta-button.secondary {
  background: var(--cta-secondary);
  color: var(--cta-secondary-text);
}

.cta-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.primary-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 22px calc(22px + env(safe-area-inset-bottom, 12px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(242, 242, 245, 0) 0%, rgba(242, 242, 245, 0.9) 48%, rgba(242, 242, 245, 1) 100%);
  backdrop-filter: blur(18px);
}

.sheet-backdrop,
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 32px 16px calc(env(safe-area-inset-bottom, 16px) + 16px);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  z-index: 100;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.overlay {
  align-items: center;
  padding: 32px 16px;
}

.sheet,
.help-card,
.round-card {
  width: min(480px, 100%);
  background: #ffffff;
  border-radius: 32px;
  box-shadow: var(--card-shadow-strong);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  transform: translateY(20px);
  animation: sheet-in 0.25s ease forwards;
}

@keyframes sheet-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-header,
.sheet-footer {
  padding: 24px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-footer {
  padding-bottom: 28px;
}

.sheet-title {
  margin: 0;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.sheet-content {
  padding: 20px 28px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9fb;
  border-radius: 20px;
  padding: 14px 16px;
}

.player-icon {
  font-size: 18px;
  color: #6b7280;
}

.player-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.player-remove {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 59, 92, 0.12);
  color: var(--danger);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.add-player {
  padding: 24px 28px 0;
  display: flex;
  gap: 12px;
}

.add-player input {
  flex: 1;
  border-radius: 22px;
  border: 2px solid #facc15;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
}

.add-player-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #facc15;
  font-size: 28px;
  color: #111111;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.category-option,
.imposter-option,
.time-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 24px;
  background: #f6f7f9;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.category-option.active,
.imposter-option.active,
.time-option.active {
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.12);
}

.imposter-option.inactive {
  opacity: 0.35;
  cursor: not-allowed;
}

.category-label {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-emoji {
  font-size: 22px;
}

.sheet-backdrop.hidden,
.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.help-card {
  background: #0f172a;
  color: #f9fafc;
  padding: 26px 28px 32px;
  gap: 18px;
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.help-header h2 {
  margin: 0;
  font-size: 22px;
}

.help-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
}

.help-footer {
  margin: 0;
  font-size: 14px;
  color: #cbd5f5;
  border-top: 1px solid rgba(203, 213, 225, 0.15);
  padding-top: 18px;
}

.round-card {
  padding: 26px 28px;
  gap: 24px;
}

.round-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.round-subtitle {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  color: var(--text-muted);
}

.round-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.round-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.round-word {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.round-note {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

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

.round-button {
  width: 100%;
}

.hold-button {
  position: relative;
  overflow: hidden;
  gap: 0;
}

.hold-button .hold-label {
  position: relative;
  z-index: 1;
}

.hold-progress {
  position: absolute;
  inset: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.2s ease;
  pointer-events: none;
}

.hold-button.holding .hold-label {
  opacity: 0.9;
}

.timer-chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%) translateY(20px);
  background: #111111;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 120;
}

.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 420px) {
  .app-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .card {
    padding: 20px 20px;
  }

  .sheet-header,
  .sheet-footer,
  .add-player,
  .sheet-content {
    padding-left: 22px;
    padding-right: 22px;
  }
}
