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

:root {
  --bg: #11142a;
  --card: rgba(255, 255, 255, 0.10);
  --text: #fffdf7;
  --muted: rgba(255, 253, 247, 0.76);
  --line: rgba(255, 255, 255, 0.22);
  --accent: #ffcf4c;
  --accent-2: #38e1d8;
  --accent-3: #ff7b9c;
  --bad: #ff6f76;
  --good: #48f2a6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Fredoka", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(950px 560px at 7% 8%, rgba(255, 207, 76, 0.26), transparent 62%),
    radial-gradient(820px 420px at 92% 16%, rgba(56, 225, 216, 0.24), transparent 62%),
    radial-gradient(980px 620px at 44% 96%, rgba(255, 123, 156, 0.20), transparent 64%),
    var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.34;
}

body::before {
  width: 260px;
  height: 260px;
  background: linear-gradient(135deg, rgba(255, 207, 76, 0.82), rgba(255, 123, 156, 0.62));
  right: -80px;
  top: 26vh;
  animation: floatOrbA 9s ease-in-out infinite;
}

body::after {
  width: 220px;
  height: 220px;
  background: linear-gradient(135deg, rgba(56, 225, 216, 0.72), rgba(119, 169, 255, 0.62));
  left: -70px;
  bottom: 8vh;
  animation: floatOrbB 11s ease-in-out infinite;
}

.wrap {
  max-width: 1020px;
  margin: 20px auto;
  padding: 18px;
}

h1, h2 {
  margin: 0 0 12px;
  font-family: "Baloo 2", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.4px;
}
h1 {
  font-size: clamp(2rem, 3.7vw, 2.9rem);
  font-weight: 800;
  color: #fff4c7;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}
h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 800;
}
p { margin: 8px 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 880px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 760px) {
  .layout {
    grid-template-columns: 1.2fr 0.9fr;
    align-items: start;
  }
}

.topGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

@media (min-width: 880px) {
  .topGrid {
    grid-template-columns: 0.6fr 1.2fr 0.6fr;
  }
}

.miniPlayers {
  display: grid;
  gap: 6px;
}

.miniPlayerRow {
  display: flex;
  gap: 8px;
  align-items: center;
}

.miniPlayerRow .name {
  font-weight: 700;
  color: rgba(246, 247, 251, 0.95);
}

.miniPlayerRow .score {
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 26px rgba(0, 0, 0, 0.20);
  animation: cardRise 380ms ease-out 1;
}

label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 6px; }
input, select, button {
  width: 100%;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  transition: transform 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(56, 225, 216, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 225, 216, 0.16);
}

button {
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 207, 76, 0.42), rgba(255, 123, 156, 0.25));
  border-color: rgba(255, 207, 76, 0.62);
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 207, 76, 0.86);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: linear-gradient(135deg, rgba(56, 225, 216, 0.18), rgba(255, 255, 255, 0.08));
  border-color: var(--line);
}

.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pill.good { border-color: rgba(66, 245, 158, 0.45); color: rgba(66, 245, 158, 0.95); }
.pill.bad { border-color: rgba(255, 107, 107, 0.55); color: rgba(255, 107, 107, 0.95); }

ul { padding-left: 18px; margin: 8px 0; }
li { margin: 6px 0; color: var(--muted); }

.bigCode {
  font-size: 34px;
  letter-spacing: 6px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.toast {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 32, 0.54);
  color: var(--muted);
}

.toast.good { border-color: rgba(66, 245, 158, 0.35); color: rgba(66, 245, 158, 0.9); }
.toast.bad { border-color: rgba(255, 107, 107, 0.35); color: rgba(255, 107, 107, 0.9); }

.options { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 680px) { .options { grid-template-columns: 1fr 1fr; } }

.optionBtn { text-align: left; }

.muted { color: var(--muted); }
.hide { display: none !important; }

/* Progress button. */
.progressBtn {
  position: relative;
  overflow: hidden;
}

.progressFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  display: block;
  pointer-events: none;
  background: rgba(255, 213, 74, 0.22);
  border-right: 1px solid rgba(255, 213, 74, 0.35);
}

.progressLabel {
  position: relative;
  z-index: 1;
}

.chatLog {
  height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 12, 30, 0.34);
}

.chatMsg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
}

.chatMsg .who {
  font-weight: 700;
  color: rgba(246, 247, 251, 0.95);
}

.chatMsg .text {
  color: var(--muted);
  word-break: break-word;
}

/* VIP spin boxes. */
.spinGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.spinBox {
  height: 90px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(7, 10, 26, 0.24));
  border-color: rgba(255, 255, 255, 0.14);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.spinBox:hover {
  transform: scale(1.02);
  border-color: rgba(255, 213, 74, 0.30);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.spinBox:active {
  transform: scale(0.98);
}

.spinBox:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.spinBox.optionPop {
  animation: optionPop 260ms ease-out 1;
}

@keyframes optionPop {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Game panel pop. */
#gameCard.gamePop {
  animation: gamePop 420ms ease-out 1;
}

@keyframes gamePop {
  0% { transform: translateY(6px); opacity: 0.85; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Avatar buttons. */
.avatarBtn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.10);
}

.avatarBtn.picked {
  border-color: rgba(255, 213, 74, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 213, 74, 0.15) inset;
}

.avatarDot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.avatarDot[data-color="sun"] { background: #ffd54a; }
.avatarDot[data-color="mint"] { background: #42f59e; }
.avatarDot[data-color="sky"] { background: #77a9ff; }
.avatarDot[data-color="rose"] { background: #ff6b9a; }
.avatarDot[data-color="grape"] { background: #b392ff; }
.avatarDot[data-color="ember"] { background: #ff8a3d; }
.avatarDot[data-color="lime"] { background: #c8ff4a; }
.avatarDot[data-color="slate"] { background: #9aa6b2; }

/* Hidden YouTube mount. It must exist for the player to work. */
#ytMount,
#previewYtMount {
  width: 1px;
  height: 1px;
  overflow: hidden;
  position: fixed;
  left: -10px;
  top: -10px;
}

.mediaTableWrap {
  width: 100%;
  overflow-x: auto;
}

.mediaTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.mediaTable th,
.mediaTable td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: middle;
}

.mediaTable th {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.mediaPlayBtn {
  min-width: 84px;
}

@keyframes cardRise {
  0% { opacity: 0; transform: translateY(8px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatOrbA {
  0% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
  100% { transform: translateY(0); }
}

@keyframes floatOrbB {
  0% { transform: translateY(0); }
  50% { transform: translateY(12px); }
  100% { transform: translateY(0); }
}
