/* Approved phone-first proposal. Desktop and Classic ANSI keep their layouts.
 * The only unconditional rules hide the new phone-only presentation nodes. */
.lf-phone-location, .lf-glance-turns { display: none; }

@media (max-width: 800px) {
  html.lord-graphical-on, html.lord-graphical-on body { min-width: 0; background: #e8d6ae; }
  html.lord-graphical-on body { color: #39291d; }
  .lord-town {
    --lf-ink: #39291d;
    --lf-dark: #302018;
    --lf-paper: #f3e5c2;
    --lf-paper-light: #fff1d1;
    --lf-brass: #bc8435;
    --lf-red: #8d3025;
    min-height: 100dvh;
    padding: 8px;
    background: radial-gradient(ellipse at 8% 0%, rgba(255,245,214,.76), transparent 46%),
      linear-gradient(145deg, #dfc99c, #c6a879);
    font-family: 'Crimson Text', Georgia, serif;
  }
  .lf-stone-frame {
    width: min(620px, 100%);
    padding: 8px;
    border: 2px solid #99612d;
    outline: 1px solid rgba(54,32,16,.4);
    background: #f0dfb7;
    box-shadow: 0 7px 18px rgba(57,37,19,.2), inset 0 0 0 3px #e5ca91;
  }
  .lf-stone-frame::before, .lf-stone-frame::after { width: 8px; height: 8px; border-width: 1px; }
  .lf-header {
    min-height: 48px;
    justify-content: flex-start;
    margin: 0 0 8px;
    padding: 0 10px;
    border: 0;
    border-bottom: 2px solid #b6813b;
    background: linear-gradient(100deg, #50301f, #6c3a26 52%, #42271c);
    box-shadow: inset 0 -1px #e3bd6e;
  }
  .lf-title-plaque {
    width: auto;
    min-height: 0;
    padding: 4px 0;
    border: 0;
    background: none;
    box-shadow: none;
    transform: none;
    justify-content: flex-start;
  }
  .lf-title-plaque::before, .lf-vine, .lf-dragon, .lf-rule { display: none; }
  .lf-brand-text { text-align: left; text-shadow: none; }
  .lf-overline { color: #e7c27b; font-size: 9px; letter-spacing: .13em; }
  .lf-brand-text h1 {
    margin-top: 2px;
    color: #fff0cc;
    font-size: clamp(19px, 5vw, 23px);
    text-shadow: 0 1px #29150e;
    white-space: normal;
  }
  .lf-brand-text h1 em { color: #e9bd63; }
  .lf-layout { display: flex; flex-direction: column; gap: 8px; }
  .lf-adventure { display: flex; flex-direction: column; min-width: 0; }
  .lf-phone-location {
    display: block;
    order: -1;
    margin: 2px 2px 9px;
    color: #69321f;
    font: 24px/1.2 'Almendra', Georgia, serif;
  }
  .lf-character {
    order: -1;
    display: block;
    padding: 0;
    border: 2px solid #a87836;
    background: linear-gradient(110deg, #fff0cc, #ead19a);
    box-shadow: inset 0 0 0 2px #ffefc7, 0 2px 4px rgba(54,34,17,.2);
  }
  .lf-character::before { inset: 3px; border-color: rgba(141,94,39,.35); }
  .lf-character > summary { display: flex; min-height: 78px; gap: 10px; padding: 7px 9px; }
  .lf-mobile-summary > img {
    width: 49px;
    height: 58px;
    object-fit: contain;
    background: #f1dfb2;
    border: 1px solid #a4783b;
  }
  .lf-mobile-summary-copy { gap: 3px; }
  .lf-mobile-summary-label { color: #79532c; font-size: 10px; letter-spacing: .07em; }
  .lf-mobile-summary-copy > b { color: #382315; font: 700 19px/1 'Almendra', Georgia, serif; }
  .lf-mobile-summary-copy > b small { font: 14px 'Crimson Text', Georgia, serif; }
  .lf-mobile-health { gap: 5px; color: #503a24; font-size: 14px; }
  .lf-mobile-health strong { color: #ad7a34; }
  .lf-mobile-caret { color: #6f321d; }
  .lf-glance-turns { display: flex; flex-wrap: wrap; gap: 5px 11px; color: #60452a; font: 13px/1.15 'Crimson Text', Georgia, serif; }
  .lf-glance-turns span { white-space: nowrap; }
  .lf-glance-turns b { color: #8b3025; font-weight: 700; }
  .lf-character[open] > summary { border-bottom: 1px solid rgba(130,83,35,.4); }
  .lf-character-body { padding: 0 10px 10px; }
  .lf-panel-top { height: 28px; }
  .lf-profile { padding: 8px 3px; }
  .lf-portrait-wrap { width: 66px; height: 75px; }
  .lf-profile-copy h2 { font-size: 24px; }
  .lf-health { padding: 9px 2px; }
  .lf-stat-heading { font-size: 16px; }
  .lf-stat-heading b { font-size: 16px; }
  .lf-stat-row, .lf-equipment-row { min-height: 30px; font-size: 15px; }
  .lf-stat-row b, .lf-equipment-row b { font-size: 16px; }
  .lf-turn-row { min-height: 32px; font-size: 14px; }
  .lf-scene-frame { order: 5; margin-top: 9px; padding: 3px; border: 2px solid #ab7934; }
  .lf-scene { height: 116px; min-height: 116px; border: 1px solid #4c321b; background-position: center 55%; }
  .lf-scene::after { box-shadow: inset 0 0 12px rgba(27,17,10,.28); }
  .lf-location-ribbon { min-width: 0; max-width: 92%; padding: 6px 17px 8px; font-size: 18px; }
  .lf-story-panel {
    order: 1;
    min-height: 0;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 8px;
    padding: 12px;
    border: 1px solid #b2823e;
    background: #fff0ce;
    box-shadow: inset 0 0 0 2px rgba(255,250,226,.65);
  }
  .lf-story-panel::before { inset: 3px; }
  .lf-story-ornament { width: 27px; height: 27px; font-size: 14px; }
  .lf-narrative, .lord-graphical-on #fantasy-town #lg-story { color: #39291d; font: 17px/1.38 'Crimson Text', Georgia, serif; }
  .lf-story-copy { min-width: 0; }
  .lf-actions { order: 3; }
  .lord-graphical-on #fantasy-town .lf-current-prompt { margin: 8px 1px; color: #69321f; font: 22px/1.15 'Almendra', Georgia, serif; }
  .lord-graphical-on #fantasy-town #lg-enemy-name { font-size: 23px; }
  .lord-graphical-on #fantasy-town #lg-battle-feedback { font-size: 17px; line-height: 1.35; }
  .lord-graphical-on #fantasy-town .lg-bar-row { font-size: 14px; }
  .lord-graphical-on #fantasy-town:is([data-scene="forest"],.lf-in-combat) .lf-secondary-grid { grid-template-columns: 1fr; }
  .lord-graphical-on #fantasy-town:is([data-scene="forest"],.lf-in-combat) button.lf-small-action { min-height: 50px; }
  .lord-graphical-on #fantasy-town:is([data-scene="forest"],.lf-in-combat) .lf-small-action > span:nth-child(2) { font-size: 17px; }
  .lf-primary-actions, .lord-graphical-on #fantasy-town .lf-primary-actions { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .lord-graphical-on #fantasy-town button.lf-destination {
    min-height: 54px;
    padding: 7px 10px;
    gap: 10px;
    border: 2px solid #d0a24f;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(37,21,10,.52), 0 2px 0 #50301c;
  }
  .lf-destination-f { background: linear-gradient(100deg, #587440, #3c5b32 62%, #314c2b); }
  .lf-destination-i { background: linear-gradient(100deg, #9b4533, #773326 62%, #60251e); }
  .lf-destination-shops { background: linear-gradient(100deg, #496b77, #345760 62%, #29474e); }
  .lf-destination-icon { width: 34px; height: 34px; }
  .lf-destination-copy b { font-size: 17px; }
  .lf-destination-copy small { margin-top: 3px; font-size: 13px; }
  .lf-keycap { min-width: 23px; padding: 3px 5px; font-size: 11px; }
  .lf-secondary-grid, .lord-graphical-on #fantasy-town .lf-secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
  .lord-graphical-on #fantasy-town button.lf-small-action {
    min-height: 46px;
    gap: 6px;
    padding: 6px 7px;
    border: 1px solid #a77737;
    background: linear-gradient(#60442d, #47301f);
    box-shadow: inset 0 0 0 1px rgba(255,225,164,.12), 0 1px 2px rgba(55,34,17,.25);
  }
  .lf-small-action > span:nth-child(2) { font-size: 14px; line-height: 1.15; }
  .lf-small-icon { width: 21px; height: 21px; }
  .lf-small-action kbd { min-width: 18px; padding: 2px 4px; font-size: 10px; text-align: center; }
  .lf-shelf-heading { min-height: 42px; font-size: 14px; flex-direction: column; align-items: stretch; gap: 8px; }
  .lf-shelf-heading button {
    width: 100%; min-height: 48px; padding: 10px 12px; font-size: 17px;
    border: 2px ridge #d6a849; border-radius: 3px;
    color: #fff0cc; background: #59402b; text-align: center;
    touch-action: manipulation;
  }
  .lf-feedback { min-height: 36px; margin-top: 8px; padding: 7px 9px; color: #fff0cc; background: #59402b; font-size: 13px; }
  .lf-footer { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 3px 1px; color: #64492d; font-size: 11px; }
  .lord-graphical-on #fantasy-town #controls { margin: 8px 0 0; padding: 8px; min-height: 48px; color: #f5dfaa; background: #4a3322; }
  #fantasy-town #controls label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
  #fantasy-town #controls select { min-height: 44px; padding: 5px 8px; }
  .lord-graphical-on #fantasy-town .pc-form { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 8px 0; padding: 12px; }
  .lord-graphical-on #fantasy-town .pc-form label { font-size: 18px; line-height: 1.25; }
  .lord-graphical-on #fantasy-town .pc-field { min-height: 48px; font-size: 16px; }
  .lord-graphical-on #fantasy-town .pc-submit { min-height: 48px; padding: 8px 13px; }
  #fantasy-town button:focus-visible, #fantasy-town input:focus-visible, #fantasy-town select:focus-visible { outline: 3px solid #a52f24; outline-offset: 2px; }
}
@media (max-width: 380px) {
  .lord-town { padding: 5px; }
  .lf-stone-frame { padding: 6px; }
  .lf-character > summary { gap: 7px; padding: 6px; }
  .lf-mobile-summary > img { width: 43px; height: 53px; }
  .lf-mobile-summary-copy > b { font-size: 17px; }
  .lf-mobile-health { font-size: 13px; }
  .lf-glance-turns { gap: 3px 7px; font-size: 12px; }
  .lf-destination-copy small { font-size: 12px; }
  .lf-secondary-grid, .lord-graphical-on #fantasy-town .lf-secondary-grid { gap: 5px; }
  .lord-graphical-on #fantasy-town button.lf-small-action { padding: 5px; }
  .lf-small-action > span:nth-child(2) { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 800px) {
  #fantasy-town *, #fantasy-town *::before, #fantasy-town *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
