@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@400;500;600;700;800&display=swap");

:root {
  --bg-0: #f4f9ff;
  --bg-1: #fff8ef;
  --bg-2: #effff7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(24, 57, 95, 0.16);
  --text: #163256;
  --muted: #506b8c;
  --brand-warm: #ff7a45;
  --brand-warm-strong: #ea5c2b;
  --brand-cool: #0f8ab6;
  --brand-cool-strong: #0a6f92;
  --danger: #c5214d;
  --danger-strong: #9f1c40;
  --ok: #0d8072;
  --shadow: 0 18px 42px rgba(13, 31, 56, 0.16);
  --shadow-hover: 0 22px 52px rgba(13, 31, 56, 0.22);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Nunito", sans-serif;
  font-size: 18px;
  line-height: 1.56;
  color: var(--text);
  background:
    radial-gradient(60rem 48rem at -10% -16%, rgba(147, 197, 253, 0.38) 0%, transparent 58%),
    radial-gradient(58rem 48rem at 110% -14%, rgba(253, 186, 116, 0.4) 0%, transparent 57%),
    radial-gradient(64rem 56rem at 50% 112%, rgba(110, 231, 183, 0.34) 0%, transparent 56%),
    linear-gradient(148deg, var(--bg-0), var(--bg-1), var(--bg-2));
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.1vw, 24px);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.4;
  animation: floatBlob 18s ease-in-out infinite;
}

body::before {
  width: min(46vw, 380px);
  height: min(46vw, 380px);
  left: -8vw;
  top: 6vh;
  background: #7dd3fc;
}

body::after {
  width: min(40vw, 320px);
  height: min(40vw, 320px);
  right: -9vw;
  bottom: 10vh;
  background: #fdba74;
  animation-delay: 3s;
}

.container {
  width: min(1080px, 96vw);
  display: grid;
  gap: 16px;
}

.container.player {
  width: min(920px, 96vw);
}

.container > * {
  animation: riseIn 0.45s ease both;
}

.container > *:nth-child(2) {
  animation-delay: 0.08s;
}

.container > *:nth-child(3) {
  animation-delay: 0.14s;
}

.top-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
}

.brand-pill,
.home-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  border-radius: 999px;
  min-height: 36px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.brand-pill {
  color: #0f3e66;
  border: 1px solid rgba(14, 116, 144, 0.26);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(226, 243, 255, 0.9));
  padding: 0 12px;
}

.home-link {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-cool), var(--brand-cool-strong));
  box-shadow: 0 10px 20px rgba(14, 116, 144, 0.24);
  padding: 0 14px;
}

.home-link::before {
  content: "←";
  margin-right: 7px;
}

.brand-pill:hover,
.home-link:hover {
  transform: translateY(-1px);
  filter: saturate(1.06);
}

.home-link:hover {
  box-shadow: 0 14px 24px rgba(14, 116, 144, 0.3);
}

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

h1,
h2,
h3 {
  font-family: "Baloo 2", "Nunito", sans-serif;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  color: #153056;
}

h2 {
  font-size: clamp(1.26rem, 2.6vw, 1.76rem);
  color: #183a61;
}

h3 {
  font-size: 1.04rem;
  color: #1d446f;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow {
  width: fit-content;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f5b80;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
}

.panel {
  background: linear-gradient(166deg, rgba(255, 255, 255, 0.95), rgba(245, 251, 255, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vw, 22px);
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.45), transparent 56%);
}

.panel:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.hero {
  background:
    radial-gradient(90% 130% at 94% -16%, rgba(251, 146, 60, 0.2), transparent 62%),
    radial-gradient(90% 120% at -12% -20%, rgba(56, 189, 248, 0.16), transparent 64%),
    linear-gradient(166deg, #ffffff, rgba(239, 247, 255, 0.95));
}

.lead,
.status-line {
  font-size: clamp(1rem, 2vw, 1.12rem);
  color: #2f4e71;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.game-card {
  align-content: start;
}

.impostor-card {
  border-top: 5px solid rgba(15, 138, 182, 0.76);
}

.vampire-card {
  border-top: 5px solid rgba(255, 122, 69, 0.78);
}

label {
  font-size: 0.98rem;
  font-weight: 700;
  color: #214566;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bfd3e8;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, #f3f9ff);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input::placeholder {
  color: #7d94b0;
}

input:focus,
select:focus {
  outline: none;
  border-color: #5da3d4;
  box-shadow: 0 0 0 4px rgba(93, 163, 212, 0.24);
}

button {
  min-height: 42px;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-warm-strong));
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(234, 92, 43, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(234, 92, 43, 0.34);
  filter: saturate(1.05);
}

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

button.secondary {
  background: linear-gradient(135deg, var(--brand-cool), var(--brand-cool-strong));
  box-shadow: 0 12px 24px rgba(14, 116, 144, 0.26);
}

button.secondary:hover {
  box-shadow: 0 16px 28px rgba(14, 116, 144, 0.33);
}

button.danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-strong));
  box-shadow: 0 12px 24px rgba(159, 28, 64, 0.28);
}

button.danger:hover {
  box-shadow: 0 16px 28px rgba(159, 28, 64, 0.34);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.actions input,
.actions select {
  flex: 1 1 160px;
}

.stack {
  display: grid;
  gap: 10px;
}

.control-stack {
  gap: 12px;
}

.control-block {
  border: 1px dashed rgba(27, 71, 113, 0.22);
  border-radius: var(--r-md);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.8), rgba(238, 248, 255, 0.68));
  padding: 12px;
  display: grid;
  gap: 10px;
}

.control-title {
  color: #1d4d7c;
}

.control-row label {
  min-width: 96px;
}

.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stats-grid > div {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(240, 248, 255, 0.84));
  border: 1px solid rgba(25, 67, 106, 0.2);
  border-radius: var(--r-md);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.stats-grid span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #617b99;
}

.stats-grid strong {
  font-size: clamp(1rem, 2.2vw, 1.26rem);
  color: #1b456e;
}

img#qrImage {
  width: min(340px, 84vw);
  border: 1px solid rgba(25, 67, 106, 0.2);
  border-radius: 14px;
  padding: 7px;
  background: var(--panel-strong);
  box-shadow: 0 10px 22px rgba(18, 47, 79, 0.15);
}

.muted {
  color: var(--muted);
  font-size: 0.98rem;
  word-break: break-word;
}

.panel-note {
  font-size: 0.92rem;
  color: #3f5f82;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--r-sm);
  padding: 7px 10px;
}

.countdown {
  width: fit-content;
  font-size: 1rem;
  color: #1c4e88;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 999px;
  padding: 7px 12px;
}

.winner {
  width: fit-content;
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--ok);
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(13, 128, 114, 0.28);
  border-radius: 10px;
  padding: 8px 12px;
}

.message {
  min-height: 28px;
  font-size: 0.98rem;
  color: #175a96;
}

.message.error {
  color: #9f1c40;
}

.role {
  border: 1px dashed rgba(28, 73, 113, 0.3);
  border-radius: var(--r-md);
  background: linear-gradient(162deg, rgba(255, 255, 255, 0.92), rgba(241, 249, 255, 0.76));
  padding: 12px;
  display: grid;
  gap: 7px;
}

.action-card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.94), rgba(242, 249, 255, 0.82));
}

.intel-panel {
  border-left: 5px solid rgba(14, 116, 144, 0.5);
}

.chat-panel {
  border-left: 5px solid rgba(255, 122, 69, 0.55);
}

.chat-channel {
  padding: 8px;
  border: 1px solid rgba(26, 72, 112, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.chat-list {
  height: clamp(180px, 30vh, 260px);
  overflow-y: auto;
  border: 1px solid rgba(26, 72, 112, 0.2);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #ffffff, #f3f9ff);
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.chat-line {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.42;
  padding: 1px 0;
  color: #1f446a;
  word-break: break-word;
}

.chat-line.muted {
  color: #7590ac;
}

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

.rule-list li {
  position: relative;
  padding: 8px 10px 8px 28px;
  border: 1px solid rgba(24, 57, 95, 0.14);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.68);
}

.rule-list li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-cool));
}

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

.player-list li {
  padding: 8px 10px;
  border: 1px solid rgba(24, 57, 95, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #264a72;
}

.player-list.compact li {
  padding: 6px 8px;
}

.hidden {
  display: none !important;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(12, 28, 49, 0.56);
  backdrop-filter: blur(2px);
}

.popup-card {
  width: min(500px, 94vw);
  background: #ffffff;
  border: 1px solid rgba(24, 57, 95, 0.22);
  border-radius: 18px;
  box-shadow: 0 22px 52px rgba(12, 28, 49, 0.34);
  padding: 22px;
  display: grid;
  gap: 14px;
  animation: riseIn 0.28s ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatBlob {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(12px, -12px);
  }
}

@media (max-width: 920px) {
  .container.player {
    width: min(98vw, 760px);
  }
}

@media (max-width: 700px) {
  body {
    font-size: 16.5px;
    padding: 10px;
  }

  .container {
    width: 98vw;
    gap: 12px;
  }

  .panel {
    border-radius: 16px;
    padding: 13px;
  }

  .top-shortcut {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-pill,
  .home-link {
    justify-content: center;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .actions label {
    margin-bottom: -4px;
  }

  .actions button,
  button {
    width: 100%;
  }

  .countdown,
  .winner {
    width: 100%;
    text-align: center;
  }

  img#qrImage {
    width: min(100%, 360px);
  }

  .chat-list {
    height: 176px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
