@import url("https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700;800&family=Rajdhani:wght@600;700&display=swap");

:root {
  --bg-deep: #07131f;
  --bg-mid: #0f2235;
  --panel: rgba(16, 33, 50, 0.88);
  --panel-strong: rgba(20, 43, 66, 0.95);
  --line: rgba(117, 173, 216, 0.28);
  --line-strong: rgba(132, 198, 244, 0.52);
  --text-main: #eef7ff;
  --text-muted: #a8bfd4;
  --accent: #47e2c5;
  --good: #61dc9f;
  --bad: #ff6f82;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Exo 2", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1200px 680px at 15% -10%, rgba(71, 226, 197, 0.17), transparent 62%),
    radial-gradient(900px 600px at 90% -5%, rgba(255, 187, 102, 0.14), transparent 58%),
    linear-gradient(165deg, var(--bg-deep), var(--bg-mid));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 18px 38px;
}

.page-title {
  margin: 0;
  text-align: center;
  font-family: "Rajdhani", "Exo 2", sans-serif;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 10px 22px rgba(3, 11, 20, 0.7);
}

.page-subtitle {
  margin: 0.4rem 0 1.35rem;
  text-align: center;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

h2,
h3 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-family: "Rajdhani", "Exo 2", sans-serif;
  letter-spacing: 0.03em;
}

.card {
  background:
    linear-gradient(155deg, rgba(16, 35, 53, 0.9), rgba(13, 27, 42, 0.95)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 20px 34px var(--shadow);
  backdrop-filter: blur(7px);
  animation: card-in 280ms ease both;
}

.stage {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.hidden {
  display: none !important;
}

label {
  color: var(--text-muted);
  font-weight: 500;
}

input,
select,
button {
  font-family: inherit;
  font-size: 1rem;
}

input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 19, 31, 0.76);
  color: var(--text-main);
  padding: 0.68rem 0.78rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(71, 226, 197, 0.2);
}

button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.66rem 1rem;
  font-weight: 700;
  color: #07131f;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #7ef3df);
  box-shadow: 0 10px 22px rgba(47, 170, 150, 0.32);
}

.btn-soft {
  background: linear-gradient(135deg, #c3d5e6, #f0f6ff);
  color: #10273b;
  border-color: rgba(255, 255, 255, 0.45);
}

#startGameBtn,
#guessBtn,
#playAudioBtn,
#chatSendBtn {
  background: linear-gradient(135deg, var(--accent), #7ef3df);
  box-shadow: 0 10px 22px rgba(47, 170, 150, 0.32);
}

.landing-form {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr);
  gap: 14px 20px;
  align-items: center;
  max-width: 620px;
  margin: 0 auto;
}

.entry-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.entry-actions > button {
  min-width: 180px;
}

.join-inline {
  display: flex;
  gap: 10px;
  min-width: 320px;
}

.join-inline input {
  flex: 1;
  text-transform: uppercase;
}

.join-inline button {
  width: 120px;
}

.host-settings {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(140px, 240px);
  gap: 14px 22px;
  align-items: center;
  max-width: 560px;
  margin: 0 0 6px;
}


.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  max-width: 700px;
  margin-top: 6px;
}

.section-title-row h3 {
  margin: 10px 0 0;
}

.tag-song-count {
  margin: 0;
  font-family: "Rajdhani", "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: rgba(221, 238, 248, 0.86);
  min-width: 78px;
  text-align: right;
}

.tag-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  max-width: 700px;
}

.tag-chip {
  background: rgba(9, 22, 34, 0.88);
  color: var(--text-main);
  border: 1px solid var(--line-strong);
  min-height: 58px;
}

.tag-chip.active {
  background: linear-gradient(135deg, var(--accent), #8ff8e8);
  color: #051520;
  border-color: rgba(143, 248, 232, 0.8);
  box-shadow: 0 8px 22px rgba(65, 197, 173, 0.28);
}

.setup-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.setup-actions button {
  min-width: 145px;
}

.room-shell {
  display: grid;
  gap: 12px;
}

.room-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.room-top-left,
.room-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-title-text {
  font-family: "Rajdhani", "Exo 2", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e9f6ff;
}

.small-btn {
  padding: 0.46rem 0.85rem;
  background: linear-gradient(135deg, #d8e4f1, #f3f8ff);
  color: #11293d;
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 7px 17px rgba(8, 24, 40, 0.35);
}

.small-btn.danger {
  background: linear-gradient(135deg, #ff8797, #ff5a73);
  color: #fff;
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 12px;
}

.player-board {
  margin: 0;
  min-height: 560px;
}

.room-meta {
  margin-top: -4px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.play-board {
  display: grid;
  gap: 12px;
}

.question-status {
  margin: 0;
}

#statusTitle {
  margin-bottom: 4px;
}

.pause-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pause-controls .small-btn {
  min-width: 132px;
}

.pause-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.score-progress-wrap {
  margin-top: 10px;
}

.score-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.score-progress-track {
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(160, 211, 250, 0.32);
  background: rgba(4, 15, 24, 0.7);
  overflow: hidden;
}

.score-progress-bar {
  height: 100%;
  width: 100%;
  background: #2e9dff;
  transition: width 220ms linear, background-color 220ms ease;
}

.result-board {
  text-align: center;
  margin-top: 2px;
}

.result-board h3 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  letter-spacing: 0.04em;
}

.result-board p {
  margin: 4px 0 12px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.result-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.winner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.winner-avatar {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2px solid rgba(148, 206, 248, 0.45);
  background: radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.25), rgba(120, 170, 220, 0.08));
  color: #d9edff;
  font-size: 2rem;
  font-weight: 800;
}

.winner-card.place-1 .winner-avatar {
  width: 114px;
  height: 114px;
  color: #12273b;
  border-color: rgba(255, 224, 130, 0.76);
  background: radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.45), rgba(255, 206, 83, 0.85));
}

.winner-card.place-2 .winner-avatar {
  border-color: rgba(205, 223, 238, 0.72);
  background: radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.42), rgba(162, 184, 205, 0.72));
}

.winner-card.place-3 .winner-avatar {
  border-color: rgba(255, 190, 140, 0.65);
  background: radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.42), rgba(211, 143, 92, 0.75));
}

.winner-rank {
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #062037;
  background: rgba(234, 245, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.62);
}

.winner-name {
  max-width: 100%;
  text-align: center;
  font-weight: 700;
  word-break: break-word;
}

.winner-score {
  color: #9ac6ef;
  font-weight: 700;
  font-size: 0.95rem;
}

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: saturate(0.35);
}
.status-controls-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.player-controls,
.host-controls {
  margin-top: 0;
}

.host-controls {
  max-width: 320px;
}

.host-controls.start-only label,
.host-controls.start-only input {
  display: none;
}

.host-controls.start-only #startGameBtn {
  width: 170px;
}

#playAudioBtn {
  margin-top: 12px;
  max-width: 190px;
}

.bottom-panels {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 12px;
}

.answer-panel,
.chat-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 340px;
}


.answer-feedback {
  margin: 0 0 10px;
  padding: 10px;
  height: 240px;
  overflow: auto;
  border: 1px solid rgba(160, 211, 250, 0.25);
  border-radius: 12px;
  background: rgba(4, 15, 24, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-feedback-item {
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.answer-feedback-item.good {
  color: #91f5c5;
  background: rgba(30, 84, 63, 0.35);
}

.answer-feedback-item.bad {
  color: #ff9cab;
  background: rgba(94, 35, 46, 0.35);
}
.guess-row {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
}

.guess-row input {
  flex: 1;
}

.guess-row button {
  width: 170px;
}

.chat-messages {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  height: 240px;
  overflow: auto;
  border: 1px solid rgba(160, 211, 250, 0.25);
  border-radius: 12px;
  background: rgba(4, 15, 24, 0.5);
}

.chat-messages li {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(160, 211, 250, 0.12);
  color: #d8e9f8;
  line-height: 1.35;
  word-break: break-word;
}

.chat-messages li:last-child {
  border-bottom: none;
}

.chat-messages li.system {
  color: #9ec6ff;
  font-size: 0.94rem;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
}

.chat-input-row button {
  width: 120px;
}

.players {
  list-style: none;
  padding: 0;
  margin: 0;
}

.players li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(160, 211, 250, 0.22);
  padding: 0.64rem;
  border-radius: 11px;
  margin-bottom: 0.45rem;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-icon {
  width: 24px;
  text-align: center;
  color: #82d8ff;
  font-size: 1.2rem;
  line-height: 1;
}

.player-icon.correct {
  color: #6ee7a8;
}

.player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-points {
  color: #8fc2ef;
  font-weight: 700;
}

#audioPlayer {
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.alerts {
  margin-bottom: 0.8rem;
}

.alert {
  border-radius: 12px;
  padding: 0.66rem 0.78rem;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}

.alert.info {
  background: rgba(71, 226, 197, 0.17);
  border-color: rgba(71, 226, 197, 0.42);
}

.alert.good {
  background: rgba(97, 220, 159, 0.18);
  border-color: rgba(97, 220, 159, 0.44);
}

.alert.bad {
  background: rgba(255, 111, 130, 0.2);
  border-color: rgba(255, 111, 130, 0.45);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(2, 10, 16, 0.72);
  backdrop-filter: blur(2px);
  padding: 16px;
}

.modal-content {
  width: min(680px, 100%);
  margin: 0;
}

.rules-list {
  margin: 0 0 12px;
  padding-left: 20px;
  color: #d9ebfc;
}

.rules-list li {
  margin-bottom: 6px;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .room-layout,
  .bottom-panels {
    grid-template-columns: 1fr;
  }

  .player-board {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .landing-form,
  .host-settings {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: none;
  }

  .entry-actions,
  .setup-actions,
  .guess-row,
  .chat-input-row,
  .room-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .join-inline {
    min-width: 0;
    width: 100%;
  }

  .join-inline button,
  .entry-actions > button,
  .setup-actions button,
  .guess-row button,
  .chat-input-row button,
  #playAudioBtn {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .room-top-left,
  .room-top-right {
    width: 100%;
    justify-content: space-between;
  }
}







