:root {
  --bg-deep: #0a0a0d;
  --bg-night: #141018;
  --accent-red: #b5162b;
  --accent-gold: #c9a35b;
  --accent-ice: #6cb4a3;
  --text-main: #f3efe7;
  --text-muted: rgba(243, 239, 231, 0.7);
  --card: rgba(16, 15, 18, 0.88);
  --card-border: rgba(201, 163, 91, 0.25);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-image: linear-gradient(160deg, rgba(10, 10, 13, 0.85), rgba(20, 16, 24, 0.9)),
    url("../img/back.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: "Sora", "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

body.game-active {
  background-image: linear-gradient(160deg, rgba(8, 8, 10, 0.6), rgba(12, 10, 16, 0.8)),
    url("../img/фон.png");
}

body.game-active::before {
  opacity: 0.45;
}

body.game-active::after {
  opacity: 0.05;
}

body.end-active {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -5% 0;
  background: radial-gradient(600px 420px at 10% 25%, rgba(181, 22, 43, 0.16), transparent 65%),
    radial-gradient(500px 360px at 85% 0%, rgba(201, 163, 91, 0.16), transparent 65%),
    radial-gradient(700px 520px at 50% 90%, rgba(255, 255, 255, 0.04), transparent 70%);
  opacity: 0.8;
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.stage {
  position: relative;
  z-index: 1;
  width: min(920px, 92vw);
  padding: 72px 64px 64px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(22, 20, 26, 0.95), rgba(12, 11, 14, 0.95));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
  animation: floatIn 0.9s ease-out;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  z-index: 0;
}

.stage::before {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 30% 30%, rgba(201, 163, 91, 0.6), transparent 65%);
  top: -120px;
  right: -60px;
}

.stage::after {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 30% 30%, rgba(181, 22, 43, 0.55), transparent 65%);
  bottom: -140px;
  left: -90px;
}

header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(201, 163, 91, 0.18);
}

.title-group {
  max-width: 60%;
}

h1 {
  margin: 0;
  font-family: "Cinzel", "Georgia", serif;
  font-size: clamp(2.4rem, 3.8vw, 3.8rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f7e6c4;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.subtitle {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.bot-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 17, 20, 0.75);
  border: 1px solid rgba(201, 163, 91, 0.4);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent-gold);
}

.bot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 16px rgba(181, 22, 43, 0.8);
  animation: pulse 2.4s ease-in-out infinite;
}

.menu {
  margin-top: 38px;
  display: grid;
  gap: 18px;
}

.is-hidden {
  display: none !important;
}

.menu button {
  width: 100%;
  padding: 20px 28px;
  border-radius: 18px;
  border: 1px solid rgba(201, 163, 91, 0.35);
  background: linear-gradient(145deg, rgba(18, 16, 20, 0.95), rgba(32, 23, 27, 0.92));
  color: var(--text-main);
  font-family: "Cinzel", "Georgia", serif;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 20px 40px rgba(0, 0, 0, 0.45);
}

.menu button::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 163, 91, 0.45), transparent);
  opacity: 0.6;
}

.menu button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 50%, rgba(181, 22, 43, 0.45), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.menu button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 50px rgba(0, 0, 0, 0.55);
  border-color: rgba(201, 163, 91, 0.6);
}

.menu button:hover::after {
  opacity: 1;
}

.menu button span {
  position: relative;
  z-index: 1;
}

.menu .create {
  background: linear-gradient(145deg, rgba(44, 16, 20, 0.95), rgba(20, 15, 19, 0.95));
}

.menu .create::after {
  background: radial-gradient(circle at 20% 50%, rgba(181, 22, 43, 0.6), transparent 60%);
}

.menu .bots {
  background: linear-gradient(145deg, rgba(16, 24, 28, 0.95), rgba(12, 16, 20, 0.95));
}

.menu .bots::after {
  background: radial-gradient(circle at 20% 50%, rgba(108, 180, 163, 0.45), transparent 65%);
}

.menu .bots.is-active {
  border-color: rgba(108, 180, 163, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 22px 46px rgba(0, 0, 0, 0.55);
}

.menu .info {
  background: linear-gradient(145deg, rgba(34, 26, 18, 0.95), rgba(18, 14, 15, 0.95));
}

.menu .info::after {
  background: radial-gradient(circle at 20% 50%, rgba(201, 163, 91, 0.5), transparent 65%);
}

.menu .settings {
  background: linear-gradient(145deg, rgba(20, 26, 24, 0.95), rgba(14, 16, 18, 0.95));
}

.menu .settings::after {
  background: radial-gradient(circle at 20% 50%, rgba(108, 180, 163, 0.45), transparent 65%);
}

.mode-panel,
.game-type-panel,
.room-panel,
.waiting-panel,
.game-panel {
  margin-top: 38px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.mode-title {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f7e6c4;
}

.mode-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.mode-grid {
  display: grid;
  gap: 14px;
}

.mode-card {
  width: 100%;
  padding: 18px 24px;
  border-radius: 16px;
  border: 1px solid rgba(201, 163, 91, 0.3);
  background: linear-gradient(145deg, rgba(18, 16, 20, 0.95), rgba(30, 20, 24, 0.92));
  color: var(--text-main);
  font-family: "Cinzel", "Georgia", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 36px rgba(0, 0, 0, 0.5);
}

.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 50%, rgba(181, 22, 43, 0.45), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 163, 91, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 44px rgba(0, 0, 0, 0.6);
}

.mode-card:hover::after {
  opacity: 1;
}

.mode-card span {
  position: relative;
  z-index: 1;
}

.room-form {
  display: grid;
  gap: 14px;
}

.timers-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(201, 163, 91, 0.25);
  background: rgba(12, 11, 14, 0.75);
}

.timers-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.bots-note {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(201, 163, 91, 0.35);
  background: rgba(12, 11, 14, 0.75);
  color: rgba(201, 163, 91, 0.85);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.field span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(201, 163, 91, 0.75);
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 91, 0.3);
  background: rgba(12, 11, 14, 0.9);
  color: var(--text-main);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.field input:focus {
  outline: none;
  border-color: rgba(201, 163, 91, 0.6);
  box-shadow: 0 0 0 2px rgba(201, 163, 91, 0.15);
}

.copy-button {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 91, 0.35);
  background: rgba(18, 16, 20, 0.95);
  color: var(--text-main);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.copy-button:hover {
  border-color: rgba(201, 163, 91, 0.6);
  transform: translateY(-1px);
}

.primary-button {
  padding: 18px 24px;
  border-radius: 16px;
  border: 1px solid rgba(201, 163, 91, 0.4);
  background: linear-gradient(145deg, rgba(44, 16, 20, 0.95), rgba(20, 15, 19, 0.95));
  color: var(--text-main);
  font-family: "Cinzel", "Georgia", serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 36px rgba(0, 0, 0, 0.5);
}

.primary-button:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 163, 91, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 44px rgba(0, 0, 0, 0.6);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.secondary-button {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 91, 0.3);
  background: rgba(18, 16, 20, 0.85);
  color: var(--text-main);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.secondary-button:hover {
  border-color: rgba(201, 163, 91, 0.6);
  transform: translateY(-1px);
}

.secondary-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.waiting-grid {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(201, 163, 91, 0.25);
  background: rgba(12, 11, 14, 0.75);
}

.waiting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.waiting-item strong {
  color: var(--text-main);
  font-weight: 600;
}

.waiting-status {
  font-size: 0.9rem;
  color: rgba(201, 163, 91, 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.game-body {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.stage-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(201, 163, 91, 0.25);
  background: rgba(12, 11, 14, 0.75);
}

.stage-label {
  font-family: "Cinzel", "Georgia", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f7e6c4;
  font-size: 1rem;
}

.stage-time {
  font-size: 2.2rem;
  letter-spacing: 0.12em;
  color: var(--text-main);
}

.stage-time.time-up {
  color: var(--accent-red);
}

.stage-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.stage-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.stage-death {
  font-size: 1rem;
  color: #f7e6c4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-reveal {
  font-size: 0.9rem;
  color: rgba(201, 163, 91, 0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-list {
  display: grid;
  gap: 8px;
}

.stage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stage-item.active {
  color: var(--text-main);
}

.end-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 6, 9, 0.86);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.end-screen.is-hidden {
  display: none;
}

.end-card {
  width: min(980px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(18, 17, 22, 0.98), rgba(9, 8, 12, 0.98));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  display: grid;
}

.end-hero {
  position: relative;
  padding: 36px 40px 28px;
  background-image: linear-gradient(120deg, rgba(12, 10, 16, 0.72), rgba(22, 18, 26, 0.86)),
    url("../img/фон.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.end-hero::after {
  content: "";
  position: absolute;
  inset: -10% 0 0;
  background-position: right 18% bottom 10%;
  background-repeat: no-repeat;
  background-size: 280px;
  opacity: 0.22;
  pointer-events: none;
}

.end-screen[data-winner="mafia"] .end-hero::after {
  background-image: url("../img/мафия.png");
}

.end-screen[data-winner="civilians"] .end-hero::after {
  background-image: url("../img/мирный.png");
}

.end-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(201, 163, 91, 0.8);
}

.end-title {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 2rem;
  letter-spacing: 0.16em;
  margin-top: 10px;
}

.end-subtitle {
  margin-top: 8px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.5;
}

.end-summary {
  padding: 24px 36px 30px;
  display: grid;
  gap: 16px;
  background: rgba(10, 9, 13, 0.65);
  border-top: 1px solid rgba(201, 163, 91, 0.16);
}

.end-summary-title {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f7e6c4;
}

.end-players {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.end-player {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(16, 15, 20, 0.8);
  border: 1px solid rgba(201, 163, 91, 0.16);
}

.end-player.is-dead {
  opacity: 0.62;
}

.end-player.is-user {
  border-color: rgba(108, 180, 163, 0.6);
  box-shadow: 0 0 0 1px rgba(108, 180, 163, 0.35);
}

.end-player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(201, 163, 91, 0.08);
}

.end-player-name {
  font-weight: 600;
}

.end-player-role {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.end-player-status {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(201, 163, 91, 0.9);
}

.end-actions {
  padding: 0 36px 32px;
  display: flex;
  justify-content: flex-end;
}

.stage-item.done {
  color: rgba(201, 163, 91, 0.7);
}

.role-action,
.vote-action {
  justify-self: center;
  width: min(260px, 100%);
}

.role-card {
  width: min(320px, 80vw);
  height: 420px;
  perspective: 1200px;
  cursor: pointer;
}

.role-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.19, 0.82, 0.2, 1);
}

.role-card.revealed .role-card-inner {
  transform: rotateY(180deg);
}

.role-card-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid rgba(201, 163, 91, 0.35);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 11, 14, 0.9);
}

.role-card-front {
  background: linear-gradient(160deg, rgba(18, 16, 20, 0.95), rgba(28, 20, 24, 0.95));
}

.role-card-back {
  transform: rotateY(180deg);
  background: #0b0b0f;
}

.role-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-card-title {
  font-family: "Cinzel", "Georgia", serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f7e6c4;
  font-size: 1.2rem;
}

.role-card-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.role-name {
  font-family: "Cinzel", "Georgia", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f7e6c4;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.game-panel.role-revealed .role-name {
  opacity: 1;
  transform: translateY(0);
}

.players-panel {
  width: 100%;
  display: grid;
  gap: 10px;
}

.players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.player-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 163, 91, 0.3);
  background: rgba(12, 11, 14, 0.75);
  color: var(--text-main);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.player-chip.is-dead {
  opacity: 0.4;
  text-decoration: line-through;
}

.role-modal,
.vote-modal,
.reveal-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 6, 10, 0.78);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.role-modal-card,
.vote-modal-card,
.reveal-modal-card {
  width: min(420px, 92vw);
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(201, 163, 91, 0.35);
  background: linear-gradient(160deg, rgba(18, 16, 20, 0.96), rgba(12, 11, 14, 0.96));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
}

.role-modal-title,
.vote-modal-title,
.reveal-modal-title {
  font-family: "Cinzel", "Georgia", serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f7e6c4;
  font-size: 1.1rem;
}

.role-modal-subtitle,
.vote-modal-subtitle,
.reveal-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.role-modal-list,
.vote-modal-list {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.role-option,
.vote-option {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 91, 0.3);
  background: rgba(12, 11, 14, 0.9);
  color: var(--text-main);
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.role-option:hover,
.vote-option:hover {
  border-color: rgba(201, 163, 91, 0.6);
  transform: translateY(-1px);
}

.role-option.is-selected,
.vote-option.is-selected {
  border-color: rgba(181, 22, 43, 0.7);
  background: rgba(44, 16, 20, 0.85);
  box-shadow: inset 0 0 0 1px rgba(181, 22, 43, 0.35);
}

.role-modal-actions,
.vote-modal-actions,
.reveal-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.back-button {
  margin-top: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid rgba(201, 163, 91, 0.35);
  background: transparent;
  color: var(--text-muted);
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.back-button:hover {
  color: var(--text-main);
  border-color: rgba(201, 163, 91, 0.6);
  transform: translateY(-1px);
}

.footer-note {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
  z-index: 1;
  position: relative;
}

.status-tag {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px dashed rgba(201, 163, 91, 0.45);
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .stage {
    padding: 48px 28px 36px;
  }

  header {
    flex-direction: column;
  }

  .title-group {
    max-width: 100%;
  }

  h1 {
    letter-spacing: 0.12em;
  }

  .footer-note {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-title {
    letter-spacing: 0.14em;
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .role-card {
    height: 360px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .end-card {
    max-height: 94vh;
  }

  .end-hero {
    padding: 28px;
  }

  .end-title {
    font-size: 1.5rem;
  }

  .end-summary {
    padding: 20px 24px 24px;
  }

  .end-player {
    grid-template-columns: 40px 1fr;
  }

  .end-player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .end-player-status {
    grid-column: 1 / -1;
  }

  .end-actions {
    padding: 0 24px 24px;
    justify-content: center;
  }
}
