/* =====================================================================
   Telas do menu: CONFIGURAÇÕES, CRÉDITOS e APARÊNCIA.
   Carregado por último. Mesmos materiais do resto do jogo (madeira escura, latão envelhecido, vinho),
   mesmos componentes (.nav-btn no rodapé, régua de opções como a dos modos, linhas como as da biblioteca).
   ===================================================================== */

/* ---------- painel de menu (.gm) ---------- */
.modal.gm {
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(42, 14, 10, .5), rgba(5, 2, 1, .86) 72%);
  backdrop-filter: blur(3px);
}
.modal.gm:not(.hidden) { animation: gm-fade .2s ease both; }
.modal.gm:not(.hidden) > .gm-panel { animation: gm-rise .32s cubic-bezier(.2, .9, .3, 1.04) both; }
@keyframes gm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gm-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.gm-panel {
  position: relative; display: flex; flex-direction: column; width: min(780px, 100%); max-width: 100%; min-width: 0; max-height: min(90vh, 780px);
  padding: 26px 30px 18px; color: var(--m-ink); border-radius: 14px;
  background: linear-gradient(180deg, rgba(56, 18, 14, .95), rgba(24, 10, 7, .96) 34%, rgba(13, 7, 5, .97)), var(--wood) center / 420px;
  border: 1px solid rgba(196, 154, 82, .45);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 225, 170, .08), inset 0 0 70px rgba(0, 0, 0, .55), 0 30px 70px rgba(0, 0, 0, .65);
}
/* filete interno de latão e um brilho quente no alto, como a luz do lustre */
.gm-panel::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(196, 154, 82, .13); border-radius: 10px; pointer-events: none; }
.gm-panel::after { content: ''; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 215, 150, .65), transparent); pointer-events: none; }

.gm-head { margin-bottom: 14px; }
.gm-kicker { margin: 0 0 4px 2px; font: 400 13px 'Rye', serif; letter-spacing: .3em; text-transform: uppercase; color: var(--m-brass); text-shadow: 0 2px 0 #000; }
.gm-kicker b { font-weight: 400; color: var(--m-ink); }
.gm-title { margin: 0; font: 400 clamp(32px, 3.4vw, 48px)/1 'Permanent Marker', sans-serif; color: #fffaf0; text-transform: uppercase;
  transform: rotate(-2deg); transform-origin: left; text-shadow: 0 4px 0 #000, 0 0 22px rgba(0, 0, 0, .5); }

/* abas: sublinhado de latão que corre para a escolhida */
.gm-tabs { display: flex; gap: 2px; min-width: 0; margin: 4px 0 6px; border-bottom: 1px solid var(--m-line); scrollbar-width: none; }
.gm-tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 12px; border: 0; border-radius: 6px 6px 0 0;
  background: none; cursor: pointer; color: var(--m-ink-dim); font: 500 14px 'Oswald', sans-serif; letter-spacing: .2em; text-transform: uppercase;
  transition: color .2s, background .2s;
}
.gm-tabs button .ic { width: 16px; height: 16px; color: var(--m-brass-dim); transition: color .2s; }
.gm-tabs button::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--m-brass);
  box-shadow: 0 0 10px rgba(226, 182, 94, .6); transform: scaleX(0); transition: transform .28s cubic-bezier(.3, 1.2, .5, 1); }
.gm-tabs button:hover { color: var(--m-ink); background: rgba(196, 154, 82, .06); }
.gm-tabs button[aria-selected="true"] { color: #f6e3b4; }
.gm-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.gm-tabs button[aria-selected="true"] .ic { color: var(--m-brass); }
.gm-tabs button:focus-visible { outline: none; color: #f6e3b4; background: radial-gradient(ellipse 70% 90% at 50% 100%, rgba(226, 182, 94, .16), transparent 70%); }

.gm-body { flex: 1; min-height: 280px; height: min(470px, 54vh); overflow-y: auto; padding: 4px 6px 4px 0; scrollbar-width: thin; scrollbar-color: rgba(196, 154, 82, .35) transparent; }
.gm-page:not([hidden]) { animation: gm-page .26s ease both; }
@keyframes gm-page { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* uma opção por linha: nome e explicação · controle · valor atual */
.gm-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 250px) 64px; align-items: center; gap: 18px;
  padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--m-line); border-radius: 6px; transition: background .2s;
}
.gm-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--m-brass); transform: scaleY(0); transition: transform .22s; }
.gm-row:hover { background: linear-gradient(90deg, rgba(196, 154, 82, .07), transparent 85%); }
.gm-row:focus-within { background: linear-gradient(90deg, rgba(196, 154, 82, .15), rgba(196, 154, 82, .03) 70%, transparent); }
.gm-row:focus-within::before { transform: none; }
.gm-label b { display: block; font: 400 18px/1.15 'Rye', serif; letter-spacing: .03em; color: var(--m-ink); text-shadow: 0 2px 0 #000; }
.gm-label small { display: block; margin-top: 4px; font: 400 13px/1.4 'Oswald', sans-serif; letter-spacing: .03em; color: var(--m-ink-dim); }
.gm-row output { justify-self: end; font: 600 15px 'Oswald', sans-serif; letter-spacing: .06em; color: var(--m-brass); font-variant-numeric: tabular-nums; transition: color .2s; }
.gm-row:focus-within output { color: #f6e3b4; }
.gm-row > .gm-seg { grid-column: 2 / 4; }

/* nome */
.gm-input { grid-column: 2 / 4; width: 100%; padding: 9px 12px; border: 1px solid rgba(196, 154, 82, .35); border-radius: 6px; background: rgba(8, 5, 3, .6);
  color: var(--m-ink); font: 400 17px 'Rye', serif; letter-spacing: .03em; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); transition: border-color .2s, box-shadow .2s; -webkit-user-select: text; user-select: text; }
.gm-input::placeholder { color: rgba(184, 163, 126, .45); }
.gm-input:hover { border-color: rgba(196, 154, 82, .6); }
.gm-input:focus { outline: none; border-color: var(--m-brass); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5), 0 0 0 3px rgba(196, 154, 82, .15); }

/* deslizador: trilho de latão que se enche + ficha de pôquer */
.gm-range { --p: 50%; width: 100%; height: 26px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.gm-range:focus { outline: none; }
.gm-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #a7772f, #e7c377 var(--p), rgba(0, 0, 0, .55) var(--p));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 225, 170, .07); }
.gm-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #f2d590 0 28%, #7d1f18 30% 46%, #e9cf96 48% 56%, #8a2a1f 58%);
  border: 2px solid #2a160a; box-shadow: 0 0 0 2px rgba(214, 170, 96, .5), 0 3px 6px rgba(0, 0, 0, .6); transition: transform .15s, box-shadow .15s; }
.gm-range:hover::-webkit-slider-thumb, .gm-range:focus-visible::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 0 3px rgba(240, 200, 120, .55), 0 0 14px rgba(255, 200, 110, .45), 0 3px 6px rgba(0, 0, 0, .6); }
.gm-range:active::-webkit-slider-thumb { transform: scale(1.06); }
.gm-range::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .55); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .65); }
.gm-range::-moz-range-progress { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #a7772f, #e7c377); }
.gm-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #2a160a;
  background: radial-gradient(circle at 50% 50%, #f2d590 0 28%, #7d1f18 30% 46%, #e9cf96 48% 56%, #8a2a1f 58%); box-shadow: 0 0 0 2px rgba(214, 170, 96, .5); }

/* liga/desliga */
.gm-switch { position: relative; display: inline-block; justify-self: start; width: 58px; height: 30px; cursor: pointer; }
.gm-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.gm-switch i { position: absolute; inset: 0; border-radius: 15px; background: rgba(0, 0, 0, .55); border: 1px solid rgba(196, 154, 82, .35);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .65); transition: background .25s, border-color .25s, box-shadow .25s; }
.gm-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e3d6bb, #8e7d5f); box-shadow: 0 2px 4px rgba(0, 0, 0, .6);
  transition: transform .26s cubic-bezier(.3, 1.35, .5, 1), background .25s; }
.gm-switch:hover i { border-color: var(--m-brass); }
.gm-switch input:checked + i { background: linear-gradient(90deg, rgba(140, 92, 36, .7), rgba(214, 170, 96, .5)); border-color: var(--m-brass); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45), 0 0 12px rgba(226, 182, 94, .25); }
.gm-switch input:checked + i::after { transform: translateX(28px); background: radial-gradient(circle at 40% 35%, #fff1c9, #d7aa58 50%, #8d6a32); }
.gm-switch input:focus-visible + i { outline: 1px solid #f6e3b4; outline-offset: 3px; }

/* régua de opções (como a dos modos de jogo) */
.gm-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; overflow: hidden; border: 1px solid rgba(196, 154, 82, .35); border-radius: 6px;
  background: rgba(8, 5, 3, .55); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.gm-seg button { position: relative; padding: 10px 10px; border: 0; background: none; cursor: pointer; color: var(--m-ink-dim);
  font: 500 14px 'Oswald', sans-serif; letter-spacing: .14em; text-transform: uppercase; transition: color .2s, background .2s; }
.gm-seg button + button { border-left: 1px solid rgba(196, 154, 82, .2); }
.gm-seg button:hover { color: var(--m-ink); background: rgba(196, 154, 82, .1); }
.gm-seg button:active { transform: translateY(1px); }
.gm-seg button[aria-checked="true"] { color: #1c0f06; font-weight: 600; background: linear-gradient(#ecca80, #c49a52); box-shadow: inset 0 1px 0 rgba(255, 240, 200, .6), inset 0 -2px 0 rgba(90, 60, 20, .35); }
.gm-seg button:focus-visible { outline: 1px solid #f6e3b4; outline-offset: -4px; }

/* lista de teclas (só consulta) */
.gm-sub { display: flex; align-items: center; gap: 12px; margin: 22px 0 6px; font: 400 12px 'Oswald', sans-serif; letter-spacing: .32em; text-transform: uppercase; color: var(--m-brass); }
.gm-sub::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--m-line), transparent); }
.gm-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 0; }
.gm-keys div { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid rgba(196, 154, 82, .1); }
.gm-keys dt { flex: none; min-width: 104px; font: 400 12px 'Oswald', sans-serif; color: var(--m-ink-dim); white-space: nowrap; }
.gm-keys dd { margin: 0; font: 400 14px/1.3 'Oswald', sans-serif; letter-spacing: .03em; color: var(--m-ink); }
.gm kbd, .gm-hint kbd, #appearance kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1px solid rgba(196, 154, 82, .4); border-bottom-width: 2px; border-radius: 4px;
  background: rgba(0, 0, 0, .4); color: var(--m-ink); font: 500 11px/1.3 'Oswald', sans-serif; letter-spacing: .05em; text-align: center; text-transform: none; }
.gm .nav-btn kbd { min-width: 0; border-bottom-width: 1px; color: var(--m-ink-dim); }

/* rodapé: ação secundária à esquerda, dica no meio, Voltar à direita */
.gm-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(196, 154, 82, .16); }
.gm-hint { margin: 0; font: 400 12px 'Oswald', sans-serif; letter-spacing: .08em; color: var(--m-ink-dim); text-align: center; }
.gm-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 4px; background: none; cursor: pointer;
  color: var(--m-ink-dim); font: 500 13px 'Oswald', sans-serif; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; transition: color .2s, background .2s; }
.gm-link .ic { width: 15px; height: 15px; color: var(--m-brass); transition: transform .4s cubic-bezier(.3, 1.3, .5, 1); }
.gm-link:hover { color: var(--m-ink); background: rgba(196, 154, 82, .09); }
.gm-link:hover .ic { transform: rotate(-120deg); }
.gm-link:active { transform: translateY(1px); }
.gm-link:focus-visible { outline: 1px solid var(--m-brass); outline-offset: 2px; }
.gm-link.done { color: #f6e3b4; }

/* ---------- créditos ---------- */
.credits-panel { width: min(680px, 100%); }
.cr-roll { position: relative; height: min(62vh, 580px); min-height: 260px; overflow-y: auto; outline: none; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 88%, transparent); mask-image: linear-gradient(transparent, #000 10%, #000 88%, transparent); }
.cr-roll::-webkit-scrollbar { display: none; }
.cr-track { padding: 34px 12px 38vh; text-align: center; }
.cr-crown { display: block; font: 400 30px/1 'Rye', serif; color: var(--m-brass); text-shadow: 0 0 18px rgba(226, 182, 94, .45); }
.cr-logo { margin: 6px 0 0; font: 400 clamp(46px, 6vw, 68px)/1 'Permanent Marker', sans-serif; color: #fffaf0; text-transform: uppercase; transform: rotate(-3deg);
  text-shadow: 0 5px 0 #000, 0 0 30px rgba(0, 0, 0, .6); }
.cr-logo b { font-weight: 400; color: #f5c21b; }
.cr-by { margin: 34px 0 6px; font: 400 12px 'Oswald', sans-serif; letter-spacing: .34em; text-transform: uppercase; color: var(--m-brass); }
.cr-name { margin: 0; font: 400 30px 'Rye', serif; color: var(--m-ink); text-shadow: 0 3px 0 #000; }
.cr-note { max-width: 440px; margin: 18px auto 0; font: 400 13px/1.5 'Oswald', sans-serif; letter-spacing: .03em; color: var(--m-ink-dim); }
.cr-sec { max-width: 540px; margin: 62px auto 0; }
.cr-sec h3 { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; font: 400 13px 'Oswald', sans-serif; letter-spacing: .34em; text-transform: uppercase; color: var(--m-brass); }
.cr-sec h3::before, .cr-sec h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--m-line)); }
.cr-sec h3::after { background: linear-gradient(90deg, var(--m-line), transparent); }
.cr-sec dl { margin: 0; }
.cr-sec dl div { margin: 0 0 20px; }
.cr-sec dt { font: 400 11px 'Oswald', sans-serif; letter-spacing: .28em; text-transform: uppercase; color: var(--m-ink-dim); }
.cr-sec dd { margin: 5px 0 0; font: 400 18px/1.4 'Rye', serif; color: var(--m-ink); text-shadow: 0 2px 0 #000; }
.cr-sec dd b { font-weight: 400; color: #f6e3b4; }
.cr-sec dd small { display: block; margin-top: 3px; font: 400 13px/1.4 'Oswald', sans-serif; letter-spacing: .03em; color: var(--m-ink-dim); text-shadow: none; }
.cr-end { margin: 80px 0 0; font: 400 32px 'Permanent Marker', sans-serif; color: #f5c21b; text-transform: uppercase; text-shadow: 0 4px 0 #000; }
.cr-end span { display: block; margin-bottom: 12px; font: 400 14px 'Rye', serif; letter-spacing: .6em; color: var(--m-brass-dim); }

/* ---------- aparência: categorias · palco · opções ---------- */
#appearance {
  display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(300px, 380px); gap: 2.2vw; padding: 4vh 3vw;
  place-items: stretch; align-items: center; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 4, 3, .93) 0%, rgba(8, 4, 3, .55) 22%, rgba(8, 4, 3, .32) 42%, rgba(8, 4, 3, .32) 58%, rgba(8, 4, 3, .62) 76%, rgba(8, 4, 3, .95) 100%);
}
#appearance > * { pointer-events: auto; }
#appearance .gm-kicker { margin-left: 4px; }
.ap-title { margin: 0 0 18px; font: 400 48px/1 'Permanent Marker', sans-serif; color: #fffaf0; text-transform: uppercase; transform: rotate(-4deg); text-shadow: 0 4px 0 #000; }
#ap-cats { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* palco: o personagem é desenhado aqui (a vitrine 3D segue este retângulo); luz quente no chão */
#ap-stage { position: relative; align-self: stretch; min-height: 320px; border-radius: 18px; cursor: grab; touch-action: none;
  background: radial-gradient(ellipse 46% 40% at 50% 62%, rgba(255, 196, 120, .17), rgba(255, 170, 90, .05) 60%, transparent 75%); }
#ap-stage.dragging { cursor: grabbing; }
.ap-stage-bar { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; align-items: center; gap: 14px; pointer-events: none; }
.ap-stage-bar > * { pointer-events: auto; }
.ap-hint { font: 400 12px 'Oswald', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--m-ink-dim); text-shadow: 0 2px 4px #000; white-space: nowrap; }
.ap-stage-bar .gm-link { background: rgba(10, 5, 3, .55); box-shadow: inset 0 0 0 1px rgba(196, 154, 82, .28); }
#ap-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  font: 500 13px 'Oswald', sans-serif; letter-spacing: .3em; text-transform: uppercase; color: var(--m-ink-dim); text-shadow: 0 2px 4px #000; }
.ap-spin { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(196, 154, 82, .2); border-top-color: var(--m-brass); animation: ap-spin .9s linear infinite; }
@keyframes ap-spin { to { transform: rotate(1turn); } }

.ap-right { display: flex; flex-direction: column; align-self: center; height: min(720px, 88vh); min-height: 0; padding: 18px 18px 14px; border-radius: 14px;
  background: linear-gradient(rgba(26, 11, 8, .86), rgba(12, 6, 4, .92)); border: 1px solid rgba(196, 154, 82, .3);
  box-shadow: inset 0 1px 0 rgba(255, 225, 170, .06), inset 0 0 40px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .5); }
.ap-who { margin: 0 0 10px 4px; }
.ap-who small { display: block; font: 400 11px 'Oswald', sans-serif; letter-spacing: .3em; text-transform: uppercase; color: var(--m-brass); }
.ap-who b { display: block; margin-top: 2px; font: 400 26px/1.1 'Rye', serif; color: var(--m-ink); text-shadow: 0 2px 0 #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ap-cat-title { margin: 0 0 4px 4px; font: 400 26px 'Permanent Marker', sans-serif; color: #f5c21b; text-transform: uppercase; text-shadow: 0 3px 0 #000; }
#ap-options { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px 4px; scrollbar-width: thin; scrollbar-color: rgba(196, 154, 82, .35) transparent; }
#ap-options .opt-group:not(:first-child) h4 { margin-top: 16px; }
.ap-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--m-line); }
#ap-save { flex: 1; font-size: 18px; padding: 11px 16px; }
.ap-right .on-foot { margin-top: 12px; padding-top: 12px; }
.ap-right .on-foot::before { background: #120806; }
.ap-toast { bottom: 16vh; }

#appearance:not(.hidden) .ap-left { animation: ap-in-left .42s cubic-bezier(.2, .9, .3, 1) both; }
#appearance:not(.hidden) .ap-right { animation: ap-in-right .42s cubic-bezier(.2, .9, .3, 1) both; }
#appearance:not(.hidden) #ap-stage { animation: gm-fade .5s ease both; }
@keyframes ap-in-left { from { opacity: 0; translate: -36px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes ap-in-right { from { opacity: 0; translate: 36px 0; } to { opacity: 1; translate: 0 0; } }

/* troca de telas do menu: entrada rápida e discreta */
#menu:not(.hidden) .menu-side, #play:not(.hidden) > .panel { animation: gm-fade .22s ease both; }

/* ---------- telas menores ---------- */
@media (max-width: 1100px) {
  #appearance { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr) minmax(280px, 330px); gap: 1.6vw; padding: 3vh 2vw; }
  .menu-card.cat { width: 210px; height: 48px; font-size: 20px; }
}
/* janela pequena (ex.: 800 × 600): categorias numa faixa em cima; palco e painel lado a lado */
@media (max-width: 860px) {
  #appearance { grid-template-columns: minmax(0, 1fr) minmax(250px, 44%); grid-template-rows: auto minmax(0, 1fr); gap: 10px 14px; padding: 12px; align-items: stretch;
    background: linear-gradient(90deg, rgba(8, 4, 3, .5), rgba(8, 4, 3, .3) 40%, rgba(8, 4, 3, .8)); }
  .ap-left { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
  .ap-left .gm-kicker { display: none; }
  #appearance .ap-title { margin: 4px 0 0; font-size: 28px; }
  #ap-save { font-size: 15px; padding: 10px 12px; white-space: nowrap; }
  #ap-cats { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  #appearance .menu-card.cat { width: auto; height: 34px; padding: 0 10px; font-size: 14px; }
  .ap-right { height: auto; align-self: stretch; padding: 12px 12px 10px; }
  .ap-who b, #ap-cat-title { font-size: 20px; }
  #ap-stage { min-height: 0; }
  .ap-hint { display: none; }
}
/* celular em pé: tudo empilhado, com rolagem */
@media (max-width: 560px) {
  #appearance { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(260px, 46vh) auto; overflow-y: auto; }
  #ap-options { flex: none; }
}
@media (max-width: 640px) {
  .gm-panel { padding: 18px 16px 14px; }
  .gm-tabs { overflow-x: auto; }
  .gm-tabs button { padding: 9px 10px 11px; letter-spacing: .12em; }
  .gm-row { grid-template-columns: minmax(0, 1fr) 56px; gap: 10px 14px; }
  .gm-row .gm-label { grid-column: 1 / -1; }
  .gm-row > .gm-seg { grid-column: 1 / -1; }
  .gm-keys { grid-template-columns: 1fr; }
  .gm-foot { flex-wrap: wrap; }
  .gm-foot .gm-hint { display: none; }
}
@media (max-height: 700px) {
  .gm-panel { padding-top: 16px; padding-bottom: 12px; }
  .gm-title { font-size: 30px; }
  .gm-row { padding-top: 9px; padding-bottom: 9px; }
  .gm-body { height: min(470px, 50vh); }
}
@media (max-height: 700px) and (min-width: 861px) {
  .ap-title { font-size: 36px; margin-bottom: 10px; }
  .menu-card.cat { height: 42px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .ap-spin { animation-duration: 3s !important; } }
