/* styles/phone.css: Phone layout (390px), animations, and reduced-motion rules */
/* SI-assisted code (Claude, Antigravity), reviewed by La Shara Cordero. See AI_DISCLOSURE.md. */
/* ==========================================================================
   PHONE (390 x 844, matches docs/design-screens/phone-*.png)
   ========================================================================== */
@media (max-width: 599px) {

  html,
  body {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
  }

  .room {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    max-width: 430px;
    height: 100dvh;
    min-height: 760px;
    margin: 0 auto;
    transform: none !important;
  }

  .room-glow {
    height: 460px;
  }

  .clock-strip {
    left: 12px;
    right: 12px;
    top: 10px;
    height: 48px;
  }

  .clock-cell:nth-child(1),
  .clock-cell:nth-child(3),
  .clock-cell:nth-child(4),
  .clock-btn--replay {
    display: none;
  }

  .clock-cell--moon {
    flex: 1;
    background: transparent;
    padding: 0 8px;
  }

  .clock-label {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .clock-val {
    font-size: 22px;
  }

  .clock-btn--mute {
    min-width: 58px;
    padding: 0 4px;
    border-right: 1px solid #1E2220;
    font-size: 9.5px;
  }

  .clock-btn--about {
    min-width: 46px;
    padding: 0 4px;
    border-right: 0;
    font-size: 9.5px;
    line-height: 1.15;
  }

  .world-btn {
    min-width: 46px;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .side-screen-left,
  .side-screen-right {
    display: none;
  }

  .main-screen {
    left: 12px;
    right: 12px;
    top: 66px;
    width: auto;
    height: 368px;
    border-radius: 50% / 4%;
  }

  .boot-panel {
    padding: 24px 20px;
  }

  .boot-title {
    font-size: 44px;
  }

  .boot-line,
  .boot-cursor {
    font-size: 21px;
  }

  .boot-begin-btn {
    font-size: 28px;
    min-height: 50px;
    padding: 0 18px;
  }

  .takeover-photo-wrap {
    display: none !important;
  }

  .moon-viewport {
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    width: 276px;
    height: 276px;
  }

  /* Keep FACE EARTH tucked at bottom-left of Moon viewport, above status box */
  .face-earth-btn {
    left: -32px;
    bottom: 2px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 9px;
  }

  .hardware-plot {
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 10px;
    width: auto;
  }

  .plot-kicker,
  .plot-legend-wrap,
  .plot-selected-wrap {
    display: none !important;
  }

  .plot-signal-box {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 18px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* GHOST LOG · 00 OF 06 CHECKED row */
  .compact-summary-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 440px;
    height: 28px;
    z-index: 5;
    font: 600 11px var(--font-mono);
    letter-spacing: 0.1em;
    color: #FFE9B0;
  }

  .compact-summary-cell--landed {
    display: none;
  }

  .compact-open-file-btn {
    min-height: 36px;
    padding: 0 10px;
    background: #2C312E;
    border: 1px solid rgba(237, 243, 238, 0.4);
    color: #EDF3EE;
    font: 600 10px var(--font-mono);
    letter-spacing: 0.08em;
    cursor: pointer;
  }

  .console-lip {
    top: 472px;
    height: 20px;
  }

  .console-desk {
    top: 484px;
  }

  .rivet,
  .dymo-wrap,
  .console-monitor-bezel,
  .indicator-strip {
    display: none;
  }

  .console-panel {
    left: 12px;
    right: 12px;
    top: 8px;
    width: auto;
    padding: 8px;
  }

  .ghost-btn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .ghost-btn {
    min-height: 50px;
  }

  .call-row {
    margin-top: 8px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .call-btn {
    min-width: 158px;
    min-height: 48px;
    font-size: 17px;
    padding: 0 10px;
  }

  .reset-btn {
    padding: 0 8px;
    font-size: 10px;
    min-height: 44px;
  }

  /* Phone Bottom Sheet (matches Block 4b 16:10 top banner spec) */
  .phone-sheet {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 76px;
    bottom: 0;
    z-index: 20;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, #7D8981 0%, #525C55 24px, #4A544E 100%);
    box-shadow: 0 -300px 0 300px rgba(2, 3, 3, 0.78), 0 -16px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    padding: 8px 10px 10px;
    overflow-y: auto;
  }

  .phone-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: rgba(232, 240, 234, 0.55);
    margin: 2px auto 6px;
    flex-shrink: 0;
  }

  .phone-sheet-close {
    position: absolute;
    right: 18px;
    top: 24px;
    z-index: 5;
    min-width: 68px;
    min-height: 44px;
    background: rgba(7, 9, 8, 0.86);
    border: 1px solid #EDF3EE;
    color: #FFFFFF;
    font: 700 12px var(--font-mono);
    letter-spacing: 0.08em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    cursor: pointer;
  }

  .phone-sheet-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 2px 4px;
    flex-shrink: 0;
  }

  .phone-sheet-photo-btn {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 176px;
    padding: 0;
    border: 1px solid rgba(201, 221, 224, 0.35);
    background: #070908;
    cursor: pointer;
    display: block;
    overflow: hidden;
  }

  .phone-sheet-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.6) contrast(1.05);
  }

  .phone-sheet-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 176px;
    border: 1px dashed rgba(201, 221, 224, 0.45);
    background: rgba(7, 9, 8, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 400 11px var(--font-mono);
    color: #C9D3CC;
    text-align: center;
    padding: 10px;
    white-space: pre-line;
  }

  .phone-sheet-title-col {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px;
  }

  .phone-sheet-name {
    margin: 0;
    font: 400 26px var(--font-vt);
    line-height: 1;
    color: #FFFFFF;
    text-transform: uppercase;
  }

  .phone-sheet-photoid {
    margin: 0;
    font: 400 10px var(--font-mono);
    color: #D5DDD7;
  }

  .phone-sheet-crt-bezel {
    background: #2A2F2C;
    border-radius: 16px;
    padding: 6px;
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.65);
    flex: 1;
    min-height: 0;
    display: flex;
  }

  .phone-sheet-crt {
    position: relative;
    width: 100%;
    background: radial-gradient(ellipse at 50% 42%, #18201C 0%, #070908 75%);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    color: #EDF3EE;
    overflow-y: auto;
  }

  .phone-sheet-crt .file-mission {
    font-size: 12px;
    line-height: 1.28;
  }

  .phone-sheet-crt .file-body {
    font-size: 12px;
    line-height: 1.3;
  }

  .phone-sheet-crt .file-answer-content {
    font-size: 15px;
    line-height: 1.32;
  }

  .phone-sheet-crt .q-btn {
    min-height: 44px;
    font-size: 11px;
    padding: 0 7px;
  }

  .phone-sheet-signal-box {
    margin-top: 5px;
    padding: 6px 10px;
    background: #070908;
    border: 1px solid rgba(201, 221, 224, 0.25);
    font: 400 19px var(--font-vt);
    line-height: 1.1;
    flex-shrink: 0;
  }

  .phone-sheet-call-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
  }

  .mission-complete-panel {
    padding: 6px 10px;
  }

  .mission-complete-card {
    padding: 6px 10px;
    gap: 4px;
  }

  .mission-complete-title {
    font-size: 16px;
    line-height: 1.05;
  }

  .badge-canvas {
    max-width: 245px;
  }

  .save-badge-btn {
    padding: 0 14px;
    font-size: 11px;
  }

  .mission-complete-study {
    padding-top: 3px;
    gap: 2px;
  }

  .mission-complete-study-label {
    font-size: 10px;
  }

  .study-tool-btn {
    padding: 0 7px;
    font-size: 10px;
  }

  .mission-complete-study-note {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drag-hint {
    transition: none !important;
  }
}