:root {
  --bg: #1b1026;
  --surface: #2a1a3b;
  --text: #faf9f6;
  --muted: #b9aecb;
  --accent: #d42990;
  --accent-2: #8025c6;
  --radius: 16px;
  --tap: 56px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

main {
  min-height: 100dvh;
  max-width: 32rem;
  margin: 0 auto;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

h1 {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.screen.center {
  justify-content: center;
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.title {
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  letter-spacing: -0.02em;
}

.tagline,
.eyebrow,
.game-desc {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin: 0;
}

.btn {
  min-height: var(--tap);
  width: 100%;
  padding: 0 1.25rem;
  border: 2px solid var(--surface);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.small {
  width: auto;
  min-height: 44px;
  padding: 0 0.75rem;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn:active:not(:disabled),
.chip:active,
.game-card:active:not(:disabled) {
  transform: scale(0.98);
}

input,
textarea {
  width: 100%;
  /* 16px+ stops iOS from zooming on focus */
  font: inherit;
  font-size: max(16px, 1rem);
  padding: 0.9rem 1rem;
  border: 2px solid var(--surface);
  border-radius: var(--radius);
  background: #120a1a;
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: none;
  margin-bottom: 0.75rem;
}

.chips,
.lang-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.lang-toggle {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
}

.chip {
  min-height: 44px;
  padding: 0 1rem;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.chip.small {
  font-size: 0.85rem;
  padding: 0 0.75rem;
}

.chip[aria-pressed="true"] {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--text);
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.game-card:disabled {
  opacity: 0.5;
  cursor: default;
}

.game-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner {
  align-self: flex-start;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

.player-tag {
  margin: 0;
  color: var(--muted);
}

.prompt {
  font-size: clamp(1.35rem, 6vw, 1.75rem);
  line-height: 1.25;
  margin: 0;
}

.card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border-left: 6px solid var(--accent);
}

.card.alt {
  border-left-color: var(--accent-2);
}

.card-label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-text {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.error {
  color: #ff8fb8;
}

.prompt.big {
  font-size: clamp(1.6rem, 7.5vw, 2.25rem);
}

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

.push-down {
  margin-top: auto;
}

.btn.verdict {
  min-height: 88px;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn.guilty {
  background: #e0364f;
  border-color: #e0364f;
}

.btn.not-guilty {
  background: #1f9e75;
  border-color: #1f9e75;
}

.card.guilty {
  border-left-color: #e0364f;
}

.card.not_guilty {
  border-left-color: #1f9e75;
}

.verdict-headline {
  text-transform: uppercase;
  font-size: clamp(2rem, 10vw, 3rem);
}

.verdict-headline.guilty {
  color: #ff5d74;
}

.verdict-headline.not_guilty {
  color: #3fd6a4;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(80vw, 20rem);
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--surface);
  box-shadow: -8px 0 24px rgb(0 0 0 / 0.4);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.menu-open .drawer {
  transform: none;
}

.menu-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.drawer .btn:not(.ghost) {
  background: var(--bg);
  border-color: var(--bg);
}

.drawer-close {
  align-self: flex-start;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer-backdrop {
    transition: none;
  }
}

.screen > .btn.primary:last-child {
  margin-top: auto;
}

.screen.center > .btn.primary:last-child {
  margin-top: 0;
}
