/* ==========================================================================
   6. DEDICATED MOBILE PLATFORM & RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* ==========================================================================
   PHASE 9: DEDICATED MOBILE PLATFORM (POCKET MAGAZINE & HANDHELD K750i/K800i)
   ========================================================================== */

/* 1. Masthead Device Mode Toggle Button */
.btn-top-mode-toggle {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 2px solid var(--ink-black);
  box-shadow: 2px 2px 0 var(--ink-black);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.1s, box-shadow 0.1s;
  user-select: none;
}

.btn-top-mode-toggle:hover {
  background: #FFE033;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink-black);
}

.btn-top-mode-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0;
}

/* 2. Mobile Top Header */
.mobile-top-header {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--ink-black);
  color: #FFFFFF;
  border-bottom: 3px solid var(--ink-red);
  padding: 8px 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.m-top-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.m-top-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ink-yellow);
  letter-spacing: 0.06em;
}

.m-top-sub {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  color: #A0AAB8;
  letter-spacing: 0.04em;
}

.m-top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-top-btn {
  background: var(--paper-bg);
  color: var(--ink-black);
  border: 1px solid var(--ink-black);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  box-shadow: 1px 1px 0 var(--ink-yellow);
}

/* 3. Mobile Pocket Hero (Cover Showcase) */
.mobile-pocket-hero {
  display: none;
  width: 100%;
  margin-bottom: 20px;
}

.mph-card {
  background-color: var(--paper-white);
  background-image: var(--paper-white-grain-img);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-blend-mode: multiply;
  border: 3px solid var(--ink-black);
  box-shadow: 4px 4px 0 var(--ink-black);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.mph-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  border-bottom: 1px dashed var(--ink-black);
  padding-bottom: 6px;
}

.mph-badge {
  background: var(--ink-red);
  color: #FFFFFF;
  padding: 2px 6px;
  letter-spacing: 0.05em;
}

.mph-rating {
  color: var(--ink-black);
  font-family: var(--font-tech);
}

.mph-wap {
  color: var(--ink-secondary);
  font-family: var(--font-tech);
}

.mph-display-wrap {
  position: relative;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  aspect-ratio: 240 / 320;
  background: #000000;
  border: 2px solid var(--ink-black);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 2px 2px 0 var(--ink-black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mph-screen-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  object-fit: contain;
}

.mph-tape-sticker {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 1px solid var(--ink-black);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  padding: 6px 8px;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.25;
  pointer-events: none;
  transform: rotate(-0.5deg);
}

.mph-meta {
  text-align: center;
}

.mph-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink-black);
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.mph-sub {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  color: var(--ink-secondary);
}

.mph-play-btn {
  background: var(--ink-red);
  color: #FFFFFF;
  border: 2px solid var(--ink-black);
  box-shadow: 3px 3px 0 var(--ink-black);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 14px;
  min-height: 48px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s;
  user-select: none;
}

.mph-play-btn:active {
  background: #B31707;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink-black);
}

/* 4. Touch-to-Life Dynamic Observation */
.game-shelf-card.touch-alive,
.catalog-card.touch-alive {
  border-color: var(--ink-red) !important;
  box-shadow: 3px 3px 0 var(--ink-red) !important;
  transform: translateY(-2px);
}

.game-shelf-card.touch-alive .shelf-thumb-wrap img,
.catalog-card.touch-alive .card-image-box img {
  filter: brightness(1.08) contrast(1.05);
}

/* 5. Mobile Handheld Faceplate Terminal (100dvh, Sony Ericsson K750i/K800i Deck) */
.mobile-faceplate-deck {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: linear-gradient(180deg, #181B20 0%, #111317 60%, #0B0D0F 100%);
  color: #FFFFFF;
  z-index: 99999;
  flex-direction: column;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-sizing: border-box;
}

.mobile-faceplate-deck.is-open {
  display: flex !important;
}

/* Top Faceplate Bar */
.mf-top-bar,
.mf-deck-header {
  height: 38px;
  min-height: 38px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181A1F;
  border-bottom: 2px solid #000;
  box-shadow: 0 2px 0 #000;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
}

.mf-brand-zone,
.mf-deck-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.mf-liquid-orb {
  width: 13px;
  height: 13px;
  min-width: 13px;
  min-height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #67C800 50%, #1A4D00 100%);
  border: 1px solid #000000;
  box-shadow: 0 0 4px rgba(103, 200, 0, 0.6);
  flex-shrink: 0;
  display: inline-block;
}

.mf-brand-title,
.mf-brand-text {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-actions-zone,
.mf-deck-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mf-btn-icon,
.mf-btn-sheet,
.mf-btn-devices,
.mf-btn-mech,
.mf-btn-cam-mode,
.mf-deck-btn {
  background: #252831;
  color: #EAEFF5;
  border: 1.5px solid #484E5C;
  border-radius: 0;
  padding: 3px 6px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 28px;
  box-shadow: 1px 1px 0 #000;
  touch-action: manipulation;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.1s ease;
}

.mf-btn-icon:active,
.mf-btn-sheet:active,
.mf-btn-devices:active,
.mf-btn-mech:active,
.mf-btn-cam-mode:active,
.mf-deck-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.mf-btn-sheet,
.mf-deck-btn-sheet {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border-color: #000;
  font-weight: 800;
}

.mf-btn-close,
.mf-deck-btn-close {
  background: var(--ink-red);
  color: #FFFFFF;
  border: 1.5px solid #000;
  font-weight: 900;
  min-width: 28px;
  padding: 3px 6px;
}

.mf-btn-devices.active,
.mf-btn-cam-mode.mode-orbit {
  background: var(--ink-orange);
  color: #FFFFFF;
  border-color: #000;
}

.mf-btn-mech {
  color: #FFFFFF;
  border-color: #484E5C;
}

.mf-btn-mech.active {
  background: var(--ink-yellow);
  color: #000;
  border-color: #000;
}

.mf-btn-icon.muted,
.mf-deck-btn.muted {
  color: #FF5555;
  border-color: #552222;
}

/* Hide text labels on narrow mobile screens so top bar never overflows */
@media (max-width: 520px) {
  .mf-btn-text {
    display: none !important;
  }
  .mf-top-bar {
    padding: 0 4px;
    gap: 4px;
  }
  .mf-actions-zone {
    gap: 3px;
  }
  .mf-btn-icon,
  .mf-btn-sheet,
  .mf-btn-devices,
  .mf-btn-mech,
  .mf-btn-cam-mode {
    padding: 3px 5px;
    min-height: 28px;
  }
  .mf-brand-title {
    max-width: 100px;
    font-size: 0.68rem;
  }
}

@media (max-width: 360px) {
  .mf-brand-title {
    max-width: 65px;
  }
}

/* Full-Viewport 3D WebGL Stage for Sony Ericsson K750i Model */
.mobile-3d-stage {
  flex: 1 1 auto;
  width: 100vw;
  height: calc(100dvh - 38px);
  position: relative;
  overflow: hidden;
  touch-action: none;
  background: radial-gradient(circle at 50% 40%, #1A1E26 0%, #0F1217 65%, #080A0D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-3d-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
  touch-action: none;
}

/* Mobile Device Stand Drawer (Collapsible) */
.mf-device-bar {
  background-color: var(--paper-cream);
  background-image: var(--paper-grain-img);
  border-bottom: 2px solid var(--ink-black);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 0 #000;
  z-index: 20;
  box-sizing: border-box;
  animation: mfSlideDown 0.15s ease-out;
}

.mf-device-bar.hidden {
  display: none !important;
}

@keyframes mfSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mf-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.mf-control-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-red);
  white-space: nowrap;
}

.mf-styled-select {
  flex: 1;
  background: #FFFFFF;
  color: #000000;
  border: 1.5px solid var(--ink-black);
  border-radius: 0;
  padding: 5px 24px 5px 8px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 1px 1px 0 #000;
}

.mf-device-chips-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
}

.mf-device-chips-scroll::-webkit-scrollbar {
  display: none;
}

.mf-device-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFFFF;
  color: #000000;
  border: 1.5px solid var(--ink-black);
  border-radius: 0;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.1s ease;
}

.mf-device-chip:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.mf-device-chip.active {
  background: var(--ink-red);
  color: #FFFFFF;
  border-color: #000000;
  box-shadow: 2px 2px 0 #000;
  font-weight: 800;
}

.mf-device-chip .chip-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Floating Status Toast for 3D Engine (Authentic Y2K Print Sticker Alert) */
.device-status-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--ink-yellow);
  background-image: var(--paper-grain-img);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-blend-mode: multiply;
  color: var(--ink-black);
  border: 2px solid var(--ink-black);
  border-radius: 0;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0px var(--ink-black);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  text-align: center;
  max-width: 90vw;
}

.device-status-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* 6. Bottom Sheet Drawer (Magazine Lore, Transcripts & Cheats) */
.mf-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85dvh;
  background-color: var(--paper-bg);
  background-image: var(--paper-grain-img);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-blend-mode: multiply;
  color: var(--ink-black);
  border-top: 3px solid var(--ink-black);
  border-radius: 0;
  box-shadow: 0 -4px 0 var(--ink-black);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.mf-bottom-sheet.is-open {
  transform: translateY(0);
}

.mf-sheet-handle-bar {
  padding: 8px 12px 6px;
  background-color: var(--paper-cream);
  background-image: var(--paper-grain-img);
  border-bottom: 2px solid var(--ink-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
}

.mf-sheet-pill {
  width: 36px;
  height: 4px;
  background: var(--ink-black);
  border-radius: 2px;
}

.mf-sheet-handle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mf-sheet-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-black);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.mf-sheet-close-btn {
  position: static;
  background: var(--ink-red);
  color: #FFFFFF;
  border: 1.5px solid var(--ink-black);
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.mf-sheet-close-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.mf-sheet-tabs {
  display: flex;
  background-color: var(--paper-white);
  background-image: var(--paper-white-grain-img);
  background-repeat: repeat;
  background-size: 256px 256px;
  background-blend-mode: multiply;
  border-bottom: 2px solid var(--ink-black);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}

.mf-sheet-tabs::-webkit-scrollbar {
  display: none;
}

.mf-sheet-tab-btn {
  flex: 1 0 auto;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-right: 1.5px solid var(--ink-black);
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  scroll-snap-align: start;
}

.mf-sheet-tab-btn:last-child {
  border-right: none;
}

.mf-sheet-tab-btn.active {
  background: var(--ink-black);
  color: var(--ink-yellow);
}

.mf-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--paper-bg);
  -webkit-overflow-scrolling: touch;
}

.mf-sheet-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.mf-sheet-pane.active {
  display: flex;
}

/* Sheet Story Card */
.mf-story-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.mf-stamp-rating {
  display: inline-block;
  background: var(--ink-red);
  color: #FFF;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 6px;
  margin-bottom: 8px;
}

.mf-quote-text {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
  border-left: 3px solid var(--ink-yellow);
  background: #FFFDF0;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.mf-lore-block {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  line-height: 1.45;
  color: #222;
}

.mf-chars-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.mf-char-item {
  background-color: var(--paper-white);
  background-image: var(--paper-white-grain-img);
  background-repeat: repeat;
  background-size: 256px 256px;
  background-blend-mode: multiply;
  border: 1px solid var(--ink-black);
  padding: 6px 8px;
  font-size: 0.78rem;
}

.mf-char-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-red);
}

/* Dialogs Stream */
.mf-dialogs-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mf-dialog-line {
  background-color: var(--paper-white);
  background-image: var(--paper-white-grain-img);
  background-repeat: repeat;
  background-size: 256px 256px;
  background-blend-mode: multiply;
  border: 1px solid #CCC;
  border-left: 3px solid var(--ink-black);
  padding: 6px 8px;
  font-size: 0.8rem;
}

.mf-dialog-speaker {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-black);
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.mf-dialog-text {
  font-family: var(--font-serif);
  color: #333;
}

/* Cheats Coupon */
.mf-cheats-coupon {
  background: #FFFDF5;
  border: 2px dashed var(--ink-red);
  padding: 12px;
}

.mf-cheats-coupon-head {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink-red);
  margin-bottom: 10px;
  text-align: center;
}

.mf-cheats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mf-cheat-row {
  background-color: var(--paper-white);
  background-image: var(--paper-white-grain-img);
  background-repeat: repeat;
  background-size: 256px 256px;
  background-blend-mode: multiply;
  border: 1px solid var(--ink-black);
  box-shadow: 2px 2px 0 var(--ink-black);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mf-cheat-info {
  display: flex;
  flex-direction: column;
}

.mf-cheat-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
}

.mf-cheat-digits {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: var(--ink-red);
  letter-spacing: 0.05em;
}

.mf-btn-inject-cheat {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 1px solid var(--ink-black);
  box-shadow: 1px 1px 0 var(--ink-black);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.mf-btn-inject-cheat:active {
  background: #FF9900;
  transform: translate(1px, 1px);
}

.mf-decomp-notes {
  margin-top: 10px;
  font-family: var(--font-tech);
  font-size: 0.68rem;
  color: #666;
  border-top: 1px solid #DDD;
  padding-top: 6px;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINT & MOBILE HANDHELD MODE ENFORCEMENT
   ========================================================================== */
.card-mobile-actions,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 820px) {
  /* Prevent horizontal scroll globally & leave space for bottom nav */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body {
    padding-bottom: 74px !important;
  }

  /* Main magazine page sheet on mobile: zero wasted margins, full screen paper canvas */
  .mag-page-sheet {
    padding: 8px 6px 30px !important;
    margin: 0 auto !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Show mobile header & pocket hero in authentic Y2K print paper substrate */
  .mobile-top-header {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    background-color: var(--paper-cream);
    background-image: var(--paper-grain-img);
    background-repeat: repeat;
    background-size: 512px 512px;
    background-blend-mode: multiply;
    border-bottom: 3px solid var(--ink-black);
    box-shadow: 0 3px 0 var(--ink-black);
    box-sizing: border-box;
    overflow: hidden;
  }

  .m-top-colophon-strip {
    background: var(--ink-red);
    color: #FFFFFF;
    font-family: var(--font-tech);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #000;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .m-colo-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .m-colo-price {
    color: var(--ink-yellow);
    font-weight: 800;
    flex-shrink: 0;
  }

  .m-top-brand-row {
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--paper-bg);
    background-image: var(--paper-grain-img);
    border-bottom: 2px solid var(--ink-black);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .m-top-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }

  .m-top-logo {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--ink-black);
    letter-spacing: 0.04em;
    text-shadow: 2px 2px 0px var(--ink-yellow);
    line-height: 1;
  }

  .m-top-sub {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--ink-red);
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .m-top-btn {
    background: var(--ink-yellow);
    color: var(--ink-black);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
    border: 2px solid #000;
    border-radius: 0;
    padding: 4px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    flex-shrink: 0;
  }

  .m-top-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
  }

  .m-top-rubrics {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 6px 8px;
    background-color: var(--paper-cream);
    background-image: var(--paper-grain-img);
    border-bottom: 1px solid var(--ink-black);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .m-top-rubrics::-webkit-scrollbar {
    display: none;
  }

  .m-rubric-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: #FFFFFF;
    color: var(--ink-black);
    border: 2px solid var(--ink-black);
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    white-space: nowrap;
    transition: all 0.1s ease;
  }

  .m-rubric-chip:active,
  .m-rubric-chip.active {
    background: var(--ink-red);
    color: #FFFFFF;
    border-color: #000;
    font-weight: 800;
    box-shadow: 2px 2px 0 #000;
  }

  /* Hide bulky desktop masthead, running header, desktop rubric ribbon, and hero centerfold on mobile */
  .mag-running-header,
  .mag-masthead,
  .mag-rubric-ribbon,
  .hero-centerfold {
    display: none !important;
  }

  /* Pocket Hero Showcase */
  .mobile-pocket-hero {
    display: block !important;
    margin: 8px 0 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .mph-flagship-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .mph-flagship-tabs::-webkit-scrollbar {
    display: none;
  }

  .mph-tab-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: var(--paper-cream);
    background-image: var(--paper-grain-img);
    color: var(--ink-black);
    border: 2px solid #000;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 10px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    border-radius: 0;
    white-space: nowrap;
    transition: all 0.1s ease;
  }

  .mph-tab-btn.active {
    background: var(--ink-red);
    color: #FFFFFF;
    box-shadow: 2px 2px 0 #000;
  }

  .mph-card {
    background: var(--paper-bg);
    background-image: var(--paper-grain-img);
    border: 3px solid var(--ink-black);
    box-shadow: 3px 3px 0px #000;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .mph-top-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }

  .mph-badge {
    background: var(--ink-red);
    color: #FFF;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 6px;
    border: 1px solid #000;
    box-shadow: 1px 1px 0 #000;
  }

  .mph-rating {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--ink-black);
  }

  .mph-wap {
    font-family: var(--font-tech);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--ink-yellow);
    color: #000;
    border: 1px solid #000;
    padding: 2px 6px;
    box-shadow: 1px 1px 0 #000;
  }

  .mph-display-wrap {
    position: relative;
    width: 240px;
    height: 320px;
    max-width: 100%;
    background: #000000;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    margin: 4px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mph-screen-canvas {
    width: 240px;
    height: 320px;
    display: block;
    image-rendering: pixelated;
    background: #000000;
  }

  .mph-tape-sticker {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: var(--ink-yellow);
    background-image: var(--paper-grain-img);
    color: #000;
    border: 1.5px solid #000;
    font-family: var(--font-serif);
    font-size: 0.8rem;
    font-style: italic;
    font-weight: 600;
    padding: 6px 8px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.6);
    transform: rotate(-0.5deg);
    line-height: 1.3;
  }

  .mph-meta {
    text-align: center;
    margin: 4px 0 8px;
    width: 100%;
  }

  .mph-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--ink-black);
    margin-bottom: 2px;
    text-transform: uppercase;
  }

  .mph-sub {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--ink-secondary);
  }

  .mph-actions-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    box-sizing: border-box;
  }

  .mph-play-btn {
    flex: 1.3;
    min-height: 44px;
    background: var(--ink-red);
    color: #FFF;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 800;
    border: 2px solid #000;
    border-radius: 0;
    box-shadow: 3px 3px 0 #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .mph-play-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
  }

  .mph-dossier-btn {
    flex: 1;
    min-height: 44px;
    background: var(--ink-yellow);
    color: #000;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 800;
    border: 2px solid #000;
    border-radius: 0;
    box-shadow: 3px 3px 0 #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .mph-dossier-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
  }

  /* Magazine Scorecard on Mobile */
  .mag-scorecard-table {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
    border: 2px solid var(--ink-black) !important;
    box-shadow: 3px 3px 0 #000 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mag-scorecard-table .highlight-col {
    grid-column: 1 / -1;
    background: var(--ink-yellow) !important;
  }

  .scorecard-divider {
    display: none;
  }

  /* Editorial Rails Swipe & Card Layout */
  .mag-rail-track-wrap {
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .mag-rail-track-wrap .catalog-card-item {
    scroll-snap-align: start;
    flex: 0 0 250px !important;
    max-width: 250px !important;
  }

  /* Catalog Search & Filter on Mobile */
  .mag-catalog-filters {
    padding: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mag-classifier-bar {
    padding: 10px 8px !important;
    margin: 10px 0 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mag-search-cell {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .search-input-wrapper {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mag-genre-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    padding: 4px 2px 8px !important;
    gap: 6px !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .mag-genre-pills::-webkit-scrollbar {
    display: none !important;
  }

  .genre-pill-btn {
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    white-space: nowrap !important;
    min-height: 36px;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border: 2px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: 2px 2px 0 #000 !important;
    background: #FFF !important;
    color: #000 !important;
    transition: all 0.1s ease !important;
  }

  .genre-pill-btn.active {
    background: var(--ink-red) !important;
    color: #FFF !important;
    box-shadow: 2px 2px 0 #000 !important;
  }

  /* Mobile Catalog Grid (Single Responsive Column) */
  .mag-catalog-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Game Card Mobile Thumb Action Buttons */
  .card-mobile-actions {
    display: flex !important;
    gap: 6px !important;
    margin-top: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .card-m-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 38px;
    padding: 6px 4px;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 800;
    border: 2px solid #000;
    border-radius: 0;
    box-shadow: 2px 2px 0 #000;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-m-play {
    background: var(--ink-red);
    color: #FFFFFF;
  }

  .card-m-play:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
  }

  .card-m-dossier {
    background: var(--ink-yellow);
    color: #000000;
  }

  .card-m-dossier:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
  }

  /* Sticky Bottom Thumb Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background-color: var(--paper-cream);
    background-image: var(--paper-grain-img);
    border-top: 3px solid #000;
    box-shadow: 0 -3px 0 #000;
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
  }

  /* When modal or faceplate deck is open, HIDE the bottom nav completely */
  body.has-active-modal .mobile-bottom-nav,
  .mobile-faceplate-deck.is-open ~ .mobile-bottom-nav {
    display: none !important;
  }

  .m-nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-black);
    gap: 2px;
    text-decoration: none;
    user-select: none;
    transition: all 0.1s;
  }

  .m-nav-item.active {
    color: var(--ink-red);
    font-weight: 800;
  }

  .m-nav-svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  .m-nav-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
  }

  .m-nav-phone-item {
    background: #000000 !important;
    color: var(--ink-yellow) !important;
    border-radius: 0 !important;
    border: 2px solid #000 !important;
    margin: 5px 6px;
    height: calc(100% - 10px);
    box-shadow: 2px 2px 0 var(--ink-red);
  }

  .m-nav-phone-item.active {
    background: var(--ink-red) !important;
    color: #FFFFFF !important;
    box-shadow: 2px 2px 0 #000;
  }

  /* Mobile Handheld Dossier Sheet Enhancements */
  .mf-head-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }

  .mf-wap-badge {
    font-family: var(--font-tech);
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--ink-yellow);
    color: #000;
    border: 1.5px solid #000;
    padding: 2px 8px;
    box-shadow: 1.5px 1.5px 0 #000;
  }

  .mf-subtitle {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-style: italic;
    color: #555;
    margin-bottom: 8px;
  }

  .mf-section-heading {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 800;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 14px;
    margin-bottom: 6px;
    border-bottom: 2px solid #000;
    padding-bottom: 3px;
  }

  .mf-dropcap-p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.55;
    color: #111;
    margin-bottom: 10px;
  }

  .mf-dropcap-p::first-letter {
    font-family: var(--font-display);
    font-size: 2.6rem;
    float: left;
    line-height: 0.82;
    padding-right: 8px;
    padding-top: 4px;
    font-weight: 900;
    color: var(--ink-red);
    text-shadow: 1px 1px 0 #000;
  }

  .mf-tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #FFF;
    border: 2px solid #000;
    padding: 10px;
    box-shadow: 2px 2px 0 #000;
    font-size: 0.8rem;
    margin-bottom: 12px;
  }

  .mf-tech-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mf-tech-lbl {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
  }

  .mf-tech-item strong {
    font-family: var(--font-tech);
    font-size: 0.82rem;
    font-weight: 700;
    color: #000;
  }

  .mf-raw-accordion-box {
    margin-top: 14px;
    border: 2px solid #000;
    background: #FFF;
    box-shadow: 2px 2px 0 #000;
  }

  .mf-raw-acc-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #EFE9DC;
    border: none;
    border-bottom: 1.5px solid #000;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
  }

  .mf-raw-dump-wrap {
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
    background: #0E1013;
    color: #00FF88;
    font-family: monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    border-top: 1px solid #333;
  }

  .mf-raw-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .mf-cookie-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FFF;
    border: 2px solid #000;
    padding: 14px;
    box-shadow: 3px 3px 0 #000;
  }

  .mf-cookie-desc {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    color: #333;
    line-height: 1.45;
  }

  .mf-cookie-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    border-bottom: 1px dotted #aaa;
    padding-bottom: 4px;
  }

  .mf-cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .mf-cookie-btn {
    padding: 8px 6px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1.5px solid #000;
    background: #F0EAE1;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    text-align: center;
    border-radius: 0;
  }

  .mf-cookie-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
  }

  .mf-cookie-danger {
    background: #FFE8E8;
    color: #D9230F;
    border-color: #D9230F;
  }

  .mf-sheet-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background-color: var(--paper-cream);
    background-image: var(--paper-grain-img);
    border-top: 3px solid #000;
    box-shadow: 0 -3px 0 #000;
    z-index: 20;
    box-sizing: border-box;
    width: 100%;
  }

  .mf-footer-play-btn {
    flex: 1.3;
    min-height: 44px;
    background: var(--ink-red);
    color: #FFF;
    border: 2px solid #000;
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mf-footer-play-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
  }

  .mf-footer-jar-btn {
    flex: 1;
    min-height: 44px;
    background: var(--ink-yellow);
    color: #000;
    border: 2px solid #000;
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    box-shadow: 3px 3px 0 #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mf-footer-jar-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
  }
}

/* Explicit .mobile-handheld-mode class on body (scoped to mobile viewports) */
@media (max-width: 820px) {
  body.mobile-handheld-mode .mobile-top-header {
    display: flex !important;
  }

  body.mobile-handheld-mode .mobile-pocket-hero {
    display: block !important;
  }

  body.mobile-handheld-mode .hero-centerfold {
    display: none !important;
  }

  body.mobile-handheld-mode .mag-scorecard-table {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  body.mobile-handheld-mode .mag-running-header,
  body.mobile-handheld-mode .mag-masthead,
  body.mobile-handheld-mode .mag-rubric-ribbon,
  body.mobile-handheld-mode .hero-centerfold {
    display: none !important;
  }

  body.mobile-handheld-mode .mag-catalog-grid {
    grid-template-columns: 1fr !important;
  }

  body.mobile-handheld-mode .card-mobile-actions,
  body.mobile-handheld-mode .mobile-bottom-nav {
    display: flex !important;
  }
}

