:root {
  --bg-deep: #1a1644;
  --bg-mid: #2d2a68;
  --panel: rgba(20, 27, 56, 0.72);
  --panel-border: rgba(255, 255, 255, 0.2);
  --gold: #ffd56a;
  --orange: #ff8e42;
  --orange-dark: #d5682e;
  --mint: #74f3d8;
  --danger: #ff6978;
  --text: #f9fbff;
  --subtle: #c7d4ff;
  --shadow: 0 12px 32px rgba(8, 12, 30, 0.42);
}

* {
  box-sizing: border-box;
}

button {
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, #4e7bff 0%, rgba(78, 123, 255, 0) 35%),
    radial-gradient(circle at 80% 70%, #1cd4b7 0%, rgba(28, 212, 183, 0) 30%),
    linear-gradient(160deg, var(--bg-deep), #262058 45%, var(--bg-mid));
}

.game {
  width: min(1020px, 95vw);
  margin: 12px auto;
  padding: 16px;
  background: rgba(10, 16, 38, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero {
  text-align: center;
}

.kicker {
  margin: 2px 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  opacity: 0.86;
  text-transform: uppercase;
}

.hero h1 {
  margin: 4px 0;
  font-family: "Bangers", "Nunito", cursive;
  font-size: clamp(2rem, 5.4vw, 3rem);
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(16, 20, 40, 0.8);
}

.hero p {
  margin: 0;
  color: var(--subtle);
}

.top-menu {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.menu-btn {
  border: none;
  border-radius: 11px;
  min-width: 98px;
  min-height: 38px;
  color: #f7fbff;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: linear-gradient(180deg, #4f74d4, #2f4f9f);
  box-shadow: 0 3px 0 #1b2f65;
}

.menu-btn.active {
  color: #2b1d0e;
  background: linear-gradient(180deg, #ffdb78, #c58a2d);
  box-shadow: 0 3px 0 #80521a;
}

.mission-box {
  margin-top: 14px;
  display: grid;
  gap: 2px;
  justify-items: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 11px;
}

.mission-box p {
  margin: 0;
  font-weight: 700;
}

.mission-sub {
  color: #d7e3ff;
  font-size: 0.93rem;
  opacity: 0.95;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.arena {
  position: relative;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.character-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 10px 20px rgba(7, 10, 26, 0.28);
}

.character-card h2 {
  margin: 4px 0 6px;
  color: #f9fcff;
}

.avatar {
  position: relative;
  width: 140px;
  height: 170px;
  margin: 0 auto 8px;
}

.avatar .head {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffd4b3;
  left: 46px;
  top: 14px;
  border: 2px solid #aa7c59;
  z-index: 4;
}

.avatar.rssi .body {
  position: absolute;
  width: 92px;
  height: 98px;
  left: 24px;
  top: 64px;
  background: #2f456a;
  border-radius: 14px 14px 8px 8px;
}

.avatar.rssi .tie {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 34px solid #d81b1b;
  left: 60px;
  top: 84px;
  z-index: 5;
}

.avatar.rssi .badge {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  left: 34px;
  top: 104px;
  background: #e7f3ff;
  border: 2px solid #6b8fcb;
}

.avatar.hacker .hood {
  position: absolute;
  width: 80px;
  height: 64px;
  left: 30px;
  top: 28px;
  border-radius: 34px 34px 20px 20px;
  background: #40444e;
  z-index: 3;
}

.avatar.hacker .body {
  position: absolute;
  width: 96px;
  height: 102px;
  left: 22px;
  top: 62px;
  border-radius: 14px;
  background: #2a2d33;
}

.avatar.hacker .laptop {
  position: absolute;
  width: 90px;
  height: 44px;
  left: 25px;
  bottom: 3px;
  border-radius: 6px;
  background: #8be9ff;
  border: 4px solid #263958;
}

.round-target {
  margin: 6px 0;
  color: #d7e1ff;
  font-size: 0.95rem;
}

.choices {
  display: grid;
  gap: 8px;
  max-width: 230px;
  margin: 0 auto;
}

.choice-btn {
  border: none;
  border-radius: 11px;
  color: #fdfdff;
  font-size: 1rem;
  font-weight: 800;
  min-height: 42px;
  cursor: pointer;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  box-shadow: 0 3px 0 #8c3f1d;
}

.rules-hint {
  margin: 9px 0 0;
  font-size: 0.85rem;
  color: #d1ddff;
}

.choice-text {
  margin: 4px 0 0;
  color: #d7e2ff;
  font-size: 1rem;
}

.result-center {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: min(88%, 420px);
  z-index: 8;
  text-align: center;
  pointer-events: auto;
}

.big-result {
  min-height: 94px;
  padding: 14px;
  border-radius: 14px;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: clamp(1.02rem, 2.6vw, 1.35rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: 0.01em;
  white-space: pre-line;
  color: #fff6d5;
  background: rgba(15, 20, 40, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
}

.big-result.countdown {
  font-family: "Bangers", "Nunito", cursive;
  font-size: clamp(2.1rem, 6vw, 3rem);
  letter-spacing: 0.05em;
  color: var(--mint);
}

.big-result.win {
  color: #9cffbc;
  border-color: #88f7b3;
}

.big-result.lose {
  color: #ff9eaa;
  border-color: #ff9eaa;
}

.big-result.draw {
  color: #ffe08a;
  border-color: #ffe08a;
}

.continue-btn {
  margin-top: 10px;
  border: none;
  border-radius: 11px;
  min-height: 42px;
  min-width: 130px;
  color: #2d1f08;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #ffdb78, #c58a2d);
  box-shadow: 0 3px 0 #80521a;
}

.status {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  font-weight: 700;
}

.scoreboard p {
  margin: 0;
  padding: 8px;
  border-radius: 9px;
  background: rgba(102, 126, 201, 0.27);
}

#playerScoreLabel {
  color: #8cf8b5;
}

.message {
  margin: 12px 0 6px;
  text-align: center;
  font-size: 1.03rem;
  min-height: 2.1em;
  color: #dce7ff;
}

.final-message {
  margin: 6px 0 8px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  min-height: 1.8em;
}

.replay-btn {
  margin-top: 10px;
  border: none;
  border-radius: 11px;
  min-height: 42px;
  min-width: 140px;
  color: #f7fbff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #58b7a5, #2d7b6e);
  box-shadow: 0 3px 0 #1f4f47;
}

.hidden {
  display: none;
}

.emoji-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4200;
}

.emoji-particle {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  user-select: none;
}

#restartBtn {
  display: block;
  margin: 0 auto;
  border: none;
  border-radius: 11px;
  min-height: 42px;
  color: #f7fbff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #58b7a5, #2d7b6e);
  box-shadow: 0 3px 0 #1f4f47;
}

@media (max-width: 860px) {
  .arena {
    grid-template-columns: 1fr;
  }

  .result-center {
    position: fixed;
    inset: 0;
    transform: none;
    margin: 0;
    width: auto;
    padding: 16px;
    background: rgba(6, 10, 28, 0.72);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }

  .result-center.mobile-modal-active {
    display: flex;
  }

  .result-center .big-result {
    width: min(92vw, 430px);
  }

  .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
