/* Vale da Amizade · parchment, stained timber, sage and aged brass. */
:root{color-scheme:light;--paper:#eee4c9;--ink:#3d493d;--brass:#b99b63;--forest:#4b6655}
body{background:#171e1c;color:var(--paper);font-family:Trebuchet MS,system-ui,sans-serif}
main{width:min(100vw,calc(100svh * 1.2));height:min(100svh,calc(100vw / 1.2))}
#game{background:#80935d;outline:1px solid #b0a27733}
button{background:#d8c499;color:#39483c;border:1px solid #8c7c58;border-radius:5px;box-shadow:inset 0 1px #f4e8c6,0 2px #403d2c;font-family:inherit;letter-spacing:.02em}
button:hover{filter:brightness(1.08)}button:active{transform:translateY(1px)}button:focus-visible,input:focus-visible{outline:3px solid #749c90;outline-offset:3px}
#hud{inset:14px 16px auto;justify-content:flex-end;gap:6px;align-items:center;text-shadow:none;pointer-events:none}
#hud>*{pointer-events:auto}#hud button{font-size:12px;padding:7px 10px;background:#eee4c9eb;min-height:34px}
#online{margin-right:auto;padding:9px 13px;border:1px solid #a99d7699;border-radius:5px;background:#334d40eb;color:#eee4c9;font-size:12px;box-shadow:0 2px #233b31;white-space:nowrap}
#help{width:34px}#voice[aria-pressed=true],#camera[aria-pressed=true]{background:#718b68;color:#fff3d5}
#chat{bottom:14px;left:16px;width:min(310px,calc(100% - 32px))}#messages{height:74px;gap:4px;text-shadow:none}.message{border-radius:3px;background:#314536df;color:#f1e8d0;padding:4px 8px;font-size:12px;line-height:1.3;border-left:2px solid #bba477}
#chatForm input{background:#f1e7cfeF;border:1px solid #a18d63;border-radius:4px;color:var(--ink);font-size:14px}#chatForm button{font-size:12px}
.welcome{background:var(--paper);border:2px solid #baa47a;border-radius:8px;box-shadow:0 0 0 5px #3b4b3e,0 12px 32px #111b1b70;padding:28px;color:var(--ink)}
dialog{max-width:700px;max-height:94svh;overflow:auto}dialog::backdrop{background:#192b26c9}
#join{top:50%;transform:translateY(-50%);margin:auto;max-height:92svh}
.closetTitle{justify-content:flex-start;border-bottom:1px solid #bdb18f;margin-bottom:18px;padding-bottom:13px;gap:14px}.closetTitle h1{font-family:Georgia,serif;font-size:32px;font-weight:normal;letter-spacing:-.035em}.closetTitle p{font-size:13px;line-height:1.5;margin:6px 0 0;color:#67715c}.closetTitle .leaf{font-size:28px;color:#657e55}
.welcome input,#join .accountLogin input{background:#f9f3e3;border:1px solid #b5a47d;border-radius:4px;padding:11px;color:#384739}.welcome small{color:#71745e;font-size:11px;line-height:1.5}
#join .accountLogin{gap:10px 16px;text-align:left}#join .accountLogin label{color:#5e6854}.closet #enter{background:#4f6d56;border:1px solid #344d3d;color:#f5ebd0;box-shadow:inset 0 1px #7a9576,0 3px #314936;border-radius:4px;padding:12px;margin-top:16px}
.avatarStage{background:#b6bea0;border:1px solid #8f9878;border-radius:5px;box-shadow:inset 0 0 0 5px #d8d6b9}.avatarStage>span{background:#61745b;color:#eee4c9;border-radius:2px;font-size:10px;letter-spacing:.14em}.wardrobeGroup{background:#f7efda;border:1px solid #c7b68e;border-radius:5px}.wardrobeGroup>b{color:#68725b;font-size:10px}#models button.selected,#genderChoice button.selected{background:#c6d0a9;border-color:#7e9065}
#questDialog{padding:19px 23px;min-height:110px;border:2px solid #af966a;border-radius:6px;background:#eee4c9;box-shadow:0 0 0 4px #3b4b3e,0 8px 22px #15251e70;grid-template-columns:minmax(0,1fr) 28px}
.dialogCopy b{font-family:Georgia,serif;color:#51694c;font-size:22px}.dialogCopy span{color:#444d3e;line-height:1.55;font-size:15px}.dialogNext{color:#79805c}
#cameraFrame,.remoteCamera{background:#283e33;border:1px solid #b29f73;border-radius:5px;box-shadow:0 3px 8px #13251b66}#cameraFrame video,.remoteCamera video{border-radius:2px}
@media(pointer:coarse){main{width:min(94vw,calc(94svh * 1.2));height:auto;aspect-ratio:6/5;max-height:94svh}#hud{inset:8px 10px auto;gap:4px}#hud button{font-size:11px;padding:5px 8px;min-height:30px}#online{font-size:11px;padding:7px 9px}#joystick{border:1px solid #e1d6b036;background:#c0bf9c0d}#stick{border:1px solid #d0d7be66;background:#83947e55;box-shadow:inset 0 2px #d0d7be22,0 4px 12px #0003}#actionPad button{border:2px solid #bdb799;background:#536b61;box-shadow:inset 0 2px #b0bd9a55,0 4px #202e28;color:#ece2c7;font-family:inherit;text-shadow:0 1px #233c2b}#actionPad button[data-action=attack]{background:#9d6959;box-shadow:inset 0 2px #d6a48055,0 4px #573e32}#actionPad button[data-action=sit]{background:#a28d62;box-shadow:inset 0 2px #d6c79255,0 4px #5e533a}#actionPad button[data-action=x],#actionPad button[data-action=y]{background:#5b756c;border-color:#b0b59b;box-shadow:inset 0 2px #aeb79d55,0 4px #30463d;opacity:1}#chatToggle{background:#4c6657;border:2px solid #a3ac8e;color:#f2e7cd;box-shadow:0 3px #243b2e}}
@media(pointer:coarse) and (orientation:portrait){
 body{background:#111816}main{width:100vw;height:100svh;max-height:none;aspect-ratio:auto;background:linear-gradient(180deg,#1c2620 0%,#141c18 70%)}
 #game{top:10px;left:10px;width:calc(100vw - 20px);height:auto;aspect-ratio:6/5;border:2px solid #646e55;border-radius:4px;box-shadow:0 0 0 4px #0a120e,0 6px 0 #2a352a}
 #hud{inset:18px 18px auto}#hud button{padding:5px 7px;font-size:10px;min-height:28px}#online{font-size:10px;padding:7px}
 #joystick,#actionPad{bottom:max(86px,calc(16svh + env(safe-area-inset-bottom)))}#joystick{left:26px}
 #chatToggle{bottom:max(94px,calc(16svh + 8px + env(safe-area-inset-bottom)));left:calc(50% - 18px);right:auto;width:36px;height:36px;font-size:15px}
 #cameraFrame,#remoteCameras{top:calc((100vw - 20px) * 5 / 6 + 35px)}
 #chat{left:12px;right:12px;bottom:218px;width:calc(100% - 24px);z-index:6}#chat.chatOpen{padding:8px;background:#263c30;border:1px solid #819170;border-radius:5px}
 #questDialog{top:calc((100vw - 20px) * 5 / 6 - 124px);bottom:auto;min-height:106px;max-height:120px;overflow:auto;width:calc(100% - 40px);padding:12px 15px;grid-template-columns:minmax(0,1fr) 20px}.dialogCopy b{font-size:18px}.dialogCopy span{font-size:13px}
 .welcome{padding:20px}.closetTitle h1{font-size:28px}
}
@media(pointer:coarse) and (orientation:portrait) and (max-height:680px){#joystick,#actionPad{bottom:26px}#chatToggle{bottom:35px}#joystick{width:106px;height:106px}#stick{left:25px;top:25px}#actionPad{gap:6px;grid-template-columns:repeat(2,46px)}#actionPad button{width:46px;height:46px}}
@media(prefers-reduced-motion:reduce){.dialogNext{animation:none}}

/* Mesa compartilhada: tabuleiro grande para ponteiro e toque. */
.chessOverlay{position:absolute;z-index:30;inset:0;display:grid;place-items:center;padding:18px;background:#15251cd9;backdrop-filter:blur(2px)}.chessCard{width:min(570px,100%);padding:18px;border:3px solid #bf9e68;border-radius:10px;background:linear-gradient(135deg,#f7edcf,#dcc69c);color:#3c3a2e;box-shadow:0 0 0 5px #31463a,0 18px 48px #08110c99}.chessCard header{display:flex;align-items:center;gap:11px;padding-bottom:13px;border-bottom:1px solid #b9a474}.chessCard header div{display:grid;gap:2px;flex:1}.chessCard header b{font:normal 24px Georgia,serif;color:#485c47}.chessCard header small,.chessPlayers small,.chessHow{font-size:12px;color:#69705a}.chessCrest{display:grid;place-items:center;width:42px;height:42px;border-radius:5px;background:#49604e;color:#f4e5b8;font:30px Georgia;box-shadow:inset 0 0 0 2px #80916d}.chessClose{width:32px;height:32px;padding:0;border-radius:50%;font-size:22px}.chessPlayers{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}.chessPlayers>div{display:grid;grid-template-columns:32px 1fr;gap:1px 8px;align-items:center;padding:10px;border:1px solid #bdac83;border-radius:5px;background:#eee1bd}.chessPlayers i{grid-row:span 2;font:30px Georgia;font-style:normal;color:#5d4a3a}.chessPlayers .ready{background:#d4dfba;border-color:#869a70}.chessPlayers span{font-weight:bold}.chessCard p{font-size:14px;line-height:1.45}.chessActions{display:flex;justify-content:space-between;gap:10px;margin-top:16px}.chessActions button{padding:10px 14px}.chessActions button:last-child{background:#506d55;color:#fff4d4}.chessActions button:disabled{opacity:.45;cursor:not-allowed}.chessBoardCard{width:min(760px,100%);padding:16px}.chessHow{margin:12px 2px}.chessPlay{display:grid;grid-template-columns:minmax(0,1fr) 105px;gap:13px;align-items:stretch}.chessBoard{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;border:8px solid #674a35;box-shadow:0 0 0 3px #b8925b,0 5px 0 #382c24;touch-action:none}.chessCell{position:relative;display:grid;place-items:center;min-width:0}.chessCell.light{background:#ecd9ac}.chessCell.dark{background:#60775f}.chessCell em,.chessCell strong{position:absolute;font:700 9px system-ui;font-style:normal;opacity:.68}.chessCell em{left:3px;top:2px}.chessCell strong{right:3px;bottom:2px}.chessPiece{position:relative;z-index:1;width:100%;height:100%;min-width:0;padding:0;border:0;border-radius:0;background:transparent!important;font:clamp(22px,7.4vw,57px)/1 Georgia,serif;cursor:grab;touch-action:none;filter:drop-shadow(1px 3px 0 #352a2180)}.chessPiece.white{color:#fff4d7;text-shadow:1px 0 #73573d,-1px 0 #73573d,0 1px #73573d,0 -1px #73573d}.chessPiece.black{color:#342b2a;text-shadow:1px 1px #8a7153}.chessPiece.dragging{opacity:.38;cursor:grabbing}.chessCaptured{display:flex;flex-direction:column;gap:7px;padding:9px 5px;border:2px dashed #a28759;border-radius:5px;background:#e8d5a8;text-align:center;font-size:11px;min-height:100%}.chessCaptured>b{font:14px Georgia;color:#52614b}.chessCaptured>span{color:#76664d}.chessCaptured div{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start}.chessCaptured .chessPiece{width:34px;height:34px;font-size:28px}
@media(pointer:coarse) and (orientation:portrait){.chessOverlay{padding:10px}.chessCard{padding:13px}.chessCard header b{font-size:21px}.chessPlay{grid-template-columns:minmax(0,1fr) 76px;gap:8px}.chessBoard{border-width:5px}.chessCaptured{padding:6px 2px}.chessCaptured .chessPiece{width:27px;height:27px;font-size:24px}.chessCard p{font-size:13px}.chessActions button{padding:9px 10px;font-size:12px}}
