:root {
  color-scheme: dark;
  --bg-0: #05050d;
  --bg-1: #09091a;
  --bg-2: #111126;
  --surface-0: rgba(255, 255, 255, 0.055);
  --surface-1: rgba(255, 255, 255, 0.09);
  --surface-2: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.12);
  --border-gold: rgba(255, 197, 73, 0.55);
  --border-violet: rgba(164, 89, 255, 0.55);
  --border-cyan: rgba(45, 213, 255, 0.45);
  --text: #fff8e8;
  --text-muted: #b8b3c8;
  --text-soft: #817b94;
  --gold: #ffc94a;
  --gold-2: #ff9f1c;
  --violet: #7b2cff;
  --violet-2: #b75cff;
  --magenta: #ff3d9a;
  --cyan: #29d9ff;
  --lime: #a8ff60;
  --danger: #ff4f6d;
  --gradient-main: linear-gradient(135deg, #ffc94a 0%, #ff5b93 48%, #7b2cff 100%);
  --gradient-purple: linear-gradient(145deg, rgba(123, 44, 255, 0.35), rgba(255, 61, 154, 0.22));
  --gradient-cyan: linear-gradient(145deg, rgba(41, 217, 255, 0.24), rgba(123, 44, 255, 0.14));
  --gradient-gold: linear-gradient(145deg, rgba(255, 201, 74, 0.32), rgba(255, 159, 28, 0.14));
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-card: 0 22px 70px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 32px rgba(123, 44, 255, 0.35);
  --shadow-gold: 0 0 28px rgba(255, 201, 74, 0.25);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(123, 44, 255, 0.35), transparent 34%),
    radial-gradient(circle at 20% 20%, rgba(41, 217, 255, 0.13), transparent 28%),
    radial-gradient(circle at 80% 30%, rgba(255, 61, 154, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 56%, #030307);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
  opacity: 0.22;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:disabled,
.tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

h1,
h2,
h3,
.logo,
.screen-title,
.room-code,
.points-number,
.timer,
.points-badge strong {
  font-family: "Space Grotesk", system-ui, sans-serif;
}

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

p {
  color: var(--text-muted);
  line-height: 1.55;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(28px);
}

.ambient::before {
  width: 220px;
  height: 220px;
  top: 14%;
  left: calc(50% - 260px);
  background: rgba(41, 217, 255, 0.12);
}

.ambient::after {
  width: 280px;
  height: 280px;
  right: calc(50% - 300px);
  bottom: 8%;
  background: rgba(255, 201, 74, 0.1);
}

.app {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 16px calc(104px + env(safe-area-inset-bottom));
  position: relative;
}

.shell,
.shell.two,
.hero-content,
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.top,
.game-header {
  height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.brand {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.icon-button,
.avatar,
.mission-icon,
.waiting-icon {
  display: grid;
  place-items: center;
}

.brand-mark,
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.brand-mark {
  border-color: var(--border-gold);
  overflow: hidden;
  background:
    linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08)),
    url("assets/icons/icon-192.png?v=20260607-icon1") center / cover no-repeat;
  color: transparent;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 800;
  box-shadow: var(--shadow-gold);
}

.brand-mark span {
  opacity: 0;
}

.brand-name {
  display: block;
  overflow: hidden;
  color: var(--gold);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-title {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  min-height: calc(100dvh - 44px);
  display: grid;
  align-content: center;
  gap: 22px;
  text-align: center;
}

.hero-symbol {
  width: 178px;
  height: 178px;
  margin: 8px auto 10px;
  border: 1px solid rgba(183, 92, 255, 0.36);
  border-radius: 38px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.02)),
    url("assets/icons/icon-512.png?v=20260607-icon1") center / cover no-repeat;
  box-shadow: 0 0 70px rgba(123, 44, 255, 0.35), 0 0 28px rgba(255, 201, 74, 0.2);
  position: relative;
}

.hero-symbol::after {
  content: "";
  position: absolute;
  inset: -16px;
  z-index: -1;
  border-radius: 48px;
  background: radial-gradient(circle, rgba(183, 92, 255, 0.28), transparent 64%);
  filter: blur(10px);
}

.logo,
h1 {
  margin: 0;
  color: var(--gold);
  font-size: 4.35rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(255, 201, 74, 0.38);
}

h1 .logo-small {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.48rem;
  letter-spacing: 0.24em;
}

h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.85rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lede {
  max-width: 330px;
  margin: 0 auto;
  color: #eee7ff;
  font-size: 1.15rem;
  font-weight: 650;
}

.home-mini-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.home-mini-nav button {
  min-height: 42px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.panel,
.game-card,
.mission-card,
.modal-card,
.player-card,
.result-card,
.lobby-card,
.hero-card {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  animation: cardEnter 0.32s ease both;
}

.panel,
.game-card {
  padding: 18px;
}

.hero-card {
  display: none;
}

.actions,
.form {
  display: grid;
  gap: 12px;
}

.actions {
  margin-top: 22px;
}

.button {
  width: auto;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.button.primary,
.button.success {
  min-height: 56px;
  border: 0;
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 14px 34px rgba(123, 44, 255, 0.35);
}

.button.success {
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  color: #071018;
}

.button.ghost {
  border-color: var(--border-gold);
  background: rgba(255, 201, 74, 0.04);
  color: var(--gold);
}

.button.danger {
  border-color: rgba(255, 79, 109, 0.54);
  background: rgba(255, 79, 109, 0.12);
  color: #ffdce2;
}

.button.full {
  width: 100%;
}

.button.hold-button {
  border-color: var(--border-cyan);
  color: var(--cyan);
  touch-action: none;
  user-select: none;
}

.button.hold-button.active {
  background: var(--gradient-cyan);
  color: var(--text);
  box-shadow: 0 0 24px rgba(41, 217, 255, 0.24);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  padding: 0 14px;
}

.textarea {
  min-height: 88px;
  padding: 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--violet-2);
  box-shadow: 0 0 0 3px rgba(183, 92, 255, 0.18);
}

.room-code {
  display: block;
  width: 100%;
  margin: 10px 0 12px;
  color: var(--violet-2);
  font-size: 2.12rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 0 24px rgba(183, 92, 255, 0.55);
}

.qr,
.qr-wrap img {
  display: block;
  width: 150px;
  height: 150px;
  margin: 14px auto;
  padding: 10px;
  border: 0;
  border-radius: 18px;
  background: #fff;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.players {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.player {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #14101d;
  font-weight: 900;
}

.player strong,
.truncate {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eadff5;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge.hot {
  border-color: var(--border-violet);
  color: var(--violet-2);
}

.badge.good {
  border-color: rgba(168, 255, 96, 0.42);
  color: #eaffce;
}

.timer {
  min-width: 86px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  background: rgba(255, 201, 74, 0.08);
  color: var(--gold);
  font-size: 1.18rem;
  font-weight: 800;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 14px -2px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-width: 112px;
  min-height: 44px;
  flex: 1 0 auto;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 800;
}

.tab.active {
  border-color: var(--border-violet);
  background: var(--gradient-purple);
  color: var(--text);
  box-shadow: var(--shadow-glow);
}

.mission-list {
  display: grid;
  gap: 12px;
}

.mission-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 58px;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.mission-card > .button {
  grid-column: 1 / -1;
}

.mission-card.mission-easy {
  border-color: rgba(41, 217, 255, 0.42);
}

.mission-card.mission-medium {
  border-color: rgba(183, 92, 255, 0.55);
}

.mission-card.mission-hard {
  border-color: rgba(255, 201, 74, 0.55);
}

.mission-card.done {
  border-color: rgba(168, 255, 96, 0.52);
  background:
    linear-gradient(180deg, rgba(168, 255, 96, 0.15), rgba(255, 255, 255, 0.04));
}

.mission-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--gradient-purple);
  color: var(--gold);
  font-size: 1.45rem;
  font-weight: 900;
}

.mission-card.done .mission-icon {
  background: var(--gradient-cyan);
  color: var(--lime);
}

.mission-content {
  min-width: 0;
}

.mission-secret {
  min-width: 0;
}

.mission-text {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.cover-text strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
}

.cover-text span {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.points-badge {
  min-width: 52px;
  min-height: 62px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid currentColor;
  border-radius: 14px;
  color: var(--gold);
  background: rgba(255, 201, 74, 0.055);
}

.points-badge strong {
  display: block;
  font-size: 1.65rem;
  line-height: 1;
}

.points-badge span {
  display: block;
  color: currentColor;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.quick-actions,
.bottom-nav {
  position: sticky;
  bottom: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px -6px -8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(5, 5, 13, 0.82);
  backdrop-filter: blur(20px);
}

.quick-actions .button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.waiting-icon {
  width: 118px;
  height: 118px;
  margin: 24px auto 18px;
  border: 1px solid var(--border-cyan);
  border-radius: 32px;
  background: var(--gradient-cyan);
  color: var(--gold);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 800;
  box-shadow: 0 0 34px rgba(41, 217, 255, 0.22);
  animation: floatPulse 2.8s ease-in-out infinite;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
}

.notice {
  border: 1px solid rgba(255, 201, 74, 0.2);
  border-left: 4px solid var(--gold);
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 201, 74, 0.08);
  color: #ffe9b5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 14px;
  background: rgba(5, 5, 13, 0.74);
}

.modal-card {
  width: min(100%, 410px);
  max-height: min(760px, calc(100dvh - 28px));
  overflow: auto;
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(123, 44, 255, 0.22), transparent 42%),
    rgba(9, 9, 26, 0.96);
}

.success-badge {
  width: 116px;
  height: 116px;
  margin: 20px auto 24px;
  border: 2px solid var(--gold);
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 201, 74, 0.22), rgba(255, 201, 74, 0.05));
  color: var(--gold);
  font-size: 3.4rem;
  box-shadow: var(--shadow-gold);
}

.rules-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.rule-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.rule-card h3,
.rule-card p,
.rules-score h3,
.rules-score p {
  margin-bottom: 5px;
}

.rule-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  background: rgba(255, 201, 74, 0.08);
  color: var(--gold);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 800;
}

.rules-score {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--border-violet);
  border-radius: var(--radius-md);
  background: var(--gradient-purple);
}

.rules-score strong {
  color: var(--text);
}

.confidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.confidence-card {
  position: relative;
  min-height: 74px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 800;
}

.confidence-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.confidence-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.confidence-card:has(input:checked) {
  border-color: var(--violet-2);
  color: var(--violet-2);
  box-shadow: 0 0 24px rgba(183, 92, 255, 0.28);
}

.suspicion-card,
.score-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.065);
}

.suspicion-card {
  grid-template-columns: 42px minmax(0, 1fr);
}

.suspicion-card h3,
.suspicion-card p {
  margin-bottom: 4px;
}

.suspicion-card.confidence-sure {
  border-color: var(--border-violet);
}

.suspicion-card.confidence-medium {
  border-color: var(--border-gold);
}

.suspicion-card.confidence-doubt {
  border-color: var(--border-cyan);
}

.score-row {
  display: grid;
  gap: 9px;
}

.score-ring {
  width: 170px;
  height: 170px;
  margin: 24px auto 20px;
  border: 8px solid rgba(255, 201, 74, 0.22);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 2px rgba(255, 201, 74, 0.55), var(--shadow-gold);
}

.score-ring strong {
  display: block;
  color: var(--gold);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 3.1rem;
  line-height: 1;
}

.score-ring span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reveal-panel {
  overflow: hidden;
}

.reveal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0 16px;
}

.microcopy {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.spacer {
  height: 14px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 201, 74, 0.32);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8e8, #ffc94a);
  color: #100814;
  font-weight: 900;
  box-shadow: var(--shadow-card);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }

  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .app {
    max-width: 430px;
    padding-top: 28px;
  }
}

@media (max-width: 380px) {
  .app {
    padding-right: 12px;
    padding-left: 12px;
  }

  .logo,
  h1 {
    font-size: 3.72rem;
  }

  .grid.two,
  .mission-card,
  .copy-row {
    grid-template-columns: 1fr;
  }

  .mission-icon,
  .points-badge {
    justify-self: start;
  }
}
