:root {
  --cream: #fbf7f2; --paper: #fffdf9; --ink: #51453f; --muted: #89766b;
  --rose: #bd7d77; --sage: #7d927c; --line: #e8ded4;
  --control: #49634b; --control-hover: #354e38; --control-ink: #334936;
  --control-soft: #eff3e9; --control-border: #6f8164; --control-muted: #55624e;
  --serif: 'Fraunces', Georgia, serif; --sans: 'DM Sans', sans-serif;
  /* HUD compacto: um tamanho de botão por tela (desktop, celular, deitado) e bordas que respeitam a safe area. */
  --hud-top: max(16px, env(safe-area-inset-top));
  --hud-edge: max(16px, env(safe-area-inset-left));
  --hud-edge-right: max(16px, env(safe-area-inset-right));
  --hud-bottom: max(16px, env(safe-area-inset-bottom));
  --hud-size: 42px; --hud-radius: 13px; --pad-cell: 40px;
  --touch-size: 40px;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; background: #e7dfd0; color: var(--ink); font-family: var(--sans); font-size: 14px; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: wait; opacity: .55; }
[x-cloak], [hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--sage); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; border-radius: 12px; background: var(--paper); padding: 12px; }
.skip-link:focus { top: 8px; }
.house-layout { position: absolute; left: 0; top: var(--casa-viewport-top, 0px); width: 100%; height: 100vh; height: var(--casa-viewport-height, 100dvh); }
.world-frame { position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate; background: #e7dfd0; touch-action: none; }
#gameMount { position: absolute; inset: 0; width: 100%; height: 100%; }
#gameMount canvas { display: block; }
.world-frame::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 90px 90px -65px #554b3733, inset 0 -90px 90px -70px #554b372b; }
.hud-glass { border: 1px solid #fffdf9cc; background: #fffdf9ed; box-shadow: 0 6px 24px #51453f15, inset 0 1px 0 #ffffffd9; }
@supports (backdrop-filter: blur(12px)) { .hud-glass { background: #fffdf9db; backdrop-filter: blur(14px); } }
.world-hud-top { position: absolute; top: var(--hud-top); left: var(--hud-edge); right: var(--hud-edge-right); z-index: 40; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
/* Marca em pílula: "CASA LÍRIO" pequeno + o cômodo em destaque. Opaca: o toque nela não vira rota escondida atrás. */
.hud-location { display: flex; align-items: center; gap: 8px; height: var(--hud-size); padding: 0 15px 0 6px; border-radius: 999px; min-width: 0; pointer-events: auto; }
.hud-flower { display: grid; place-items: center; width: calc(var(--hud-size) - 12px); height: calc(var(--hud-size) - 12px); flex-shrink: 0; border: 1px solid #a1b29555; border-radius: 50%; font-size: 20px; line-height: 1; background: #e8edde; color: #879a74; }
.hud-location-copy { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.hud-eyebrow { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.hud-location h1 { font-family: var(--sans); font-size: 9px; line-height: 1.45; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #6f604f; margin: 0; white-space: nowrap; }
.hud-private { font-size: 9px; line-height: 1.45; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--control); white-space: nowrap; }
.hud-location p { display: flex; align-items: center; gap: 5px; min-width: 0; margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.hud-room { overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #91a180; flex-shrink: 0; }
.hud-top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; pointer-events: auto; }
.studio-return { position: relative; display: inline-flex; align-items: center; gap: 7px; height: var(--hud-size); padding: 0 14px 0 12px; border-radius: var(--hud-radius); color: #675648; font-size: 12px; font-weight: 600; white-space: nowrap; }
.studio-return:hover { background: var(--paper); border-color: #97a487; }
.studio-return svg { width: 17px; height: 17px; flex-shrink: 0; color: #869473; }
.hud-icon-button { position: relative; display: grid; place-items: center; padding: 0; width: var(--hud-size); height: var(--hud-size); border-radius: var(--hud-radius); color: #82725f; }
.hud-icon-button:hover { background: var(--paper); color: var(--ink); }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hud-icon-button svg { width: 19px; height: 19px; }
/* Sacola no topo: o ícone fica sempre; o número some com a sacola vazia e dá um pulinho quando entra peça. */
.hud-bag-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #a24f49; color: #fffdf9; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #fffdf9, 0 2px 6px #51453f33; pointer-events: none; }
.hud-bag-count.is-bump { animation: bag-bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bag-bump { 40% { transform: scale(1.35); } }
.movement-pad { position: absolute; left: var(--hud-edge); bottom: var(--hud-bottom); z-index: 40; display: grid; grid-template: repeat(3, var(--pad-cell)) / repeat(3, var(--pad-cell)); border-radius: 20px; padding: 2px; touch-action: none; user-select: none; -webkit-user-select: none; transition: opacity .2s ease; }
.move-button { display: grid; place-items: center; width: var(--pad-cell); height: var(--pad-cell); border: 0; border-radius: 11px; background: transparent; color: #8d806e; padding: 0; touch-action: none; }
.move-button svg { width: 19px; height: 19px; stroke-width: 2; }
.move-button:hover { color: #5b704c; background: #e5eadc; }
.move-button:active, .move-button.is-pressed { color: #526544; background: #dce4d2; box-shadow: inset 0 1px 3px #51453f14; }
.move-button:disabled { opacity: .35; cursor: default; background: transparent; box-shadow: none; }
.move-button[aria-disabled=true] { opacity: .4; }
.move-up { grid-area: 1 / 2; }
.move-left { grid-area: 2 / 1; }
.move-right { grid-area: 2 / 3; }
.move-down { grid-area: 3 / 2; }
.pad-center { grid-area: 2 / 2; display: grid; place-items: center; color: #bdc6b0; font-size: 18px; line-height: 1; pointer-events: none; }
.tray-toggle { position: absolute; left: 50%; bottom: var(--hud-bottom); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; justify-content: center; gap: 8px; height: var(--hud-size); border-radius: var(--hud-radius); padding: 0 16px; color: #635642; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tray-toggle:hover { background: var(--paper); }
.tray-toggle svg { width: 17px; height: 17px; flex-shrink: 0; color: #8e9a7c; }
.tray-chevron { color: #a48f78; font-size: 18px; line-height: .8; transition: transform .22s ease; }
.tray-toggle[aria-expanded=true] { border-color: #a6b397; background: #f2f5eb; }
.tray-toggle[aria-expanded=true] .tray-chevron { transform: rotate(180deg); }
.overview-button { position: absolute; right: var(--hud-edge-right); bottom: var(--hud-bottom); z-index: 40; width: var(--hud-size); height: var(--hud-size); border-radius: var(--hud-radius); }
.interaction-button { position: absolute; right: var(--hud-edge-right); bottom: calc(var(--hud-bottom) + var(--hud-size) + 10px); z-index: 20; display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 300px; min-height: var(--hud-size); padding: 6px 14px; border-radius: var(--hud-radius); color: #69543f; font-size: 12px; line-height: 1.3; }
.interaction-spark { color: #b2946e; font-size: 18px; line-height: 1; }
.interaction-button kbd { font-family: inherit; border: 1px solid #dacdbb; padding: 2px 6px; border-radius: 5px; font-size: 10px; color: #98836d; }
.world-loading { position: absolute; inset: 0; z-index: 60; background: #f0e9dd; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 19px; padding: 24px; text-align: center; }
.world-loading p { max-width: 400px; font-family: var(--serif); font-size: 23px; line-height: 1.5; margin: 0; color: #8c7462; }
.loading-flower { font-size: 46px; color: #af8d75; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; transform: rotate(40deg); } }
.tray-backdrop { position: absolute; inset: 0; z-index: 25; background: #51453f36; }
.casa-tray { position: absolute; left: 50%; bottom: calc(var(--hud-bottom) + var(--hud-size) + 12px); transform: translateX(-50%); z-index: 35; width: min(920px, calc(100% - var(--hud-edge) - var(--hud-edge-right))); max-height: calc(var(--casa-viewport-height, 100dvh) - var(--hud-top) - var(--hud-bottom) - 2 * var(--hud-size) - 24px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d0c2af transparent; border: 1px solid #fffdf9dc; border-radius: 26px; padding: 25px; background: #fffdf9f7; box-shadow: 0 24px 70px #493e3033, inset 0 1px 0 #ffffff; touch-action: pan-y; }
@supports (backdrop-filter: blur(12px)) { .casa-tray { backdrop-filter: blur(20px); background: #fffdf9ed; } }
.world-frame[data-tray-open=true] .movement-pad, .world-frame[data-tray-open=true] .interaction-button { visibility: hidden; pointer-events: none; }
.tray-enter { transition: opacity .24s ease, transform .24s ease; }
.tray-leave { transition: opacity .18s ease, transform .18s ease; }
.tray-enter-start { opacity: 0; transform: translate(-50%, 28px); }
.tray-enter-end { opacity: 1; transform: translate(-50%, 0); }
.tray-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 7px; text-transform: uppercase; font-size: 9px; letter-spacing: .15em; font-weight: 600; color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.03em; }
.tray-heading h2 { font-family: var(--serif); font-size: 26px; margin: 0; line-height: 1.15; }
.tray-heading .close-button { width: 44px; height: 44px; background: #f4eee5; border-color: transparent; }
.tray-content { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 22px; }
.avatar-card { background: #f5f0e7; border: 1px solid #e5dbcde0; border-radius: 19px; padding: 18px; display: flex; flex-direction: column; justify-content: center; }
.avatar-card-top { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.avatar-card h3 { font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0; margin: 0 0 7px; line-height: 1.45; }
.avatar-card .eyebrow { font-size: 8px; margin-bottom: 5px; }
.avatar-state { font-size: 10px; line-height: 1.6; color: var(--muted); margin: 0; }
.avatar-portrait { position: relative; width: 62px; height: 80px; border-radius: 32px 32px 18px 18px; background: #eae1d3; overflow: hidden; flex-shrink: 0; }
.avatar-portrait img { height: 138px; width: 98px; max-width: none; position: absolute; left: -18px; top: -2px; }
.avatar-card > .text-link { display: block; text-align: center; margin-top: 13px; font-size: 10px; line-height: 1.65; }
.avatar-card .button { min-height: 44px; padding: 11px 9px; font-size: 10px; gap: 8px; }
.tray-explore { min-width: 0; }
.room-navigation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 13px; }
.room-button { position: relative; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 9px; min-width: 0; padding: 13px 8px; border: 1px solid #e5dccf; border-radius: 14px; background: #fffdf9b0; color: var(--ink); text-align: center; }
.room-button:hover, .room-button[aria-current=location] { background: #eef1e6; border-color: #b4bea1; }
.room-icon { width: 32px; height: 32px; display: grid; place-items: center; color: #8c9f79; background: #e9eddf; border-radius: 10px; }
.room-icon svg { width: 20px; height: 20px; }
.room-button:nth-child(2) .room-icon { background: #f2e3dc; color: #b88979; }
.room-button:nth-child(3) .room-icon { background: #eee5d4; color: #a78e66; }
.room-button strong { font-size: 11px; font-weight: 500; display: block; margin-bottom: 4px; }
.room-button small { font-size: 9px; color: var(--muted); line-height: 1.3; display: block; }
.room-arrow { position: absolute; top: 10px; right: 9px; color: #b3a390; font-size: 10px; }
.tray-activities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tray-action { min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 11px; text-align: left; border: 1px solid #e8dfd2; border-radius: 12px; background: #fffdf987; color: #74614c; }
.tray-action:hover { border-color: #c5b8a5; background: #fffdf9; }
.tray-action > svg { width: 20px; height: 20px; flex-shrink: 0; color: #a39178; }
.tray-action > span:nth-child(2) { min-width: 0; }
.tray-action > span:last-child { margin-left: auto; color: #b3a18a; font-size: 13px; flex-shrink: 0; }
.tray-action strong { display: flex; align-items: center; gap: 5px; color: #685742; font-size: 11px; font-weight: 500; line-height: 1.35; }
.tray-action small { display: block; font-size: 9px; line-height: 1.45; color: #a08f7b; margin-top: 4px; }
.action-puzzle { background: #edf1e6; border-color: #d7dfc9; }
.action-puzzle > svg { color: #91a17b; }
.action-social { grid-column: 1 / -1; border-style: dashed; background: #f8f4eb80; min-height: 54px; }
.action-social small { display: none; }
.soon-tag { border-radius: 999px; padding: 4px 7px; background: #f0ece3; font-size: 8px !important; line-height: 1.2; color: #a2917b !important; white-space: nowrap; }
.tray-footnote { margin: 17px 0 0; color: #b09e88; font-size: 9px; line-height: 1.5; text-align: center; }
.tray-footnote > span { color: #a9b699; margin-right: 5px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; padding: 12px 16px; border-radius: 9px; border: 1px solid transparent; font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--ink); }
.button-primary { background: var(--ink); color: #fffdf9; }
.button-primary:hover { background: #6b584c; }
.button-cream { background: #eee5d7; border-color: #e0d2bf; }
.button-cream:hover { background: #e6dac8; }
.button-subtle { background: none; }
.text-link { border: 0; background: none; padding: 0; color: #7a6657; font-size: 12px; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }
.toast { position: fixed; top: calc(var(--casa-viewport-top, 0px) + var(--hud-top) + var(--hud-size) + 10px); left: 50%; transform: translate(-50%, -6px); opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; z-index: 80; color: var(--paper); background: #51453ff2; font-size: 12px; line-height: 1.5; border-radius: 14px; padding: 13px 21px; box-shadow: 0 5px 20px #51453f33; width: max-content; max-width: min(calc(100vw - 32px), 500px); text-align: center; pointer-events: none; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s ease, transform .2s ease; }
.toast:empty { padding: 0; background: transparent; box-shadow: none; }
.casa-dialog{border:1px solid var(--line);padding:29px;border-radius:22px;background:var(--paper);color:var(--ink);width:min(780px,calc(100% - 28px));max-height:90dvh;overflow:auto;box-shadow:0 25px 80px #51453f30}.casa-dialog::backdrop{background:#51453f66;backdrop-filter:blur(4px)}.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.dialog-heading h2{font-size:28px;margin:0}.close-button{display:grid;place-items:center;flex-shrink:0;border:1px solid var(--line);background:transparent;border-radius:50%;width:31px;height:31px;font-size:21px;color:var(--muted);line-height:1}.dialog-intro{color:var(--muted);font-size:12px;line-height:1.8;margin:0 0 21px}.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-bottom:24px}.product-card{position:relative;display:flex;flex-direction:column;align-items:stretch;border:1px solid var(--line);border-radius:14px;overflow:hidden;text-align:left;background:none;padding:0}.product-card img{width:100%;aspect-ratio:1;object-fit:contain;background:#f5eee7;padding:13px}.product-card-body{padding:12px}.product-card h3{font-family:var(--sans);font-size:12px;font-weight:500;letter-spacing:0;margin:0 0 7px}.product-card p{margin:0;color:#9d7c66;font-size:11px}.product-dialog{width:min(660px,calc(100% - 28px));position:relative;padding:0;overflow:hidden}.floating-close{position:absolute;right:13px;top:13px;z-index:2;background:var(--paper)}.product-detail{display:grid;grid-template-columns:1fr 1fr}.product-detail-image{display:flex;background:#f3ebe2;align-items:center;justify-content:center;padding:22px;min-height:300px}.product-detail-image img{width:100%;height:270px;object-fit:contain}.product-detail-copy{padding:35px 24px;align-self:center}.product-detail-copy h2{font-size:25px;margin:0 0 12px}.product-price{font-size:17px;margin:0 0 12px}.product-sale{font-size:11px;line-height:1.65;color:var(--muted)}.product-detail-copy .button{margin:15px 0 12px}.field-label{display:block;font-size:11px;margin:16px 0 7px;color:#7a6758}select,input{font:inherit;width:100%;border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:11px 10px;border-radius:8px}select:focus-visible{outline:2px solid var(--sage);outline-offset:3px}.product-detail-copy .text-link{display:block}.small-dialog{width:min(440px,calc(100% - 28px))}.small-dialog p{font-size:13px;line-height:1.9;color:var(--muted)}.small-dialog ul{font-size:12px;line-height:1.9;padding-left:18px;color:var(--muted)}.small-dialog form .button{margin-top:19px}.form-error{color:#a45651!important;font-size:12px!important;line-height:1.6!important}.closet-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}.look-card{background:#f5eee7;border:1px solid var(--line);padding:12px;border-radius:13px;text-align:center}.look-card img{width:100%;height:175px;object-fit:contain}.look-card h3{font-family:var(--sans);font-size:12px;letter-spacing:0;margin:8px 0 12px}.look-card .button{width:100%;font-size:11px;padding:10px}.look-equipped{border-color:#9caa91;background:#edf0e5}.pagination{display:flex;align-items:center;justify-content:center;gap:20px;margin-bottom:20px}.pagination span{font-size:11px;color:var(--muted)}.empty-state{padding:28px;background:#f4eee6;text-align:center;border-radius:12px;line-height:1.8;font-size:13px;color:var(--muted);margin-bottom:20px}.empty-state .button{margin-top:13px}.cart-dialog{width:min(540px,calc(100% - 28px))}.cart-item{display:flex;align-items:center;gap:13px;padding:14px 0;border-bottom:1px solid var(--line)}.cart-item img{width:58px;height:68px;object-fit:contain;background:#f4ede5;border-radius:9px}.cart-item-copy{flex:1}.cart-item-copy strong{font-size:12px;font-weight:500;display:block}.cart-item-copy p{font-size:11px;color:var(--muted);margin:6px 0}.cart-item button{background:none;border:0;font-size:11px;color:var(--muted)}.cart-total{display:flex;justify-content:space-between;font-size:14px;margin:19px 0}.cart-note{font-size:10px;color:var(--muted);line-height:1.7;margin:18px 0}.puzzle-dialog{width:min(510px,calc(100% - 28px))}.puzzle-toolbar{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);margin-bottom:14px}.puzzle-board{display:grid;grid-template-columns:repeat(6,1fr);gap:9px;padding:18px;background:#f2ebe1;border-radius:15px;aspect-ratio:1}.puzzle-point{position:relative;border:1px solid #d8c6b5;border-radius:50%;width:100%;aspect-ratio:1;background:#fffbf4;color:#bba18a;font-size:17px;padding:0}.puzzle-point.is-knot{border-color:transparent;background:#dfd2c5;color:#b3957d;cursor:default}.puzzle-point.is-path{background:#c7948a;border-color:#b58379;color:#fff8ed}.puzzle-point.is-start{background:#e3d6bb;color:#8f7650;font-size:20px}.puzzle-point.is-finish{background:#e0e8d5;color:#7c956e;font-size:25px}.puzzle-point.can-visit{box-shadow:0 0 0 2px #c7948a55}.puzzle-point.is-current{box-shadow:0 0 0 3px #b5796f66}.puzzle-message{min-height:38px;font-family:var(--serif);font-size:16px;text-align:center;line-height:1.5;color:#927360;margin:16px 0}.puzzle-actions{display:flex;align-items:center;justify-content:center;gap:15px;flex-wrap:wrap}.puzzle-note{font-size:10px;line-height:1.7;color:var(--muted);text-align:center;margin-top:19px}.no-script{margin:25px;padding:20px;background:white}.no-script a{text-decoration:underline}
@media(max-width:760px){.casa-dialog{padding:21px;max-height:88dvh;border-radius:18px}.dialog-heading h2{font-size:24px}.dialog-intro{font-size:11px;margin-bottom:17px}.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.product-dialog{padding:0;overflow:auto}.product-detail{grid-template-columns:1fr}.product-detail-image{min-height:190px;padding:15px}.product-detail-image img{height:190px}.product-detail-copy{padding:20px}.product-detail-copy h2{font-size:25px}.product-detail-copy .button{margin-top:13px}.closet-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.look-card{padding:9px}.look-card img{height:155px}.puzzle-board{gap:7px;padding:13px}.puzzle-point{font-size:16px}.puzzle-message{font-size:15px}}
/* A margem nativa centraliza os diálogos apesar do preflight Tailwind. */
.casa-dialog { margin: auto; }
/* As 36 casas da trama cabem no quadrado sem sobrepor a mensagem em 320px. */
.puzzle-board { width: 100%; min-width: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.puzzle-point { min-width: 0; min-height: 0; width: 100%; height: 100%; display: grid; place-items: center; line-height: 1; padding: 0; }
.history-dialog { width: min(600px, calc(100% - 28px)); }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.history-item strong { display: block; font-size: 15px; line-height: 1.5; }
.history-item time { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.history-item p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.history-prompt { display: flex; flex-direction: column; gap: 14px; }
.puzzle-history { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 12px 0; }
.no-script { position: fixed; top: 120px; left: 20px; right: 20px; z-index: 90; margin: 0; border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--paper); }
@media (max-width: 760px) {
  :root { --hud-top: max(10px, env(safe-area-inset-top)); --hud-edge: max(12px, env(safe-area-inset-left)); --hud-edge-right: max(12px, env(safe-area-inset-right)); --hud-bottom: max(12px, env(safe-area-inset-bottom)); --hud-size: 40px; --hud-radius: 12px; --pad-cell: 38px; }
  .world-hud-top { gap: 6px; }
  .hud-location { gap: 7px; padding: 0 12px 0 5px; }
  .hud-flower { font-size: 18px; }
  .hud-location h1, .hud-private { letter-spacing: .1em; }
  .hud-location p { font-size: 14px; }
  .hud-top-actions { gap: 6px; }
  .studio-return { gap: 5px; padding: 0 11px 0 10px; font-size: 11px; }
  .studio-return svg { width: 15px; height: 15px; }
  /* Rótulos curtos ("Studio", "Explorar"): o resto continua para o leitor de tela. */
  .hud-label-long { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .hud-icon-button svg { width: 18px; height: 18px; }
  .movement-pad { border-radius: 18px; }
  /* "Explorar" sai do centro e fica junto da visão geral: o controle desce até a base, onde fica o polegar. */
  .tray-toggle { left: auto; right: calc(var(--hud-edge-right) + var(--hud-size) + 8px); transform: none; gap: 6px; padding: 0 12px; }
  .tray-toggle svg { width: 16px; height: 16px; }
  .tray-chevron { font-size: 15px; }
  .interaction-button { max-width: calc(100% - var(--hud-edge) - var(--hud-edge-right) - 3 * var(--pad-cell) - 20px); gap: 6px; padding: 6px 12px; font-size: 11px; }
  .interaction-button kbd { display: none; }
  .interaction-spark { font-size: 16px; }
  .casa-tray { width: calc(100% - 24px); border-radius: 22px; padding: 18px; }
  .tray-heading { margin-bottom: 16px; }
  .tray-heading h2 { font-size: 24px; }
  .tray-content { grid-template-columns: 1fr; gap: 15px; }
  .avatar-card { padding: 13px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, .78fr); gap: 8px 13px; align-items: center; border-radius: 15px; }
  .avatar-card-top { gap: 10px; margin-bottom: 0; }
  .avatar-portrait { width: 43px; height: 58px; border-radius: 25px 25px 12px 12px; }
  .avatar-portrait img { height: 102px; width: 73px; left: -15px; }
  .avatar-card h3 { font-size: 11px; margin-bottom: 4px; }
  .avatar-state { font-size: 9px; }
  .avatar-card .button { font-size: 10px; gap: 4px; padding: 9px 7px; line-height: 1.5; }
  .avatar-card > .text-link { grid-column: 1 / -1; margin: 0; text-align: left; border-top: 1px solid #e6dccf; padding-top: 10px; }
  .room-navigation { gap: 6px; margin-bottom: 12px; }
  .room-button { padding: 12px 5px; gap: 8px; }
  .room-button strong { font-size: 10px; }
  .room-button small { display: none; }
  .room-arrow { top: 8px; right: 7px; }
  .room-icon { width: 29px; height: 29px; border-radius: 9px; }
  .room-icon svg { width: 18px; height: 18px; }
  .tray-activities { gap: 7px; }
  .tray-action { min-height: 60px; padding: 10px 9px; gap: 8px; }
  .tray-action > svg { width: 18px; height: 18px; }
  .tray-action strong { font-size: 10px; }
  .tray-action small { font-size: 8px; }
  .tray-action > span:last-child { font-size: 11px; }
  .action-social { min-height: 49px; }
  .tray-footnote { font-size: 8px; margin-top: 15px; }
  .toast { top: calc(var(--casa-viewport-top, 0px) + var(--hud-top) + 2 * var(--hud-size) + 16px); padding: 10px 16px; font-size: 11px; }
}
@media (max-width: 359px) {
  :root { --hud-edge: max(10px, env(safe-area-inset-left)); --hud-edge-right: max(10px, env(safe-area-inset-right)); --pad-cell: 36px; }
  .world-hud-top { gap: 5px; }
  .hud-location { gap: 6px; padding: 0 10px 0 5px; }
  .hud-location p { font-size: 13px; }
  /* Voltar ao Studio vira só o ícone; o nome continua para o leitor de tela. */
  .studio-return { width: var(--hud-size); padding: 0; justify-content: center; }
  .studio-return .hud-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .hud-top-actions { gap: 5px; }
  .tray-toggle { padding: 0 10px; gap: 5px; }
  .casa-tray { width: calc(100% - 20px); padding: 16px; }
  .avatar-card { grid-template-columns: 1fr; gap: 12px; }
  .avatar-card .button { font-size: 11px; }
  .avatar-card > .text-link { font-size: 10px; }
  .tray-action { gap: 6px; padding: 10px 7px; }
  .tray-action > svg { width: 16px; height: 16px; }
  .tray-action strong { font-size: 9px; }
  .tray-action small { font-size: 8px; }
  .tray-action > span:last-child { display: none; }
  .action-social > span:last-child { display: block; }
}
@media (max-height: 560px) {
  :root { --hud-top: max(8px, env(safe-area-inset-top)); --hud-bottom: max(10px, env(safe-area-inset-bottom)); --hud-size: 38px; --hud-radius: 11px; --pad-cell: 34px; }
  .hud-flower { font-size: 17px; }
  .hud-location p { font-size: 14px; }
  .casa-tray { padding: 18px; }
  .tray-heading { margin-bottom: 15px; }
  .tray-heading h2 { font-size: 23px; }
  .tray-footnote { margin-top: 12px; }
}
@media (max-height: 560px) and (min-width: 761px) {
  .tray-content { grid-template-columns: 210px minmax(0, 1fr); gap: 15px; }
  .avatar-card { padding: 12px; }
  .room-button { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { .loading-flower { animation: none; } .tray-enter, .tray-leave, .tray-chevron { transition: none; } }

/* Interior pessoal: ações compactas, escolha por toque e sem alterar o HUD da loja. */
/* Desktop/deitado: no centro da linha do topo; celular: logo abaixo dela, à direita. */
.personal-hud { position: absolute; left: 50%; top: var(--hud-top); transform: translateX(-50%); z-index: 6; display: flex; align-items: center; height: var(--hud-size); padding: 2px; border-radius: var(--hud-radius); }
.personal-hud button { height: calc(var(--hud-size) - 6px); padding: 0 11px; background: none; border: 0; border-radius: calc(var(--hud-radius) - 3px); color: var(--ink); font-size: 11px; white-space: nowrap; }
.personal-hud button:hover { background: #eee5d780; }
.personal-hud button span { color: var(--sage); margin-right: 4px; }
.personal-hud-separator { height: 18px; width: 1px; background: var(--line); }
.room-personal { background: #eef1e8; border-color: #dce3d2; }
.space-dialog { width: min(620px, calc(100% - 28px)); }
.space-options, .space-choice-group { min-width: 0; border: 0; padding: 0; margin: 0; }
.space-options { display: grid; gap: 20px; }
.space-choice-group legend { color: #766450; font-size: 12px; margin-bottom: 9px; }
.space-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.space-choice { position: relative; cursor: pointer; }
.space-choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.space-choice-body { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 85px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 13px; background: #f8f4ed; font-size: 11px; text-align: center; }
.space-choice input:checked + .space-choice-body { border-color: var(--sage); background: #edf1e7; box-shadow: 0 0 0 1px var(--sage); }
.space-choice input:focus-visible + .space-choice-body { outline: 2px solid var(--ink); outline-offset: 3px; }
.space-option-preview { font-size: 28px; line-height: 1; color: #93a078; height: 30px; display: flex; align-items: center; }
.space-palette { gap: 0; overflow: hidden; border-radius: 8px; width: 64px; border: 1px solid #e3d8c9; }
.space-palette i { display: block; width: 33.333%; height: 30px; }
.space-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.space-footer p { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 0; max-width: 180px; }
.space-footer .button { flex-shrink: 0; min-height: 44px; }
@media (max-width: 760px) {
  .personal-hud { left: auto; right: var(--hud-edge-right); transform: none; top: calc(var(--hud-top) + var(--hud-size) + 6px); }
  .personal-hud button { padding: 0 9px; }
  .space-options { gap: 15px; }
  .space-choice-body { min-height: 75px; font-size: 10px; }
  .space-footer { flex-wrap: wrap; }
  .space-footer p { max-width: none; }
  .space-footer .button { width: 100%; }
}

/* Editor com cômodo visível: lateral no desktop, bandeja inferior no celular. */
.world-frame[data-decorating=true] .world-hud-top,
.world-frame[data-decorating=true] .personal-hud,
.world-frame[data-decorating=true] .movement-pad,
.world-frame[data-decorating=true] .tray-toggle,
.world-frame[data-decorating=true] .overview-button,
.world-frame[data-decorating=true] .interaction-button { visibility: hidden; pointer-events: none; }
.casa-dialog.space-dialog { position: fixed; inset: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto; margin: 0; width: 374px; height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))); max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))); padding: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 60px #51453f25; }
.space-dialog::backdrop { background: #51453f08; backdrop-filter: none; }
#spaceForm { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.space-editor-heading { padding: 23px 21px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.space-editor-heading h2 { font-size: 25px; }
.space-editor-heading .eyebrow { font-size: 8px; margin-bottom: 5px; }
.space-editor-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 21px 20px; }
.space-editor-scroll .dialog-intro { font-size: 11px; margin-bottom: 19px; }
.space-dialog .space-options { gap: 21px; }
.space-dialog .space-choice-body { min-height: 70px; font-size: 10px; gap: 6px; border-radius: 12px; }
.space-dialog .space-option-preview { font-size: 25px; height: 25px; }
.space-dialog .space-palette { height: 25px; width: 54px; }
.space-dialog .space-palette i { height: 25px; }
.space-dialog .space-choice-group legend { font-size: 11px; }
.space-wall-swatch { width: 27px; height: 27px !important; border: 1px solid #b3a58e66; border-radius: 50%; justify-content: center; background: #efe8dc; font-size: 20px !important; }
.space-dialog .space-footer { display: block; padding: 12px 16px 15px; margin: 0; border-top: 1px solid var(--line); background: #fffdf9; }
.space-dialog .space-footer p { max-width: none; font-size: 10px; margin-bottom: 10px; }
.space-editor-actions { display: flex; align-items: center; gap: 7px; }
.space-editor-actions .text-link { flex: 1; font-size: 10px; text-align: left; }
.space-dialog .space-editor-actions .button { width: auto; padding: 11px 9px; font-size: 10px; min-height: 41px; }
.space-sheet-handle { display: none; }
.memory-dialog { width: min(500px, calc(100% - 28px)); padding: 22px; }
.memory-dialog .dialog-heading { margin-bottom: 10px; }
.memory-dialog .dialog-intro { font-size: 11px; line-height: 1.65; margin-bottom: 12px; }
.memory-toolbar { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: #f2ecdf; }
.memory-toolbar strong { color: #62775b; font-size: 15px; }
.memory-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-height: 40px; }
.memory-card { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-width: 0; gap: 7px; aspect-ratio: 1.4; min-height: 66px; padding: 8px; border: 1px solid #d9dac6; border-radius: 13px; background: repeating-linear-gradient(45deg, #e8eddc, #e8eddc 6px, #eef1e7 6px, #eef1e7 7px); color: #8c9b79; transition: background .2s, border-color .2s, box-shadow .2s; box-shadow: 0 3px 0 #d6ddc9; }
.memory-card-symbol { color: #8c9b79; font-size: 29px; line-height: 1; }
.memory-card-label { font-size: 10px; letter-spacing: .02em; }
.memory-card.is-revealed { background: #fffaf2; border-color: #c6ac94; box-shadow: 0 3px 0 #dfcdbb; }
.memory-card.is-revealed .memory-card-symbol { color: var(--memory-card-color, #7d927c); }
.memory-card.is-matched { background: #f2f4e9; border-color: #aab995; box-shadow: none; }
.memory-card:disabled { opacity: 1; cursor: default; }
.memory-message { font-family: var(--serif); font-size: 16px; text-align: center; line-height: 1.5; margin: 12px 0 6px; }
.memory-receipt { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.5; min-height: 16px; margin: 0 0 10px; }
.memory-receipt:empty { display: none; }
.memory-retry { font-size: 11px; color: #62775b; border: 0; background: none; padding: 5px; text-decoration: underline; }
#memoryRestart { display: flex; margin: 0 auto; min-height: 42px; }
@media (max-width: 760px) {
  .casa-dialog.space-dialog { inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px; width: calc(100% - 20px); height: min(48dvh, 450px); max-height: min(48dvh, 450px); border-radius: 24px; }
  .space-sheet-handle { display: block; height: 4px; width: 34px; margin: 8px auto 0; border-radius: 99px; background: #d9cfbe; flex-shrink: 0; }
  .space-editor-heading { padding: 8px 16px 11px; align-items: center; }
  .space-editor-heading h2 { font-size: 21px; }
  .space-editor-heading .eyebrow { display: none; }
  .space-editor-scroll { padding: 12px 16px 17px; }
  .space-editor-scroll .dialog-intro { margin-bottom: 14px; font-size: 10px; }
  .space-dialog .space-options { gap: 17px; }
  .space-dialog .space-footer { padding: 10px 13px 12px; }
  .space-dialog .space-footer p { font-size: 9px; }
  .space-dialog .space-editor-actions .button { padding: 10px 9px; }
  .memory-board { gap: 8px; }
  .memory-card { min-height: 66px; border-radius: 11px; }
  .memory-card-symbol { font-size: 24px; }
  .memory-card-label { font-size: 9px; }
  .memory-message { font-size: 16px; }
}
@media (max-height: 560px) {
  .memory-dialog { padding: 12px 20px; }
  .memory-dialog .dialog-heading { margin-bottom: 9px; }
  .memory-dialog .dialog-heading h2 { font-size: 23px; }
  .memory-dialog .dialog-intro, .memory-dialog .eyebrow { display: none; }
  .memory-board { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .memory-card { min-height: 60px; }
  .memory-message { margin: 8px 0 4px; font-size: 14px; }
  .memory-receipt { margin-bottom: 6px; }
  #memoryRestart { min-height: 36px; padding: 9px 14px; }
}

/* Flora: um balão de conversa que deixa a Casa visível ao redor. */
.casa-dialog.concierge-dialog { position: fixed; inset: auto max(28px, env(safe-area-inset-right)) max(31px, env(safe-area-inset-bottom)) auto; margin: 0; width: min(500px, calc(100% - 56px)); max-height: min(620px, calc(100dvh - 112px)); padding: 0; border-radius: 26px 26px 9px 26px; overflow: visible; background: #fffcf7; border-color: #d7d4bf; box-shadow: 0 18px 65px #51453f26; }
.concierge-dialog::backdrop { background: #51453f14; backdrop-filter: none; }
.concierge-dialog::after { content: ''; position: absolute; right: 32px; bottom: -12px; width: 22px; height: 22px; background: #fffcf7; border-right: 1px solid #d7d4bf; border-bottom: 1px solid #d7d4bf; transform: rotate(45deg); border-radius: 0 0 5px 0; pointer-events: none; }
.concierge-card { display: flex; flex-direction: column; max-height: min(620px, calc(100dvh - 112px)); overflow: hidden; border-radius: inherit; }
.concierge-heading { display: flex; align-items: center; gap: 14px; padding: 20px 22px 15px; border-bottom: 1px solid #e7e3d4; background: linear-gradient(110deg, #edf1e7, #fbf8f0 82%); flex-shrink: 0; }
.concierge-identity { flex: 1; min-width: 0; }
.concierge-heading .eyebrow { color: #7e8c70; font-size: 8px; margin: 0 0 5px; }
.concierge-heading h2 { font-size: 30px; margin: 0; color: #59694e; }
.concierge-heading .close-button { width: 40px; height: 40px; border-color: #d9dccd; background: #fffcf7c9; }
.concierge-portrait { flex-shrink: 0; width: 60px; height: 64px; border: 1px solid #c9d0b8; border-radius: 32px 32px 18px 18px; background: #e3e9d7; overflow: hidden; display: grid; place-items: center; }
.concierge-portrait > span { font-family: var(--serif); font-size: 42px; color: #859872; }
.concierge-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.concierge-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 19px 23px 17px; scrollbar-width: thin; }
.concierge-topic-title { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin: 0 0 11px; color: #897159; }
.concierge-speech { font-size: 13px; line-height: 1.9; min-height: 99px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.concierge-reading { display: flex; align-items: center; min-height: 27px; gap: 9px; margin-top: 10px; }
.concierge-progress { font-size: 9px; color: #9d937f; letter-spacing: .03em; }
.concierge-reading .text-link { font-size: 10px; margin-left: auto; padding: 5px 0; }
.concierge-dialog[data-mode=menu] .concierge-speech { min-height: 0; }
.concierge-dialog[data-mode=menu] .concierge-reading { display: none; }
.concierge-writing { display: none; align-items: center; gap: 3px; }
.concierge-writing i { width: 4px; height: 4px; border-radius: 50%; background: #92a17d; animation: concierge-dot 1.05s ease-in-out infinite; }
.concierge-writing i:nth-child(2) { animation-delay: .13s; }.concierge-writing i:nth-child(3) { animation-delay: .26s; }
.concierge-dialog[data-typing=true] .concierge-writing { display: flex; }
.concierge-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 10px; margin-top: 4px; border-top: 1px solid #eee7da; }
.concierge-topic-button { display: flex; gap: 8px; align-items: center; min-width: 0; min-height: 49px; padding: 11px; border: 1px solid #e2dfcd; border-radius: 12px; background: #f5f5ec; text-align: left; color: #6c725f; font-size: 10px; line-height: 1.5; }
.concierge-topic-button:hover { background: #eaf0e2; border-color: #bfcbaa; }.concierge-topic-button:focus-visible { outline: 2px solid #8d9d7b; outline-offset: 2px; }
.concierge-topic-symbol { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; font-family: var(--serif); font-size: 21px; color: #97a480; }
.concierge-destinations { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.concierge-destination.button { font-size: 10px; padding: 11px 13px; min-height: 42px; flex: 1; justify-content: center; }
.concierge-footer { display: flex; align-items: center; justify-content: flex-end; gap: 15px; padding: 11px 22px 17px; flex-shrink: 0; }
.concierge-footer .text-link { margin-right: auto; font-size: 11px; }.concierge-footer .button { min-height: 42px; padding: 10px 16px; font-size: 11px; }
@keyframes concierge-dot { 0%, 80%, 100% { opacity: .38; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 760px) {
  .casa-dialog.concierge-dialog { inset: auto 12px max(24px, calc(env(safe-area-inset-bottom) + 12px)) 12px; width: calc(100% - 24px); max-height: calc(100dvh - 160px); border-radius: 23px 23px 8px 23px; }
  .concierge-card { max-height: calc(100dvh - 160px); }
  .concierge-heading { padding: 14px 17px 12px; gap: 11px; }.concierge-heading h2 { font-size: 27px; }
  .concierge-portrait { width: 50px; height: 54px; }.concierge-portrait > span { font-size: 35px; }
  .concierge-body { padding: 15px 18px 12px; }.concierge-topic-title { font-size: 20px; }
  .concierge-speech { font-size: 12px; line-height: 1.85; min-height: 105px; }
  .concierge-topic-button { min-height: 51px; padding: 9px 8px; font-size: 9px; gap: 6px; }
  .concierge-topic-symbol { width: 18px; font-size: 19px; }.concierge-footer { padding: 8px 17px 14px; }
}
@media (max-height: 560px) {
  .casa-dialog.concierge-dialog { inset: auto max(18px, env(safe-area-inset-right)) max(23px, env(safe-area-inset-bottom)) auto; width: min(550px, calc(100% - 36px - env(safe-area-inset-left) - env(safe-area-inset-right))); max-height: calc(100dvh - 64px); }
  .concierge-card { max-height: calc(100dvh - 64px); }.concierge-heading { padding: 10px 17px; gap: 10px; }
  .concierge-heading h2 { font-size: 25px; }.concierge-portrait { width: 43px; height: 45px; }
  .concierge-body { padding: 12px 18px; }.concierge-speech { min-height: 64px; font-size: 12px; line-height: 1.7; }
  .concierge-topic-title { font-size: 19px; margin-bottom: 8px; }.concierge-reading { margin-top: 4px; }
  .concierge-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }.concierge-topic-button { min-height: 43px; padding: 7px; font-size: 9px; }
  .concierge-footer { padding: 6px 17px 10px; }.concierge-footer .button { min-height: 37px; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .concierge-writing i { animation: none; } }

/* Superfícies clicáveis: verde da Lírio, fundo opaco e relevo discreto sobre a arte. */
.button, .studio-return, .hud-icon-button, .tray-toggle, .interaction-button,
.room-button, .tray-action, .concierge-topic-button, .product-card {
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.button { font-weight: 600; }
.button-primary, .tray-toggle, .interaction-button {
  background: var(--control); border: 1px solid #314a35; color: #fffdf9;
  box-shadow: 0 3px 0 #314a35, 0 7px 18px #314a3526, inset 0 1px 0 #ffffff24;
}
.button-primary:not(:disabled):hover, .tray-toggle:hover, .interaction-button:hover {
  background: var(--control-hover); border-color: #263d29; color: #fffdf9;
}
.button-primary:not(:disabled):active, .tray-toggle:active, .interaction-button:active {
  box-shadow: 0 1px 0 #314a35, inset 0 2px 3px #17291d33;
}
.tray-toggle { font-weight: 600; }
.tray-toggle svg, .tray-chevron, .interaction-spark { color: #fffdf9; }
.tray-toggle[aria-expanded=true] { background: var(--control-hover); border-color: #263d29; color: #fffdf9; }
.interaction-button { font-weight: 600; }
.interaction-button kbd { color: #fffdf9; border-color: #cad8bd; background: #314a35; }
.button-cream, .button-subtle, .studio-return, .hud-icon-button {
  background: var(--control-soft); border: 1px solid var(--control-border); color: var(--control-ink);
  box-shadow: 0 2px 0 #9ba991, 0 5px 13px #314a3514, inset 0 1px 0 #ffffffc4;
}
.button-cream:not(:disabled):hover, .button-subtle:not(:disabled):hover,
.studio-return:hover, .hud-icon-button:not(:disabled):hover {
  background: #dfe9d5; border-color: var(--control); color: var(--control-ink);
}
.studio-return { font-weight: 600; }
.studio-return svg { color: var(--control); }
.hud-icon-button[aria-pressed=true]:not(:disabled) { background: var(--control); border-color: #314a35; color: #fffdf9; }
.movement-pad {
  background: #fffdf9; border-color: var(--control-border); gap: 2px;
  box-shadow: 0 3px 0 #9ba991, 0 7px 20px #314a3521;
}
.move-button { background: var(--control-soft); border: 1px solid var(--control-border); color: var(--control-ink); }
.move-button:not(:disabled):hover { background: #dfe9d5; color: var(--control-ink); }
.move-button:not(:disabled):active, .move-button.is-pressed:not(:disabled) { background: var(--control); border-color: #314a35; color: #fffdf9; box-shadow: inset 0 2px 3px #17291d33; }
.move-button:disabled { background: #f1f0ea; border-color: #a5af9c; color: #6b7863; }
.pad-center { color: #647c55; }
.personal-hud { gap: 4px; background: #fffdf9; border-color: var(--control-border); }
.personal-hud button {
  background: var(--control-soft); border: 1px solid var(--control-border); color: var(--control-ink); font-weight: 600;
  box-shadow: 0 1px 0 #9ba991;
}
.personal-hud button:hover { background: #dfe9d5; border-color: var(--control); }
.personal-hud button span { color: var(--control); }
.personal-hud-separator { display: none; }
.room-button, .tray-action, .concierge-topic-button, .space-choice-body, .product-card {
  background: #fffdf9; border-color: var(--control-border); color: var(--control-ink);
  box-shadow: 0 2px 0 #b4bfaa;
}
.room-button:not(:disabled):hover, .tray-action:hover, .concierge-topic-button:not(:disabled):hover,
.space-choice:hover .space-choice-body, .product-card:hover {
  background: #edf3e5; border-color: var(--control); box-shadow: 0 2px 0 #839775, 0 4px 12px #314a3517;
}
.room-button[aria-current=location]:not(:disabled), .space-choice input:checked + .space-choice-body {
  background: #e0ead7; border-color: var(--control); color: var(--control-ink); box-shadow: inset 0 0 0 1px var(--control), 0 2px 0 #839775;
}
.room-button strong, .tray-action strong { color: var(--control-ink); font-size: 12px; font-weight: 600; }
.room-button small, .tray-action small { color: var(--control-muted); font-size: 10px; }
.room-arrow, .tray-action > span:last-child, .tray-action > svg, .room-icon,
.room-button:nth-child(2) .room-icon, .room-button:nth-child(3) .room-icon { color: var(--control); }
.room-icon { background: #e2ead8; }
.action-puzzle { background: #e8f0df; }
.action-social { background: #f6f3eb; border-color: #8b7960; }
.soon-tag { background: #eee8dc; color: #655840 !important; }
.concierge-topic-button { font-weight: 600; font-size: 11px; }
.concierge-topic-symbol, .space-option-preview { color: var(--control); }
.space-choice-group legend { color: var(--control-ink); font-weight: 600; }
.space-choice-body { font-weight: 500; }
.text-link, .memory-retry, .cart-item button { color: var(--control); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.text-link:hover, .memory-retry:hover, .cart-item button:hover { color: #263d29; }
.casa-dialog .close-button, .tray-heading .close-button {
  color: var(--control-ink); background: var(--control-soft); border-color: var(--control-border); box-shadow: 0 1px 0 #9ba991;
}
.casa-dialog .close-button:hover, .tray-heading .close-button:hover { background: #dfe9d5; border-color: var(--control); }
.product-card h3 { color: var(--control-ink); font-weight: 600; }
.product-card p { color: #75583f; }
.puzzle-point { background: var(--control-soft); border-color: var(--control-border); color: var(--control-ink); }
.puzzle-point.is-start { background: #f0dfbb; border-color: #8d7350; color: #624926; }
.puzzle-point.is-finish { background: #dfead3; border-color: var(--control-border); color: #335d3e; }
.puzzle-point.is-knot { background: #d9c9b7; border-color: #8a735b; color: #66513d; }
.puzzle-point.is-path { background: #865549; border-color: #6b3f37; color: #fffdf9; }
.puzzle-point.can-visit { box-shadow: 0 0 0 2px var(--control); }
.puzzle-point.is-current { box-shadow: 0 0 0 3px #6b3f37; }
.memory-card { border-color: var(--control-border); color: var(--control-ink); box-shadow: 0 3px 0 #9ba991; }
.memory-card-symbol, .memory-card-label { color: var(--control-ink); }
.memory-card:not(:disabled):hover { border-color: var(--control); box-shadow: 0 3px 0 #839775, 0 4px 12px #314a3521; }
.memory-card.is-revealed { background: #fffdf9; border-color: var(--control); }
.memory-card.is-matched { background: #e0ead7; border-color: var(--control); }
button:focus-visible, a:focus-visible, input:focus-visible,
.concierge-topic-button:focus-visible, .space-choice input:focus-visible + .space-choice-body {
  outline: 3px solid #314a35; outline-offset: 3px; box-shadow: 0 0 0 2px #fffdf9;
}
@media (max-width: 760px) { .concierge-topic-button { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) {
  .button, .studio-return, .hud-icon-button, .tray-toggle, .interaction-button,
  .room-button, .tray-action, .concierge-topic-button, .product-card { transition: none; }
}

/* ── HUD compacto (14/10/2026): ajustes finos ─────────────────────────────────────────────── */
/* Segurar o controle ou o link do Studio no iPhone não abre lupa nem prévia de link. */
.world-frame { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* Foco do mundo desenhado por dentro (o #world ocupa a tela; o contorno por fora ficava invisível) — só para quem usa
   teclado (game.js marca data-input="teclado"): o foco dado por código aparecia como borda verde no iPhone. */
#world:focus { outline: none; }
#world[data-input="teclado"]:focus-visible::before { content: ''; position: absolute; z-index: 2; pointer-events: none; inset: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); border-radius: 16px; box-shadow: inset 0 0 0 3px #314a35, inset 0 0 0 5px #fffdf9; }
/* Celular: quem anda tocando no chão vê o controle discreto; ele volta inteiro quando é usado. */
@media (max-width: 760px) {
  .world-frame[data-input=tap] .movement-pad { opacity: .55; }
  .world-frame .movement-pad:has(.is-pressed), .world-frame .movement-pad:focus-within { opacity: 1; }
}
/* No toque, o :hover fica "grudado" até tocar em outro lugar: mantém o desenho de repouso. */
@media (hover: none) {
  .studio-return:hover, .hud-icon-button:not(:disabled):not([aria-pressed=true]):hover { background: var(--control-soft); border-color: var(--control-border); }
  .tray-toggle:not([aria-expanded=true]):hover, .interaction-button:hover { background: var(--control); border-color: #314a35; }
  .move-button:not(:disabled):not(.is-pressed):not(:active):hover { background: var(--control-soft); }
  .personal-hud button:hover { background: var(--control-soft); border-color: var(--control-border); }
}
/* Sacola: retirar com área de toque de verdade; nome longo não estoura; alternativa sem conta. */
.cart-item-copy { min-width: 0; }
.cart-item .cart-remove { flex-shrink: 0; min-height: 40px; padding: 8px 10px; margin-right: -10px; border-radius: 10px; }
.cart-item .cart-remove:hover { background: var(--control-soft); }
.cart-alt { display: block; margin-top: 12px; text-align: center; font-size: 11px; }
.cart-dialog .empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
/* Diálogos: × de 40px que acompanha a rolagem no celular. */
.close-button { width: 40px; height: 40px; font-size: 22px; }
.casa-dialog:not(.space-dialog):not(.concierge-dialog) { max-width: calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
@media (max-width: 760px), (max-height: 560px) {
  .casa-dialog > .dialog-heading { position: sticky; top: -1px; z-index: 3; align-items: center; margin-bottom: 0; padding-bottom: 10px; background: var(--paper); box-shadow: 0 -30px 0 var(--paper); }
  .casa-dialog > .dialog-heading .eyebrow { display: none; }
  .casa-dialog > .dialog-heading h2 { font-size: 22px; }
  .floating-close { position: sticky; top: 10px; margin: 10px 10px -50px auto; z-index: 3; }
  .cart-dialog #cartCheckout { display: flex; position: sticky; bottom: 0; }
}
/* Celular deitado: produto rola até o "Colocar na sacola" e o tabuleiro da Trama cabe na tela. */
@media (max-height: 560px) {
  .casa-dialog { padding: 16px 22px; }
  .product-dialog { padding: 0; overflow: auto; }
  .product-detail-image { min-height: 0; padding: 12px; }
  .product-detail-image img { height: min(270px, 58dvh); }
  .product-detail-copy { padding: 18px 22px; }
  .puzzle-dialog .dialog-intro, .puzzle-note { display: none; }
  .puzzle-board { width: min(100%, 60dvh); margin-inline: auto; padding: 8px; gap: 5px; }
  .puzzle-message { min-height: 0; margin: 8px 0; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .movement-pad, .toast { transition: none; }
  .hud-bag-count.is-bump { animation: none; }
}

/* Descobertas: cartões editoriais; só a pista ativa aparece no cenário. */
.discovery-dialog { width: min(610px, calc(100% - 28px)); }
.discovery-dialog .dialog-heading h2 { font-size: 27px; }
.discovery-dialog .dialog-intro { color: var(--control-muted); font-size: 14px; line-height: 1.65; }
.discovery-progress { margin: 0 0 12px; color: var(--control-ink); font-size: 12px; font-weight: 600; }
.discovery-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; list-style: none; padding: 0; margin: 0 0 20px; }
.discovery-card { min-width: 0; }
.discovery-card button { display: flex; width: 100%; height: 100%; min-height: var(--hud-size); padding: 15px 8px; flex-direction: column; align-items: center; gap: 9px; text-align: center; border: 1px dashed #9b9686; border-radius: var(--hud-radius); color: #665e4d; background: #f4f0e7; }
.discovery-card button:disabled { opacity: 1; cursor: default; }
.discovery-card.is-found button { background: var(--control-soft); color: var(--control-ink); border: 1px solid var(--control-border); box-shadow: 0 2px 0 #a8b69d; }
.discovery-card.is-found button:hover { background: #e0ead7; }
.discovery-card-symbol { display: grid; place-items: center; width: calc(var(--hud-size) - 6px); height: calc(var(--hud-size) - 6px); border-radius: 50%; background: #fffdf9; font-size: 24px; font-family: var(--serif); }
.discovery-card strong { font-size: 12px; line-height: 1.45; font-weight: 600; }
.discovery-card small { font-size: 10px; line-height: 1.5; }
.discovery-clue { padding: 20px; margin-bottom: 18px; border-radius: 16px; background: #f3ede2; border: 1px solid #d4c4af; }
.discovery-clue .eyebrow { color: #70543c; margin-bottom: 9px; }
.discovery-clue h3, .discovery-story h3, .discovery-finish h3 { font-family: var(--serif); margin: 0 0 12px; font-size: 23px; line-height: 1.4; font-weight: 500; }
.discovery-hint { color: var(--control-ink); font-size: 13px; line-height: 1.65; }
.discovery-hint summary { display: flex; align-items: center; min-height: max(var(--touch-size), var(--hud-size)); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.discovery-hint summary::before { content: '+ '; white-space: pre; text-decoration: none; }
.discovery-hint[open] summary::before { content: '− '; }
.discovery-hint p { margin: 0; }
.discovery-note { font-size: 12px; line-height: 1.6; color: var(--control-muted); margin: 12px 0 0; }
.discovery-story { padding: 8px 0 22px; }
.discovery-story > p:not(.eyebrow), .discovery-finish p { font-size: 14px; line-height: 1.75; color: #625641; }
.discovery-emblem { float: right; display: grid; place-items: center; width: calc(var(--hud-size) * 1.5); height: calc(var(--hud-size) * 1.5); border: 1px solid var(--control-border); border-radius: 50%; color: var(--control); background: var(--control-soft); font-size: 32px; margin: 0 0 12px 16px; }
.discovery-finish { margin-bottom: 20px; }
.discovery-receipt { padding: 12px 14px; border-left: 3px solid var(--control-border); background: var(--control-soft); border-radius: 4px 10px 10px 4px; }
.discovery-reward { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding: 15px; border: 1px solid #bdad83; border-radius: 15px; background: #faf2df; }
.discovery-reward.is-earned { background: #edf3e4; border-color: #9daf8c; }
.discovery-reward-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 1px solid #baa06b; border-radius: 50%; color: #88682f; background: #fffbec; font-size: 25px; }
.discovery-reward-copy { min-width: 0; }
.discovery-reward .eyebrow { margin: 0 0 5px; color: #665532; font-size: 10px; }
.discovery-reward-gains { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; margin: 0 0 6px; color: #405738; font-size: 13px; }
.discovery-reward-gains strong { font-family: var(--serif); font-size: 23px; line-height: 1.3; font-weight: 500; }
.discovery-reward-detail { margin: 0; color: #625b49; font-size: 12px; line-height: 1.65; }
.discovery-reward-link { display: inline-flex; align-items: center; min-height: max(var(--touch-size), var(--hud-size)); margin-top: 5px; padding: 4px 0; background: transparent; border: 0; color: var(--control-ink); font-size: 12px; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.discovery-reward-link:focus-visible { outline: 3px solid var(--control-ink); outline-offset: 3px; border-radius: 4px; }
.discovery-dialog .button { min-height: max(var(--touch-size), var(--hud-size)); }
.discovery-hint summary:focus-visible { outline: 3px solid var(--control-ink); outline-offset: 3px; }
@media (max-width: 760px) {
  .casa-dialog.discovery-dialog { position: fixed; inset: auto var(--hud-edge-right) var(--hud-bottom) var(--hud-edge); margin: 0; width: auto; max-height: calc(100dvh - var(--hud-top) - var(--hud-bottom) - var(--hud-size)); padding: 20px; border-radius: 22px; }
  .discovery-dialog .dialog-heading h2 { font-size: 23px; }
  .discovery-cards { gap: 6px; margin-bottom: 16px; }
  .discovery-card button { padding: 12px 6px; gap: 7px; }
  .discovery-clue { padding: 16px; }
  .discovery-clue h3 { font-size: 21px; }
}
@media (max-height: 560px) {
  .discovery-dialog .dialog-intro { margin-bottom: 12px; }
  .discovery-cards { margin-bottom: 12px; }
  .discovery-card button { padding: 10px 8px; }
}
@media (hover: none) { .discovery-card.is-found button:hover { background: var(--control-soft); } }
