/* CUBIVERSO · O Jogo — feito pra TV (10 pés de distância): tudo em vh, margem segura de 5%,
   e só CSS que o Chromium antigo do webOS entende (nada de gap em flex, inset, aspect-ratio). */
:root {
  --rosa: #ff7ac8; --roxo: #6b3fb8; --roxo-esc: #3a1f6e; --amarelo: #ffd84d; --azul: #7a9cff; --verde: #5fd49a;
  --fundo: rgba(58, 31, 110, 0.86); --texto: #ffffff;
}
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #b9a6ff; color: var(--texto);
  font-family: 'Baloo 2', 'Arial Rounded MT Bold', Arial, sans-serif; font-weight: 800; -webkit-user-select: none; user-select: none; cursor: default; }
canvas#gl { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.escondido { display: none !important; }

.tela { position: fixed; left: 0; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#inicio { background: radial-gradient(ellipse at center, rgba(255,255,255,0.15), rgba(107,63,184,0.55)); }
.logo { font-size: 15vh; line-height: 1; color: var(--amarelo); text-shadow: 0 0.9vh 0 var(--roxo), 0 0 4vh rgba(255,255,255,0.6); letter-spacing: 0.4vh; }
.logo span { color: var(--rosa); }
.sub { font-size: 4.4vh; margin: 1vh 0 5vh; text-shadow: 0 0.4vh 0 var(--roxo); }

/* menus navegáveis pelo direcional: item com foco = maior, amarelo, com brilho */
.menu { display: flex; flex-direction: column; align-items: center; }
.menu .item { font: inherit; font-size: 4.6vh; color: #fff; background: var(--fundo); border: 0.6vh solid rgba(255,255,255,0.35);
  border-radius: 3vh; padding: 1.2vh 6vh; margin: 1vh 0; min-width: 40vh; transition: transform .12s, background .12s; cursor: pointer; }
.menu .item.foco { background: var(--rosa); border-color: var(--amarelo); transform: scale(1.12); box-shadow: 0 0 3.5vh rgba(255,216,77,0.9); }
.dica-controle { position: absolute; bottom: 6vh; font-size: 3.2vh; opacity: 0.95; text-shadow: 0 0.3vh 0 var(--roxo); }

/* ícones dos botões (desenhados, não dependem de fonte de emoji da TV) */
.bt { display: inline-block; width: 5vh; height: 5vh; line-height: 5vh; border-radius: 50%; background: #2a1650; color: #fff; font-size: 3.4vh;
  vertical-align: middle; margin: 0 0.6vh; box-shadow: 0 0.4vh 0 rgba(0,0,0,0.35); text-align: center; position: relative; }
.bt.x::before, .bt.x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 2.8vh; height: 0.6vh; background: #8fc8ff; border-radius: 0.3vh; }
.bt.x::before { transform: translate(-50%, -50%) rotate(45deg); } .bt.x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.bt.o::before { content: ''; position: absolute; left: 50%; top: 50%; width: 2.2vh; height: 2.2vh; border: 0.55vh solid #ff7a8a; border-radius: 50%; transform: translate(-50%, -50%); }
.bt.q::before { content: ''; position: absolute; left: 50%; top: 50%; width: 2.1vh; height: 2.1vh; border: 0.55vh solid #ff9fe0; transform: translate(-50%, -50%); }
.bt.t::before { content: ''; position: absolute; left: 50%; top: 46%; width: 0; height: 0; border-left: 1.4vh solid transparent; border-right: 1.4vh solid transparent; border-bottom: 2.4vh solid #6fe0b0; transform: translate(-50%, -50%); }
.bt.ok { border-radius: 1.2vh; width: auto; padding: 0 1.4vh; font-size: 2.8vh; }

/* HUD */
#hud { position: fixed; left: 5vw; right: 5vw; top: 5vh; bottom: 5vh; pointer-events: none; }
#missao-nome { position: absolute; left: 0; top: 0; background: var(--fundo); border-radius: 2.5vh; padding: 0.8vh 2.8vh; font-size: 3.6vh; }
#missao-nome:empty { display: none; }
#estrelas-total { position: absolute; right: 0; top: 0; background: var(--fundo); border-radius: 2.5vh; padding: 0.8vh 2.8vh; font-size: 3.6vh; color: var(--amarelo); }
#ajuda { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); background: var(--fundo); border-radius: 3vh; padding: 1vh 3vh; font-size: 3.4vh; white-space: nowrap; }
#ajuda:empty { display: none; }
#ajuda .sep { display: inline-block; width: 3vh; }
#jogadores { position: absolute; left: 0; bottom: 0; font-size: 2.6vh; }
.estrela { display: inline-block; width: 4vh; height: 4vh; vertical-align: middle; background: var(--amarelo);
  -webkit-clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.estrela.vazia { background: rgba(255,255,255,0.3); }
#painel .estrela { width: 10vh; height: 10vh; margin: 0 1vh; }

/* painel central */
#painel { background: rgba(40, 20, 80, 0.45); }
#painel .caixa { background: var(--fundo); border: 0.6vh solid rgba(255,255,255,0.4); border-radius: 4vh; padding: 4vh 8vh; max-width: 80vw; }
#painel h2 { margin: 0 0 2vh; font-size: 6.5vh; color: var(--amarelo); text-shadow: 0 0.5vh 0 var(--roxo-esc); }
#painel-texto { font-size: 3.8vh; margin-bottom: 3vh; }

/* lousa de traçar */
#lousa { position: fixed; left: 50%; top: 50%; width: 76vh; height: 76vh; margin: -38vh 0 0 -38vh; background: #2f5a4a; border: 2vh solid #c58a6e; border-radius: 3vh; box-shadow: 0 2vh 6vh rgba(0,0,0,0.4); }
#lousa canvas { width: 100%; height: 100%; display: block; }
.lousa-dica { position: absolute; left: 0; right: 0; bottom: -9vh; font-size: 3.4vh; text-shadow: 0 0.3vh 0 var(--roxo); }

#aviso { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); background: #fff; color: var(--roxo-esc); border-radius: 3vh; padding: 1.4vh 4vh; font-size: 3.4vh; box-shadow: 0 1vh 3vh rgba(0,0,0,0.3); white-space: nowrap; }
#carregando { background: #b9a6ff; z-index: 10; }
.cubinho { width: 10vh; height: 10vh; background: var(--rosa); border-radius: 2vh; border: 0.8vh solid #fff; animation: gira 1.1s infinite ease-in-out; margin-bottom: 3vh; }
@keyframes gira { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(0.8); } 100% { transform: rotate(360deg) scale(1); } }
#carregando-txt { font-size: 4vh; }
#erro { background: #3a1f6e; z-index: 20; font-size: 3.6vh; padding: 0 10vw; }
#fps { position: fixed; left: 50%; top: 0; transform: translateX(-50%); pointer-events: none; max-width: 90vw; overflow: hidden; white-space: nowrap; font: 2vh monospace; background: rgba(0,0,0,0.5); padding: 0.4vh 1vh; z-index: 30; }

/* ---------- celular / tablet ---------- */
html, body, canvas#gl { touch-action: none; -webkit-tap-highlight-color: transparent; }
#toque { display: none; }
body.toque.emjogo #toque { display: block; }
body.toque #ajuda { display: none; }   /* os botões da tela já dizem o que fazem */
#joy-base { position: fixed; left: 0; top: 0; width: 26vmin; height: 26vmin; margin: -13vmin 0 0 -13vmin; border-radius: 50%;
  background: rgba(58,31,110,0.25); border: 0.8vmin solid rgba(255,255,255,0.55); display: none; pointer-events: none; z-index: 5; }
#joy-base.ativo { display: block; }
#joy-pino { position: absolute; left: 50%; top: 50%; width: 11vmin; height: 11vmin; margin: -5.5vmin 0 0 -5.5vmin; border-radius: 50%;
  background: rgba(255,255,255,0.85); box-shadow: 0 0.6vmin 1.5vmin rgba(58,31,110,0.4); }
#joy-dica { position: fixed; }
.bt-t { position: absolute; border-radius: 50%; background: rgba(58,31,110,0.72); border: 0.6vmin solid rgba(255,255,255,0.75); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 6; box-shadow: 0 0.8vmin 0 rgba(40,15,80,0.45); }
.bt-t b { font-size: 2.6vmin; line-height: 1; margin-top: 0.4vmin; }
.bt-t.on { transform: scale(0.9); background: var(--rosa); }
#bts-t { position: fixed; right: 3vmin; bottom: 3vmin; width: 46vmin; height: 46vmin; }
#bts-t .grande { right: 0; bottom: 0; width: 25vmin; height: 25vmin; background: rgba(255,122,200,0.85); }
#bts-t .grande b { font-size: 3.6vmin; }
#bts-t .peq { width: 15vmin; height: 15vmin; }
#bts-t .peq[data-acao="ouvir"] { right: 26vmin; bottom: 2vmin; }
#bts-t .peq[data-acao="ajuda"] { right: 6vmin; bottom: 27vmin; }
#bt-pausa-t { position: fixed; right: 3vmin; top: 3vmin; width: 11vmin; height: 11vmin; font-size: 4vmin; }
body.toque #estrelas-total { right: 13vmin; }
/* ícones desenhados (sem depender de emoji) */
.ic-mao { width: 7vmin; height: 7vmin; border-radius: 1.2vmin; background: #fff; box-shadow: inset 0 0 0 1.2vmin #ffd84d; transform: rotate(-8deg); }
.ic-ouvir { width: 5vmin; height: 5vmin; border: 1vmin solid #fff; border-left-color: transparent; border-radius: 50%; transform: rotate(-45deg); }
.ic-pipo { width: 5.5vmin; height: 5.5vmin; border-radius: 1vmin; background: #ff9fd6; border: 0.5vmin solid #fff; }
/* celular em pé: tudo um pouco menor e o painel ocupa a largura */
@media (orientation: portrait) {
  #hud { left: 3vw; right: 3vw; top: 3vh; bottom: 3vh; }
  #missao-nome, #estrelas-total { font-size: 2.2vh; padding: 0.6vh 1.6vh; }
  #missao-nome { max-width: 46vw; font-size: 1.8vh; }
  #estrelas-total { font-size: 2vh; }
  #painel .caixa { padding: 3vh 5vw; max-width: 90vw; }
  #painel h2 { font-size: 4.2vh; } #painel-texto { font-size: 2.5vh; }
  .menu .item { font-size: 3vh; min-width: 60vw; padding: 1.2vh 4vw; }
  .logo { font-size: 9vh; } .sub { font-size: 2.8vh; }
  .dica-controle { font-size: 2.2vh; padding: 0 5vw; }
  #aviso { font-size: 2.3vh; white-space: normal; width: 80vw; text-align: center; }
}
#lousa { width: 76vh; height: 76vh; width: min(76vh, 92vw); height: min(76vh, 92vw); left: 50%; top: 45%; margin: 0; transform: translate(-50%, -50%); }

.conta { font-size: 3vh; margin: -3vh 0 3vh; opacity: 0.95; text-shadow: 0 0.3vh 0 var(--roxo); }
@media (orientation: portrait) { .conta { font-size: 2vh; padding: 0 5vw; } }

/* tela das temporadas: os cubos são 3D (canvas); aqui só o título e os nomes, presos embaixo de cada cubo */
#temporadas { position: fixed; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; }
#temporadas .temp-titulo { position: absolute; left: 0; right: 0; top: 3vh; text-align: center; }
#temporadas .logo { font-size: 10vh; }
#temporadas .sub { margin: 0.4vh 0 0; font-size: 4vh; }
#temp-rotulos { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.temp-rotulo { position: absolute; transform: translate(-50%, 0); width: var(--rot-w, 23vh); box-sizing: border-box; text-align: center; pointer-events: auto; cursor: pointer;
  background: var(--fundo); border: 0.4vh solid rgba(255,255,255,0.3); border-radius: 2vh; padding: 0.5vh 1vh; transition: transform .12s, background .12s; }
.temp-rotulo small { display: block; font-size: calc(var(--rot-f, 2.5vh) * 0.76); opacity: 0.8; }
.temp-rotulo b { display: block; font-size: var(--rot-f, 2.5vh); line-height: 1.1; white-space: nowrap; }
.temp-rotulo span { display: block; font-size: calc(var(--rot-f, 2.5vh) * 0.8); color: var(--amarelo); }
.temp-rotulo.embreve { background: rgba(70, 55, 100, 0.75); }
.temp-rotulo.embreve span { color: #d8cfee; }
.temp-rotulo.foco { background: var(--rosa); border-color: var(--amarelo); transform: translate(-50%, 0) scale(1.12); box-shadow: 0 0 3vh rgba(255,216,77,0.9); z-index: 2; }
.temp-rotulo.embreve.foco { background: #8a7ab0; }
#temp-dica { left: 0; right: 0; bottom: 2.5vh; text-align: center; }
body.em-pe .temp-rotulo small { display: none; }
body.em-pe #temporadas .logo { font-size: 13vw; } body.em-pe #temporadas .sub { font-size: 5vw; }
body.em-pe #temp-dica { font-size: 3.6vw; bottom: 1.5vh; }
