/* ==========================================================================
   New York Nights: Success in the City — 16:9 PC Director's Cut & Smart Mobile
   - Desktop (16:9 / 21:9): Sweet-Spot 4x Diorama + Live JVM RAM Side Panels
   - Mobile Phones: Zero Phone-in-Phone! Edge-to-Edge + Smart Touch Controls
   ========================================================================== */

:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-editorial: 'Newsreader', 'Georgia', serif;
  --font-hand: 'Caveat', 'Segoe Script', cursive;
  --font-tech: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

/* 2005 Handset Skins (For Desktop 2.8s Intro Splash & Optional 2005 Desk View) */
body,
body[data-skin="espresso"] {
  --body-outer-hi: #4f4139; --body-outer-mid: #271e19; --body-outer-lo: #120d0b;
  --plate-top: #bdb0a2; --plate-mid: #96897b; --plate-bot: #73675b; --plate-ink: #1e1916;
  --well-bg: #14100e; --key-top: #38302b; --key-mid: #251f1c; --key-bot: #181412;
  --key-rim: rgba(255, 236, 209, 0.22);
  --el-glow: #ff9f2e; --el-soft: rgba(255, 159, 46, 0.34);
  --el-text: #ffe7c2; --el-sub: #e0b27b;
}
body[data-skin="champagne"] {
  --body-outer-hi: #7c828d; --body-outer-mid: #3d424b; --body-outer-lo: #1d2026;
  --plate-top: #e3e6ec; --plate-mid: #bfc5cf; --plate-bot: #949ba8; --plate-ink: #1b1e24;
  --well-bg: #1b1e24; --key-top: #4d535e; --key-mid: #353a43; --key-bot: #23272e;
  --key-rim: rgba(255, 255, 255, 0.34);
  --el-glow: #bae6fd; --el-soft: rgba(186, 230, 253, 0.32);
  --el-text: #f0f9ff; --el-sub: #cbd5e1;
}
body[data-skin="razr"] {
  --body-outer-hi: #75304d; --body-outer-mid: #3e1528; --body-outer-lo: #1b0710;
  --plate-top: #dfb3c5; --plate-mid: #b98098; --plate-bot: #8c556d; --plate-ink: #260b17;
  --well-bg: #1c0912; --key-top: #4a2033; --key-mid: #321321; --key-bot: #200b15;
  --key-rim: rgba(255, 214, 232, 0.28);
  --el-glow: #ff7ab8; --el-soft: rgba(255, 122, 184, 0.34);
  --el-text: #ffe4f1; --el-sub: #f5a3c8;
}
body[data-skin="titanium"] {
  --body-outer-hi: #4b5768; --body-outer-mid: #1e242d; --body-outer-lo: #0d1015;
  --plate-top: #9aaaba; --plate-mid: #6e7e90; --plate-bot: #4d5b6b; --plate-ink: #0f141b;
  --well-bg: #0f1318; --key-top: #2c3440; --key-mid: #1d232c; --key-bot: #12161c;
  --key-rim: rgba(203, 229, 255, 0.24);
  --el-glow: #38bdf8; --el-soft: rgba(56, 189, 248, 0.3);
  --el-text: #e0f2fe; --el-sub: #93c5fd;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0c0b0a;
  color: #f4f1ea;
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* Mobile Isolation: Never render PC sidebars or fake 2005 phone on a smartphone */
body.is-mobile #desk-splash-layer,
body.is-mobile .pc-panel,
body.is-mobile .desktop-only-chip {
  display: none !important;
}

body:not(.is-mobile) .smart-controls {
  display: none;
}

/* ==========================================================================
   PRIMARY STAGE SHELL & SUBTLE ATMOSPHERIC BACKDROP
   ========================================================================== */
.fullscreen-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

body.mode-splash .fullscreen-stage {
  transform: scale(0.96);
  opacity: 0.18;
}

.fs-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, #1c1815 0%, #0b0a09 75%);
}

.ambient-canvas {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(72px) saturate(1.25) brightness(0.24);
  opacity: 0.88;
  transform: translateZ(0);
}

.rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.fs-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 48%, transparent 42%, rgba(6, 5, 5, 0.72) 100%);
}

/* ==========================================================================
   TOP ARCHITECTURAL HEADER BAR
   ========================================================================== */
.fs-topbar {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(20, 19, 18, 0.82);
  border: 1px solid rgba(255, 240, 214, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.fs-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fs-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e59934;
  box-shadow: 0 0 8px rgba(229, 153, 52, 0.75);
  flex-shrink: 0;
}

.fs-title {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f7f3eb;
  white-space: nowrap;
}

.fs-edition-tag {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #a89f91;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 240, 214, 0.14);
}

.fs-scene-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f3c378;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(229, 153, 52, 0.14);
  border: 1px solid rgba(229, 153, 52, 0.3);
  white-space: nowrap;
}

.fs-hud-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.fs-chip {
  appearance: none;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 240, 214, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #cfc8bc;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.fs-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}
.fs-chip:active { transform: scale(0.97); }
.fs-chip.active {
  color: #fde6b8;
  background: rgba(229, 153, 52, 0.16);
  border-color: rgba(229, 153, 52, 0.42);
}

/* ==========================================================================
   16:9 PC DIRECTOR'S CUT 3-COLUMN WORKSPACE
   ========================================================================== */
.pc-workspace {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(272px, 324px) minmax(420px, 1fr) minmax(272px, 328px);
  align-items: stretch;
  gap: 16px;
}

body.is-mobile .pc-workspace {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  gap: 10px;
}

/* Left & Right 16:9 Editorial Side Panels */
.pc-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(20, 19, 18, 0.82);
  border: 1px solid rgba(255, 240, 214, 0.1);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.panel-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #9e9587;
  margin-bottom: 2px;
}

/* Left Panel: Resident Identity, Wallet & 40-Day Countdown */
.resident-card {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 240, 214, 0.09);
  flex-shrink: 0;
}

.res-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.res-name {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.1;
  color: #fbf8f3;
}

.wallet-box {
  text-align: right;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.24);
}

.wallet-val {
  font-family: var(--font-mono);
  font-size: 1.04rem;
  font-weight: 600;
  color: #6ee7b7;
}

.countdown-strip {
  margin-top: 9px;
}

.cd-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: #e7dfd3;
  margin-bottom: 4px;
}

.cd-muted { color: #9e9587; }

.cd-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cd-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e59934, #f59e0b);
  transition: width 0.35s ease;
}

.care-tip {
  margin: 8px 0 0;
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 0.74rem;
  line-height: 1.32;
  color: #c2b8a8;
}
.care-tip.urgent {
  color: #fca5a5;
}

/* Shared Panel Section Blocks */
.panel-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #b8afa0;
}

.mono-dim {
  font-size: 0.52rem;
  color: #787166;
}

/* 5 Live Stat Bars */
.stat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  color: #e5dfd5;
}

.stat-meta b {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #f8f5ef;
}

.stat-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.sf-beauty  { background: linear-gradient(90deg, #f472b6, #fb7185); }
.sf-health  { background: linear-gradient(90deg, #34d399, #10b981); }
.sf-humor   { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sf-culture { background: linear-gradient(90deg, #60a5fa, #38bdf8); }
.sf-pop     { background: linear-gradient(90deg, #c084fc, #e879f9); }

/* 8 Manhattan NPCs Social Network */
.social-block {
  flex: 1;
  border-top: 1px solid rgba(255, 240, 214, 0.09);
  padding-top: 9px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
  overflow-y: auto;
}

.npc-pill {
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 240, 214, 0.08);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.npc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.68rem;
  font-weight: 500;
  color: #dfd8cc;
}

.npc-row small {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #a89f91;
}

.npc-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.npc-fill {
  height: 100%;
  background: #e59934;
  transition: width 0.3s ease;
}

/* ==========================================================================
   CENTER COLUMN: SWEET-SPOT ISOMETRIC DIORAMA (Non-Chunky 4x / 5.2x Scale!)
   ========================================================================== */
.diorama-column {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.diorama-header {
  width: min(100%, 520px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(20, 19, 18, 0.8);
  border: 1px solid rgba(255, 240, 214, 0.11);
  flex-shrink: 0;
}

body.diorama-large .diorama-header,
body.diorama-large .diorama-dock {
  width: min(100%, 664px);
}

.dio-loc {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  color: #faf7f2;
}

.dio-pin {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 7px rgba(52, 211, 153, 0.7);
}

.dio-time {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
}

.dio-date {
  font-size: 0.66rem;
  color: #9e9587;
}

.dio-clock {
  font-size: 0.8rem;
  color: #fde6b8;
}

/* Sweet-Spot 4x (512x464) Isometric Diorama Box on Desktop! */
.fs-viewport {
  position: relative;
  width: min(100%, 520px);
  max-height: min(62dvh, 471px);
  aspect-ratio: 128 / 116;
  border-radius: 12px;
  overflow: hidden;
  background: #050506;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.82),
    0 0 0 1px rgba(255, 240, 214, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  transition: width 0.22s ease, max-height 0.22s ease;
}

body.diorama-large .fs-viewport {
  width: min(100%, 664px);
  max-height: min(72dvh, 602px);
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  cursor: pointer;
}

/* Desktop Action Dock Below Diorama */
.diorama-dock {
  width: min(100%, 520px);
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(20, 19, 18, 0.82);
  border: 1px solid rgba(255, 240, 214, 0.11);
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.dock-prompt-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: #d6cfc2;
  min-height: 18px;
}

.prompt-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e59934;
  flex-shrink: 0;
}

.dock-prompt-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-btn-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 7px;
}

.dock-btn {
  appearance: none;
  height: 32px;
  border-radius: 7px;
  border: 1px solid rgba(255, 240, 214, 0.13);
  background: rgba(255, 255, 255, 0.05);
  color: #e5dfd5;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.dock-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.dock-btn:active,
.dock-btn.pressed {
  transform: translateY(1px);
}
.dock-btn kbd {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #cbd5e1;
}

.dock-btn-primary {
  background: rgba(229, 153, 52, 0.2);
  border-color: rgba(229, 153, 52, 0.48);
  color: #fde6b8;
}
.dock-btn-primary:hover {
  background: rgba(229, 153, 52, 0.3);
}

/* ==========================================================================
   RIGHT 16:9 PANEL: LIVE MANHATTAN CHRONICLE & CITY SHORTCUTS
   ========================================================================== */
.feed-block {
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid rgba(255, 240, 214, 0.09);
  padding-bottom: 10px;
}

.live-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
}

.live-feed::-webkit-scrollbar { width: 4px; }
.live-feed::-webkit-scrollbar-thumb { background: rgba(255, 240, 214, 0.18); border-radius: 4px; }

.feed-empty {
  margin: auto 0;
  text-align: center;
  padding: 16px 10px;
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #968d7f;
}

.feed-entry {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.038);
  border-left: 2px solid #e59934;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: #9e9587;
}

.feed-speaker {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  color: #f3c378;
}

.feed-body {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 0.84rem;
  line-height: 1.38;
  color: #f3efe8;
}

/* Quick City Shortcuts & Collapsible PC Minigame Pad */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sc-card {
  appearance: none;
  padding: 8px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 240, 214, 0.11);
  background: rgba(255, 255, 255, 0.04);
  color: #e5dfd5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.sc-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(229, 153, 52, 0.36);
}
.sc-card.active {
  border-color: #e59934;
  background: rgba(229, 153, 52, 0.16);
}

.sc-title {
  font-size: 0.71rem;
  font-weight: 600;
  text-align: left;
}

.sc-card kbd {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a89f91;
}

.pc-numpad-box {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 240, 214, 0.09);
}

.pc-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.pc-pad-key {
  appearance: none;
  height: 27px;
  border-radius: 5px;
  border: 1px solid rgba(255, 240, 214, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f4f1ea;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.pc-pad-key:hover { background: rgba(255, 255, 255, 0.11); }
.pc-pad-key:active,
.pc-pad-key.pressed { background: #e59934; color: #120f0c; }

/* Touch Ripple, Hint & Native Name Input */
.touch-ripple {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(243, 195, 120, 0.9);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
.touch-ripple.animate { animation: rippleOut 0.36s ease-out forwards; }
@keyframes rippleOut {
  0% { transform: translate(-50%, -50%) scale(0.25); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(1.45); opacity: 0; }
}

.canvas-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(12, 11, 10, 0.86);
  border: 1px solid rgba(255, 240, 214, 0.18);
  color: #f4f1ea;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.4s ease;
}
.canvas-hint.fade-out { opacity: 0; }

.name-input-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 330px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(18, 17, 16, 0.95);
  border: 1.5px solid #e59934;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  z-index: 8;
}
.name-input-bar label { font-size: 0.7rem; font-weight: 600; color: #fde6b8; white-space: nowrap; }
.name-input-bar input {
  flex: 1; min-width: 0; background: #090908; border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px; color: #fff; font-family: var(--font-ui); font-size: 16px; padding: 4px 7px; outline: none;
  user-select: text; -webkit-user-select: text;
}
.name-input-bar button {
  background: #e59934; color: #120f0c; border: none; border-radius: 5px;
  padding: 5px 11px; font-size: 0.74rem; font-weight: 700; cursor: pointer;
}

/* ==========================================================================
   MOBILE SMART TOUCH CONTROLS (Bezel-Free Portrait & Landscape)
   ========================================================================== */
@media (max-width: 560px) {
  .fs-title { display: none; }
}
@media (max-width: 460px) {
  #btn-upscale { display: none; }
}

body.is-mobile .chip-lbl { display: none; }
body.is-mobile .fs-topbar { height: 35px; padding: 0 9px; }
body.is-mobile .fs-chip { height: 26px; padding: 0 7px; font-size: 0.68rem; }

body.is-mobile .diorama-column {
  justify-content: center;
  gap: 14px;
}

body.is-mobile .fs-viewport {
  width: 100%;
  max-width: min(100%, 460px);
  max-height: calc(100dvh - 246px);
}

.smart-controls {
  position: relative;
  width: 100%;
  max-width: 460px;
  flex: 1;
  min-height: 150px;
  max-height: 206px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 14px;
  padding: 4px 6px 2px;
}

.smart-left-wing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }

.smart-pad {
  position: relative; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(42, 40, 38, 0.88) 0%, rgba(19, 18, 17, 0.94) 100%);
  border: 1.5px solid rgba(255, 240, 214, 0.16);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  touch-action: none;
}
.pad-dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.26); }
.pad-n { top: 11px; left: 50%; transform: translateX(-50%); }
.pad-s { bottom: 11px; left: 50%; transform: translateX(-50%); }
.pad-w { left: 11px; top: 50%; transform: translateY(-50%); }
.pad-e { right: 11px; top: 50%; transform: translateY(-50%); }

.smart-puck {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 38% 35%, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.32); pointer-events: none;
}
.smart-pad.active .smart-puck { border-color: #e59934; background: rgba(229, 153, 52, 0.3); }

.smart-utility-row { display: flex; gap: 6px; }
.smart-pill {
  appearance: none; height: 28px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(255, 240, 214, 0.16); background: rgba(24, 23, 22, 0.88);
  color: #d6cfc2; font-size: 0.72rem; font-weight: 600; cursor: pointer; touch-action: none;
}
.smart-pill:active, .smart-pill.pressed, .smart-pill.active {
  background: rgba(229, 153, 52, 0.22); border-color: #e59934; color: #fde6b8;
}

.smart-right-wing { display: flex; flex-direction: column; justify-content: center; gap: 10px; width: 100%; }
.smart-sec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.smart-sec-row.smart-sec-3 { grid-template-columns: 1fr 1fr 1fr; }
.smart-sec-btn {
  appearance: none; height: 42px; border-radius: 11px; border: 1px solid rgba(255, 240, 214, 0.15);
  background: rgba(26, 25, 24, 0.9); color: #e5dfd5; font-size: 0.74rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; touch-action: none;
}
.smart-phone-btn { color: #86efac; border-color: rgba(74, 222, 128, 0.28); }
.smart-primary-btn {
  appearance: none; width: 100%; height: 62px; border-radius: 16px;
  border: 1px solid rgba(243, 195, 120, 0.55);
  background: linear-gradient(145deg, #e59934 0%, #c67a1b 100%);
  box-shadow: 0 10px 24px rgba(198, 122, 27, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  color: #140f0a; font-size: 0.96rem; font-weight: 700; cursor: pointer; touch-action: none;
}
.smart-primary-btn:active, .smart-primary-btn.pressed { transform: scale(0.96); }

.smart-numpad-drawer {
  position: absolute; inset: 0; z-index: 12; padding: 8px 10px; border-radius: 16px;
  background: rgba(15, 14, 13, 0.96); border: 1px solid rgba(229, 153, 52, 0.4);
  display: flex; flex-direction: column; gap: 6px;
}
.snum-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; font-weight: 600; color: #fde6b8; }
.snum-head button { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; border-radius: 6px; padding: 2px 9px; font-size: 0.7rem; cursor: pointer; }
.snum-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.snum-key { appearance: none; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(34, 32, 30, 0.92); color: #fff; font-size: 0.95rem; font-weight: 700; cursor: pointer; touch-action: none; }
.snum-key:active, .snum-key.pressed { background: #e59934; color: #120f0c; }

@media (min-aspect-ratio: 11/10) and (max-height: 540px) {
  body.is-mobile .fullscreen-stage {
    gap: 4px;
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
  }
  body.is-mobile .fs-topbar { height: 30px; padding: 0 8px; }
  body.is-mobile .diorama-column {
    display: grid; grid-template-columns: 158px minmax(0, 1fr) 168px; grid-template-rows: 1fr;
    align-items: center; justify-items: center; gap: 10px;
  }
  body.is-mobile .fs-viewport { grid-column: 2; grid-row: 1; height: 100%; max-height: 100%; width: auto; max-width: 100%; }
  body.is-mobile .smart-controls { display: contents; }
  body.is-mobile .smart-left-wing { grid-column: 1; grid-row: 1; }
  body.is-mobile .smart-right-wing { grid-column: 3; grid-row: 1; }
  body.is-mobile .smart-pad { width: 112px; height: 112px; }
  body.is-mobile .smart-numpad-drawer { grid-column: 3; grid-row: 1; position: relative; width: 100%; height: 100%; max-height: 290px; }
  body.is-mobile .r37dy-watermark { padding: 1px 9px; font-size: 0.56rem; }
  body.is-mobile .r37dy-watermark .wm-prefix,
  body.is-mobile .wm-subcopy { display: none; }
  body.is-mobile .wm-copyright,
  body.is-mobile .wm-legal-link { font-size: 0.54rem; }
}

/* ==========================================================================
   DESKTOP 2005 WALNUT DESK & SONORA K750i INTRO SPLASH / OPTIONAL DESK VIEW
   ========================================================================== */
.desk-splash-layer {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  will-change: transform, opacity;
  transition: transform 0.88s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.65s ease 0.16s;
}
.desk-splash-layer.zooming-in { transform: scale(3.75); opacity: 0; pointer-events: none; }
.desk-splash-layer.splash-hidden { display: none !important; pointer-events: none; }

body:not(.is-mobile) .desk-photo {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 22% 10%, rgba(255, 196, 120, 0.12) 0%, transparent 48%), url('../img/desk-2005.jpg') center center / cover no-repeat;
  transform: scale(1.01);
}
.lamp-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(8, 5, 3, 0.58) 100%); pointer-events: none; }

.splash-banner {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 5;
  width: min(90%, 430px); padding: 9px 14px 10px; border-radius: 10px;
  background: rgba(16, 12, 9, 0.88); border: 1px solid rgba(255, 220, 165, 0.28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.78); backdrop-filter: blur(10px);
}
body.mode-desk-view .splash-banner { display: none; }
.splash-banner-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.76rem; font-weight: 500; color: #f5efe6; margin-bottom: 7px; }
.splash-banner-row button { background: #e59934; color: #140e08; border: none; border-radius: 5px; padding: 4px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.splash-progress { width: 100%; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.splash-bar { width: 0%; height: 100%; background: #fbbf24; transition: width 0.1s linear; }

.desk-stage { position: relative; z-index: 2; width: 100%; height: 100%; display: grid; grid-template-columns: 1fr; align-items: center; justify-items: center; }
.desk-ephemera, .tabletop-deck { display: none; }
@media (min-width: 1060px) and (min-height: 620px) {
  .desk-stage { grid-template-columns: 276px minmax(315px, 344px) 276px; justify-content: center; gap: 34px; }
  .desk-ephemera, .tabletop-deck { display: block; }
}

.desk-ephemera { position: relative; width: 276px; padding-top: 14px; }
.mta-metrocard { position: absolute; top: -6px; right: -8px; width: 174px; height: 96px; border-radius: 7px; background: linear-gradient(135deg, #facc15 0%, #eab308 55%, #ca8a04 100%); box-shadow: 1px 2px 4px rgba(12, 7, 2, 0.6), 7px 13px 22px rgba(8, 4, 1, 0.52); transform: rotate(7.5deg); z-index: 0; overflow: hidden; border: 1px solid rgba(120, 82, 8, 0.45); }
.mta-magstripe { height: 17px; margin-top: 8px; background: linear-gradient(180deg, #221f1d 0%, #3a3532 50%, #181615 100%); }
.mta-body { padding: 7px 11px; display: flex; flex-direction: column; }
.mta-logo { font-family: var(--font-ui); font-style: italic; font-weight: 900; font-size: 1.08rem; color: #103478; }
.mta-sub { font-family: var(--font-tech); font-size: 0.58rem; font-weight: 600; color: #1f2937; margin-top: 2px; }
.mta-notch { position: absolute; right: -6px; top: 42px; width: 12px; height: 12px; border-radius: 50%; background: #472e1b; }

.paper-leaflet { position: relative; z-index: 1; background: linear-gradient(168deg, #f5efe2 0%, #ebe2ce 62%, #e2d6be 100%); color: #241f1c; padding: 16px 17px 14px; border-radius: 2px; transform: rotate(-1.4deg); box-shadow: 2px 4px 7px rgba(12, 7, 2, 0.52), 10px 18px 30px rgba(8, 4, 1, 0.56); }
.paper-crease { position: absolute; left: 0; right: 0; top: 51%; height: 6px; background: linear-gradient(180deg, rgba(95, 76, 52, 0.14) 0%, rgba(255, 253, 248, 0.65) 45%, transparent 100%); pointer-events: none; }
.leaflet-head { border-bottom: 1.5px solid #2b241f; padding-bottom: 7px; margin-bottom: 9px; }
.leaflet-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.54rem; font-weight: 600; color: #7c6d5c; margin-bottom: 4px; }
.leaflet-head h2 { margin: 0; font-family: var(--font-editorial); font-size: 1.32rem; font-weight: 600; color: #1b1613; }
.leaflet-deck { margin: 3px 0 0; font-family: var(--font-editorial); font-style: italic; font-size: 0.74rem; color: #8c2d27; }
.leaflet-prose { margin: 0 0 10px; font-family: var(--font-editorial); font-size: 0.77rem; line-height: 1.42; color: #2f2823; }
.leaflet-divider { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.leaflet-divider::before, .leaflet-divider::after { content: ''; flex: 1; height: 1px; background: rgba(43, 36, 31, 0.28); }
.leaflet-divider span { font-family: var(--font-tech); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; color: #5c4f42; }
.printed-keymap { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.printed-keymap > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; border-bottom: 1px dotted rgba(60, 48, 36, 0.22); padding-bottom: 3px; }
.printed-keymap dt { font-family: var(--font-tech); font-size: 0.68rem; font-weight: 700; color: #231d19; }
.printed-keymap kbd { display: inline-block; padding: 0 4px; border: 1px solid rgba(43, 36, 31, 0.48); border-radius: 2px; background: rgba(255, 255, 255, 0.42); font-family: var(--font-mono); font-size: 0.58rem; color: #1b1613; }
.printed-keymap dd { margin: 0; font-family: var(--font-editorial); font-size: 0.71rem; color: #4a3f36; }
.leaflet-foot { margin-top: 8px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.52rem; color: #7c6d5c; }

.postit-note { position: relative; z-index: 2; margin: -8px 6px 0 18px; padding: 11px 14px 9px; background: linear-gradient(172deg, #f6e583 0%, #f3dd6d 70%, #ebd056 100%); color: #193b8a; border-radius: 1px 1px 10px 2px; transform: rotate(2.5deg); cursor: pointer; box-shadow: 1px 2px 4px rgba(15, 9, 2, 0.42), 9px 15px 20px -5px rgba(8, 4, 1, 0.58); }
.postit-glue { position: absolute; top: 0; left: 0; right: 0; height: 9px; background: rgba(210, 180, 55, 0.18); }
.handwriting { margin: 0; font-family: var(--font-hand); font-size: 1.06rem; font-weight: 600; line-height: 1.16; color: #193b8a; }
.postit-extra { margin-top: 5px; padding-top: 4px; border-top: 1px dashed rgba(25, 59, 138, 0.25); }
.ink-underline { font-weight: 700; border-bottom: 1.5px solid rgba(25, 59, 138, 0.68); }
.postit-sig { margin-top: 4px; display: flex; align-items: baseline; justify-content: space-between; }
.postit-hint { font-family: var(--font-hand); font-size: 0.92rem; font-weight: 600; color: rgba(25, 59, 138, 0.72); }

.handset-stage { height: 100%; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.phone-chassis { position: relative; width: min(100%, 334px); height: auto; max-height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px 11px 9px; border-radius: 28px 28px 34px 34px; background: linear-gradient(132deg, var(--body-outer-hi) 0%, var(--body-outer-mid) 36%, var(--body-outer-lo) 100%); box-shadow: 3px 6px 10px rgba(6, 3, 1, 0.72), 14px 26px 42px rgba(4, 2, 0, 0.8), inset 1.5px 1.5px 1px rgba(255, 245, 228, 0.34), inset -1.5px -2px 3px rgba(0, 0, 0, 0.82); }
.irda-port { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 34px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, #22060b, #5c0b18 50%, #1c0408); }
.hw-vol-up, .hw-vol-dn, .hw-shutter { position: absolute; width: 3px; background: linear-gradient(180deg, #d6d3ce, #78726c); }
.hw-vol-up { left: -3px; top: 96px; height: 28px; border-radius: 2px 0 0 2px; }
.hw-vol-dn { left: -3px; top: 130px; height: 28px; border-radius: 2px 0 0 2px; }
.hw-shutter { right: -3px; top: 148px; height: 36px; border-radius: 0 2px 2px 0; }
.upper-faceplate { flex: 0 1 auto; display: flex; flex-direction: column; padding: 7px 9px 8px; border-radius: 20px 20px 10px 10px; background: linear-gradient(148deg, var(--plate-top) 0%, var(--plate-mid) 48%, var(--plate-bot) 100%); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.65), 0 2px 5px rgba(0, 0, 0, 0.65); }
.phone-crown { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-bottom: 5px; }
.acoustic-slot { display: flex; gap: 3px; padding: 2px 7px; border-radius: 999px; background: #141210; }
.acoustic-slot span { width: 9px; height: 2.5px; border-radius: 1px; background: #3a3530; }
.brand-row { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.sensor-eye { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #3b4c66 0%, #0b0e14 75%); }
.brand-wordmark { font-family: var(--font-tech); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.24em; color: var(--plate-ink); }
.model-tag { font-family: var(--font-mono); font-size: 0.55rem; font-weight: 600; color: var(--plate-ink); opacity: 0.78; }
.lens-housing { position: relative; flex: 0 1 auto; display: flex; flex-direction: column; padding: 5px 8px 5px; border-radius: 10px 10px 7px 7px; background: #08090b; border: 1.5px solid #181a1f; overflow: hidden; }
.glass-reflection { position: absolute; inset: 0; background: linear-gradient(126deg, rgba(255, 252, 245, 0.065) 0%, rgba(255, 252, 245, 0.02) 32%, transparent 32.4%); pointer-events: none; z-index: 4; }
.lens-top-meta { display: flex; justify-content: space-between; padding: 0 2px 3px; }
.carrier-tag, .scene-pill { font-family: var(--font-mono); font-size: 0.52rem; letter-spacing: 0.08em; color: #9ca3af; }
.screen-frame { position: relative; width: 100%; aspect-ratio: 128 / 116; display: flex; align-items: center; justify-content: center; background: #030304; border-radius: 3px; overflow: hidden; box-shadow: 0 0 12px var(--el-soft); }
#splash-canvas { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.lens-softkey-strip { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 0; }
.sk-callout { font-family: var(--font-tech); font-size: 0.68rem; font-weight: 600; color: #9ca3af; }
.sk-callout b { color: #e5e7eb; }
.lens-submodel { font-family: var(--font-mono); font-size: 0.48rem; letter-spacing: 0.16em; color: #4b5563; }
.keypad-well { display: flex; flex-direction: column; gap: 5px; padding: 6px 6px 5px; border-radius: 9px 9px 24px 24px; background: var(--well-bg); }
.hw-key { appearance: none; border: 1px solid rgba(0, 0, 0, 0.85); cursor: pointer; position: relative; touch-action: none; }
.nav-deck { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.nav-wing { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sk-key, .call-key, .end-key { width: 100%; height: 31px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(180deg, var(--key-top) 0%, var(--key-mid) 58%, var(--key-bot) 100%); box-shadow: inset 0 1px 0 var(--key-rim), 0 2px 3px rgba(0, 0, 0, 0.8); }
.sk-key-left { border-radius: 8px 4px 3px 4px; } .sk-key-right { border-radius: 4px 8px 4px 3px; } .call-key { border-radius: 4px 3px 4px 8px; } .end-key { border-radius: 3px 4px 8px 4px; flex-direction: row; gap: 6px; }
.sk-bar { width: 22px; height: 2.5px; border-radius: 2px; background: #e5e7eb; }
.sk-key small { font-family: var(--font-tech); font-size: 0.56rem; font-weight: 600; color: var(--el-sub); }
.tel-pickup { color: #4ade80; } .clear-c { font-family: var(--font-tech); font-size: 0.8rem; font-weight: 700; color: var(--el-text); } .end-bar { width: 11px; height: 3px; border-radius: 2px; background: #f87171; }
.joy-bezel { position: relative; width: 94px; height: 74px; border-radius: 17px; padding: 4px; background: linear-gradient(138deg, #f5f6f8 0%, #aeb4be 38%, #59606b 72%, #c9ced6 100%); display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.joy-bezel::before { content: ''; position: absolute; inset: 4px; border-radius: 13px; background: #1c1917; pointer-events: none; }
.joy-dir { position: relative; z-index: 1; background: transparent; border: none; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dir-tick { display: block; background: rgba(229, 231, 235, 0.55); border-radius: 1px; }
.joy-up .dir-tick, .joy-down .dir-tick { width: 8px; height: 2px; } .joy-left .dir-tick, .joy-right .dir-tick { width: 2px; height: 8px; }
.joy-up { grid-column: 2; grid-row: 1; } .joy-left { grid-column: 1; grid-row: 2; } .joy-right { grid-column: 3; grid-row: 2; } .joy-down { grid-column: 2; grid-row: 3; }
.joy-stick { grid-column: 2; grid-row: 2; z-index: 2; width: 31px; height: 31px; place-self: center; border-radius: 50%; border: 1.5px solid #09090b; padding: 3px; background: radial-gradient(circle, var(--el-glow) 35%, #18181b 75%); cursor: pointer; }
.joy-cap { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 62% 65%, #e5e7eb 0%, #9ca3af 48%, #4b5563 100%); }
.keypad-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2px; row-gap: 3px; padding: 3px; border-radius: 6px 6px 19px 19px; background: #0c0a09; }
.dome-key { min-width: 0; height: 31px; padding: 0 7px; display: flex; align-items: baseline; justify-content: space-between; background: radial-gradient(ellipse at 50% 60%, var(--el-soft) 0%, transparent 72%), linear-gradient(180deg, var(--key-top) 0%, var(--key-mid) 62%, var(--key-bot) 100%); box-shadow: inset 0 1px 0 var(--key-rim); }
.col-l { border-radius: 6px 2px 2px 8px; } .col-m { border-radius: 2px; } .col-r { border-radius: 2px 6px 8px 2px; }
.keypad-grid .dome-key:nth-child(10) { border-bottom-left-radius: 15px; } .keypad-grid .dome-key:nth-child(12) { border-bottom-right-radius: 15px; }
.dome-key b { font-family: var(--font-tech); font-size: 1.02rem; font-weight: 700; color: var(--el-text); }
.dome-key small { font-family: var(--font-tech); font-size: 0.6rem; font-weight: 600; color: var(--el-sub); }
.voicemail-mark { font-family: var(--font-mono) !important; font-size: 0.54rem !important; text-decoration: underline; }
.tactile-pip::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 10px; height: 1.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.62); }
.phone-chin { display: flex; align-items: center; justify-content: center; gap: 8px; }
.quickshare-badge { font-family: var(--font-tech); font-size: 0.46rem; font-weight: 700; letter-spacing: 0.22em; color: rgba(255, 240, 220, 0.34); }
.mic-hole { width: 5px; height: 3.5px; border-radius: 999px; background: #060505; }

.tabletop-deck { width: 276px; transform: rotate(0.6deg); }
.deck-wood-frame { padding: 7px; border-radius: 10px; background: linear-gradient(145deg, #593720 0%, #382010 52%, #221208 100%); box-shadow: 2px 5px 9px rgba(8, 4, 1, 0.68), 12px 24px 38px rgba(4, 2, 0, 0.76); }
.deck-metal-plate { position: relative; padding: 14px 13px; border-radius: 6px; background: linear-gradient(160deg, #2b2d31 0%, #1d1f23 55%, #141619 100%); border: 1px solid #0c0d0f; display: flex; flex-direction: column; gap: 12px; }
.screw { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #7c828d, #2b2e35); }
.sc-tl { top: 6px; left: 6px; } .sc-tr { top: 6px; right: 6px; } .sc-bl { bottom: 6px; left: 6px; } .sc-br { bottom: 6px; right: 6px; }
.deck-header { display: flex; justify-content: space-between; padding: 0 6px; }
.deck-maker { font-family: var(--font-tech); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; color: #d6cfc2; }
.deck-sub { font-family: var(--font-mono); font-size: 0.48rem; color: #828894; }
.deck-lcd { padding: 7px 9px; border-radius: 4px; background: linear-gradient(180deg, #221706 0%, #2f2008 100%); border: 1.5px solid #0b0c0e; font-family: var(--font-mono); color: #ffb52e; }
.deck-lcd-top { display: flex; justify-content: space-between; font-size: 0.66rem; font-weight: 600; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 181, 46, 0.18); }
.deck-lcd-mid { margin-top: 5px; display: flex; align-items: center; justify-content: space-between; font-size: 0.56rem; color: #eab308; }
.vu-meter { display: flex; align-items: flex-end; gap: 2px; height: 11px; }
.vu-meter span { width: 4px; height: 3px; background: #ffb52e; }
.deck-section { display: flex; flex-direction: column; gap: 6px; }
.section-etch { font-family: var(--font-tech); font-size: 0.56rem; font-weight: 700; letter-spacing: 0.16em; color: #8f96a3; border-bottom: 1px solid rgba(255, 255, 255, 0.07); padding-bottom: 2px; }
.shell-tray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.shell-chip { appearance: none; padding: 5px 3px; border-radius: 4px; border: 1px solid #0c0d0f; background: #23252a; color: #9ca3af; font-family: var(--font-tech); font-size: 0.62rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.shell-chip.active { border-color: #d97706; color: #fef3c7; }
.chip-metal { width: 24px; height: 11px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.75); }
.cm-espresso { background: linear-gradient(135deg, #b8ab9c 0%, #4a372a 55%, #d97706 100%); }
.cm-champagne { background: linear-gradient(135deg, #f3f4f6 0%, #9ca3af 60%, #4b5563 100%); }
.cm-razr { background: linear-gradient(135deg, #e8a9c1 0%, #9d174d 60%, #3b0a1e 100%); }
.cm-titanium { background: linear-gradient(135deg, #94a3b8 0%, #334155 60%, #0f172a 100%); }
.enter-4k-btn { width: 100%; padding: 9px 10px; border-radius: 5px; border: 1px solid rgba(251, 191, 36, 0.55); background: linear-gradient(180deg, #d97706 0%, #b45309 100%); color: #fffbeb; font-family: var(--font-tech); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; cursor: pointer; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 5, 5, 0.82); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal-card { width: min(100%, 440px); max-height: 88dvh; overflow-y: auto; background: #171615; border: 1px solid rgba(255, 240, 214, 0.14); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9); padding: 18px; color: #f4f1ea; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.09); padding-bottom: 10px; }
.modal-kicker { display: block; font-family: var(--font-mono); font-size: 0.54rem; letter-spacing: 0.12em; color: #e59934; margin-bottom: 2px; }
.modal-header h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #faf7f2; }
.icon-close { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: #e5e7eb; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; }
.modal-section { margin-top: 14px; }
.modal-section h3 { margin: 0 0 8px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: #a89f91; text-transform: uppercase; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.82rem; }
.hw-fader { flex: 1; accent-color: #e59934; cursor: pointer; }
.muted-note { margin: 0 0 8px; font-size: 0.74rem; color: #a89f91; line-height: 1.42; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-btn { border: 1px solid rgba(255, 240, 214, 0.14); background: rgba(255, 255, 255, 0.05); color: #e5dfd5; border-radius: 8px; padding: 7px 11px; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.modal-btn.active { border-color: #e59934; color: #fde6b8; background: rgba(229, 153, 52, 0.18); }
.modal-btn.danger { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

.seo-guide-article {
  border-top: 1px solid rgba(255, 240, 214, 0.1);
  padding-top: 12px;
}
.seo-faq-item {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 240, 214, 0.09);
}
.seo-faq-item summary {
  font-size: 0.76rem;
  font-weight: 600;
  color: #e5dfd5;
  cursor: pointer;
}
.seo-faq-item p {
  margin: 6px 0 0;
}

.save-toast {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(16, 24, 20, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  color: #a7f3d0;
  font-size: 0.76rem;
  font-weight: 600;
  pointer-events: none;
}

/* ==========================================================================
   SUBTLE CLICKABLE r37dy.com WATERMARK + GAMELOFT COPYRIGHT & LEGAL COLOPHON
   ========================================================================== */
.r37dy-watermark-bar {
  position: relative;
  z-index: 4;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  pointer-events: none;
  margin-top: -3px;
}

.wm-pill-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 7px;
  row-gap: 2px;
  max-width: 100%;
  text-align: center;
}

.wm-divider {
  font-size: 0.6rem;
  color: rgba(214, 207, 194, 0.28);
  user-select: none;
}

.wm-copyright {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: rgba(198, 190, 177, 0.46);
  letter-spacing: 0.01em;
}

.wm-legal-link {
  pointer-events: auto;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(214, 207, 194, 0.62);
  text-decoration: underline;
  text-decoration-color: rgba(214, 207, 194, 0.28);
  text-underline-offset: 2px;
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.wm-legal-link:hover,
.wm-legal-link:focus-visible {
  color: #fde6b8;
  text-decoration-color: rgba(229, 153, 52, 0.7);
  outline: none;
}

@media (max-width: 820px) {
  .wm-subcopy {
    display: none;
  }
}

@media (max-width: 520px) {
  .wm-divider:first-of-type {
    display: none;
  }
  .wm-copyright {
    font-size: 0.55rem;
  }
  .wm-legal-link {
    font-size: 0.56rem;
  }
}

.legal-modal-card {
  width: min(100%, 540px);
}

.legal-copy .muted-note {
  font-size: 0.76rem;
  line-height: 1.5;
}

.r37dy-watermark {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2.5px 11px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: rgba(214, 207, 194, 0.5);
  background: rgba(14, 13, 12, 0.44);
  border: 1px solid rgba(255, 240, 214, 0.075);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.r37dy-watermark .wm-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(229, 153, 52, 0.52);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.r37dy-watermark .wm-prefix {
  font-size: 0.53rem;
  letter-spacing: 0.11em;
  opacity: 0.78;
}

.r37dy-watermark .wm-brand {
  font-weight: 600;
  color: rgba(244, 241, 234, 0.72);
  transition: color 0.18s ease;
}

.r37dy-watermark .wm-arrow {
  font-size: 0.6rem;
  opacity: 0.62;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.r37dy-watermark:hover,
.r37dy-watermark:focus-visible {
  color: #f4f1ea;
  background: rgba(22, 20, 18, 0.88);
  border-color: rgba(229, 153, 52, 0.38);
  outline: none;
}

.r37dy-watermark:hover .wm-brand,
.r37dy-watermark:focus-visible .wm-brand {
  color: #fde6b8;
}

.r37dy-watermark:hover .wm-dot,
.r37dy-watermark:focus-visible .wm-dot {
  background: #e59934;
  box-shadow: 0 0 6px rgba(229, 153, 52, 0.72);
}

.r37dy-watermark:hover .wm-arrow,
.r37dy-watermark:focus-visible .wm-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

.r37dy-desk-watermark {
  display: none;
  position: absolute;
  bottom: 14px;
  right: 18px;
  z-index: 6;
}

body.mode-desk-view .r37dy-desk-watermark {
  display: inline-flex;
}

.inline-brand-link {
  color: #f3c378;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inline-brand-link:hover {
  color: #fde6b8;
}
