:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-soft: #10151c;
  --card: #141b24;
  --line: #293545;
  --text: #e8f2ff;
  --muted: #90a4ba;
  --green: #43f58f;
  --amber: #ffc65c;
  --red: #ff6d6d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #0f1622, var(--bg) 60%);
  color: var(--text);
}

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.2;
}

h1 {
  font-size: 1.8rem;
}

p, li, label, input, textarea, button, a {
  font-size: 1rem;
}

.small {
  color: var(--muted);
  font-size: 0.875rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.03em;
}

.field {
  margin-bottom: 0.9rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

input[type="text"],
input[type="file"],
textarea,
select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg-soft);
  color: var(--text);
}

.btn:hover {
  opacity: 0.93;
}

.btn-primary {
  background: color-mix(in srgb, var(--green) 18%, #111a22);
  border-color: color-mix(in srgb, var(--green) 45%, #2f3f32);
  box-shadow: 0 0 16px color-mix(in srgb, var(--green) 30%, transparent);
}

.btn-warning {
  background: color-mix(in srgb, var(--amber) 14%, #211c12);
  border-color: color-mix(in srgb, var(--amber) 40%, #3f321b);
}

.btn-danger {
  background: color-mix(in srgb, var(--red) 16%, #221517);
  border-color: color-mix(in srgb, var(--red) 42%, #472026);
}

.inline-form {
  display: inline-block;
}

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

.row > * {
  margin: 0;
}

.flash {
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}

.flash-notice {
  background: #173023;
  border: 1px solid #2b7a54;
}

.flash-alert {
  background: #2d1717;
  border: 1px solid #7f3232;
}

.status-pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.board {
  list-style: none;
  padding: 0;
  margin: 0;
}

.board li {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid #1f2a38;
}

.alive {
  color: var(--green);
}

.dead {
  color: var(--red);
}

.fixed-cta {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
}

.fixed-cta .btn {
  width: min(760px, calc(100% - 2rem));
  text-align: center;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
}

.nav a:hover {
  color: var(--text);
}

.screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: var(--bg-soft);
  font-size: 1.2rem;
}

.settings-link:hover {
  border-color: color-mix(in srgb, var(--muted) 60%, var(--line));
}

.mission-card p {
  margin-top: 0.25rem;
  margin-bottom: 0.6rem;
}

.mission-flip {
  perspective: 1000px;
  overflow: hidden;
}

.mission-flip-inner {
  display: grid;
  min-height: 124px;
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}

.mission-flip.is-revealed .mission-flip-inner {
  transform: rotateY(180deg);
}

.mission-face {
  grid-area: 1 / 1;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  backface-visibility: hidden;
}

.mission-flip-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.mission-flip-trigger:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 48%, transparent);
  border-radius: 10px;
}

.mission-face-back {
  transform: rotateY(180deg);
  flex-direction: column;
  gap: 0.85rem;
}

.mission-text {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.45rem;
  line-height: 1.4;
  font-size: 1.05rem;
  font-weight: 600;
}

.mission-word {
  color: var(--text);
}

.mission-hint {
  font-weight: 700;
  font-size: 1.05rem;
}

.mission-emphasis {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.mission-actions {
  justify-content: center;
}

.recent-kills-card .board li:last-child {
  border-bottom: 0;
}

.kill-entry {
  gap: 0.65rem;
  align-items: flex-start;
}

.kill-line {
  line-height: 1.35;
}

.kill-entry .small {
  white-space: nowrap;
}

.kill-target {
  font-weight: 750;
  color: var(--text);
}

.kill-location {
  font-weight: 700;
  color: var(--green);
}

.kill-item {
  font-weight: 700;
  color: var(--amber);
}

.feed-more {
  margin-top: 0.7rem;
}

.feed-more summary {
  cursor: pointer;
  color: var(--muted);
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
}

.player-tile {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.silhouette {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  margin: 0 auto 0.5rem;
  background: linear-gradient(180deg, #65758a, #3f4a59);
  position: relative;
}

.silhouette::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -14px;
  width: 56px;
  height: 26px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #65758a, #3f4a59);
}

.silhouette-button {
  border: 0;
  cursor: pointer;
}

.silhouette-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 60%, transparent);
}

.player-name {
  margin: 1.1rem 0 0.45rem;
  font-weight: 600;
}

.you-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0d1811;
  background: var(--green);
  vertical-align: middle;
}

.status-pill.alive {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
}

.status-pill.waiting {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
}

.status-pill.dead {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
}

.status-pill.not-joined {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--muted) 45%, var(--line));
}

.waiting {
  color: var(--amber);
}

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

.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;
}

.photo-modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(92vw, 560px);
}

.photo-modal::backdrop {
  background: rgba(5, 8, 12, 0.8);
}

.photo-modal-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
}

.photo-modal-close {
  margin-left: auto;
  display: block;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.photo-modal-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 0.5rem;
}
