
:root{--a:#0b3d91;--b:#00c6ff;--fs:16px;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{height:100%;font-size:var(--fs)}
body{height:100%;margin:0;overflow:hidden;color:#fff;background:#0b3d91;background:linear-gradient(160deg,var(--a),var(--b));font-family:'Orbitron',sans-serif}
[hidden]{display:none!important}
#bg{position:fixed;left:0;top:0;width:100%;height:100%}
#top{position:fixed;top:env(safe-area-inset-top,0px);left:0;right:0;display:flex;justify-content:space-between;padding:.7rem 1.2rem;font-size:.85rem;text-shadow:0 1px 4px rgba(0,0,0,.6)}
#xmb{position:fixed;left:0;right:0;top:16vh;height:68vh}
.cat{position:absolute;left:0;top:0;width:8rem;text-align:center;opacity:.55;transform:translateX(calc(var(--i)*8.5rem + 14vw));transition:transform .3s,opacity .3s}
.cat.on{opacity:1}
.ci{display:block;font-size:3rem;filter:drop-shadow(0 2px 6px rgba(0,0,0,.5));transition:font-size .3s}
.on .ci{font-size:4.2rem}
.cn{display:block;font-size:.8rem;margin-top:.3rem;text-shadow:0 1px 4px rgba(0,0,0,.6)}
.items{position:absolute;left:0;top:7.5rem;width:0;opacity:0;transition:opacity .3s}
.on .items{opacity:1}
.it{position:absolute;left:2.5rem;width:20rem;height:3.4rem;display:flex;align-items:center;gap:1rem;text-align:left;opacity:.7;transform:translateY(calc(var(--j)*4rem));transition:transform .25s,opacity .25s}
.it.past{opacity:0}
.it.sel{opacity:1}
.it .ic{width:2.6rem;text-align:center;font-size:1.9rem}
.it b{display:block;font-size:1rem;text-shadow:0 1px 4px rgba(0,0,0,.6)}
.it.sel b{font-size:1.15rem;text-shadow:0 0 12px #fff}
.it small{display:block;font-size:.7rem;opacity:.85}
#app{position:fixed;inset:0;background:rgba(0,0,0,.78);display:flex;flex-direction:column;align-items:center;padding:4.5rem 1rem 3.5rem;box-sizing:border-box;text-align:center}
#at{font-size:1.4rem;margin-bottom:1rem}
#ab{flex:1;width:100%;max-width:34rem;overflow:auto;display:flex;flex-direction:column;align-items:center;justify-content:center}
#ah{font-size:.8rem;opacity:.8;margin-top:.8rem}
.list{width:100%;text-align:left;align-self:flex-start}
.li{padding:.7rem 1rem;margin:.25rem 0;border-radius:.6rem}
.li.sel{background:rgba(255,255,255,.22);box-shadow:0 0 0 2px #fff}
.game-cover{width:min(80vw,26rem);max-height:15rem;object-fit:contain;border-radius:.8rem;box-shadow:0 8px 30px rgba(0,0,0,.6)}
.ph{width:min(80vw,26rem);height:15rem;border-radius:.8rem;box-shadow:0 8px 30px rgba(0,0,0,.6)}
canvas.g{max-width:100%;border:2px solid rgba(255,255,255,.6);border-radius:.4rem}
.bars{display:flex;gap:4px;align-items:flex-end;height:80px;margin:1rem 0}
.bars i{width:10px;background:#fff;border-radius:2px;display:block;transition:height .15s}
.grid{display:grid;grid-template-columns:repeat(4,4.2rem);gap:.5rem}
.grid div{height:3.4rem;line-height:3.4rem;background:rgba(255,255,255,.14);border-radius:.5rem}
.grid .sel{background:#fff;color:#111}
.disp{width:19rem;max-width:100%;box-sizing:border-box;text-align:right;font-size:1.6rem;padding:.7rem;margin-bottom:.7rem;background:rgba(255,255,255,.12);border-radius:.5rem;min-height:3.2rem;overflow:hidden}
.big{font-size:2.6rem;margin:1rem}
textarea{width:100%;height:50vh;box-sizing:border-box;padding:.8rem;border-radius:.6rem;border:2px solid #fff;background:rgba(255,255,255,.1);color:#fff;font:inherit}
.vw{width:100%;text-align:center}.vw video,.vw canvas,.vw img{width:100%;max-height:55vh;background:#000;border-radius:.5rem}
.li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rm{float:right;margin-left:.6rem;padding:0 .4rem;cursor:pointer}
.vbar{width:100%;height:6px;background:rgba(255,255,255,.2);border-radius:3px;margin-top:.8rem}.vbar i{display:block;height:100%;width:0;background:#fff;border-radius:3px}
.btns{display:grid;grid-template-columns:repeat(6,2.4rem);gap:.4rem;margin-top:1rem}
.btns i{height:2.4rem;line-height:2.4rem;border-radius:50%;background:rgba(255,255,255,.15);font-style:normal;font-size:.7rem}
.btns i.on{background:#fff;color:#111}
body{touch-action:none;-webkit-user-select:none;user-select:none}textarea{touch-action:auto;-webkit-user-select:text;user-select:text}
.cat:not(.on) .items,.it.past{pointer-events:none}
#bk{position:absolute;top:calc(env(safe-area-inset-top,0px) + 1rem);left:1rem;padding:.6rem 1.1rem;border-radius:2rem;border:2px solid #fff;background:rgba(255,255,255,.15);color:#fff;font:inherit;font-size:.85rem;cursor:pointer}
#hint{position:fixed;bottom:env(safe-area-inset-bottom,0px);left:0;right:0;text-align:center;font-size:.72rem;padding:.7rem;text-shadow:0 1px 4px rgba(0,0,0,.7)}
#toast{position:fixed;left:50%;bottom:4rem;transform:translateX(-50%);background:rgba(0,0,0,.75);padding:.6rem 1.2rem;border-radius:2rem;font-size:.85rem}



/* =====================================================
   CAPA DO JOGO COM BOTÃO PLAY — XMB
   ===================================================== */

.xmb-capa-container {
    position: relative;
    width: min(80vw, 26rem);
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,.6);
}

.xmb-capa-container img {
    display: block;
    width: 100%;
    max-height: 15rem;
    object-fit: contain;
}

.xmb-play-link {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 95px;
    height: 95px;
    border-radius: 50%;

    background: rgba(0,0,0,.78);
    border: 3px solid #fff;
    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 19px;
    font-weight: 900;
    text-decoration: none;

    box-shadow: 0 0 15px #00c6ff;
    transition: .2s;
}

.xmb-play-link:hover {
    background: #00aaff;
    transform: translate(-50%, -50%) scale(1.1);
}

.xmb-play-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 5px;
}







/* =====================================================
   CORREÇÃO PSP XMB — MODO PAISAGEM E IFRAME
   NÃO ALTERA CLASSES OU IDS EXISTENTES
   ===================================================== */

/* Ajuste geral para qualquer tamanho de tela */
html,
body {
    width: 100%;
    min-width: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

/* Fundo sempre ocupa a tela */
#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Barra superior */
#top {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    z-index: 100;
    min-height: 35px;
    padding: 8px 14px;
    gap: 8px;
    align-items: center;
    font-size: clamp(10px, 2vw, 13px);
}

/* Menu principal */
#xmb {
    position: fixed;
    left: 0;
    right: 0;
    top: 15%;
    height: 72%;
    height: 72dvh;
    max-height: 72dvh;
    overflow: visible;
    z-index: 10;
}

/* Categorias */
.cat {
    width: clamp(75px, 13vw, 128px);
    transform: translateX(calc(var(--i) * clamp(75px, 13vw, 136px) + 12vw));
}

.ci {
    font-size: clamp(2rem, 5vh, 3rem);
}

.on .ci {
    font-size: clamp(2.6rem, 7vh, 4rem);
}

.cn {
    font-size: clamp(10px, 1.8vh, 14px);
}

/* Lista de opções */
.items {
    top: clamp(5rem, 13vh, 7.5rem);
}

.it {
    width: min(80vw, 320px);
    height: clamp(42px, 7vh, 55px);
    transform: translateY(calc(var(--j) * clamp(44px, 7.5vh, 64px)));
    gap: 10px;
}

.it .ic {
    width: 35px;
    font-size: clamp(1.3rem, 3vh, 1.9rem);
}

.it b {
    font-size: clamp(12px, 2vh, 16px);
}

.it.sel b {
    font-size: clamp(13px, 2.2vh, 18px);
}

.it small {
    font-size: clamp(9px, 1.5vh, 12px);
}

/* Tela dos aplicativos e biblioteca de jogos */
#app {
    position: fixed;
    inset: 0;
    z-index: 200;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding:
        calc(env(safe-area-inset-top, 0px) + 3.8rem)
        clamp(10px, 3vw, 25px)
        calc(env(safe-area-inset-bottom, 0px) + 2.8rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Título */
#at {
    flex: 0 0 auto;
    width: 100%;
    font-size: clamp(15px, 3vh, 23px);
    margin-bottom: 8px;
}

/* Conteúdo com rolagem independente */
#ab {
    flex: 1 1 auto;
    width: 100%;
    max-width: 850px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding: 8px 5px 20px;
}

/* Descrições e listas */
.list {
    width: 100%;
}

.li {
    width: 100%;
    min-height: 38px;
    padding: 9px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: clamp(11px, 2vh, 15px);
}

/* Capas dos jogos */
.xmb-capa-container {
    width: min(75vw, 350px);
    max-width: 100%;
    margin: 0 auto;
}

.xmb-capa-container img {
    width: 100%;
    max-height: 32vh;
    object-fit: contain;
}

/* Botão voltar sempre visível */
#bk {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 12px;
    z-index: 500;
    padding: 8px 16px;
    font-size: 12px;
}

/* Ajuda inferior */
#hint {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    padding: 7px 10px;
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    font-size: clamp(9px, 1.5vh, 12px);
    background: linear-gradient(transparent, rgba(0,0,0,.4));
}

/* =====================================================
   MODO PAISAGEM — CELULAR DEITADO
   ===================================================== */

@media screen and (orientation: landscape) and (max-height: 600px) {

    #top {
        padding: 4px 12px;
        font-size: 10px;
    }

    #xmb {
        top: 10%;
        height: 80dvh;
    }

    .cat {
        width: 75px;
    }

    .ci {
        font-size: 1.8rem;
    }

    .on .ci {
        font-size: 2.5rem;
    }

    .cn {
        font-size: 10px;
        margin-top: 2px;
    }

    .items {
        top: 4.5rem;
    }

    .it {
        left: 1.5rem;
        height: 36px;
        transform: translateY(calc(var(--j) * 38px));
    }

    .it .ic {
        font-size: 1.3rem;
    }

    .it b,
    .it.sel b {
        font-size: 12px;
    }

    .it small {
        font-size: 9px;
    }

    #app {
        padding-top: 5rem;
        padding-bottom: 2rem;
    }

    #at {
        font-size: 15px;
        margin-bottom: 3px;
    }

    #ab {
        padding-top: 3px;
        padding-bottom: 10px;
    }

    .xmb-capa-container {
        width: min(48vw, 300px);
    }

    .xmb-capa-container img {
        max-height: 25vh;
    }

    .xmb-play-link {
        width: 65px;
        height: 65px;
        font-size: 14px;
    }

    #hint {
        padding: 3px 8px;
        font-size: 9px;
    }

    #bk {
        top: 5px;
        padding: 5px 12px;
        font-size: 10px;
    }
}

/* Telas muito baixas */
@media screen and (max-height: 380px) {

    #app {
        padding-top: 2.5rem;
        padding-bottom: 1.5rem;
    }

    #at {
        font-size: 12px;
        margin-bottom: 0;
    }

    .xmb-capa-container img {
        max-height: 19vh;
    }

    .li {
        min-height: 30px;
        padding: 5px 9px;
    }

    #hint {
        display: none;
    }
}






/* MODAL INTERNET */

.modal-internet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-internet.ativo {
    display: flex;
}

.modal-internet-conteudo {
    width: 100%;
    height: 100%;
    background: #111;
    border: 2px solid #ffffff55;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-internet-topo {
    height: 45px;
    min-height: 45px;
    background: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.modal-internet-topo button {
    background: #c62828;
    color: white;
    border: 0;
    padding: 7px 14px;
    cursor: pointer;
    border-radius: 5px;
}

#iframeInternet {
    width: 100%;
    height: 100%;
    border: 0;
    background: white;
}




/* Sistema de ondas animadas */
/* Ondas estilo XMB do PSP: curvas suaves, seda translúcida, deriva lenta */

/* Ondas copiadas do XMB (canvas) convertidas para CSS:
   3 camadas de seno brancas, base em 62% da altura, fluxo para a esquerda */

.wave-1 {
  position: absolute;
  left: 0;
  width: 100%;
  top: calc(62% - 26px);
  bottom: 0;
  overflow: hidden;
  pointer-events: none;

  /* 👈 TRANSPARÊNCIA GERAL (as 3 ondas juntas): 1 = original, .5 = metade, .25 = bem sutil */
  opacity: 1;

  /* camada 1 — 👈 mude fill-opacity='.05' (menor = mais transparente) */
  background-repeat: repeat-x;
  background-position: 0 0;
  background-size: 1068px 1600px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1068 1600'><path fill='white' fill-opacity='.05' d='M0 26 C89 12.39 178 0 267 0 C356 0 445 12.39 534 26 C623 39.61 712 52 801 52 C890 52 979 39.61 1068 26 L1068 1600 L0 1600 Z'/></svg>");
  animation: xmbFlow1 8.17s linear infinite;
}

.wave-1::before,
.wave-1::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  bottom: 0;
  background-repeat: repeat-x;
  background-position: 0 0;
  background-size: 1068px 1600px;
}

/* camada 2 — 👈 mude fill-opacity='.075' */
.wave-1::before {
  top: 26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1068 1600'><path fill='white' fill-opacity='.075' d='M0 34 C89 16.2 178 0 267 0 C356 0 445 16.2 534 34 C623 51.8 712 68 801 68 C890 68 979 51.8 1068 34 L1068 1600 L0 1600 Z'/></svg>");
  animation: xmbFlow2 6.05s linear infinite;
}

/* camada 3 — 👈 mude fill-opacity='.10' */
.wave-1::after {
  top: 52px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1068 1600'><path fill='white' fill-opacity='.10' d='M0 42 C89 20.01 178 0 267 0 C356 0 445 20.01 534 42 C623 63.99 712 84 801 84 C890 84 979 63.99 1068 42 L1068 1600 L0 1600 Z'/></svg>");
  animation: xmbFlow3 4.80s linear infinite;
}

@keyframes xmbFlow1 { from { background-position-x: 0; } to { background-position-x: -1068px; } }
@keyframes xmbFlow2 { from { background-position-x: 0; } to { background-position-x: -1068px; } }
@keyframes xmbFlow3 { from { background-position-x: 0; } to { background-position-x: -1068px; } }

@media (prefers-reduced-motion: reduce) {
  .wave-1,
  .wave-1::before,
  .wave-1::after {
    animation:;
  }
}

.wave-2::before { height: 180%; background: rgba(0,220,255,.3); }
.wave-3::before { animation-duration: 5s; }
.wave-4::before { border-radius: 50%; }
.wave-5::before { transform: rotate(35deg); }
.wave-6::before { background: rgba(0,80,180,.4); }
.wave-7::before { box-shadow: 0 0 35px #00eaff; }
.wave-8::before { background: linear-gradient(90deg,#00eaff,#a000ff,#00eaff); }
.wave-9::before { box-shadow: 0 0 50px #00aaff; }
.wave-10::before { animation-duration: 3s; }






/* =================================
   ABERTURA BIG RETRO GAMER
================================= */

#introRetro {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(
            circle at center,
            #152b50 0%,
            #080d20 55%,
            #02040b 100%
        );

    opacity: 1;
    visibility: visible;

    transition:
        opacity .8s ease,
        visibility .8s ease;
}

#introRetro.saindo {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ================= NOVO: ONDAS ESTILO XMB ================= */

/* variáveis animáveis: cada onda anda na sua velocidade */
@property --w1 { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --w2 { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --w3 { syntax: '<length>'; inherits: false; initial-value: 0px; }

#introRetro::before {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    top: calc(62% - 26px);   /* base das ondas em 62% da altura */
    bottom: 0;
    pointer-events: none;

    /* 👈 TRANSPARÊNCIA GERAL das 3 ondas: 1 = original, .5 = metade, .25 = sutil */
    opacity: 1;

    background-repeat: repeat-x;
    background-size: 1068px 1600px;

    /* a primeira da lista fica por cima: camada 3, camada 2, camada 1 */
    background-image:
        /* camada 3 — 👈 fill-opacity='.10' */
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1068 1600'><path fill='white' fill-opacity='.10' d='M0 42 C89 20.01 178 0 267 0 C356 0 445 20.01 534 42 C623 63.99 712 84 801 84 C890 84 979 63.99 1068 42 L1068 1600 L0 1600 Z'/></svg>"),
        /* camada 2 — 👈 fill-opacity='.075' */
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1068 1600'><path fill='white' fill-opacity='.075' d='M0 34 C89 16.2 178 0 267 0 C356 0 445 16.2 534 34 C623 51.8 712 68 801 68 C890 68 979 51.8 1068 34 L1068 1600 L0 1600 Z'/></svg>"),
        /* camada 1 — 👈 fill-opacity='.05' */
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1068 1600'><path fill='white' fill-opacity='.05' d='M0 26 C89 12.39 178 0 267 0 C356 0 445 12.39 534 26 C623 39.61 712 52 801 52 C890 52 979 39.61 1068 26 L1068 1600 L0 1600 Z'/></svg>");

    background-position:
        var(--w3) 52px,
        var(--w2) 26px,
        var(--w1) 0;

    animation:
        introOnda3 4.80s linear infinite,
        introOnda2 6.05s linear infinite,
        introOnda1 8.17s linear infinite;
}

/* deslocamento = largura do tile (1068px), então o loop não tem emenda */
@keyframes introOnda1 { from { --w1: 0px; } to { --w1: -1068px; } }
@keyframes introOnda2 { from { --w2: 0px; } to { --w2: -1068px; } }
@keyframes introOnda3 { from { --w3: 0px; } to { --w3: -1068px; } }

@media (prefers-reduced-motion: reduce) {
    #introRetro::before {
        animation: ;
    }
}

/* ================= FIM DAS ONDAS ================= */

.intro-conteudo {
    position: relative;   /* NOVO: fica na frente das ondas */
    z-index: 1;           /* NOVO */
    text-align: center;
    padding: 20px;
    animation: introEntrada 1.4s ease both;
}

.intro-controle {
    font-size: 65px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px #00c6ff);
    animation: controleFlutuar 2s ease-in-out infinite;
}

.intro-conteudo h1 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 5px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intro-conteudo h1 span {
    font-size: clamp(40px, 10vw, 75px);
    color: #fff;
    text-shadow:
        0 0 10px #00c6ff,
        0 0 30px #00c6ff;
}

.intro-conteudo h1 strong {
    font-size: clamp(22px, 6vw, 43px);
    color: #00c6ff;
    text-shadow:
        0 0 10px #00c6ff,
        0 0 25px #0066ff;
}

.intro-subtitulo {
    color: #fff;
    font-size: 12px;
    letter-spacing: 5px;
    margin-top: 28px;
}

.intro-carregamento {
    width: min(280px, 75vw);
    height: 5px;
    margin: 30px auto 15px;
    background: #1c3150;
    border-radius: 20px;
    overflow: hidden;
}

.intro-carregamento div {
    height: 100%;
    width: 0;
    background: #00c6ff;
    box-shadow: 0 0 15px #00c6ff;
    animation: carregarIntro 5s linear forwards;
}

.intro-conteudo small {
    color: #8ca9d5;
    font-size: 10px;
    letter-spacing: 3px;
}

@keyframes introEntrada {
    from {
        opacity: 0;
        transform: scale(.4);
        filter: blur(15px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes controleFlutuar {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes carregarIntro {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* ESCONDER MENUS DURANTE A ABERTURA */

body:not(.retro-menu-pronto) #xmb {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* MOSTRAR MENUS */

body.retro-menu-pronto #xmb {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 1s ease;
}

/* =================================
   ABERTURA BIG RETRO GAMER END
================================= */




#btnTelaCheia {
    
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    vertical-align: middle;
    text-shadow: 0 0 8px #00c6ff;
    transition: .3s;
}

#btnTelaCheia:hover {
    color: #00c6ff;
    transform: scale(1.2);
}

