:root {
  --bg: #0b0614;
  --bg-2: #120a22;
  --panel: rgba(28, 16, 52, .72);
  --panel-solid: #1a0f30;
  --line: rgba(167, 120, 255, .18);
  --line-2: rgba(167, 120, 255, .35);
  --text: #f3edff;
  --muted: #a99bc7;
  --purple: #9b5cff;
  --purple-2: #c08bff;
  --purple-deep: #5b21d6;
  --pink: #ff5fc8;
  --gold: #ffcf4a;
  --green: #4dff9a;
  --red: #ff4d6d;
  --pixel: "Press Start 2P", monospace;
  --body: "Rubik", system-ui, sans-serif;
  --r: 14px;
  --shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- fundo ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(155, 92, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 92, 255, .07) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; inset: -20% -10% auto; height: 70vh; z-index: -1;
  background:
    radial-gradient(40% 60% at 20% 30%, rgba(155, 92, 255, .35), transparent 70%),
    radial-gradient(35% 50% at 85% 10%, rgba(255, 95, 200, .18), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

/* ---------- topo ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 6, 20, .7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-k {
  width: 42px; height: 42px; display: grid; place-items: center;
  font-family: var(--pixel); font-size: 20px; color: #fff;
  background: linear-gradient(160deg, var(--purple-2), var(--purple-deep));
  border-radius: 10px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3), inset 0 3px 0 rgba(255, 255, 255, .25), 0 0 24px rgba(155, 92, 255, .55);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--pixel); font-size: 15px; letter-spacing: 1px; }
.brand-text small { font-family: var(--pixel); font-size: 9px; color: var(--purple-2); margin-top: 6px; letter-spacing: 3px; }

.top-mid { display: flex; align-items: center; gap: 12px; }
.live-badge {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--pixel); font-size: 10px; letter-spacing: 1px;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); color: var(--muted);
  border: 1px solid var(--line);
}
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-badge.on { background: rgba(255, 77, 109, .15); color: #ffd6de; border-color: rgba(255, 77, 109, .5); }
.live-badge.on i { background: var(--red); box-shadow: 0 0 0 0 rgba(255, 77, 109, .7); animation: ping 1.6s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, .7); }
  70% { box-shadow: 0 0 0 9px rgba(255, 77, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}
.watching { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.watching svg { width: 18px; fill: var(--purple-2); }
.watching b { color: var(--text); }

.top-right { display: flex; gap: 10px; align-items: center; }
.ip-chip, .user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-weight: 500; font-size: 14px;
  transition: border-color .2s, transform .1s;
}
.ip-chip:hover, .user-chip:hover { border-color: var(--line-2); }
.ip-chip:active, .user-chip:active { transform: translateY(1px); }
.ip-chip .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--green); box-shadow: 0 0 10px var(--green); }
.ip-chip svg { width: 15px; fill: var(--muted); }
.user-chip img { width: 24px; height: 24px; border-radius: 5px; image-rendering: pixelated; }

/* ---------- abas (mobile) ---------- */
.tabs { display: none; }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px;
  padding: 20px 24px 40px; max-width: 1560px; margin: 0 auto;
}
.stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- tela da live ---------- */
.screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--r); overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 60px -10px rgba(155, 92, 255, .45), 0 30px 60px -30px #000;
}
.screen::after { /* moldura com brilho */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
#player, .screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen-off {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background:
    radial-gradient(60% 80% at 50% 40%, rgba(155, 92, 255, .25), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 4px),
    #0d0718;
}
.off-k {
  font-family: var(--pixel); font-size: 48px; color: var(--purple-2); margin-bottom: 18px;
  text-shadow: 4px 4px 0 var(--purple-deep), 0 0 30px rgba(155, 92, 255, .8);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px); } }
.off-inner h2 { font-family: var(--pixel); font-size: clamp(14px, 2vw, 20px); margin: 0 0 12px; line-height: 1.5; }
.off-inner p { color: var(--muted); margin: 0 auto 20px; max-width: 360px; }
.off-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.screen-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: rgba(11, 6, 20, .85); border: 1px solid var(--line-2);
  padding: 10px 16px; border-radius: 999px; font-weight: 500; font-size: 14px;
  pointer-events: none; animation: hint 1.6s ease-in-out infinite;
}
.screen-hint span { color: var(--purple-2); margin-right: 6px; }
@keyframes hint { 50% { transform: translate(-50%, -4px); } }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--pixel); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; text-decoration: none;
  padding: 14px 18px; border: 0; border-radius: 10px; color: #fff;
  background: linear-gradient(180deg, var(--purple-2), var(--purple) 55%, var(--purple-deep));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .3), 0 8px 24px -8px rgba(155, 92, 255, .8);
  transition: transform .08s, filter .2s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .3); }
.btn:disabled { filter: grayscale(.6) brightness(.8); cursor: wait; }
.btn.ghost { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.big { width: 100%; padding: 18px; font-size: 13px; }

/* ---------- HUD ---------- */
.hud {
  display: grid; gap: 14px;
  grid-template-columns: 1.35fr 1fr 1.1fr 1fr;
}
.hud-card {
  position: relative; background: var(--panel); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
  backdrop-filter: blur(6px);
}
.lbl {
  display: block; font-family: var(--pixel); font-size: 9px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.sub { color: var(--muted); font-size: 13px; }
.sub b { color: var(--text); font-weight: 500; }

/* jogador + nível */
.player-card { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; }
.head {
  width: 56px; height: 56px; border-radius: 10px; image-rendering: pixelated;
  background: var(--bg-2); box-shadow: 0 0 0 2px var(--line-2), 0 6px 0 -2px rgba(0, 0, 0, .4);
}
.pc-info { min-width: 0; }
.pc-info .lbl { margin-bottom: 6px; }
.pc-info b { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvl-title { font-size: 12px; color: var(--purple-2); font-weight: 500; }
.lvl-badge {
  width: 52px; height: 56px; display: grid; place-items: center; align-content: center; gap: 4px;
  background: linear-gradient(180deg, #ffe07a, var(--gold) 50%, #d99a00);
  color: #3a2500; clip-path: polygon(50% 0, 100% 22%, 100% 78%, 50% 100%, 0 78%, 0 22%);
  filter: drop-shadow(0 0 10px rgba(255, 207, 74, .4));
}
.lvl-badge small { font-family: var(--pixel); font-size: 7px; }
.lvl-badge b { font-family: var(--pixel); font-size: 15px; }
.xp { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.xp-bar { flex: 1; height: 10px; background: rgba(0, 0, 0, .4); border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.xp-bar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--green) 0 10px, #2fe07f 10px 12px);
  box-shadow: 0 0 12px rgba(77, 255, 154, .6);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.xp span { font-family: var(--pixel); font-size: 8px; color: var(--muted); white-space: nowrap; }

/* pontos */
.points-card { overflow: visible; }
.points {
  font-family: var(--pixel); font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; margin-bottom: 10px;
  background: linear-gradient(180deg, #fff, var(--purple-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 var(--purple-deep));
  font-variant-numeric: tabular-nums;
}
.points.bump { animation: bump .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { 30% { transform: scale(1.18); } }
.pop-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pop {
  position: absolute; left: 50%; top: 30%;
  font-family: var(--pixel); font-size: 22px; color: var(--gold);
  text-shadow: 3px 3px 0 #7a4a00, 0 0 16px rgba(255, 207, 74, .8);
  animation: pop 1.3s ease-out forwards;
}
@keyframes pop {
  0% { transform: translate(-50%, 10px) scale(.6); opacity: 0; }
  20% { transform: translate(-50%, -10px) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(1); opacity: 0; }
}

/* timer */
.timer-card { display: flex; align-items: center; gap: 16px; }
.ring { width: 92px; height: 92px; flex: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(0, 0, 0, .45); stroke-width: 12; }
.ring-fg {
  fill: none; stroke: var(--purple); stroke-width: 12; stroke-linecap: butt;
  stroke-dasharray: 314.16; stroke-dashoffset: 314.16;
  filter: drop-shadow(0 0 6px rgba(155, 92, 255, .9));
  transition: stroke .3s;
}
.timer-card.farming .ring-fg { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(77, 255, 154, .8)); }
.ring-wrap { position: relative; width: 92px; height: 92px; flex: none; }
.ring-center {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 4px; pointer-events: none;
}
.ring-center b { font-family: var(--pixel); font-size: 18px; font-variant-numeric: tabular-nums; }
.ring-center small { font-family: var(--pixel); font-size: 7px; color: var(--muted); }
.timer-info { min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.status i { width: 10px; height: 10px; border-radius: 2px; background: var(--muted); flex: none; }
.status.farming i { background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1s steps(2) infinite; }
.status.paused i, .status.afk i { background: var(--gold); }
.status.capped i { background: var(--pink); }
.status.offline i { background: var(--red); }
@keyframes blink { 50% { opacity: .35; } }

/* hoje */
.today-num { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.today-num b { font-family: var(--pixel); font-size: 20px; }
.today-num span { font-family: var(--pixel); font-size: 10px; color: var(--muted); }
.seg-bar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: 10px; }
.seg-bar i { height: 12px; border-radius: 2px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px var(--line); }
.seg-bar i.on { background: linear-gradient(180deg, var(--pink), #c4319a); box-shadow: 0 0 8px rgba(255, 95, 200, .5); }

/* ---------- painéis laterais ---------- */
.panel { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; backdrop-filter: blur(6px); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { font-family: var(--pixel); font-size: 11px; margin: 0; letter-spacing: 1px; text-transform: uppercase; }
.tip { font-size: 12px; color: var(--muted); }

.chat-wrap { position: relative; height: 460px; border-radius: 10px; overflow: hidden; background: #0f0a1a; box-shadow: inset 0 0 0 1px var(--line); }
.chat-wrap iframe { width: 100%; height: 100%; border: 0; }
.chat-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.chat-out { display: block; text-align: center; margin-top: 10px; font-size: 13px; color: var(--purple-2); text-decoration: none; }
.chat-out:hover { text-decoration: underline; }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-list li {
  display: grid; grid-template-columns: 30px 28px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s;
}
.rank-list li.me { box-shadow: inset 0 0 0 1px var(--purple); background: rgba(155, 92, 255, .14); }
.rank-list .pos { font-family: var(--pixel); font-size: 10px; color: var(--muted); text-align: center; }
.rank-list li:nth-child(1) .pos { color: var(--gold); text-shadow: 0 0 10px rgba(255, 207, 74, .7); }
.rank-list li:nth-child(2) .pos { color: #dfe6f0; }
.rank-list li:nth-child(3) .pos { color: #e09a5e; }
.rank-list li:nth-child(-n+3) { background: linear-gradient(90deg, rgba(255, 207, 74, .08), rgba(0, 0, 0, .25) 60%); }
.rank-list img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }
.rank-list .nick { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-list .val { font-family: var(--pixel); font-size: 10px; color: var(--purple-2); }
.rank-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.steps b {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  font-family: var(--pixel); font-size: 10px; border-radius: 7px;
  background: rgba(155, 92, 255, .2); color: var(--purple-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.steps em { font-style: normal; color: var(--gold); font-weight: 700; }
.steps code { font-family: var(--pixel); font-size: 10px; background: rgba(0, 0, 0, .4); padding: 4px 6px; border-radius: 5px; color: var(--green); }
.fine { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }

/* ---------- modais ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(6, 3, 12, .72); backdrop-filter: blur(8px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } }
.card {
  width: 100%; max-width: 440px; background: linear-gradient(180deg, #221440, var(--panel-solid));
  border-radius: 18px; padding: 28px;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 80px -10px rgba(155, 92, 255, .5), 0 40px 80px -30px #000;
  animation: rise .35s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes rise { from { transform: translateY(20px) scale(.97); opacity: 0; } }
.login-head { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.login-preview {
  width: 84px; height: 84px; flex: none; border-radius: 14px; image-rendering: pixelated; background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--purple), 0 8px 0 -1px var(--purple-deep), 0 0 30px rgba(155, 92, 255, .6);
  animation: bob 2.6s ease-in-out infinite;
}
.login-card h1 { font-family: var(--pixel); font-size: 15px; line-height: 1.6; margin: 0 0 8px; }
.login-card h1 span { color: var(--gold); }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card label { display: block; font-family: var(--pixel); font-size: 9px; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.login-card input {
  width: 100%; padding: 16px; font: 500 18px var(--body); color: var(--text);
  background: rgba(0, 0, 0, .45); border: 0; border-radius: 10px; outline: none;
  box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .2s; margin-bottom: 8px;
}
.login-card input:focus { box-shadow: inset 0 0 0 2px var(--purple), 0 0 0 4px rgba(155, 92, 255, .2); }
.err { min-height: 20px; color: var(--red) !important; font-size: 13px !important; margin-bottom: 8px !important; }
.login-card .fine { text-align: center; margin-top: 14px; }

.afk-card { text-align: center; }
.afk-icon {
  width: 72px; height: 72px; margin: 0 auto 16px; display: grid; place-items: center;
  font-family: var(--pixel); font-size: 30px; color: #3a2500; border-radius: 16px;
  background: linear-gradient(180deg, #ffe07a, var(--gold) 50%, #d99a00);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2), 0 0 30px rgba(255, 207, 74, .5);
  animation: wobble .8s ease-in-out infinite;
}
@keyframes wobble { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.afk-card h2 { font-family: var(--pixel); font-size: 18px; margin: 0 0 10px; }
.afk-card p { color: var(--muted); margin: 0 0 18px; }
.afk-timer { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .45); overflow: hidden; margin-bottom: 18px; }
.afk-timer i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width 1s linear; }

/* ---------- toast + fx ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #1f1238; border-radius: 10px; padding: 12px 18px; font-weight: 500; font-size: 14px;
  box-shadow: 0 0 0 1px var(--line-2), 0 20px 40px -10px #000;
  transition: transform .3s cubic-bezier(.2, 1.2, .4, 1), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- responsivo ---------- */
@media (max-width: 1280px) {
  .hud { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .chat-wrap { height: 420px; }
}
@media (max-width: 720px) {
  .top { padding: 10px 16px; }
  .top-mid .watching, .brand-text small { display: none; }
  .ip-chip span#ipText { display: none; }
  .layout { padding: 12px 16px 32px; gap: 12px; }
  .tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    padding: 10px 16px 0; position: sticky; top: 63px; z-index: 15; background: var(--bg);
  }
  .tabs button {
    background: var(--panel); border: 0; border-radius: 10px; padding: 11px 6px;
    font-family: var(--pixel); font-size: 9px; text-transform: uppercase; color: var(--muted);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .tabs button.active { color: #fff; background: rgba(155, 92, 255, .25); box-shadow: inset 0 0 0 1px var(--purple); }
  [data-pane] { display: none; }
  body[data-tab="live"] [data-pane="live"],
  body[data-tab="chat"] [data-pane="chat"],
  body[data-tab="rank"] [data-pane="rank"] { display: flex; }
  .panel[data-pane] { display: none; }
  body[data-tab="chat"] .panel[data-pane="chat"],
  body[data-tab="rank"] .panel[data-pane="rank"] { display: block; }
  .hud { gap: 10px; }
  .hud-card { padding: 14px; }
  .player-card { grid-column: 1 / -1; order: 0; }
  .points-card { order: 1; }
  .today-card { order: 2; }
  .timer-card { grid-column: 1 / -1; order: 3; }
  .top { gap: 8px; }
  .top-right, .top-mid { gap: 6px; }
  #userNick { display: none; }
  .user-chip, .ip-chip { padding: 8px; }
  .live-badge { padding: 7px 10px; font-size: 9px; }
  .brand-text b { font-size: 13px; }
  .logo-k { width: 36px; height: 36px; font-size: 16px; }
  .screen-hint { white-space: nowrap; font-size: 12px; padding: 8px 12px; bottom: 10px; }
  .points { font-size: 24px; }
  .sub { font-size: 12px; }
  .chat-wrap { height: calc(100vh - 220px); min-height: 360px; }
  .login-head { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =================================================================
   Vídeos
   ================================================================= */
body[data-mode="live"] .video-screen,
body[data-mode="live"] .video-bar,
body[data-mode="live"] .videos-section,
body[data-mode="videos"] .live-screen { display: none !important; }

.mode-switch {
  display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px;
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow);
}
.mode-switch button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; border-radius: 9px; padding: 10px 16px;
  font-family: var(--pixel); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  transition: background .2s, color .2s;
}
.mode-switch button:hover { color: var(--text); }
.mode-switch button.active { color: #fff; background: linear-gradient(180deg, rgba(192, 139, 255, .35), rgba(91, 33, 214, .35)); box-shadow: inset 0 0 0 1px var(--purple); }
.mode-switch svg { width: 14px; fill: currentColor; }
.mode-switch .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
body.is-live .mode-switch .dot-live { background: var(--red); animation: ping 1.6s infinite; }
.mode-switch .count {
  font-family: var(--body); font-weight: 700; font-size: 11px; color: #3a2500;
  background: var(--gold); border-radius: 6px; padding: 2px 6px; letter-spacing: 0;
}
.mode-switch .count:empty, .mode-switch .count[data-zero] { display: none; }

#vplayer, .video-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* barra do vídeo atual */
.video-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 300px); gap: 18px; align-items: center;
  background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px;
}
.vb-info { min-width: 0; }
.vb-info .lbl { margin-bottom: 6px; }
.vb-info b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.vb-progress { height: 12px; border-radius: 3px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; margin-bottom: 8px; }
.vb-progress i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--purple-2) 0 10px, var(--purple) 10px 12px);
  box-shadow: 0 0 12px rgba(155, 92, 255, .7);
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.video-bar.done .vb-progress i { background: repeating-linear-gradient(90deg, var(--green) 0 10px, #2fe07f 10px 12px); box-shadow: 0 0 12px rgba(77, 255, 154, .6); }
.vb-reward {
  display: grid; justify-items: center; gap: 4px; padding: 10px 16px; border-radius: 12px;
  background: rgba(255, 207, 74, .1); box-shadow: inset 0 0 0 1px rgba(255, 207, 74, .35);
}
.vb-reward small { font-family: var(--pixel); font-size: 7px; color: var(--muted); text-transform: uppercase; }
.vb-reward b { font-family: var(--pixel); font-size: 18px; color: var(--gold); text-shadow: 2px 2px 0 #7a4a00; }
.video-bar.done .vb-reward { background: rgba(77, 255, 154, .1); box-shadow: inset 0 0 0 1px rgba(77, 255, 154, .4); }
.video-bar.done .vb-reward b { color: var(--green); text-shadow: 2px 2px 0 #0f6b3a; }
.vb-cta p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.vb-cta .btn { width: 100%; font-size: 9px; padding: 12px; }
.vb-cta svg { width: 14px; fill: currentColor; }

/* grade de vídeos */
.videos-section { display: flex; flex-direction: column; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.vcard {
  position: relative; display: flex; flex-direction: column; text-align: left;
  background: var(--panel); border: 0; border-radius: var(--r); padding: 0; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .2s;
}
.vcard:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2), 0 16px 30px -12px rgba(155, 92, 255, .5); }
.vcard.active { box-shadow: 0 0 0 2px var(--purple), 0 0 30px -6px rgba(155, 92, 255, .7); }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; }
.vthumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(11, 6, 20, .85)); }
.vthumb .play {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: grid; place-items: center; border-radius: 50%; background: rgba(11, 6, 20, .7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .3); opacity: 0; transition: opacity .2s, transform .2s; transform: scale(.85);
}
.vthumb .play svg { width: 18px; fill: #fff; margin-left: 2px; }
.vcard:hover .play { opacity: 1; transform: scale(1); }
.vchip {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  font-family: var(--pixel); font-size: 10px; padding: 6px 8px; border-radius: 7px;
  color: #3a2500; background: linear-gradient(180deg, #ffe07a, var(--gold));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2), 0 4px 10px rgba(0, 0, 0, .4);
}
.vdur { position: absolute; left: 8px; bottom: 8px; z-index: 1; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .75); padding: 2px 6px; border-radius: 4px; }
.vcard .vbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.vcard .vtitle { font-weight: 500; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .vprog { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .45); overflow: hidden; margin-top: auto; }
.vcard .vprog i { display: block; height: 100%; background: var(--purple); }
.vcard .vmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.vcard.done .vchip { color: #063; background: linear-gradient(180deg, #8dffbf, var(--green)); }
.vcard.done .vthumb { filter: saturate(.6) brightness(.8); }
.vcard.done .vprog i { background: var(--green); }
.vcard .done-tag { color: var(--green); font-weight: 700; }
.videos-empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 28px; font-size: 14px;
  background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow);
}
.videos-locked .vcard { pointer-events: none; opacity: .5; }

.timer-card.video-mode .ring-fg { stroke: var(--purple-2); }
.timer-card.video-mode.farming .ring-fg { stroke: var(--green); }

@media (max-width: 1280px) {
  .video-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .vb-cta { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
  .vb-cta p { margin: 0; flex: 1; }
  .vb-cta .btn { width: auto; }
}
@media (max-width: 720px) {
  .mode-switch { display: none; }
  .tabs { grid-template-columns: repeat(4, 1fr); }
  .video-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .vcard .vbody { padding: 10px; }
  .vcard .vtitle { font-size: 13px; }
  .vcard .vmeta span + span { display: none; }
  .off-inner p { font-size: 13px; margin-bottom: 14px; }
  .off-inner h2 { font-size: 12px; }
  .off-k { font-size: 32px; margin-bottom: 10px; }
  .vb-cta { flex-direction: column; align-items: stretch; }
  .vb-cta .btn { width: 100%; }
}

.vshort {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  font-family: var(--pixel); font-size: 8px; padding: 5px 7px; border-radius: 6px;
  color: #fff; background: linear-gradient(180deg, #ff4d6d, #c41a3b);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .4);
}

/* =================================================================
   Sorteio ao vivo
   ================================================================= */
.raffle-modal { z-index: 55; }
.raffle-card { max-width: 560px; text-align: center; position: relative; overflow: hidden; }
.raffle-card::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 70%; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 50%, rgba(255, 207, 74, .25), transparent 70%);
}
.rf-badge {
  display: inline-block; font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; padding: 8px 12px; border-radius: 999px;
  color: #3a2500; background: linear-gradient(180deg, #ffe892, var(--gold)); box-shadow: 0 0 24px rgba(255, 207, 74, .5);
  margin-bottom: 14px; position: relative;
}
.raffle-card h2 { font-family: var(--pixel); font-size: 16px; line-height: 1.5; margin: 0 0 8px; position: relative; }
.rf-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; position: relative; }
.rf-wheel { position: relative; margin-bottom: 18px; }
.rf-window {
  height: 92px; overflow: hidden; border-radius: 12px; position: relative;
  background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 0 30px rgba(0, 0, 0, .6);
}
.rf-window::before, .rf-window::after { content: ""; position: absolute; top: 0; bottom: 0; width: 20%; z-index: 2; pointer-events: none; }
.rf-window::before { left: 0; background: linear-gradient(90deg, #1d1236, transparent); }
.rf-window::after { right: 0; background: linear-gradient(-90deg, #1d1236, transparent); }
.rf-strip { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 8px; will-change: transform; }
.rf-strip .slot {
  flex: none; width: 140px; height: 70px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  border-radius: 10px; background: rgba(28, 16, 52, .95); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 14px; overflow: hidden;
}
.rf-strip .slot img { width: 36px; height: 36px; border-radius: 7px; image-rendering: pixelated; flex: none; background: var(--bg-2); }
.rf-strip .slot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-strip .slot.win { color: var(--gold); background: linear-gradient(180deg, #3d2a0a, #24170a); box-shadow: inset 0 0 0 2px var(--gold), 0 0 26px rgba(255, 207, 74, .6); }
.rf-marker { position: absolute; left: 50%; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; z-index: 3; border-radius: 2px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.rf-result { animation: rise .45s cubic-bezier(.2, 1.3, .4, 1); margin-bottom: 16px; position: relative; }
.rf-you {
  font-family: var(--pixel); font-size: 22px; color: var(--gold); margin-bottom: 12px;
  text-shadow: 3px 3px 0 #7a4a00, 0 0 24px rgba(255, 207, 74, .8); animation: bump .6s cubic-bezier(.2, 1.6, .4, 1) 2;
}
.rf-winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rf-winners .w { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 10px; background: rgba(0, 0, 0, .35); font-weight: 700; color: var(--gold); }
.rf-winners .w img { width: 36px; height: 36px; border-radius: 7px; image-rendering: pixelated; }
.rf-winners .w.me { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(255, 207, 74, .5); }
.rf-note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
@media (max-width: 720px) {
  .rf-strip .slot { width: 120px; font-size: 12px; }
  .rf-you { font-size: 16px; }
}
