/* Visual inspirado na tela inicial do PS5: fundo com a arte do jogo, fileira de jogos e painéis de vidro */
:root {
  color-scheme: dark;
  --bg: #03060e;
  --bg2: #0a1222;
  --glass: rgba(255, 255, 255, .07);
  --glass2: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .14);
  --fg: #fff;
  --muted: rgba(255, 255, 255, .62);
  --dim: rgba(255, 255, 255, .42);
  --blue: #0b6cff;
  --blue2: #4d9bff;
  --ok: #3ddc97;
  --warn: #ffc857;
  --err: #ff5f7a;
  --radius: 14px;
  --font: "SST", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--fg); font: 16px/1.45 var(--font);
  background: radial-gradient(1400px 800px at 50% -20%, #12305f 0%, #071226 45%, var(--bg) 80%) fixed, var(--bg);
}
[hidden] { display: none !important; }
a { color: var(--blue2); }
h1, h2 { margin: 0; font-weight: 300; letter-spacing: .005em; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: #0008; padding: 2px 7px; border-radius: 6px; letter-spacing: .06em; }
.muted { color: var(--muted); font-size: .875rem; }
.icon { width: 20px; height: 20px; flex: none; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.card, .panel {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
}
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---- botões: brancos como os do PS5 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: #000; padding: 11px 22px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .2s, background .15s, opacity .15s;
}
.btn:hover { box-shadow: 0 0 0 4px #ffffff33, 0 8px 30px -6px #ffffff66; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: var(--glass2); color: var(--fg); }
.btn.ghost:hover { background: rgba(255, 255, 255, .2); box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: .82rem; }
.btn.danger { background: transparent; color: var(--err); }
.btn.danger:hover { background: #ff5f7a22; box-shadow: none; }
.btn.block { width: 100%; padding: 13px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: .875rem; color: var(--blue2); cursor: pointer; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; flex: none;
  background: transparent; border: 0; color: var(--fg); cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--glass2); }

input, select {
  font: inherit; width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .35); color: var(--fg); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--dim); }
select option { background: #0a1222; color: #fff; }
input:focus, select:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px #ffffff30; }

/* ================= tela inicial ================= */
.home { overflow-x: hidden; background: var(--bg); }

/* fundo: arte do jogo selecionado, trocando com fade */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.backdrop .layer {
  position: absolute; inset: -60px; background-size: cover; background-position: center 30%;
  filter: blur(26px) saturate(130%) brightness(.75); transform: scale(1.08); opacity: 0; transition: opacity .7s ease;
}
.backdrop .layer.on { opacity: 1; }
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #03060e55 0%, #03060e22 25%, #03060ecc 62%, var(--bg) 100%),
              linear-gradient(90deg, #03060ebb 0%, transparent 60%);
}

/* topo */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) 8px;
}
.nav { display: flex; gap: 28px; }
.nav button {
  background: none; border: 0; padding: 6px 0; font: inherit; font-size: 1.35rem; font-weight: 300;
  color: var(--muted); cursor: pointer; position: relative; transition: color .15s;
}
.nav button:hover { color: var(--fg); }
.nav button.on { color: var(--fg); font-weight: 600; }
.nav button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-radius: 2px; background: #fff; }
.tools { display: flex; align-items: center; gap: 6px; }
.search {
  position: relative; display: flex; align-items: center; width: 40px; height: 40px; border-radius: 999px;
  transition: width .25s ease, background .15s; cursor: pointer;
}
.search:hover, .search.open { background: var(--glass2); }
.search.open { width: min(260px, 52vw); cursor: text; }
.search svg { position: absolute; left: 10px; pointer-events: none; }
.search input { border: 0; background: transparent; padding: 0 12px 0 40px; height: 100%; opacity: 0; pointer-events: none; }
.search.open input { opacity: 1; pointer-events: auto; }
.search input:focus { box-shadow: none; }
.user { display: flex; align-items: center; gap: 10px; margin-left: 6px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue), #7b4dff); font-weight: 700; text-transform: uppercase;
  box-shadow: 0 0 0 2px #ffffff40;
}
.user .who { font-weight: 600; font-size: .95rem; }
.badge { font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: #ffffff22; text-transform: uppercase; letter-spacing: .06em; }
.clock { font-size: 1.1rem; font-weight: 300; margin-left: 12px; font-variant-numeric: tabular-nums; }

.view { padding: 0 clamp(16px, 4vw, 56px) 40px; }

/* filtro de plataforma, acima da fileira */
.filters { display: flex; gap: 8px; padding: 14px 4px 0; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  display: inline-flex; align-items: center; gap: 7px; flex: none; font: inherit; font-size: .85rem; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass2); color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.filters button:hover { color: var(--fg); background: rgba(255, 255, 255, .2); }
.filters button.on { background: #fff; color: #000; border-color: #fff; }
.filters small { font-size: .72rem; font-weight: 700; opacity: .6; font-variant-numeric: tabular-nums; }

/* fileira de jogos */
.shelf {
  list-style: none; margin: 0; padding: 26px 4px 22px; display: flex; align-items: flex-start; gap: 14px;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; min-height: 208px;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf li { flex: none; }
.tile {
  --s: 118px; display: block; width: var(--s); height: var(--s); border-radius: 14px; overflow: hidden;
  position: relative; text-decoration: none; color: inherit; cursor: pointer;
  box-shadow: 0 10px 24px -10px #000c; transition: width .22s ease, height .22s ease, box-shadow .22s, transform .12s;
}
.tile:hover { transform: translateY(-3px); }
.tile:focus-visible { outline: none; }
.tile .cover { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.tile.sel {
  --s: 158px;
  box-shadow: 0 0 0 3px #fff, 0 0 26px 4px #ffffff55, 0 18px 40px -12px #000;
}
.tile.sel:hover { transform: none; }
.tile .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; font-size: .72rem; font-weight: 600;
  background: linear-gradient(transparent, #000c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 3;
}
.tile.sel .name, .tile.art-only .name { display: none; }

/* capa (usada nos quadrados): imagem inteira por cima de uma cópia desfocada */
.cover {
  --h: 220; position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(140deg, hsl(var(--h) 70% 42%), hsl(calc(var(--h) + 45) 75% 22%));
}
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 25% 15%, #fff3, transparent 55%); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover img.bg { object-fit: cover; filter: blur(14px) brightness(.55); transform: scale(1.2); }
.cover img.fg { object-fit: contain; z-index: 1; }
.cover.art .initials, .cover.art::after { display: none; }
.cover .initials { font-size: 2.1rem; font-weight: 800; color: #fffe; letter-spacing: -.02em; text-shadow: 0 2px 10px #0006; }
.cover .sys {
  position: absolute; top: 7px; left: 7px; z-index: 2; font-size: .6rem; font-weight: 800; padding: 2px 6px;
  border-radius: 5px; background: #000a; color: #fff; letter-spacing: .06em;
}

/* destaque do jogo selecionado */
.hero { max-width: 880px; padding-top: 6px; animation: fade .35s ease; }
.hero .eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue2); margin-bottom: 6px; min-height: 1.2em; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.08; text-shadow: 0 4px 30px #000a; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 26px; }
.chip { font-size: .78rem; font-weight: 600; padding: 4px 11px; border-radius: 99px; background: var(--glass2); border: 1px solid var(--line); color: var(--muted); }
.hero .actions { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.btn-play { padding: 14px 46px; font-size: 1.05rem; }
.btn-play svg { width: 18px; height: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat {
  padding: 16px 18px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.stat .label { display: flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .label .icon { width: 15px; height: 15px; }
.stat strong { display: block; font-size: 1.35rem; font-weight: 300; margin-top: 6px; }
.stat small { color: var(--dim); font-size: .78rem; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* dicas de controle, canto inferior */
.hints {
  position: fixed; right: clamp(16px, 4vw, 56px); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 18px;
  font-size: .8rem; color: var(--muted); pointer-events: none;
}
.hints span { display: flex; align-items: center; gap: 6px; }
.hints kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 50%;
  border: 1.5px solid var(--muted); font: 700 .7rem var(--font); color: var(--fg);
}
.hints kbd.key { border-radius: 6px; }
.hints kbd svg { width: 12px; height: 12px; }

/* estados vazios / carregando */
.empty { max-width: 520px; padding: 40px 0; color: var(--muted); }
.empty .big { font-size: 2.6rem; margin-bottom: 10px; }
.empty strong { color: var(--fg); display: block; margin-bottom: 6px; font-size: 1.5rem; font-weight: 300; }
.skeleton .tile { pointer-events: none; background: linear-gradient(90deg, #ffffff10, #ffffff22, #ffffff10); background-size: 200% 100%; animation: shimmer 1.2s infinite; box-shadow: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #ffffff55; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.busy { background: var(--warn); animation: pulse 1s infinite; }
.dot.err { background: var(--err); }
@keyframes pulse { 50% { opacity: .35; } }

/* envio de arquivos (admin) */
.drop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #03060edd;
  backdrop-filter: blur(6px); border: 3px dashed #fff; font-size: 1.4rem; font-weight: 300;
}
.upload-card { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 60; width: min(440px, calc(100% - 32px)); padding: 16px 18px; }
.progress { height: 5px; background: #ffffff22; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }

/* convites */
.panel { max-width: 880px; margin-top: 24px; }
.panel .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel h2 { font-size: 1.8rem; }
.panel .head p { margin: 6px 0 0; }
.invites { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.invites li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; }
.invites li.used { opacity: .55; }
.invites code { font-size: 1rem; }
.pill { font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }
.pill.free { background: #3ddc9722; color: var(--ok); }
.pill.used { background: #ffffff14; color: var(--muted); }
.invites .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- amigos e presença ---- */
/* bolinha de status no canto do avatar: verde disponível, amarela ausente, azul jogando, cinza offline/invisível */
.avatar { position: relative; }
.avatar[data-letter]::before { content: attr(data-letter); }
/* foto do perfil por cima da letra (a letra fica se a foto não carregar) */
.avatar .pic { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.editable { cursor: pointer; }
.avatar.editable::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .15s;
  background: rgba(0, 0, 0, .5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / 34% no-repeat;
}
.avatar.editable:hover::after, .avatar.editable:focus-visible::after { opacity: 1; }
/* janela de ajustar a foto (photo.js): o círculo claro é o que aparece no avatar */
.crop {
  position: relative; width: min(320px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 12px;
  background: #000; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.crop:active { cursor: grabbing; }
.crop:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.crop canvas { position: absolute; left: 0; top: 0; display: block; max-width: none; pointer-events: none; }
.crop::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .6), inset 0 0 0 2px #ffffffb0;
}
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.crop-zoom input { flex: 1; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--blue); }
.presence {
  position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%;
  border: 2.5px solid var(--bg); background: #6b7385;
}
.presence.online { background: var(--ok); }
.presence.away { background: var(--warn); }
.presence.playing { background: var(--blue2); }
.presence.invisible { background: var(--bg); box-shadow: inset 0 0 0 2px #8e96a8; }
.presence.none { display: none; }
.user { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 0;
  background: transparent; color: inherit; font: inherit; cursor: pointer; transition: background .15s;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--glass2); }
.user-btn .who { display: grid; text-align: left; line-height: 1.15; }
.user-btn .who small { font-size: .7rem; font-weight: 400; color: var(--muted); }
.status-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; width: 270px; padding: 6px;
  background: rgba(20, 28, 46, .96); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(20px); box-shadow: 0 20px 50px -12px #000; animation: fade .15s ease;
}
.status-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.status-menu button:hover, .status-menu button:focus-visible { background: var(--glass2); outline: none; }
.status-menu button[aria-checked="true"] { background: #0b6cff2a; }
.status-menu .presence { position: static; flex: none; border: 0; width: 12px; height: 12px; }
.status-menu .presence.invisible { background: transparent; }
.status-menu span { display: grid; }
.status-menu strong { font-size: .92rem; font-weight: 600; }
.status-menu small { font-size: .75rem; color: var(--muted); }
.status-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.nav .count {
  position: absolute; top: 0; right: -16px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--err); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center;
}

.add-friend { display: flex; gap: 8px; width: min(100%, 380px); }
.add-friend input { padding: 9px 14px; border-radius: 999px; }
.add-friend .btn { flex: none; padding: 9px 18px; }
.group { margin-bottom: 22px; }
.panel h3, .profile-page h3 { margin: 0 0 10px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; }
.people li.friend { cursor: pointer; transition: background .15s; }
.people li.friend:hover { background: rgba(255, 255, 255, .06); }
.people li.offline { opacity: .6; }
.people li.empty-row { display: block; }
.people .avatar, .profile-page .avatar {
  background: linear-gradient(135deg, hsl(var(--h, 220) 70% 45%), hsl(calc(var(--h, 220) + 45) 75% 28%));
  box-shadow: none;
}
.people .presence { border-color: #10172a; }
.people .who { flex: 1; min-width: 140px; display: grid; }
.people .who strong { font-weight: 600; }
.people .who .handle { font-weight: 400; color: var(--dim); font-size: .82rem; }
.people .who small { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .who small.playing, .pf-status.playing { color: var(--blue2); }
.people .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* ================= perfil (perfil.html), página inteira ================= */
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--fg); text-decoration: none; font-size: .95rem; font-weight: 600;
  padding: 8px 16px 8px 10px; border-radius: 999px; background: var(--glass2); transition: background .15s;
}
.back-link:hover { background: rgba(255, 255, 255, .2); }
.topbar .brand { font-size: 1.25rem; }
.topbar .brand .logo { width: 36px; height: 36px; }
.profile-page { max-width: 880px; display: grid; gap: 26px; padding-top: 22px; animation: fade .35s ease; }
.pf-head { display: flex; align-items: center; gap: 24px; }
.pf-head > div { min-width: 0; }
.pf-head .eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue2); margin-bottom: 4px; }
.pf-head h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; overflow-wrap: anywhere; text-shadow: 0 4px 30px #000a; }
.pf-head .handle { font-size: 1rem; color: var(--muted); margin-top: 4px; }
.avatar.big { width: 112px; height: 112px; font-size: 3rem; box-shadow: 0 0 0 3px #ffffff30, 0 16px 40px -12px #000; }
.avatar.big .presence { width: 26px; height: 26px; border-width: 4px; right: 0; bottom: 0; }
.pf-status { font-size: .95rem; margin-top: 6px; color: var(--muted); }
.pf-status.online { color: var(--ok); }
.pf-status.away { color: var(--warn); }
.pf-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-actions:empty { display: none; }
.profile-page h3 { margin: 0 0 12px; }
.profile-page .empty { padding: 20px 0; }
.pf-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pf-games li {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px 10px 10px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.pf-games li.empty-row { display: block; padding: 14px; }
.pf-games .cover { width: 64px; flex: none; border-radius: 10px; }
.pf-games .cover .initials { font-size: 1.2rem; }
.pf-games .cover .sys { display: none; }
.pf-games .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pf-games .info strong { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-games .info small { color: var(--muted); font-size: .76rem; }
.bar-time { height: 4px; border-radius: 2px; background: #ffffff14; margin-top: 5px; overflow: hidden; }
.bar-time i { display: block; height: 100%; background: var(--blue2); border-radius: 2px; }
.pf-games .hours { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; text-align: right; }
.pf-games .hours small { display: block; color: var(--muted); font-size: .68rem; font-weight: 500; }
.pf-friends {
  font: inherit; font-weight: 600; color: var(--fg); background: none; border: 0; padding: 0; margin-left: 12px; cursor: pointer;
}
.pf-friends:hover:not(:disabled) { text-decoration: underline; }
.pf-friends:disabled { color: var(--muted); font-weight: 400; cursor: default; }
.friends-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.friends-dialog .people { max-height: min(60vh, 480px); overflow-y: auto; }
.people a.person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.pf-tabs { display: inline-flex; margin-bottom: 12px; }
.pf-tabs button { flex: none; padding: 8px 18px; font-size: .85rem; }

/* janela de mudar o apelido */
.nick-dialog { margin: auto; color: var(--fg); width: min(460px, calc(100vw - 24px)); background: rgba(10, 18, 34, .96); padding: 24px; }
.nick-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
.nick-dialog h2 { font-size: 1.5rem; }
.nick-dialog p.muted { margin: 6px 0 0; }
.nick-dialog b { color: var(--fg); font-weight: 600; }
.nick-preview {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
}
.nick-preview .avatar { background: linear-gradient(135deg, hsl(var(--h, 220) 70% 45%), hsl(calc(var(--h, 220) + 45) 75% 28%)); box-shadow: none; }
.nick-preview div { display: grid; min-width: 0; flex: 1; }
.nick-preview strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nick-preview small { color: var(--muted); font-size: .8rem; }
.nick-preview .nick-tag { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.nick-hint { display: flex; justify-content: space-between; gap: 12px; }
#nickCount { flex: none; font-variant-numeric: tabular-nums; }
.nick-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nick-actions .spacer { flex: 1; }
.nick-dialog input, .nick-dialog select { font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--fg); }

/* ---- conversa com amigos: painel no canto inferior direito (tela inteira no celular) ---- */
.people .btn .count {
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px;
  background: var(--err); color: #fff; font-size: .68rem; font-weight: 700; display: inline-grid; place-items: center;
}
.people .who small.unread { color: var(--fg); font-weight: 600; }
.chat {
  position: fixed; right: clamp(16px, 4vw, 56px); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 90;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(14, 22, 40, .94); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 24px 60px -16px #000; animation: fade .2s ease;
}
.chatting .hints { display: none; }
.chat-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 12px; border-bottom: 1px solid var(--line); }
.chat-who {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px 8px 4px 4px; border-radius: 12px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.chat-who:hover { background: var(--glass2); }
.chat-who .avatar { background: linear-gradient(135deg, hsl(var(--h, 220) 70% 45%), hsl(calc(var(--h, 220) + 45) 75% 28%)); box-shadow: none; }
.chat-who .presence { border-color: #0e1628; }
.chat-who .who { display: grid; min-width: 0; line-height: 1.25; }
.chat-who strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who .handle { font-weight: 400; color: var(--dim); font-size: .8rem; }
.chat-who small { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-who small.playing { color: var(--blue2); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.chat-more { align-self: center; margin-bottom: 10px; }
.chat-empty { margin: auto; text-align: center; }
.chat-list { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 82%; align-self: flex-start; display: grid; gap: 2px; }
.msg p {
  margin: 0; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--glass2);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.35;
}
.msg time { font-size: .68rem; color: var(--dim); padding: 0 6px; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.mine p { background: var(--blue); border-radius: 16px 16px 4px 16px; }
.msg.seen time::after { content: " · Visto"; }
.chat-form { display: flex; align-items: flex-end; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea {
  flex: 1; font: inherit; font-size: 1rem; resize: none; padding: 9px 14px; border-radius: 20px; max-height: 130px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--fg); line-height: 1.35;
}
.chat-form textarea::placeholder { color: var(--dim); }
.chat-form textarea:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px #ffffff30; }
.chat-send { background: #fff; color: #000; }
.chat-send:hover { background: #dfe6f2; }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-off { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); text-align: center; }
.toast.clickable { cursor: pointer; }

/* notificações, no canto superior direito como no PS5 */
.toasts { position: fixed; top: 76px; right: clamp(16px, 4vw, 56px); z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast {
  padding: 14px 16px; border-radius: 12px; background: rgba(20, 28, 46, .92); border: 1px solid var(--line);
  backdrop-filter: blur(20px); box-shadow: 0 16px 40px -12px #000; font-size: .9rem; animation: slide .25s ease-out;
  border-left: 4px solid var(--blue2);
}
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* ================= login ================= */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.wrap { width: 100%; margin: 0 auto; }
.narrow { max-width: 420px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 300; font-size: 1.6rem; color: var(--fg); text-decoration: none; }
.brand small { font-weight: 600; font-size: inherit; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--blue), #7b4dff); box-shadow: 0 8px 24px -8px var(--blue);
}
.logo svg { width: 24px; height: 24px; }
.auth .brand { justify-content: center; margin-bottom: 8px; }
.auth .sub { text-align: center; margin: 0 0 26px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, .35); border-radius: 999px; margin-bottom: 20px; }
.tabs button {
  flex: 1; font: inherit; font-weight: 600; font-size: .9rem; padding: 9px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.tabs button.on { background: #fff; color: #000; }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 7px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.form .hint { font-weight: 400; font-size: .78rem; letter-spacing: 0; text-transform: none; color: var(--dim); }
.pass { position: relative; }
.pass input { padding-right: 46px; }
.pass button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 6px; display: grid; }
.pass button:hover { color: var(--fg); }
.notice { padding: 12px 14px; border-radius: 10px; font-size: .875rem; margin: 0; }
.notice.info { background: #0b6cff22; border: 1px solid #4d9bff55; }
.notice.err { background: #ff5f7a1a; border: 1px solid #ff5f7a55; color: #ffc6d0; }
.auth footer { text-align: center; margin-top: 20px; }
.google { display: grid; gap: 16px; justify-items: center; }
.google .or { display: flex; align-items: center; gap: 12px; width: 100%; font-size: .78rem; color: var(--dim); }
.google .or::before, .google .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google #googleBtn, .google-btn { min-height: 44px; color-scheme: normal; }
.google-btn { display: grid; justify-items: center; }

/* ================= tela do jogo ================= */
.play { height: 100dvh; display: flex; flex-direction: column; background: #000; }
.bar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #0a1222, #050a14); border-bottom: 1px solid var(--line);
}
.bar .back {
  display: inline-flex; align-items: center; gap: 6px; color: var(--fg); text-decoration: none; font-size: .9rem; font-weight: 600;
  padding: 7px 14px 7px 8px; border-radius: 999px; flex: none; background: var(--glass); transition: background .15s;
}
.bar .back:hover { background: var(--glass2); }
.bar #title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; font-weight: 300; }
.status {
  display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: .8rem; color: var(--muted);
  padding: 6px 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 99px; max-width: 45vw;
}
.status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
#game { flex: 1; min-height: 0; }
.fatal { margin: auto; width: calc(100% - 32px); max-width: 420px; text-align: center; padding: 28px 24px; }
.fatal p { margin: 8px 0; }
.fatal .btn { margin-top: 10px; }
.fatal-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 700; color: var(--err); background: #ff5f7a1f; border: 2px solid var(--err);
}
/* tela de carregamento, por cima do emulador até o jogo começar */
#game .ejs_loading_text { display: none; }
.loading {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(900px 520px at 50% -10%, #12305f 0%, #071226 50%, var(--bg) 85%), var(--bg);
  transition: opacity .45s ease;
}
.loading[hidden] { display: none; }
.loading.done { opacity: 0; pointer-events: none; }
.loading-card { width: min(380px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; animation: fade .4s ease; }
.loading-ring { position: relative; width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 4px; color: var(--blue2); }
.loading-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--blue) 60%, #7b4dff 85%, #fff 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spin 1.1s linear infinite;
}
.loading-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); }
.loading-ring svg { position: relative; z-index: 1; width: 30px; height: 30px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.loading-name { margin: 0; font-size: 1.35rem; font-weight: 300; line-height: 1.25; overflow-wrap: anywhere; }
.loading-line { margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.loading-title { font-size: .95rem; font-weight: 600; }
.loading-detail { font-size: .85rem; color: var(--blue2); font-variant-numeric: tabular-nums; }
.loading-bar { width: 100%; height: 6px; border-radius: 99px; background: var(--glass2); overflow: hidden; }
.loading-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue2)); box-shadow: 0 0 12px var(--blue2); transition: width .3s ease;
}
.loading-bar.indeterminate i { width: 35%; animation: indeterminate 1.3s ease-in-out infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.loading-steps { list-style: none; margin: 2px 0 0; padding: 0; display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: center; }
.loading-steps li { display: flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.loading-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--glass2); }
.loading-steps li.on { color: var(--fg); }
.loading-steps li.on::before { background: var(--blue2); box-shadow: 0 0 8px var(--blue2); animation: pulse 1s infinite; }
.loading-steps li.done { color: var(--ok); }
.loading-steps li.done::before { background: var(--ok); }
.loading-tip { margin: 10px 0 0; min-height: 2.6em; font-size: .82rem; color: var(--muted); animation: fade .5s ease; }
.loading-actions { display: none; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.loading.error .loading-actions { display: flex; }
.loading.error .loading-bar, .loading.error .loading-steps, .loading.error .loading-tip { display: none; }
.loading.error .loading-ring { color: var(--err); }
.loading.error .loading-ring::before { animation: none; background: var(--err); }
.loading.error .loading-ring svg { animation: none; }
.loading.error .loading-title { color: var(--err); }
.loading.error .loading-line { flex-direction: column; align-items: center; gap: 4px; }
.loading.error .loading-detail { color: var(--muted); }
/* mensagens do emulador durante o jogo (state salvo, carregado...): pílula no alto, no lugar do texto vermelho */
#game .ejs_message {
  top: 12px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); z-index: 10; pointer-events: none;
  padding: 9px 16px; border-radius: 999px; font: 600 .875rem var(--font); color: var(--fg); text-shadow: none; text-align: center;
  background: rgba(10, 18, 34, .88); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: toast .25s ease;
}
#game .ejs_message:empty { display: none; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -6px); } }
/* aviso ao abrir o jogo */
.tips { margin: auto; color: var(--fg); max-width: min(460px, calc(100vw - 32px)); background: rgba(10, 18, 34, .92); }
.tips::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.tips ol { margin: 14px 0 20px; padding-left: 20px; display: grid; gap: 10px; font-size: .95rem; }
.tips em { font-style: normal; font-weight: 600; color: var(--blue2); }
.tips label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.tips input[type=checkbox] { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--blue); }
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--fg); background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px 7px 10px; cursor: pointer; transition: background .15s;
}
.menu-btn:hover { background: var(--glass2); }
/* botão ☰ do emulador no celular: maior e mais fácil de achar (abre o menu de pausa) */
.ejs_virtualGamepad_open {
  width: 44px !important; height: 44px !important; padding: 11px; top: 8px !important; right: 8px !important;
  border-radius: 50%; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .25); opacity: .85 !important;
}
/* menu de pausa */
.pause {
  margin: auto; color: var(--fg); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto;
  background: rgba(10, 18, 34, .94); display: grid; gap: 14px; padding: 20px;
}
.pause:not([open]) { display: none; }
.pause::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.pause-head h2 { font-size: 1.4rem; }
.pause-head p { margin: 4px 0 0; }
.pause .resume { padding: 16px; font-size: 1.05rem; }
.pause-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pause-grid button {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; text-align: left;
  min-height: 68px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass);
  color: var(--fg); font: inherit; cursor: pointer; transition: background .15s, transform .12s, opacity .15s;
}
.pause-grid button:hover { background: var(--glass2); }
.pause-grid button:active { transform: scale(.97); }
.pause-grid button:disabled, .pause .btn:disabled { opacity: .5; cursor: progress; }
.pause-grid svg { grid-row: span 2; width: 26px; height: 26px; }
.pause-grid strong { font-size: .95rem; font-weight: 600; }
.pause-grid small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.pause-grid .off .sound-on, .pause-grid button:not(.off) .sound-off { display: none; }
/* escolha do visual do controle virtual */
.pad-skins { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; font-size: .875rem; color: var(--muted); }
.pad-skins[hidden] { display: none; }
.pad-skins div { display: flex; flex: 1; gap: 4px; padding: 4px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.pad-skins button {
  flex: 1; font: inherit; font-size: .85rem; padding: 8px 6px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--fg); transition: background .15s;
}
.pad-skins button:hover { background: var(--glass2); }
.pad-skins button[aria-checked="true"] { background: #fff; color: #000; font-weight: 600; }
/* a barra, as configurações e o menu do botão direito do emulador ficam desligados: tudo está no menu de pausa */
#game .ejs_menu_bar, #game .ejs_context_menu { display: none !important; }
.pause-view { display: grid; gap: inherit; min-width: 0; }
.sub-head { display: flex; align-items: center; gap: 6px; margin: -6px 0 0 -8px; }
.sub-head h2 { font-size: 1.3rem; }
.pause-view > .muted { margin: 0; }
/* configurações */
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .9rem; }
.opt > span { display: grid; min-width: 0; }
.opt small { color: var(--muted); font-size: .72rem; }
.opt select { width: auto; max-width: 55%; padding: 8px 10px; font-size: .85rem; }
.opt.volume { padding: 4px 2px 6px; }
.opt.volume input { width: 60%; padding: 0; border: 0; background: none; accent-color: var(--blue); }
.opt-group { border: 1px solid var(--line); border-radius: 12px; background: var(--glass); }
.opt-group summary { padding: 12px 14px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.opt-group summary::-webkit-details-marker { display: none; }
.opt-group summary::after { content: "›"; color: var(--muted); transition: transform .15s; }
.opt-group[open] summary::after { transform: rotate(90deg); }
.opt-group .opt { padding: 6px 14px; }
.opt-group[open] { padding-bottom: 8px; }
.opt-tools { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.opt-tools .btn { flex: 1 1 auto; }
/* cheats */
.cheat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cheat-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.cheat-list li.muted { justify-content: center; }
.cheat-list label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.cheat-list input { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--blue); }
.cheat-form { display: grid; gap: 10px; }
.cheat-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.cheat-form textarea {
  font: .9rem ui-monospace, "SF Mono", Menlo, monospace; width: 100%; padding: 10px 12px; border-radius: 10px; resize: vertical;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--fg);
}
.cheat-form textarea:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px #ffffff30; }
.cheat-form .btn { justify-self: end; }
.pause-msg { margin: 0; font-size: .875rem; color: var(--muted); text-align: center; }
.pause-msg:empty { display: none; }
.pause-msg.ok { color: var(--ok); }
.pause-msg.busy { color: var(--warn); }
.pause-msg.err { color: var(--err); }
/* celular deitado: pouca altura, então 3 colunas e menos espaço */
@media (orientation: landscape) and (max-height: 500px) {
  .pause { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 16px); padding: 14px 16px; gap: 10px; }
  .pause-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .pause-head h2 { font-size: 1.15rem; }
  .pause-head p { margin: 0; }
  .pause .resume { padding: 12px; }
  .pause-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pause-grid button { min-height: 54px; padding: 8px 12px; }
  .pause-grid small { display: none; }
  .pause-grid svg { grid-row: auto; width: 22px; height: 22px; }
}
/* escolha do slot de save, antes de abrir o jogo */
#game:has(.slots) { overflow-y: auto; padding: 16px; }
.slots { margin: auto; width: 100%; max-width: 560px; }
.slots p { margin: 8px 0 18px; }
.slots ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.slot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px; background: var(--glass); border: 1px solid transparent;
}
.slot.latest { border-color: var(--blue2); background: #0b6cff1f; }
.slot strong { display: block; font-weight: 600; }
.slot small { color: var(--muted); font-size: .8rem; }
.slot .actions { display: flex; gap: 6px; margin-left: auto; }

/* ================= celular ================= */
@media (max-width: 640px) {
  .nav { gap: 18px; }
  .nav button { font-size: 1.1rem; }
  .user .who, .badge, .clock, .hints { display: none; }
  .user-btn { padding: 3px; }
  #logout { display: none; } /* fica no menu do avatar */
  .tools { gap: 2px; }
  .nav .count { right: -14px; }
  .add-friend { width: 100%; }
  .people .actions { width: 100%; justify-content: flex-end; }
  .chat { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .chatting { overflow: hidden; }
  .topbar .brand { font-size: 1.05rem; }
  .back-link span { display: none; }
  .back-link { padding: 8px; }
  .profile-page { gap: 20px; padding-top: 10px; }
  .profile-page .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .profile-page .stat .label { font-size: .62rem; letter-spacing: .04em; }
  .profile-page .stat .label .icon { display: none; }
  .profile-page .stat strong { font-size: .95rem; }
  .pf-head { gap: 16px; }
  .avatar.big { width: 76px; height: 76px; font-size: 2rem; }
  .avatar.big .presence { width: 20px; height: 20px; border-width: 3.5px; }
  .pf-actions { gap: 8px; }
  /* janela do apelido: Cancelar e Salvar lado a lado, Tirar apelido embaixo */
  .nick-dialog { padding: 20px; }
  .nick-actions .spacer { display: none; }
  .nick-actions .btn { flex: 1; }
  .nick-actions #nickClear { order: 3; flex-basis: 100%; }
  .pf-actions .btn { padding: 9px 16px; font-size: .85rem; }
  .pf-games .cover { width: 52px; }
  .shelf { gap: 10px; min-height: 150px; padding-top: 18px; }
  .tile { --s: 84px; border-radius: 11px; }
  .tile.sel { --s: 114px; }
  .tile .name { display: none; }
  .hero .meta { margin: 10px 0 20px; }
  .btn-play { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px 14px; }
  .stat strong { font-size: 1.1rem; }
  .bar .back span { display: none; }
  .bar .back { padding: 7px; }
  .bar { gap: 10px; }
  .status { max-width: 34vw; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ================= visuais do controle virtual (data-pad no #game) =================
   O EmulatorJS põe borda e cantos inline nos botões Start/Select, por isso os !important */
#game[data-pad] .ejs_virtualGamepad_button { transition: background .1s, transform .1s, box-shadow .1s; }
#game[data-pad] .ejs_virtualGamepad_button_down { transform: scale(.92); }

/* Clássico: cores do aparelho de cada sistema */
#game[data-pad="classico"] .ejs_virtualGamepad_button {
  background: linear-gradient(180deg, #4a4560, #2c2940); color: #e4e0ff; border: 0 !important;
  box-shadow: 0 3px 0 #17151f, 0 4px 10px rgba(0, 0, 0, .5);
}
#game[data-pad="classico"] .ejs_virtualGamepad_button.cs_gb:not(.b_start):not(.b_select) { background: linear-gradient(180deg, #c22a6f, #8a1449); color: #ffd9ea; }
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_start,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_select,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_analog,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_l,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_r,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_l2,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_r2 { background: linear-gradient(180deg, #8d8a99, #5f5c6b); color: #fff; border-radius: 99px !important; }
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_l,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_r,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_l2,
#game[data-pad="classico"] .ejs_virtualGamepad_button.b_r2 { border-radius: 10px !important; }
#game[data-pad="classico"] .ejs_virtualGamepad_button_down { box-shadow: 0 1px 0 #17151f; filter: brightness(.8); }
#game[data-pad="classico"] .ejs_dpad_main { opacity: .95; }
#game[data-pad="classico"] .ejs_dpad_bar { background: #2b2a33; }
#game[data-pad="classico"] .ejs_dpad_horizontal:before { border-right-color: #6c6a78; }
#game[data-pad="classico"] .ejs_dpad_horizontal:after { border-left-color: #6c6a78; }
#game[data-pad="classico"] .ejs_dpad_vertical:before { border-bottom-color: #6c6a78; }
#game[data-pad="classico"] .ejs_dpad_vertical:after { border-top-color: #6c6a78; }
#game[data-pad="classico"] .ejs_dpad_left_pressed .ejs_dpad_horizontal:before { border-right-color: #fff; }
#game[data-pad="classico"] .ejs_dpad_right_pressed .ejs_dpad_horizontal:after { border-left-color: #fff; }
#game[data-pad="classico"] .ejs_dpad_up_pressed .ejs_dpad_vertical:before { border-bottom-color: #fff; }
#game[data-pad="classico"] .ejs_dpad_down_pressed .ejs_dpad_vertical:after { border-top-color: #fff; }
/* PS1 e PSP: botões pretos com △ ○ ✕ □ coloridos */
#game[data-pad="classico"] .cs_psx.b_y, #game[data-pad="classico"] .cs_psp.b_y, #game[data-pad="classico"] .cs_psx.b_b, #game[data-pad="classico"] .cs_psp.b_b,
#game[data-pad="classico"] .cs_psx.b_a, #game[data-pad="classico"] .cs_psp.b_a, #game[data-pad="classico"] .cs_psx.b_x, #game[data-pad="classico"] .cs_psp.b_x { background: linear-gradient(180deg, #2a2a30, #141418); color: transparent; }
#game[data-pad="classico"] .cs_psx.b_y::after, #game[data-pad="classico"] .cs_psp.b_y::after,
#game[data-pad="classico"] .cs_psx.b_b::after, #game[data-pad="classico"] .cs_psp.b_b::after,
#game[data-pad="classico"] .cs_psx.b_a::after, #game[data-pad="classico"] .cs_psp.b_a::after,
#game[data-pad="classico"] .cs_psx.b_x::after, #game[data-pad="classico"] .cs_psp.b_x::after { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 400; line-height: 1; }
#game[data-pad="classico"] .cs_psx.b_y::after, #game[data-pad="classico"] .cs_psp.b_y::after { content: "△"; color: #3ddc97; }
#game[data-pad="classico"] .cs_psx.b_b::after, #game[data-pad="classico"] .cs_psp.b_b::after { content: "○"; color: #ff5f7a; }
#game[data-pad="classico"] .cs_psx.b_a::after, #game[data-pad="classico"] .cs_psp.b_a::after { content: "✕"; color: #6fa8ff; }
#game[data-pad="classico"] .cs_psx.b_x::after, #game[data-pad="classico"] .cs_psp.b_x::after { content: "□"; color: #ff8ad8; }
#game[data-pad="classico"] .ejs_virtualGamepad_parent .back { background: #2b2a33 !important; opacity: .8 !important; }
#game[data-pad="classico"] .ejs_virtualGamepad_parent .front { background: #6c6a78 !important; opacity: .95 !important; }

/* Neon: contorno azul brilhante, combina com o site */
#game[data-pad="neon"] .ejs_virtualGamepad_button {
  background: rgba(11, 108, 255, .14); color: #cfe2ff; border: 2px solid #4d9bff !important;
  box-shadow: 0 0 10px rgba(77, 155, 255, .6), inset 0 0 8px rgba(77, 155, 255, .35); text-shadow: 0 0 8px #4d9bff;
}
#game[data-pad="neon"] .ejs_virtualGamepad_button_down { background: #0b6cff; color: #fff; box-shadow: 0 0 22px #4d9bff; }
#game[data-pad="neon"] .ejs_dpad_main { opacity: 1; filter: drop-shadow(0 0 6px rgba(77, 155, 255, .7)); }
#game[data-pad="neon"] .ejs_dpad_bar { background: rgba(11, 108, 255, .3); }
#game[data-pad="neon"] .ejs_dpad_horizontal, #game[data-pad="neon"] .ejs_dpad_vertical { border: 2px solid #4d9bff; }
#game[data-pad="neon"] .ejs_dpad_horizontal:before { border-right-color: #9cc6ff; }
#game[data-pad="neon"] .ejs_dpad_horizontal:after { border-left-color: #9cc6ff; }
#game[data-pad="neon"] .ejs_dpad_vertical:before { border-bottom-color: #9cc6ff; }
#game[data-pad="neon"] .ejs_dpad_vertical:after { border-top-color: #9cc6ff; }
#game[data-pad="neon"] .ejs_dpad_left_pressed .ejs_dpad_horizontal:before { border-right-color: #fff; }
#game[data-pad="neon"] .ejs_dpad_right_pressed .ejs_dpad_horizontal:after { border-left-color: #fff; }
#game[data-pad="neon"] .ejs_dpad_up_pressed .ejs_dpad_vertical:before { border-bottom-color: #fff; }
#game[data-pad="neon"] .ejs_dpad_down_pressed .ejs_dpad_vertical:after { border-top-color: #fff; }
#game[data-pad="neon"] .ejs_virtualGamepad_parent .back { background: rgba(11, 108, 255, .25) !important; border: 2px solid #4d9bff; box-shadow: 0 0 12px rgba(77, 155, 255, .6); }
#game[data-pad="neon"] .ejs_virtualGamepad_parent .front { background: #4d9bff !important; opacity: .9 !important; box-shadow: 0 0 14px #4d9bff; }

/* Discreto: só o contorno, para ver mais do jogo */
#game[data-pad="discreto"] .ejs_virtualGamepad_button {
  background: transparent; color: rgba(255, 255, 255, .45); border: 1px solid rgba(255, 255, 255, .28) !important;
}
#game[data-pad="discreto"] .ejs_virtualGamepad_button_down { background: rgba(255, 255, 255, .18); color: #fff; }
#game[data-pad="discreto"] .ejs_dpad_main { opacity: .35; }
#game[data-pad="discreto"] .ejs_dpad_main[class*="_pressed"] { opacity: .6; }
#game[data-pad="discreto"] .ejs_virtualGamepad_parent .back { opacity: .2 !important; }
#game[data-pad="discreto"] .ejs_virtualGamepad_parent .front { opacity: .4 !important; }

/* ================= rodapé e política de privacidade ================= */
.site-footer { text-align: center; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); font-size: .8rem; }
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }
.auth .site-footer { padding-bottom: 0; }
.policy { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.policy .eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue2); }
.policy h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 4px 0 14px; }
.policy h2 { font-size: 1.25rem; font-weight: 600; margin: 28px 0 8px; }
.policy p, .policy li { color: var(--muted); }
.policy ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.policy strong { color: var(--fg); }
