/* R56 is intentionally loaded after the historical stylesheet. The phone
   remains 844:390; only its internal composition becomes world-first. */
@media (min-width: 680px) {
  .app-shell {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #f7cda5;
  }

  .topbar {
    position: absolute;
    z-index: 40;
    inset: 0 0 auto;
    width: 100%;
    height: 46px;
    min-height: 46px;
    padding: 7px 12px;
    border: 0;
    background: linear-gradient(180deg, rgba(48, 35, 48, 0.58), rgba(48, 35, 48, 0));
    pointer-events: none;
  }

  .brand-lockup {
    gap: 7px;
    padding: 5px 10px 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(48, 35, 48, 0.46);
    backdrop-filter: blur(9px);
  }

  .brand-name { color: #fffaf2; font-size: 0.72rem; letter-spacing: 0.22em; }
  .brand-mark { width: 17px; height: 17px; color: #ff9a70; }
  .topbar-stats, .cash-readout { pointer-events: auto; }
  .cash-readout {
    min-width: 82px;
    padding: 4px 12px 5px;
    border: 1px solid rgba(255, 245, 209, 0.48);
    border-radius: 15px;
    background: rgba(53, 42, 59, 0.78);
    backdrop-filter: blur(9px);
  }
  .cash-readout .eyebrow { color: rgba(255, 246, 229, 0.76); font-size: 0.43rem; }
  .cash-readout strong { color: #ffd168; font-size: 1.08rem; }

  .status-row, .app-footer, .brand-phase, .hammer-readout,
  .growth-heading, .left-rail #buyPanel,
  .stone-tier-option > .growth-option-heading,
  .goal-value-line, .goal-track, .goal-copy,
  .scene-progress-track, .scene-progress-label, .workshop-effect,
  .facility-effect, .facility-reserve,
  .action-dock-copy .action-microcopy { display: none; }

  .game-main, .play-layout, .app-shell[data-phase="result"] .play-layout {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .arena, .app-shell[data-phase="idle"] .arena,
  .app-shell[data-phase="result"] .arena {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none !important;
    flex-basis: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #efc396;
    box-shadow: none;
  }

  .arena-backdrop { inset: 0; border-radius: 0; background: #efc396; }
  .arena-backdrop::after {
    background: linear-gradient(180deg, rgba(44,28,39,.1), transparent 28%, transparent 66%, rgba(51,31,38,.26)), radial-gradient(circle at 50% 45%, transparent 44%, rgba(56,33,47,.12));
  }
  .scene-backdrop {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 54%;
    filter: saturate(1.12) brightness(1.03) contrast(1.02);
  }

  .arena-heading {
    position: absolute;
    z-index: 11;
    top: 48px;
    left: 50%;
    width: max-content;
    max-width: 380px;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 999px;
    background: rgba(255,252,242,.74);
    transform: translateX(-50%);
    backdrop-filter: blur(7px);
  }
  .arena-heading .eyebrow { display: none; }
  .arena-hint, .automation-status {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #513f57;
    font-size: .55rem;
    box-shadow: none;
  }
  .mine-caption { z-index: 12; bottom: 7px; left: 10px; }

  .left-rail, .app-shell[data-phase="result"] .left-rail {
    position: absolute;
    z-index: 20;
    right: auto;
    bottom: 7px;
    left: 50%;
    display: block;
    width: 430px;
    height: 82px;
    min-height: 82px;
    overflow: visible;
    transform: translateX(-50%);
  }
  .growth-rail, .growth-body, .stone-tier-option {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .tier-options {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .tier-button {
    min-height: 78px;
    height: 78px;
    padding: 7px 8px 7px 56px;
    border: 2px solid rgba(255,255,255,.72);
    border-radius: 20px 20px 13px 13px;
    box-shadow: 0 8px 0 rgba(96,61,71,.2), 0 14px 22px rgba(71,42,53,.18), inset 0 1px rgba(255,255,255,.9);
    transform: none;
  }
  .tier-button.is-selected {
    border-color: #fff8cf;
    box-shadow: 0 0 0 3px rgba(255,204,91,.72), 0 8px 0 rgba(96,61,71,.2), 0 16px 26px rgba(255,157,79,.28);
    transform: translateY(-5px);
  }
  .tier-art { position: absolute; top: 8px; bottom: auto; left: 6px; width: 49px; height: 59px; }
  .tier-button > span:not(.tier-art) {
    display: block;
    max-height: 2.2em;
    overflow: hidden;
    color: #51364f;
    font-size: .52rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: clip;
    white-space: normal;
  }
  .tier-button > strong { display: block; margin-top: 6px; color: #3d2a43; font-size: 1rem; }
  .tier-button > small { display: none; }

  .hammer-option {
    position: absolute;
    z-index: 3;
    top: 15px;
    left: -55px;
    display: block;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 16px;
  }
  .hammer-art { position: absolute; z-index: 1; inset: 7px; width: auto; height: auto; }
  .hammer-option .growth-option-heading, .hammer-option .upgrade-hint,
  .hammer-option .upgrade-button > span { display: none; }
  .hammer-option .upgrade-button {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 27px 2px 1px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .hammer-option .upgrade-button strong { display: block; font-size: .5rem; }

  .right-rail, .app-shell[data-phase="result"] .right-rail {
    position: absolute;
    z-index: 25;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    pointer-events: none;
  }
  .right-rail > * { pointer-events: auto; }
  .goal-panel {
    position: absolute;
    top: 52px;
    left: 10px;
    display: block;
    width: 154px;
    min-height: 0;
    padding: 7px;
    border-radius: 15px;
    background: rgba(255,250,240,.84);
    backdrop-filter: blur(9px);
  }
  .goal-panel[data-workshop-state="max"] { display: none; }
  .goal-topline, .goal-panel > strong { display: none; }
  .scene-progress { display: block; padding: 0; }
  .scene-progress strong { font-size: .54rem; }
  .workshop-upgrade-button { width: 100%; min-height: 44px; padding: 5px 8px; border-radius: 12px; }

  .facility-panel:not([data-kind="new-game-plus"]) {
    position: absolute;
    top: 52px;
    right: 10px;
    display: grid;
    width: 176px;
    min-height: 78px;
    gap: 4px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255,247,238,.88);
    backdrop-filter: blur(9px);
  }
  .facility-panel:not([data-kind="new-game-plus"]) > strong { font-size: .67rem; }
  .facility-panel:not([data-kind="new-game-plus"]) .facility-button { min-height: 44px; }

  .star-core-button {
    position: absolute;
    z-index: 19;
    top: 104px;
    right: 137px;
    display: grid;
    width: 74px;
    height: 74px;
    padding: 0;
    place-items: center;
    border: 3px solid rgba(255,245,189,.94);
    border-radius: 25px;
    background: linear-gradient(145deg, #4cbca8, #258b88 58%, #6d4c9b);
    color: #ffd65c;
    box-shadow: 0 0 0 5px rgba(69,132,126,.35), 0 11px 26px rgba(72,44,65,.28), inset 0 2px rgba(255,255,255,.45);
  }
  .star-core-button.is-ready { animation: r56-star-core-pulse 1.8s ease-in-out infinite; }
  .star-core-button.is-installed { width: 48px; height: 48px; border-radius: 16px; opacity: .92; }
  .star-core-button:disabled { filter: none; }
  .star-core-glow { position: absolute; inset: 8px; border-radius: 50%; background: radial-gradient(circle, rgba(255,250,178,.84), rgba(255,189,72,.2) 58%, transparent 72%); }
  .star-core-gem { position: relative; z-index: 1; font-size: 2.45rem; line-height: 1; text-shadow: 0 2px 0 #9c5c1b, 0 0 15px rgba(255,224,91,.95); }
  .star-core-count { position: absolute; z-index: 2; right: -7px; bottom: -5px; min-width: 24px; height: 24px; padding: 4px; border-radius: 999px; background: #7459b6; color: #fff; font-size: .58rem; }
  .star-core-count:empty { display: none; }

  .facility-panel[data-kind="new-game-plus"] {
    position: absolute;
    z-index: 35;
    top: 76px;
    left: 50%;
    display: grid;
    width: 348px;
    min-height: 178px;
    padding: 13px;
    border: 2px solid rgba(255,219,101,.88);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255,252,236,.98), rgba(233,226,255,.98));
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px) scale(.96);
  }
  .is-star-preview-open .facility-panel[data-kind="new-game-plus"] { opacity: 1; pointer-events: auto; transform: translate(-50%,0) scale(1); }
  .facility-panel[data-kind="new-game-plus"] .facility-effect,
  .facility-panel[data-kind="new-game-plus"] .facility-reserve { display: block; font-size: .61rem; line-height: 1.35; }
  .facility-panel[data-kind="new-game-plus"] .facility-button { min-height: 48px; }
  .facility-panel[data-kind="new-game-plus"] .facility-button:not(:disabled) {
    border-color: rgba(206, 128, 52, .66);
    background: linear-gradient(135deg, #ffe58c, #ff9f6d);
    color: #54313e;
    box-shadow: 0 8px 18px rgba(199,102,75,.24);
  }
  .facility-panel[data-kind="new-game-plus"] .facility-button:not(:disabled) strong {
    color: #54313e;
  }

  .tap-panel, .reveal-panel, .result-panel {
    position: absolute;
    z-index: 30;
    top: 62px;
    left: 50%;
    width: 286px;
    min-height: 92px;
    padding: 10px;
    transform: translateX(-50%);
    backdrop-filter: blur(9px);
  }
  .tap-panel {
    top: 54px;
    left: 10px;
    width: 190px;
    min-height: 0;
    padding: 9px;
    transform: none;
  }
  .tap-panel .action-microcopy { display: none; }
  .tap-panel .panel-copy strong { font-size: .82rem; }
  .tap-panel .panel-copy > span:last-child { font-size: .56rem; }
  .outcome-odds { gap: 3px; padding-top: 5px; }
  .odds-list { gap: 2px; }
  .odds-row { min-height: 17px; font-size: .5rem; }
  .odds-note { font-size: .43rem; }
  .result-panel { grid-template-columns: 66px minmax(0,1fr) auto; min-height: 104px; }
  .result-art-frame, .result-art { width: 66px; height: 66px; }
  .damage-meter { position: absolute; z-index: 13; right: 50%; bottom: 102px; width: 238px; margin: 0; transform: translateX(50%); }
  .damage-meter .meter-topline, .damage-meter .peek-signal { display: none; }
  .geode-button { z-index: 12; width: min(37vh,156px); margin: 54px 0 86px; }
  .app-shell[data-conveyor-level="1"] .field-stones,
  .app-shell[data-conveyor-level="2"] .field-stones {
    z-index: 14;
    right: auto;
    bottom: 28%;
    left: 29%;
    width: 42%;
    height: 52px;
  }
  .facility-slot-rail {
    bottom: 25%;
    left: 29%;
    width: 42%;
    grid-template-columns: repeat(7, 14px);
    justify-content: end;
    gap: 9px;
  }
  .facility-slot-light {
    width: 14px;
    height: 14px;
  }

  .action-dock {
    position: absolute;
    z-index: 45;
    right: auto;
    bottom: 9px;
    left: 50%;
    display: grid;
    width: 360px;
    min-height: 68px;
    transform: translateX(-50%);
  }
  .app-shell[data-phase="cracking"] .left-rail,
  .app-shell[data-phase="reveal"] .left-rail,
  .app-shell[data-phase="result"] .left-rail { opacity: 0; pointer-events: none; transform: translate(-50%,12px); }
  .app-shell[data-phase="cracking"] .goal-panel,
  .app-shell[data-phase="reveal"] .goal-panel,
  .app-shell[data-phase="result"] .goal-panel,
  .app-shell[data-phase="cracking"] .facility-panel,
  .app-shell[data-phase="reveal"] .facility-panel,
  .app-shell[data-phase="result"] .facility-panel,
  .app-shell[data-phase="cracking"] .star-core-button,
  .app-shell[data-phase="reveal"] .star-core-button,
  .app-shell[data-phase="result"] .star-core-button { display: none; }

  @keyframes r56-star-core-pulse {
    0%,100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.04); box-shadow: 0 0 0 8px rgba(255,210,86,.22), 0 0 28px rgba(255,210,86,.72), 0 14px 30px rgba(72,44,65,.3); }
  }
}

@media (min-width: 680px) and (max-height: 380px) {
  .left-rail, .app-shell[data-phase="result"] .left-rail { bottom: 5px; width: 408px; height: 74px; min-height: 74px; }
  .tier-button { min-height: 70px; height: 70px; padding-left: 52px; }
  .tier-art { width: 45px; height: 53px; }
  .goal-panel, .facility-panel:not([data-kind="new-game-plus"]) { top: 48px; }
  .star-core-button { top: 92px; right: 130px; width: 66px; height: 66px; }
  .damage-meter { bottom: 88px; }
  .app-shell[data-conveyor-level="1"] .field-stones,
  .app-shell[data-conveyor-level="2"] .field-stones { bottom: 27%; }
  .facility-slot-rail { bottom: 24%; }
}
