/* Templo do Saber - estilos (menus, painel de perguntas, controles de toque) */
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0d1c; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
  font-family: "Trebuchet MS", "Segoe UI", Roboto, Arial, sans-serif; color: #fff; }
canvas { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#c3d { image-rendering: pixelated; image-rendering: crisp-edges; background: #0b0d1c; }
#hud { z-index: 2; }
.sem-js { position: fixed; left: 0; right: 0; top: 40%; text-align: center; font-size: 20px; }

#voltar { position: fixed; left: 10px; top: 10px; z-index: 50; display: none; padding: 9px 16px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.9); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; border: 2px solid rgba(255,255,255,0.7); }
#voltar:focus-visible, .btn:focus-visible, .opc:focus-visible { outline: 3px solid #ffe45e; }
body.overlay #voltar { display: block; }

#ui { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tela { pointer-events: auto; box-sizing: border-box; width: min(94vw, 760px); max-height: 90vh; overflow-y: auto; padding: 20px 22px;
  background: linear-gradient(160deg, rgba(20, 24, 58, 0.93), rgba(12, 14, 34, 0.95)); border: 2px solid rgba(255, 215, 120, 0.55);
  border-radius: 18px; text-align: center; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6); }
.tela[hidden], #painel[hidden] { display: none; }
.tela h1 { margin: 0 0 6px; font-size: clamp(26px, 6vw, 44px); color: #ffd978; text-shadow: 0 3px 0 #5a3a08; letter-spacing: 1px; }
.tela h2 { margin: 0 0 10px; font-size: clamp(20px, 4vw, 28px); color: #ffd978; }
.tela p, .tela li { font-size: clamp(14px, 2.4vw, 17px); line-height: 1.45; }
.tela .sub { margin: 0 0 16px; color: #d6dcff; }
.tela ul { text-align: left; margin: 0 auto 14px; padding-left: 22px; max-width: 620px; }
.tela li { margin: 5px 0; }
.col { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fila { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0; }

.btn { font: inherit; font-weight: 700; font-size: clamp(16px, 2.8vw, 20px); color: #fff; cursor: pointer; padding: 12px 22px; min-width: 190px;
  border-radius: 14px; border: 2px solid rgba(255,255,255,0.6); background: linear-gradient(#3b4aa0, #263172); touch-action: manipulation; }
.btn:hover { filter: brightness(1.12); }
.btn.pri { background: linear-gradient(#f6c344, #c98a12); color: #2b1a00; border-color: #fff0b8; }
.btn.peq { min-width: 0; padding: 8px 16px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; cursor: default; filter: none; }
.seg { padding: 8px 14px; min-width: 0; font-size: 15px; }
.seg.on { background: linear-gradient(#f6c344, #c98a12); color: #2b1a00; }

.cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 12px 0; }
.card { box-sizing: border-box; width: 210px; padding: 12px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.5); cursor: pointer;
  color: #fff; font: inherit; text-align: center; touch-action: manipulation; }
.card.t0 { background: linear-gradient(#8a5a1c, #4a2c08); }
.card.t1 { background: linear-gradient(#34407c, #151b44); }
.card.t2 { background: linear-gradient(#5a3a8c, #26164a); }
.card.bloq { filter: grayscale(0.9) brightness(0.6); cursor: default; }
.card .emo { font-size: 38px; }
.card .nome { font-weight: 700; font-size: 18px; margin: 4px 0; }
.card .est { font-size: 26px; color: #ffd34d; letter-spacing: 3px; }
.card .peq { font-size: 13px; color: #d6dcff; margin: 3px 0; }

.ctl { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px auto; max-width: 520px; font-size: 17px; text-align: left; }
.ctl input[type=range] { width: 200px; }
.ctl input[type=checkbox] { width: 26px; height: 26px; }
.estrelas-fim { font-size: 54px; color: #ffd34d; letter-spacing: 6px; text-shadow: 0 3px 0 #5a3a08; }

#painel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; box-sizing: border-box; width: min(94vw, 720px);
  max-height: 94vh; overflow-y: auto; padding: 16px 18px; border-radius: 16px; border: 3px solid #7fb4ff; text-align: left;
  background: linear-gradient(160deg, rgba(14, 30, 78, 0.97), rgba(10, 12, 38, 0.98)); box-shadow: 0 10px 40px rgba(0,0,0,0.7); }
#painel .chip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #2a6fdb; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
#painel .q { font-size: clamp(17px, 3.2vw, 23px); font-weight: 700; margin: 4px 0 12px; line-height: 1.35; }
#painel .opcs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { #painel .opcs { grid-template-columns: 1fr; } }
.opc { font: inherit; font-size: clamp(15px, 2.8vw, 19px); text-align: left; color: #fff; cursor: pointer; min-height: 52px; padding: 10px 14px;
  border-radius: 12px; border: 2px solid rgba(255,255,255,0.55); background: linear-gradient(#2c3b8a, #1a2358); touch-action: manipulation; }
.opc:hover:not([disabled]) { filter: brightness(1.15); }
.opc.certa { background: linear-gradient(#2ea64f, #19743a); border-color: #b6ffcb; }
.opc.errada { background: linear-gradient(#c23b3b, #832020); border-color: #ffb3b3; }
.opc.dim { opacity: 0.55; }
.opc[disabled] { cursor: default; }
#painel .fb { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.1); font-size: clamp(14px, 2.6vw, 17px); line-height: 1.4; }
#painel .fb b.ok { color: #7dffa0; } #painel .fb b.no { color: #ffb0a0; }
#painel .fila { justify-content: flex-end; }

#toque { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 5; pointer-events: none; display: none; }
body.toque.jogando #toque { display: block; }
#toque button { pointer-events: auto; font: inherit; font-weight: 700; color: #fff; border: 3px solid rgba(255,255,255,0.85); background: rgba(30, 41, 90, 0.6);
  touch-action: manipulation; }
#bt-int { position: fixed; right: 5%; bottom: 24%; width: 104px; height: 104px; border-radius: 50%; font-size: 17px; background: rgba(39, 130, 214, 0.75); display: none; }
#bt-int.vis { display: block; }
.mini-bts { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 8px; }
.mini-bts button { min-width: 62px; height: 40px; border-radius: 20px; font-size: 14px; padding: 0 10px; }
