/* Meme Copier — glassmorphic neon theme */
:root {
  --neon: #22ffe0;
  --grape: #a855f7;
  --candy: #ff3df0;
}
* { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  background: #07070f;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}
.neon-text {
  background: linear-gradient(90deg, var(--neon), var(--grape), var(--candy));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-glow { text-shadow: 0 0 40px rgba(168, 85, 247, .55), 0 0 90px rgba(34, 255, 224, .25); }

/* ambient orbs */
.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: drift 14s ease-in-out infinite alternate; }
.orb-a { width: 420px; height: 420px; background: #7c3aed; top: -120px; left: -120px; }
.orb-b { width: 380px; height: 380px; background: #0ea5e9; bottom: -120px; right: -100px; animation-delay: -5s; }
.orb-c { width: 300px; height: 300px; background: #ec4899; top: 40%; left: 60%; opacity: .22; animation-delay: -9s; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(60px,40px) scale(1.15); } }

#float-layer { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.floater {
  position: absolute; top: 105%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 22px;
  animation: floatUp linear forwards;
  box-shadow: 0 0 24px rgba(168,85,247,.25);
  white-space: nowrap;
}
@keyframes floatUp { to { transform: translateY(-130vh) rotate(8deg); } }
#viz { position: fixed; inset: 0; z-index: 0; opacity: .25; pointer-events: none; }

/* glass */
.glass {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
}
.pill { border-radius: 999px; }
.card { padding: 20px; }
.screen { display: none; animation: screenIn .35s ease; }
.screen.active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
.float-slow { animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.h2 { font-weight: 900; font-size: 1.6rem; margin-bottom: 1rem; text-align: center; }

/* buttons + inputs */
.btn-primary {
  background: linear-gradient(135deg, #22ffe0, #a855f7 55%, #ff3df0);
  color: #06121a; font-weight: 900;
  border-radius: 16px; padding: 14px 20px;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s;
  box-shadow: 0 6px 30px rgba(168,85,247,.45);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.01); filter: brightness(1.08); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; filter: grayscale(.5); cursor: not-allowed; transform: none; }
.btn-glass {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 12px 16px; font-weight: 700;
  transition: all .15s ease; backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255,255,255,.15); transform: translateY(-1px); }
.btn-glass:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-ghost { opacity: .65; font-weight: 600; padding: 10px; border-radius: 12px; transition: opacity .15s; }
.btn-ghost:hover { opacity: 1; }
.inp {
  width: 100%; margin-top: 4px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px; padding: 10px 12px; color: #fff; outline: none;
}
.inp:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(34,255,224,.15); }
.lbl { display: block; font-size: .8rem; opacity: .9; margin-bottom: 10px; }
.chip {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 4px 10px; font-size: 11px;
}
.chip-big {
  background: rgba(0,0,0,.35); border: 1px solid rgba(34,255,224,.4);
  border-radius: 16px; padding: 10px 18px; font-weight: 800; font-size: 1.1rem;
  box-shadow: 0 0 24px rgba(34,255,224,.2);
}
.roomid {
  font-family: monospace; font-size: 1.4rem; font-weight: 900; letter-spacing: .2em;
  background: linear-gradient(135deg, rgba(34,255,224,.15), rgba(255,61,240,.15));
  border: 1px dashed rgba(34,255,224,.6); border-radius: 14px; padding: 6px 12px 6px 18px;
}
.roomid:hover { background: rgba(34,255,224,.15); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-on { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.dot-off { background: #f87171; box-shadow: 0 0 8px #f87171; }

/* vote cards */
.vote-card { transition: transform .15s ease, box-shadow .15s ease; cursor: pointer; }
.vote-card:hover { transform: translateY(-4px); }
.vote-card.picked { border-color: var(--neon); box-shadow: 0 0 30px rgba(34,255,224,.35); }
.vote-emoji { font-size: 3rem; }
.votes-badge {
  display: inline-block; min-width: 2rem; text-align: center;
  background: rgba(34,255,224,.15); border: 1px solid rgba(34,255,224,.5);
  border-radius: 999px; padding: 2px 10px; font-weight: 800;
}
.timerbar { height: 8px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.timerbar > div { height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--neon), var(--candy));
  transition: width 1s linear; }

/* stage */
.stage-glow { border-color: rgba(255,61,240,.35); box-shadow: 0 0 60px rgba(255,61,240,.15), 0 8px 40px rgba(0,0,0,.45); }
/* fullscreen arena: fills everything between the boxes above and below */
.stage-arena {
  position: relative;
  width: 100%;
  height: calc(100vh - 430px);
  height: calc(100dvh - 430px);
  min-height: 360px;
  max-height: 640px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(34,255,224,.3);
  box-shadow: 0 0 50px rgba(34,255,224,.12), 0 12px 50px rgba(0,0,0,.5);
}
#stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#wave-canvas { height: 110px; border-radius: 55px; }
.wave { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 44px; opacity: .5; }
.wave span { width: 8px; border-radius: 4px; background: linear-gradient(180deg, var(--neon), var(--grape)); height: 30%; }
.wave.live span { opacity: 1; animation: wave .7s ease-in-out infinite alternate; }
.wave.live span:nth-child(2n) { animation-delay: -.2s; }
.wave.live span:nth-child(3n) { animation-delay: -.4s; }
@keyframes wave { from { height: 15%; } to { height: 100%; } }
.meter { height: 12px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; width: 0%; background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80); border-radius: 999px; }
.level { height: 10px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.level > div { height: 100%; width: 0%; background: var(--neon); border-radius: 999px; transition: width .08s; }
.turn-chip { font-size: .75rem; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15); }
.turn-chip.done { border-color: #4ade80; color: #4ade80; }
.turn-chip.now { border-color: var(--candy); box-shadow: 0 0 14px rgba(255,61,240,.5); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* scoreboard */
.score-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.score-row.first { border-color: gold; box-shadow: 0 0 30px rgba(255,215,0,.25); }
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; flex: 1; }
.bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--neon), var(--grape), var(--candy)); width: 0%; transition: width 1s ease; }

/* countdown */
#countdown { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
#countdown.hidden { display: none; }
#countdown-num { font-size: 7rem; font-weight: 900; animation: pop .9s ease infinite; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* modals */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); padding: 16px; }
.modal.hidden { display: none; }
.modal-card { max-width: 380px; width: 100%; padding: 28px; text-align: center; animation: screenIn .25s ease; }
.credit { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px; }

/* toasts */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(20,20,35,.9); border: 1px solid rgba(34,255,224,.4); border-radius: 999px; padding: 8px 18px; font-size: .85rem;
  animation: screenIn .25s ease; box-shadow: 0 4px 24px rgba(0,0,0,.5); max-width: 90vw; }

/* ---------------- full mobile version ---------------- */
@media (max-width: 640px) {
  #app { padding-left: 12px; padding-right: 12px; }
  header.glass { flex-wrap: wrap; gap: 8px; border-radius: 18px; justify-content: center; }
  .card { padding: 14px; }
  .h2 { font-size: 1.3rem; }
  .title-glow { line-height: 1.05; }
  #countdown-num { font-size: clamp(4rem, 24vw, 7rem); }
  #countdown-meme { font-size: 1rem; padding: 0 12px; }
  .stage-arena { height: calc(100vh - 400px); height: calc(100dvh - 400px); min-height: 300px; border-radius: 16px; }
  .vote-emoji { font-size: 2.4rem; }
  .btn-primary { padding: 12px 14px; font-size: 1rem; }
  .btn-glass { padding: 10px 12px; font-size: .92rem; }
  .chip-big { font-size: .9rem !important; padding: 8px 12px; }
  .roomid { font-size: 1.05rem; }
  .score-row { flex-wrap: wrap; gap: 8px; }
  .floater { font-size: 16px; }
  #wave-canvas { height: 92px; }
  .modal-card { padding: 20px; }
  #stage-player { font-size: 1.4rem; }
  .toast { font-size: .78rem; padding: 7px 14px; }
  button, .vote-card { touch-action: manipulation; }
  #toasts { bottom: 12px; width: 94vw; }
}
@media (max-width: 380px) {
  #stage-player { font-size: 1.2rem; }
  .btn-primary, .btn-glass { font-size: .9rem; }
}
