/* Chat Raid: o visual do jogo (fundo roxo-escuro, molduras douradas, fontes pixeladas) */
:root {
  --bg: #0b0714; --bar: #120c20; --panel: #160f27; --panel2: #1f1636; --btn: #241a3d; --edge: #3b2a5c;
  --gold: #c9962f; --gold-hi: #ffd23f; --text: #f4eeff; --muted: #b3a7cc;
  --green: #4ade80; --green-hi: #8affc0; --red: #ff6b6b; --red-bg: #3a0d16; --blue: #4aa3ff; --cyan: #8ad8ff;
  --twitch: #9146ff; --kick: #53fc18;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Jersey 10', system-ui, sans-serif; font-size: 22px; line-height: 1.25; min-height: 100vh; }
a { color: var(--gold-hi); } a:hover { color: #fff1a8; }
img.pix, .pix img, .avatar { image-rendering: pixelated; }
.px { font-family: 'Press Start 2P', monospace; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* cabeçalho */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 24px; border-bottom: 3px solid var(--gold); background: var(--bar); }
.logo { font-size: 20px; color: var(--gold-hi); text-shadow: 3px 3px 0 #5a3a08; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.nav a, .linklike { font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--text); padding: 10px 14px; text-decoration: none; border-radius: 4px; background: none; border: 0; cursor: pointer; }
.nav a.on { color: var(--bar); background: var(--gold-hi); }
.langs { display: flex; gap: 4px; }
.langs button { font-family: 'Press Start 2P', monospace; font-size: 9px; padding: 9px 10px; background: var(--btn); color: var(--text); border: 3px solid var(--edge); border-radius: 4px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--gold-hi); color: var(--bar); border-color: var(--gold-hi); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 4px; border: 3px solid var(--twitch); background: #2f2350; object-fit: cover; }
.me.kick .avatar { border-color: var(--kick); }
.me-text { display: flex; flex-direction: column; font-size: 21px; }
.me-plat { font-size: 8px; color: #c9b6ff; }
.me.kick .me-plat { color: #8dff5c; }

/* moldura e botões */
.frame { background: var(--panel); border: 3px solid var(--gold); box-shadow: inset 0 0 0 3px #3b2a10, 0 0 0 3px #05030a; border-radius: 4px; }
.btn { font-family: 'Press Start 2P', monospace; font-size: 10px; cursor: pointer; border: 3px solid var(--gold); background: var(--btn); color: var(--text);
  border-radius: 4px; box-shadow: inset 0 -4px 0 #120c20; padding: 10px 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover:not(:disabled) { background: #2f2350; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn:focus-visible, .langs button:focus-visible, .nav a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn.small { font-size: 9px; padding: 8px 10px; }
.btn.gold { background: #4a3410; border-color: var(--gold-hi); color: var(--text); }
.btn.danger { background: var(--red); color: #1a0508; border-color: #ffd6d6; }
.bar { height: 12px; background: #1a2440; border: 2px solid #05030a; border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; transition: width .4s; }
.bar.hp { background: var(--red-bg); } .bar.hp > i { background: var(--green); }
.bar.xp > i { background: var(--blue); }
.bar.boss { background: var(--red-bg); height: 14px; flex: 1 1 240px; } .bar.boss > i { background: #e5304a; }

/* login */
.login { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px; padding: 56px 24px; max-width: 1280px; margin: 0 auto; }
.login .pitch { flex: 1 1 440px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.login h1 { margin: 0; font-size: 32px; line-height: 1.35; color: var(--gold-hi); text-shadow: 4px 4px 0 #5a3a08; }
.login .lead { margin: 0; font-size: 28px; max-width: 30ch; }
.login .buttons { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.login .plat { justify-content: flex-start; font-size: 12px; padding: 18px 20px; }
.plat.twitch { background: var(--twitch); border-color: #c9b6ff; color: #fff; box-shadow: inset 0 -4px 0 #5a2bb0; }
.plat.kick { background: var(--kick); border-color: #b8ff9a; color: #07150a; box-shadow: inset 0 -4px 0 #2a9a08; }
.btn.plat.twitch:hover { background: #a46bff; }
.btn.plat.kick:hover { background: #7dff4f; }
.login .side { flex: 1 1 420px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.login .classes { padding: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.login .chips { display: flex; gap: 12px; flex-wrap: wrap; }
.login .chips > div { flex: 1 1 120px; background: var(--panel); border: 3px solid var(--edge); border-radius: 4px; padding: 14px; display: flex; gap: 10px; align-items: center; font-size: 20px; }
.login .chips img { width: 28px; height: 28px; }
.login .classes figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login .classes img { width: 88px; height: 88px; object-fit: contain; }
.login .classes figcaption { font-size: 9px; }
.err { background: var(--red-bg); border: 3px solid var(--red); border-radius: 4px; padding: 12px 16px; color: #ffd6d6; }

/* play */
.play { display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 24px; }
.stage { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.player { flex: 999 1 720px; min-width: 0; aspect-ratio: 16 / 9; background: #07050d; padding: 0; overflow: hidden; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.chat { flex: 1 1 330px; min-width: 0; display: flex; flex-direction: column; background: #100a1c; min-height: 420px; overflow: hidden; }
.chat iframe { flex: 1 1 auto; width: 100%; border: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 3px solid var(--edge); font-size: 10px; }
.chat-head i { width: 10px; height: 10px; background: var(--kick); }
.chat-list { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 20px; }
.chat-list b { font-weight: normal; }
.chat-form { padding: 10px; border-top: 3px solid var(--edge); display: flex; gap: 6px; }
.chat-form input { flex: 1 1 auto; min-width: 0; font-family: 'Jersey 10', sans-serif; font-size: 20px; padding: 10px 12px; background: var(--panel2); color: var(--text); border: 2px solid var(--edge); border-radius: 4px; }
.raidbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 16px; background: var(--panel); border: 3px solid var(--edge); border-radius: 4px; }
.raidbar .boss-name { font-size: 10px; color: var(--gold-hi); }
.raidbar .info { font-size: 19px; color: var(--muted); }
.alert { font-size: 10px; color: #1a0508; background: var(--red); padding: 8px 10px; border-radius: 3px; animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.herobar { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.hero-id { flex: 1 1 330px; display: flex; gap: 14px; align-items: center; min-width: 0; }
.portrait { width: 84px; height: 84px; background: var(--btn); border: 3px solid var(--gold); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex: none; }
.portrait img { width: 72px; height: 72px; object-fit: contain; }
.hero-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tag { font-size: 8px; padding: 4px 6px; border-radius: 3px; border: 2px solid var(--green); color: var(--green-hi); }
.tag.out { border-color: var(--edge); color: var(--muted); }
.tag.dead { border-color: var(--red); color: #ffb3b3; }
.gold-row { display: flex; align-items: center; gap: 8px; font-size: 19px; color: var(--muted); flex-wrap: wrap; }
.gold-row img { width: 20px; height: 20px; }
.gold-row .px { font-size: 11px; color: var(--gold-hi); }
.skills { display: flex; gap: 8px; flex: 0 1 auto; flex-wrap: wrap; }
.skill { width: 132px; flex-direction: column; padding: 10px 6px; gap: 6px; }
.skill img { width: 30px; height: 30px; }
.skill .name { font-size: 9px; text-align: center; }
.skill .cd { font-size: 8px; color: var(--green-hi); }
.skill .cd.wait { color: #ffb3b3; }
.items { display: flex; gap: 6px; flex: 0 1 auto; flex-wrap: wrap; }
.item { width: 70px; flex-direction: column; padding: 8px 4px; gap: 6px; }
.item img { width: 30px; height: 30px; }
.item .k { font-size: 8px; color: var(--gold-hi); }
.item .q { font-size: 8px; }
.join { flex: 1 1 520px; display: flex; flex-direction: column; gap: 10px; }
.join-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.join-head p { margin: 0; }
.join-head .gold-row { margin-left: auto; }
.join .choices { display: flex; gap: 8px; flex-wrap: wrap; }
.join .choice { min-width: 150px; padding: 6px 14px 6px 8px; gap: 8px; font-size: 9px; justify-content: flex-start; }
.join .choice img { width: 40px; height: 40px; object-fit: contain; }
.note { margin: 0; font-size: 18px; color: var(--muted); }

/* modal (loja e notícias) */
.modal { position: fixed; inset: 0; background: rgba(5, 3, 10, .6); display: flex; align-items: flex-start; justify-content: center; padding: 80px 16px 16px; z-index: 10; overflow-y: auto; }
.dialog { width: 100%; max-width: 980px; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.dialog-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dialog-head h2 { margin: 0; font-size: 18px; color: var(--gold-hi); }
.dialog-head .gold { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dialog-head .gold img { width: 22px; height: 22px; }
.dialog-head .gold .px { font-size: 12px; color: var(--gold-hi); }
.close { width: 44px; height: 44px; font-size: 12px; padding: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ware { background: var(--panel2); border: 3px solid var(--edge); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ware-head { display: flex; align-items: center; gap: 10px; }
.ware-head img { width: 40px; height: 40px; }
.ware-head .px { font-size: 10px; }
.ware p { margin: 0; font-size: 19px; min-height: 48px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty .btn { width: 44px; height: 44px; padding: 0; font-size: 12px; }
.qty .px { flex: 1 1 auto; text-align: center; font-size: 12px; }
.news-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.news-list li { display: flex; gap: 12px; font-size: 21px; }
.news-list time { color: var(--muted); min-width: 56px; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: #12361f; border: 3px solid var(--green); border-radius: 4px; padding: 10px 14px; font-size: 20px; color: #c9ffe0; }
.toast.bad { background: var(--red-bg); border-color: var(--red); color: #ffd6d6; }

/* como jogar */
.howto { max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 28px; }
.howto .banner { width: 100%; height: auto; border: 3px solid var(--gold); border-radius: 4px; }
.howto h2 { margin: 0 0 10px; font-size: 16px; color: var(--gold-hi); }
.howto p { margin: 0; max-width: 70ch; }
.howto ol { margin: 0; padding-left: 28px; display: flex; flex-direction: column; gap: 8px; max-width: 70ch; }
.howto .box { background: var(--panel); border: 3px solid var(--cyan); border-radius: 4px; padding: 16px 20px; max-width: 70ch; margin-top: 14px; }
.howto .box .px { font-size: 11px; color: var(--cyan); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { padding: 16px; display: flex; gap: 14px; align-items: center; }
.card img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.card .px { font-size: 11px; }
.table-wrap { overflow-x: auto; border: 3px solid var(--gold); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 22px; }
th { text-align: left; padding: 12px 16px; font-size: 10px; color: var(--gold-hi); background: var(--btn); }
td { padding: 10px 16px; border-top: 2px solid #2a1f45; }
td:first-child { white-space: nowrap; }
.wares { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.wares > div { background: var(--panel); border: 3px solid var(--edge); border-radius: 4px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.wares img { width: 36px; height: 36px; flex: none; }

.play-foot { display: flex; align-items: center; gap: 12px; }
.play-foot .note { flex: 1 1 auto; }
.pip-hold { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--muted); }
.pip-hold p { margin: 0; }

/* mini player: a janelinha flutuante com a live e as barras */
body.pip { height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 6px; overflow-y: auto; font-size: 20px; }
body.pip .player { width: 100%; flex: none; aspect-ratio: 16 / 9; }
body.pip .raidbar { padding: 4px 10px; gap: 8px; }
body.pip .raidbar .info { font-size: 16px; }
body.pip .raidbar .boss-name { font-size: 8px; }
body.pip .herobar { padding: 8px; gap: 8px; }
body.pip .hero-id { flex: 1 1 100%; gap: 10px; }
body.pip .portrait { width: 52px; height: 52px; } body.pip .portrait img { width: 44px; height: 44px; }
body.pip .skills, body.pip .items { flex: 1 1 100%; flex-wrap: nowrap; gap: 6px; }
body.pip .skill, body.pip .item { width: auto; flex: 1 1 0; min-width: 0; padding: 6px 4px; gap: 4px; }
body.pip .skill .name { font-size: 7px; }
body.pip .join { flex-basis: 100%; }
body.pip .join .choice { min-width: 0; flex: 1 1 45%; }
body.pip .no-pip { display: none !important; }

/* tela de computador: live, chat e ações cabem juntos na tela, sem rolar.
   A área da live ocupa a altura que sobra; o vídeo fica no maior 16:9 que cabe e o chat pega o resto da largura. */
@media (min-width: 900px) and (min-height: 600px) {
  body:has(.play) { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
  body:has(.play) > #view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .play { flex: 1 1 auto; min-height: 0; padding: 12px 16px; gap: 10px; }
  .stage { flex: 1 1 auto; min-height: 280px; flex-wrap: nowrap; container-type: size; }
  .player { flex: none; width: min(calc(100cqw - 352px), calc(100cqh * 16 / 9)); align-self: flex-start; }
  .chat { flex: 1 1 340px; min-height: 0; }
  .raidbar { padding: 6px 14px; }
  .herobar { padding: 10px 14px; gap: 12px; }
  .portrait { width: 72px; height: 72px; } .portrait img { width: 60px; height: 60px; }
  .skill { padding: 8px 6px; gap: 4px; }
  .item { padding: 6px 4px; gap: 4px; }
  .play-note { font-size: 16px; }
}

@media (max-width: 760px) {
  body { font-size: 20px; }
  .top { padding: 10px 14px; }
  .play { padding: 12px; }
  .chat { min-height: 360px; }
  .skill { width: calc(50% - 4px); }
  .item { width: calc(20% - 5px); }
  .login h1 { font-size: 24px; }
  .login .classes img { width: 64px; height: 64px; }
}

/* ---------- telas públicas: início, rankings, histórico e perfil ---------- */
main > section.home, main > section.ranks, main > section.raids, main > section.profile { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.home-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.home-hero h1 { font-size: clamp(22px, 5vw, 40px); color: var(--gold-hi); text-shadow: 4px 4px 0 #5a3a08; margin: 8px 0 0; }
.home-hero .lead { max-width: 760px; margin: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.home-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.home-grid .player { flex: 3 1 560px; }
.status { flex: 1 1 280px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.status .boss-name { font-size: 11px; color: var(--gold-hi); }
.status .info { color: var(--muted); }
.status .field { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 19px; }
.status .field .dead { opacity: .5; text-decoration: line-through; }
.record { display: flex; align-items: center; gap: 8px; }
.record img, .crest img { width: 24px; height: 24px; }
img.crest { width: 16px; height: 16px; vertical-align: -2px; margin-right: 3px; }
.goal { display: flex; flex-direction: column; gap: 4px; }
.bar.gold { background: #2a1d0a; } .bar.gold > i { background: var(--gold-hi); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.step { padding: 14px; } .step .px { font-size: 10px; color: var(--gold-hi); } .step p { margin: 8px 0 0; }
.follow { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px; }
.follow > img { width: 48px; height: 48px; }
.follow > div { flex: 1 1 300px; } .follow .px { font-size: 10px; color: #ff9ad5; } .follow p { margin: 6px 0 0; }
.home-week, .rank { padding: 14px; } .home-week h2, .rank h2 { font-size: 11px; color: var(--gold-hi); margin: 0 0 10px; }
.home-week ol, .rank ol { margin: 0 0 8px; padding-left: 28px; }
.rank li { display: flex; justify-content: space-between; gap: 10px; }
.rank li .v { color: var(--muted); }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ranks h1, .raids h1 { font-size: 18px; color: var(--gold-hi); margin: 0; }
.raid-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.raid-list li { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.raid-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.raid-head .px { font-size: 10px; color: var(--gold-hi); }
.raid-heroes { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.mvp { color: var(--gold-hi); }
.profile-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 16px; }
.profile-head .portrait img { width: 96px; height: 96px; }
.profile-head > div:last-child { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.name-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.name-row h1 { font-size: clamp(16px, 3vw, 24px); margin: 0; }
.crest { display: inline-flex; align-items: center; gap: 6px; color: #ff9ad5; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 3px solid var(--edge); border-radius: 4px; padding: 10px 12px; }
.stat .px { font-size: 11px; margin-top: 4px; }
.rank.wide table { width: 100%; border-collapse: collapse; }
.rank.wide th, .rank.wide td { text-align: left; padding: 6px 8px; border-bottom: 2px solid var(--edge); }
.rank.wide th { font-size: 8px; }
img.mini { width: 24px; height: 24px; vertical-align: -5px; }
.mini-raids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.status .bar.boss { flex: none; height: 14px; }

/* equipamento visual na loja */
.gear-pic { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; flex: none; }
.ware.gear.on { outline: 2px solid #8affc0; }
