@font-face { font-family: Clarendon; src: url(../fonts/Clarendon.ttf); }
@font-face { font-family: ClarendonBold; src: url(../fonts/Clarendon-Bold.ttf); }
@font-face { font-family: DroidSansBold; src: url(../fonts/DroidSans-Bold.ttf); }
:root { --bg: #1b130c; --gold: #e3c355; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); color: #fff; font-family: Clarendon, Georgia, serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; overflow: hidden; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.dfc { position: absolute; left: 0; top: 0; }
.dfscreen { position: absolute; }
.dftext { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: visible; }
.dftex { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.dfinput { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; border: 0; outline: 0; color: #fff; font-family: Clarendon, Georgia, serif; font-size: 40px; text-align: center; text-shadow: 1px 1px 0 #000; }

.dfscroll { position: absolute; left: 0; top: 0; }
#rotate { display: none; position: fixed; inset: 0; z-index: 99; background: var(--bg); color: var(--gold); align-items: center; justify-content: center; text-align: center; font-size: 22px; padding: 24px; }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: flex; } }
/* mensagens rolando (ScrollMessage) */
.toast { position: absolute; left: 50%; top: 300px; transform: translate(-50%, -20px); max-width: 1100px; padding: 18px 46px; border-radius: 18px; background: rgba(20,12,6,0.82); border: 3px solid rgba(227,195,85,0.75); color: #f3e3b0; font-size: 40px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s; z-index: 30; text-shadow: 2px 2px 0 #000; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* TurnStateLabel ("Sua vez") */
.turnstate { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%) scale(.6); font-size: 110px; color: #e3c355; text-shadow: 4px 4px 0 #000, 0 0 30px rgba(0,0,0,.8); opacity: 0; pointer-events: none; z-index: 31; white-space: nowrap; }
.turnstate.show { animation: turnstate 1.8s ease-out forwards; }
@keyframes turnstate { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1.05); } 30% { transform: translate(-50%,-50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1); } }
/* comentários dos personagens (DialogScreen): personagem montado + barra de diálogo */
.aidialog { position: absolute; left: 270px; bottom: 0; width: 1000px; height: 420px; z-index: 32; opacity: 0; transform: translateY(60px); transition: opacity .35s, transform .35s; pointer-events: none; }
.aidialog.show { opacity: 1; transform: none; pointer-events: auto; }
.aidialog .aiface { position: absolute; left: 10px; bottom: 0; height: 400px; width: auto; max-width: 320px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)); animation: aibob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes aibob { 0%,100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(-1.2deg) translateY(-4px); } }
.aidialog .aibar { position: absolute; left: 200px; bottom: 0; width: 760px; height: 140px; border-style: solid; border-width: 56px 40px 60px 2px; border-image: url(../ui/atlas/Ingame/DialogBar.png) 56 40 60 2 fill stretch; box-sizing: border-box; }
.aidialog .ainame { position: absolute; left: 160px; top: -48px; font-size: 28px; color: #e3c355; text-shadow: 2px 2px 0 #000; }
.aidialog .aitext { position: absolute; left: 150px; right: -20px; top: -30px; bottom: -40px; display: flex; align-items: center; color: #fff; font-size: 32px; line-height: 1.15; text-shadow: 2px 2px 0 #000; }
/* escolha do tipo de seguidor (SelectableFollowerContainer) */
.chooser { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 26px; }
.chooser img { height: 120px; cursor: pointer; filter: drop-shadow(0 6px 6px rgba(0,0,0,.6)); }
.dragghost { position: fixed; pointer-events: none; z-index: 100; filter: drop-shadow(0 10px 12px rgba(0,0,0,.6)); }
.roomcode { position: absolute; left: 120px; right: 120px; top: 165px; text-align: center; font-size: 44px; color: #f3e3b0; text-shadow: 2px 2px 0 #000; cursor: pointer; pointer-events: auto; }
.roomcode b { color: #e3c355; font-size: 64px; letter-spacing: 10px; }
.roomcode span { display: block; font-size: 26px; opacity: .8; }
.roommsg { position: absolute; left: 0; right: 0; top: 1035px; text-align: center; font-size: 32px; color: #f3e3b0; text-shadow: 2px 2px 0 #000; }
/* fundo do menu (cena level3) */
#menubg { position: absolute; inset: 0; overflow: hidden; background: #000; }
#menubg .mb-scene { position: absolute; inset: 0; perspective-origin: 56% 30%; }
#menubg .mb-plane { position: absolute; left: 50%; top: 62%; width: 600vh; height: 900vh; margin-left: -300vh; margin-top: -450vh; transform-style: preserve-3d; transform: rotateX(62deg) rotateZ(-8deg); background: url(../ui/tex-game/wood.png) repeat; }
#menubg .mb-card { position: absolute; left: 50%; top: 50%; background: url(../ui/tex-game/tiles_backside.png) 0 0 / 100% 100%; transform-style: preserve-3d; }
#menubg .mb-spot { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 55% 60% at 56% 62%, rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,.93) 100%); }
.dfbg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.dfc { isolation: isolate; }
.loadtiles { position: absolute; left: 50%; top: 50%; width: 2000px; transform: translate(-50%,-50%) rotate(15deg); opacity: .55; animation: loaddrift 12s linear infinite; pointer-events: none; }
@keyframes loaddrift { from { transform: translate(-50%,-56%) rotate(15deg); } to { transform: translate(-50%,-44%) rotate(15deg); } }
/* campo de texto: a moldura decorativa por cima não pode roubar o clique */
.dfc.dfTextbox > .dfc, .dfc.dfTextbox > .dfbg { pointer-events: none !important; }
.dfc.dfTextbox > .dfinput { z-index: 5; pointer-events: auto; cursor: text; }
/* fundo do menu no celular: plano 3D menor (camadas gigantes somem na GPU e piscam preto) e cor da madeira por trás */
#menubg { background: #2a170c; }
#menubg .mb-plane { backface-visibility: hidden; will-change: transform; }
@media (pointer: coarse), (max-width: 1000px) {
  #menubg .mb-plane { width: 240vmax; height: 300vmax; margin-left: -120vmax; margin-top: -150vmax; }
}
