:root {
  --bg: #1b0838; --bg2: #25104a; --card: #2e1459; --card2: #3a1c70;
  --ink: #fbf2ea; --mute: #bba9da; --accent: #ffc61a; --accent2: #ff9f45;
  --ok: #06d6a0; --bad: #ef476f; --line: #502a8c;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 700px at 20% -10%, #6b2fb055, transparent), var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
.hide { display: none !important; }
.top { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; }
.logo { font-weight: 800; letter-spacing: .5px; font-size: 1.25rem; }
.logo b { color: var(--accent); }
.conn { font-size: .8rem; color: var(--mute); }
.conn.off { color: var(--bad); }
main { max-width: 640px; margin: 0 auto; padding: 0 1rem 2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem; padding: 1rem; margin-bottom: .9rem; }
h1, h2, h3 { margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; }
.mute { color: var(--mute); }
.center { text-align: center; }
label { display: block; font-size: .85rem; color: var(--mute); margin: .7rem 0 .25rem; }
input[type=text], select {
  width: 100%; padding: .8rem .9rem; font-size: 1.1rem; border-radius: .8rem;
  border: 2px solid var(--line); background: var(--bg2); color: var(--ink); outline: none;
}
input[type=text]:focus, select:focus { border-color: var(--accent); }
.code-in { text-transform: uppercase; letter-spacing: .4rem; text-align: center; font-weight: 800; }
button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: .9rem;
  padding: .85rem 1.2rem; color: #2a0d52; background: var(--accent); font-size: 1.05rem;
}
button:active { transform: scale(.97); }
button.big { width: 100%; padding: 1rem; font-size: 1.2rem; }
button.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
button.ok { background: var(--ok); }
button.bad { background: var(--bad); color: #fff; }
button.sm { padding: .35rem .7rem; font-size: .85rem; border-radius: .6rem; }
button:disabled { opacity: .5; cursor: default; }
.err { color: var(--bad); min-height: 1.3rem; margin-top: .5rem; font-weight: 600; }

/* palavras */
.words { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; margin: .6rem 0; }
.w { padding: .45rem .75rem; border-radius: .8rem; font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.w.hid {
  min-width: 3rem; text-align: center; background: var(--card2); color: #b79be0;
  border: 2px dashed #7a4fc0; font-family: inherit;
}
button.w.hid { color: #e8dcff; cursor: pointer; }
button.w.hid:hover { border-color: var(--accent); color: var(--accent); }
.w.rev { background: linear-gradient(135deg, #ffd84d, #ffc61a); color: #2a0d52; }
.w.rev.new { animation: pop .45s ease-out; box-shadow: 0 0 0 3px #fff6; }
.w.full { background: var(--card2); color: var(--ink); }
.words.big .w { font-size: 1.9rem; padding: .6rem 1rem; }
@keyframes pop { 0% { transform: scale(.4) rotate(-6deg); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

.banner { margin-bottom: .8rem; border-radius: 1rem; padding: .8rem 1rem; text-align: center; font-weight: 700; font-size: 1.1rem; background: var(--card2); }
.banner.me { background: linear-gradient(135deg, #6b2fb0, #9a55e0); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #ffc61a33; } }
.hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; font-weight: 700; }
.pill { background: var(--card2); padding: .3rem .75rem; border-radius: 99px; font-size: .9rem; }
.pill.pts { background: var(--accent); color: #2a0d52; }
.timer { height: 8px; border-radius: 6px; background: var(--bg2); overflow: hidden; margin: .6rem 0; }
.timer > i { display: block; height: 100%; width: 100%; background: var(--ok); transform-origin: left; }
.timer.low > i { background: var(--bad); }

.feed { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.g { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--bg2); border-radius: .7rem; padding: .45rem .7rem; font-size: .95rem; }
.g.wrong b { color: var(--accent2); }
.g.right { background: #06d6a033; }
.g.note { color: var(--mute); font-style: italic; }
.board { display: flex; flex-direction: column; gap: .35rem; }
.row { display: flex; align-items: center; gap: .6rem; background: var(--bg2); border-radius: .8rem; padding: .55rem .8rem; }
.row .pos { width: 1.6rem; text-align: center; font-weight: 800; color: var(--mute); }
.row .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sc { font-weight: 800; color: var(--accent); }
.row.me { outline: 2px solid var(--accent); }
.row.cur { background: #9a55e055; }
.row.off { opacity: .45; }
.row .sub { color: var(--mute); font-size: .8rem; font-weight: 600; }
.answer { font-size: 2rem; font-weight: 800; color: var(--accent); text-align: center; margin: .3rem 0; }
.big-emoji { font-size: 3rem; text-align: center; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 1rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { padding: .5rem .8rem; border-radius: 99px; border: 2px solid var(--line); background: var(--bg2); color: var(--ink); font-weight: 700; font-size: .95rem; cursor: pointer; }
.chip.on { background: var(--accent); color: #2a0d52; border-color: var(--accent); }
.tag { font-size: .75rem; padding: .15rem .5rem; border-radius: 99px; background: var(--card2); color: var(--mute); }
.notice { background: #ffc61a22; border: 1px solid #ffc61a88; color: #ffe6a0; border-radius: .8rem; padding: .6rem .8rem; margin-bottom: .8rem; font-size: .9rem; }
.guessform { display: flex; gap: .5rem; margin-top: .6rem; }
.guessform input { flex: 1; }

/* ---------- tela do anfitrião (PC/TV) ---------- */
body.host main { max-width: 1250px; }
.hgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .hgrid { grid-template-columns: 1fr; } }
.qrbox { background: #fff; border-radius: 1rem; padding: .6rem; width: min(100%, 300px); margin: 0 auto; }
.qrbox img { width: 100%; display: block; }
.roomcode { font-size: 3.4rem; font-weight: 900; letter-spacing: .6rem; text-align: center; color: var(--accent); }
.url { text-align: center; font-size: 1.15rem; word-break: break-all; }
.gamegrid { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; }
@media (max-width: 900px) { .gamegrid { grid-template-columns: 1fr; } }
.turnname { font-size: 1.6rem; font-weight: 800; text-align: center; margin: .3rem 0; }
.podium { display: flex; gap: .8rem; align-items: flex-end; justify-content: center; margin: 1rem 0; }
.pod { text-align: center; background: var(--card2); border-radius: 1rem 1rem 0 0; padding: .8rem 1rem; min-width: 110px; }
.pod.p1 { background: linear-gradient(#ffd84d, #ffc61a); color: #2a0d52; padding-top: 2rem; }
.pod.p2 { padding-top: 1.2rem; }
.pod .medal { font-size: 2rem; }
.pod .n { font-weight: 800; }
.row2 { display: flex; gap: .6rem; flex-wrap: wrap; }
.row2 > * { flex: 1; }
.spaced { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }

/* ---------- marca MicoRei ---------- */
:root { --purple: #400c71; --gold: #ffc61a; --orange: #f59a0b; --cream: #fbf2ea; }
a { color: var(--accent); }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand img { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--purple); }
.brand b { color: var(--accent); }
.brand small { font-weight: 600; font-size: .8rem; color: var(--mute); }

/* página inicial da plataforma */
body.home main { max-width: 880px; }
.hero { text-align: center; padding: 1.2rem 0 .6rem; }
.hero img.big-logo { width: min(78vw, 360px); height: auto; filter: drop-shadow(0 8px 24px #0006); }
.hero p { color: var(--mute); font-size: 1.1rem; max-width: 34rem; margin: .4rem auto 0; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.gcard { display: flex; flex-direction: column; gap: .5rem; }
.gcard h3 { font-size: 1.35rem; margin: 0; }
.gcard p { margin: 0; color: var(--mute); }
.gart { height: 92px; border-radius: .9rem; background: linear-gradient(135deg, var(--purple), #6b2fb0); display: flex; flex-direction: column; justify-content: center; gap: .4rem; padding: 0 1rem; }
.gart i { display: block; height: 14px; border-radius: 8px; background: #ffffff26; }
.gart i.g { background: var(--gold); width: 34%; }
.gart i.w1 { width: 82%; } .gart i.w2 { width: 64%; }
.gbtns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; }
.gbtns .btn, .gbtns button { flex: 1; text-align: center; text-decoration: none; }
a.btn { display: inline-block; }
a.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.gcard.soon { border-style: dashed; justify-content: center; text-align: center; opacity: .8; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.step { background: var(--bg2); border-radius: 1rem; padding: .9rem; }
.step b { color: var(--accent); font-size: 1.3rem; }
.foot { text-align: center; color: var(--mute); font-size: .85rem; padding: 1.5rem 0 2.5rem; }
