/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1a2e;
  color: #eee;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Game container ── */
#game-container {
  position: relative;
  /*
   * Fit within both viewport width AND height.
   * min() picks the most restrictive constraint so the canvas
   * never overflows in either orientation.
   */
  width: min(800px, 100vw, calc(100vh * 800 / 450));
  width: min(800px, 100vw, calc(100dvh * 800 / 450));
  aspect-ratio: 800 / 450;
}

#game-canvas,
#game-canvas-3d {
  width: 100%;
  height: 100%;
  display: block;
  border: 2px solid #333;
  border-radius: 4px;
  image-rendering: pixelated;
}

#game-canvas-3d {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: auto;
}

#hud-canvas-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ── UI overlay ── */
#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(10, 10, 30, 0.92);
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Menu screen ── */
.menu-screen,
.word-entry-screen,
.loading-screen,
.victory-screen,
.leaderboard-screen,
.assets-screen,
.asset-detail-screen {
  text-align: center;
  padding: 24px;
  max-width: 90%;
  margin: auto;
}

.game-title {
  font-size: 3rem;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.tagline {
  font-size: 0.9rem;
  color: #aaa;
  font-style: italic;
  margin-bottom: 28px;
}

/* ── Buttons ── */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 32px;
  border: 2px solid;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 200px;
}

.btn-primary {
  background: #FFD700;
  color: #1a1a2e;
  border-color: #FFD700;
  font-weight: bold;
}

.btn-primary:hover {
  background: #FFC000;
  transform: scale(1.03);
}

.btn-secondary {
  background: transparent;
  color: #aaa;
  border-color: #555;
}

.btn-secondary:hover {
  color: #fff;
  border-color: #888;
}

/* ── Word entry ── */
.word-entry-screen h2 {
  font-size: 1.5rem;
  color: #FFD700;
  margin-bottom: 20px;
}

.word-inputs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}

.word-inputs label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.word-label {
  font-size: 0.8rem;
  color: #aaa;
}

.word-inputs input {
  font-family: inherit;
  font-size: 1.1rem;
  padding: 8px 14px;
  width: 260px;
  max-width: 100%;
  background: #222;
  border: 2px solid #555;
  border-radius: 4px;
  color: #fff;
  text-align: center;
}

.word-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-random {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: bold;
  color: #FFD700;
  background: #333;
  border: 2px solid #555;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-random:hover {
  background: #444;
  border-color: #FFD700;
}

.btn-random:active {
  background: #555;
}

.btn-random.loading {
  pointer-events: none;
  opacity: 0.5;
  animation: pulse-random 0.8s ease-in-out infinite;
}

@keyframes pulse-random {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.word-inputs input:focus {
  outline: none;
  border-color: #FFD700;
}

.error-text {
  color: #FF6644;
  font-size: 0.8rem;
  min-height: 1.2em;
  margin-bottom: 8px;
}

/* ── Loading screen ── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #333;
  border-top: 4px solid #FFD700;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.95rem;
  color: #ccc;
  font-style: italic;
}

/* ── Victory screen ── */
.victory-screen h2 {
  font-size: 2rem;
  color: #FFD700;
  margin-bottom: 12px;
}

.victory-stats {
  font-size: 1rem;
  margin-bottom: 8px;
}

.victory-words {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 16px;
}

.initials-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.initials-entry input {
  font-family: inherit;
  font-size: 1.3rem;
  width: 80px;
  padding: 6px;
  background: #222;
  border: 2px solid #555;
  border-radius: 4px;
  color: #FFD700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.initials-entry input:focus {
  outline: none;
  border-color: #FFD700;
}

/* ── Leaderboard ── */
.leaderboard-screen h2 {
  font-size: 1.5rem;
  color: #FFD700;
  margin-bottom: 16px;
}

.leaderboard-table-wrapper {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 4px 8px;
  text-align: center;
  border-bottom: 1px solid #333;
}

.leaderboard-table th {
  color: #FFD700;
  font-size: 0.75rem;
}

.leaderboard-table td {
  color: #ccc;
}

.words-col {
  font-size: 0.7rem;
  color: #888;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Touch controls ── */
#touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 20;
}

.touch-left, .touch-right {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.touch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.touch-btn:active {
  background: rgba(255, 215, 0, 0.3);
  border-color: #FFD700;
}

/* ── Responsive ── */
@media (max-width: 820px) {
  #game-container {
    width: min(100vw, calc(100vh * 800 / 450));
    width: min(100vw, calc(100dvh * 800 / 450));
  }

  #game-canvas {
    border: none;
    border-radius: 0;
  }

  /*
   * On mobile the canvas is small in portrait (~219px tall on a
   * typical phone). Making the overlay cover the full viewport
   * gives menus and forms room to breathe.
   */
  #ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 30; /* above touch controls (z-index 20) */
    padding:
      env(safe-area-inset-top, 0px)
      env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px)
      env(safe-area-inset-left, 0px);
  }

  .game-title {
    font-size: 2rem;
  }

  .word-inputs input {
    width: 220px;
  }

  .btn-random {
    width: 40px;
    height: 40px;
  }
}

/* ── Portrait mobile: large touch targets at screen bottom ── */
@media (max-width: 600px) and (orientation: portrait) {
  #touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 16px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  }

  .touch-btn {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }
}

/* ── Landscape mobile: respect safe areas on notched phones ── */
@media (max-height: 500px) and (orientation: landscape) {
  #touch-controls {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }

  .touch-btn {
    width: 48px;
    height: 48px;
  }

  /* Tighter spacing for short screens */
  .menu-screen,
  .word-entry-screen,
  .loading-screen,
  .victory-screen,
  .leaderboard-screen,
  .assets-screen,
  .asset-detail-screen {
    padding: 12px;
  }

  .game-title {
    font-size: 1.6rem;
    margin-bottom: 4px;
  }

  .tagline {
    margin-bottom: 14px;
  }

  .word-inputs {
    gap: 8px;
    margin-bottom: 8px;
  }

  .leaderboard-table-wrapper {
    max-height: 180px;
  }
}

/* ── Level 2 Button ── */
.btn-level2 {
  background: linear-gradient(135deg, #6644cc, #aa44ff);
  color: #fff;
  border-color: #aa66ff;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(170, 102, 255, 0.5);
}

.btn-level2:hover {
  background: linear-gradient(135deg, #7755dd, #bb55ff);
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(170, 102, 255, 0.4);
}

/* ── Leaderboard buttons ── */
.leaderboard-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── Level 2 Intro Screen ── */
.level2-intro-screen {
  text-align: center;
  padding: 20px;
  max-width: 90%;
  margin: auto;
}

.level2-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6644cc, #aa44ff);
  color: #fff;
  padding: 4px 16px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  margin-bottom: 12px;
  text-shadow: 0 0 6px rgba(170, 102, 255, 0.6);
}

.victory-badge {
  background: linear-gradient(135deg, #cc8800, #ffd700);
  color: #1a1a2e;
  text-shadow: none;
}

.level2-intro-screen h2 {
  font-size: 1.5rem;
  color: #aa88ff;
  margin-bottom: 8px;
}

.level2-subtitle {
  font-size: 0.9rem;
  color: #aaa;
  font-style: italic;
  margin-bottom: 20px;
}

.level2-info {
  margin-bottom: 20px;
}

.level2-info p {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 4px;
}

.level2-controls-info {
  background: rgba(100, 68, 204, 0.15);
  border: 1px solid rgba(170, 102, 255, 0.3);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: inline-block;
}

.controls-header {
  font-size: 0.75rem;
  color: #aa88ff;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.controls-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  text-align: left;
  font-size: 0.8rem;
  color: #ccc;
}

.controls-grid .key {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  color: #FFD700;
  text-align: center;
}

.level2-objective {
  font-size: 0.85rem;
  color: #FFD700;
  margin-bottom: 16px;
}

/* ── Level 2 Loading ── */
.level2-loading {
  /* Additional styling for Level 2 loading */
}

.level2-spinner {
  border-top-color: #aa66ff !important;
}

.level2-loading-badge {
  font-size: 0.75rem;
  color: #aa88ff;
  letter-spacing: 0.2em;
  font-weight: bold;
}

/* ── Level 2 Victory Screen ── */
.level2-victory-screen {
  text-align: center;
  padding: 24px;
  max-width: 90%;
  margin: auto;
}

.level2-victory-screen h2 {
  font-size: 1.6rem;
  color: #FFD700;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.victory-subtitle {
  font-size: 0.9rem;
  color: #aaa;
  font-style: italic;
  margin-bottom: 20px;
}

.final-stats {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  display: inline-block;
  min-width: 250px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: #888;
  font-size: 0.8rem;
}

.stat-value {
  color: #FFD700;
  font-size: 0.85rem;
  font-weight: bold;
}

.victory-flavor {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════
   Level 2 Touch Controls — Dual-Stick + Action Buttons
   Left joystick = move, Right swipe = camera, Buttons = actions
   ══════════════════════════════════════════════ */

#touch-controls-3d {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
  z-index: 20;
}

/* ── Movement Joystick Zone (left ~40% of screen) ── */
.touch3d-joystick-zone {
  position: absolute;
  left: 0;
  top: 0;
  width: 40%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
}

.joystick-base {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 68, 204, 0.15) 0%, rgba(100, 68, 204, 0.05) 70%, transparent 100%);
  border: 2px solid rgba(170, 102, 255, 0.3);
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: opacity 0.15s;
  /* Default position — bottom-left area */
  left: 80px;
  top: calc(100% - 80px);
}

.joystick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 102, 255, 0.6), rgba(100, 68, 204, 0.4));
  border: 2px solid rgba(170, 102, 255, 0.7);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(170, 102, 255, 0.3);
}

/* ── Camera Joystick Zone (right ~60% of screen) ── */
.touch3d-camera-zone {
  position: absolute;
  right: 0;
  top: 0;
  width: 60%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
}

.cam-joystick-base {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 170, 255, 0.12) 0%, rgba(68, 170, 255, 0.04) 70%, transparent 100%);
  border: 2px solid rgba(68, 170, 255, 0.25);
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: opacity 0.15s;
  /* Default position — bottom-right area */
  right: 80px;
  left: auto;
  top: calc(100% - 80px);
}

.cam-joystick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 170, 255, 0.5), rgba(30, 100, 180, 0.35));
  border: 2px solid rgba(68, 170, 255, 0.6);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(68, 170, 255, 0.25);
}

/* ── 3D Action Buttons (float over camera zone, bottom-right) ── */
.touch3d-actions {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: center;
  justify-items: center;
  pointer-events: auto;
  z-index: 25; /* Above camera zone */
}

.touch3d-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

.touch3d-btn:active {
  background: rgba(170, 102, 255, 0.4);
  border-color: #aa66ff;
}

/* Attack button — bigger and highlighted */
.touch3d-attack {
  width: 68px;
  height: 68px;
  font-size: 1.8rem;
  border-color: rgba(255, 68, 68, 0.5);
  background: rgba(180, 30, 30, 0.4);
}

.touch3d-attack:active {
  background: rgba(255, 68, 68, 0.5);
  border-color: #ff4444;
}

/* Jump button — medium with accent */
.touch3d-jump {
  border-color: rgba(68, 221, 255, 0.4);
  background: rgba(20, 80, 120, 0.4);
}

.touch3d-jump:active {
  background: rgba(68, 221, 255, 0.4);
  border-color: #44ddff;
}

/* Item button */
.touch3d-item {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(120, 100, 0, 0.3);
}

.touch3d-item:active {
  background: rgba(255, 215, 0, 0.4);
  border-color: #FFD700;
}

/* Reset button — small and subtle */
.touch3d-reset {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.2);
}

.touch3d-reset:active {
  opacity: 1;
  background: rgba(255, 100, 100, 0.3);
}

/* ── Portrait mobile: adjust 3D controls ── */
@media (max-width: 600px) and (orientation: portrait) {
  .touch3d-attack {
    width: 72px;
    height: 72px;
    font-size: 2rem;
  }

  .touch3d-jump {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
  }

  .joystick-base,
  .cam-joystick-base {
    width: 120px;
    height: 120px;
  }

  .joystick-thumb,
  .cam-joystick-thumb {
    width: 50px;
    height: 50px;
  }
}

/* ── Landscape mobile: tighter layout ── */
@media (max-height: 500px) and (orientation: landscape) {
  .touch3d-actions {
    gap: 6px;
  }

  .touch3d-attack {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .touch3d-jump {
    width: 48px;
    height: 48px;
  }

  .touch3d-item {
    width: 42px;
    height: 42px;
  }

  .touch3d-reset {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .joystick-base,
  .cam-joystick-base {
    width: 90px;
    height: 90px;
  }

  .joystick-thumb,
  .cam-joystick-thumb {
    width: 38px;
    height: 38px;
  }
}

/* ══════════════════════════════════════════════
   Assets Menu Button
   ══════════════════════════════════════════════ */

.btn-assets {
  background: transparent;
  color: #44ddff;
  border-color: #44ddff;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(68, 221, 255, 0.3);
}

.btn-assets:hover {
  background: rgba(68, 221, 255, 0.1);
  border-color: #66eeff;
  color: #66eeff;
  transform: scale(1.03);
}

/* ══════════════════════════════════════════════
   Assets Screen — list of generated assets
   ══════════════════════════════════════════════ */

.assets-screen h2 {
  font-size: 1.5rem;
  color: #44ddff;
  margin-bottom: 4px;
}

.assets-subtitle {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-bottom: 16px;
}

.assets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding: 0 4px;
}

.assets-empty {
  color: #666;
  font-size: 0.9rem;
  padding: 32px 0;
}

.asset-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: #ccc;
  font-size: 0.85rem;
  text-align: left;
}

.asset-item:hover {
  background: rgba(68, 221, 255, 0.08);
  border-color: rgba(68, 221, 255, 0.3);
}

.asset-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.asset-type-creature {
  background: rgba(255, 68, 68, 0.2);
  color: #ff6666;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.asset-type-weapon {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.asset-type-environment {
  background: rgba(68, 221, 255, 0.15);
  color: #44ddff;
  border: 1px solid rgba(68, 221, 255, 0.3);
}

.asset-word {
  font-weight: bold;
  color: #eee;
  text-transform: capitalize;
}

.asset-name {
  color: #777;
  font-size: 0.75rem;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ══════════════════════════════════════════════
   Asset Detail Screen — 2D + 3D side by side
   ══════════════════════════════════════════════ */

.asset-detail-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.asset-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 640px;
}

.asset-detail-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-back {
  padding: 6px 16px;
  font-size: 0.85rem;
  min-width: auto;
}

.btn-regenerate {
  background: transparent;
  color: #44ddff;
  border-color: #44ddff;
  font-weight: bold;
  padding: 6px 16px;
  font-size: 0.85rem;
  min-width: auto;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-regenerate:hover {
  background: rgba(68, 221, 255, 0.1);
  border-color: #66eeff;
  color: #66eeff;
  transform: scale(1.03);
}

.asset-detail-info {
  text-align: left;
}

.asset-detail-info h3 {
  font-size: 1.1rem;
  color: #eee;
  margin: 4px 0 2px;
}

.asset-description {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

.asset-viewers {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.asset-viewer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.viewer-label {
  font-size: 0.7rem;
  color: #666;
  letter-spacing: 0.15em;
  font-weight: bold;
}

.asset-viewer-panel canvas {
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a3a;
}

.viewer-hint {
  font-size: 0.65rem;
  color: #555;
  font-style: italic;
}

/* ── Responsive: smaller canvases on mobile ── */
@media (max-width: 820px) {
  .asset-viewer-panel canvas {
    width: 200px;
    height: 200px;
  }

  .assets-list {
    max-height: 220px;
  }

  .asset-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .assets-screen,
  .asset-detail-screen {
    padding: 12px;
  }

  .asset-viewer-panel canvas {
    width: 180px;
    height: 180px;
  }

  .assets-list {
    max-height: 160px;
  }

  .asset-viewers {
    gap: 10px;
  }
}
