/* RECESS: sunny park, chunky UI floating over a fullscreen canvas.
   Display font Titan One; numerals and body in Rubik. Emoji-only art. */

:root {
  --ink: #2b2233;
  --card: #fff7ea;
  --yellow: #ffd23f;
  --yellow-d: #c79a00;
  --pink: #ff4d6d;
  --green: #30a46c;
  --font-show: 'Titan One', system-ui, sans-serif;
  --font-num: 'Rubik', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-num);
  background: #5da83e;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
}

.hidden {
  display: none !important;
}

/* ---------- join overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 50% -10%, #ffffff33, transparent 60%),
    linear-gradient(#6db84cdd, #4f9a33dd);
  z-index: 100;
  padding: 16px;
}

.home-card {
  background: var(--card);
  color: var(--ink);
  border-radius: 26px;
  padding: 30px 34px;
  width: min(440px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    0 14px 0 #00000033,
    0 30px 80px #00000055;
  text-align: center;
}

.home-card h1 {
  font-family: var(--font-show);
  font-weight: 400;
  font-size: clamp(44px, 9vw, 64px);
  margin: 0;
  color: var(--pink);
  text-shadow:
    0 4px 0 #b22347,
    0 8px 0 #00000022;
  transform: rotate(-2deg);
}

.home-card h1 span {
  font-size: 0.8em;
}

.tagline {
  margin: 0 0 6px;
  color: #6b5f7a;
  font-weight: 600;
}

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

.home-av {
  font-size: 34px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #00000022;
}

.av-btn {
  background: #00000010;
  border-radius: 12px;
  width: 32px;
  height: 58px;
  font-size: 24px;
  color: var(--ink);
}

input {
  font-family: var(--font-num);
  font-size: 17px;
  color: var(--ink);
  background: #00000008;
  border: 2px solid #00000022;
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  min-width: 0;
  text-align: center;
}

input:focus {
  border-color: var(--pink);
}

#home-name {
  flex: 1;
}

.colors {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #00000018;
}

.swatch.active {
  border-color: var(--ink);
  transform: scale(1.18);
}

.big-btn {
  font-family: var(--font-show);
  font-size: 22px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 16px;
  padding: 15px 26px;
  box-shadow: 0 6px 0 var(--yellow-d);
  transition:
    transform 0.06s,
    box-shadow 0.06s;
}

.big-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--yellow-d);
}

.big-btn:disabled {
  opacity: 0.6;
}

.home-err {
  color: #c2226c;
  font-weight: 700;
}

.hint-line {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8d819c;
  font-weight: 600;
}

/* ---------- hud ---------- */

#hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  z-index: 40;
  pointer-events: none;
}

#hud-top > * {
  pointer-events: auto;
}

.brand {
  font-family: var(--font-show);
  font-size: 24px;
  color: #fff;
  text-shadow:
    0 3px 0 #00000044,
    0 0 24px #ffffff44;
  transform: rotate(-2deg);
}

.pill {
  background: #2b2233cc;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.pill .big {
  font-size: 18px;
  color: var(--yellow);
}

.pill.btn:hover {
  background: #2b2233ee;
}

.spacer {
  flex: 1;
}

#emotes {
  display: flex;
  gap: 4px;
}

.ebtn {
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2b2233cc;
  transition: transform 0.08s;
}

.ebtn:hover {
  transform: scale(1.25) rotate(-8deg);
}

#stars {
  position: fixed;
  top: 64px;
  right: 14px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.srow {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #2b2233b8;
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.srow.you {
  outline: 2px solid var(--yellow);
}

.srow.off {
  opacity: 0.45;
}

.sav {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.sstars {
  color: var(--yellow);
}

#banner {
  position: fixed;
  top: 18vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--card);
  color: var(--ink);
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 800;
  border-radius: 18px;
  padding: 14px 30px;
  box-shadow:
    0 8px 0 #00000033,
    0 18px 50px #00000055;
  animation: bannerIn 0.25s cubic-bezier(0.2, 2, 0.4, 1);
  text-align: center;
  max-width: 90vw;
}

#banner small {
  font-size: 0.6em;
  color: #6b5f7a;
}

@keyframes bannerIn {
  from {
    transform: translateX(-50%) scale(1.6);
    opacity: 0;
  }
}

/* big center countdown while a minigame gathers */
#gather {
  position: fixed;
  top: 26vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 3px 0 #00000055;
}

.g-kind {
  font-family: var(--font-show);
  font-size: clamp(26px, 5vw, 44px);
  color: var(--yellow);
}

.g-count {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(64px, 14vw, 120px);
  color: #fff;
  line-height: 1;
  animation: countPop 1s infinite;
}

@keyframes countPop {
  0% {
    transform: scale(1.25);
  }
  30% {
    transform: scale(1);
  }
}

.g-sub {
  font-weight: 800;
  font-size: clamp(15px, 2.6vw, 22px);
  color: #fff;
}

/* white blast when a round goes live */
.flash {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, #ffffff, #ffffff88 55%, transparent 80%);
  animation: flashOut 0.55s ease-out forwards;
}

@keyframes flashOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* you are IT: the screen edges burn */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  box-shadow: inset 0 0 140px 36px rgba(255, 45, 45, 0.55);
  animation: vigPulse 0.7s infinite alternate;
}

@keyframes vigPulse {
  to {
    box-shadow: inset 0 0 170px 52px rgba(255, 45, 45, 0.75);
  }
}

#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #2b2233dd;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  padding: 9px 18px;
  max-width: 90vw;
  text-align: center;
}

/* ---------- touch ---------- */

#joy {
  position: fixed;
  left: 26px;
  bottom: 26px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #2b223355;
  border: 2px solid #ffffff55;
  z-index: 60;
  touch-action: none;
  display: grid;
  place-items: center;
}

#joy-knob {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff7eadd;
  box-shadow: 0 4px 10px #00000055;
  pointer-events: none;
}

#tbtns {
  position: fixed;
  right: 22px;
  bottom: 26px;
  display: grid;
  grid-template-columns: repeat(2, 60px);
  gap: 12px;
  z-index: 60;
}

.tbtn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 26px;
  background: #2b2233aa;
  border: 2px solid #ffffff55;
}

.tbtn:active {
  transform: scale(0.9);
}
