/* Wuhan Linjian Kindergarten 3D WebGL Panorama Stylesheet */
:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg-dark: #0f172a;
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-card: rgba(30, 41, 59, 0.7);
  --border-glass: rgba(255, 255, 255, 0.12);
  --accent-green: #10b981;
  --accent-light-green: #34d399;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overscroll-behavior: none;
}

/* Canvas Container */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overscroll-behavior: none;
}

#webgl-canvas {
  width: 100%;
  height: 100%;
  display: block;
  overscroll-behavior: none;
}

/* UI Overlay HUD */
.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.hud-layer * {
  pointer-events: auto;
}

/* Persistent switch for a clean, full-canvas editing view */
.hud-visibility-toggle {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 220;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.hud-visibility-toggle:hover {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(52, 211, 153, 0.8);
  transform: translateY(-2px);
}

.hud-visibility-toggle:focus-visible {
  outline: 2px solid var(--accent-light-green);
  outline-offset: 3px;
}

.hud-visibility-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.hud-layer,
#hotspot-overlay,
.modal-backdrop {
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

body.hud-hidden .hud-layer,
body.hud-hidden #hotspot-overlay,
body.hud-hidden .modal-backdrop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.hud-hidden .hud-layer *,
body.hud-hidden #hotspot-overlay * {
  pointer-events: none;
}

body.hud-hidden .hud-visibility-toggle {
  background: rgba(5, 150, 105, 0.94);
  border-color: rgba(167, 243, 208, 0.85);
}

/* Header Navbar */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  box-shadow: var(--shadow-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-light-green);
  border-radius: 20px;
  font-weight: 600;
}

/* Navigation Controls Bar */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.hud-btn.active {
  background: var(--accent-green);
  color: #042f2e;
  border-color: var(--accent-light-green);
  box-shadow: var(--shadow-glow);
}

/* Floating Center Controls Bar (Camera Modes) */
.camera-mode-bar {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  padding: 6px;
  border-radius: 30px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-tab:hover {
  color: var(--text-main);
}

.mode-tab.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1);
}

/* Sidebar Info & Controls Panel */
.main-content-layout {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: calc(100% - 80px);
  pointer-events: none;
}

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 320px;
  pointer-events: auto;
}

.left-panel {
  position: relative;
  transition: width 0.22s ease;
}

.left-panel > .panel-card {
  width: 320px;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.left-panel-expand-btn,
.left-panel-collapse-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text-main);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.left-panel-expand-btn {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 25;
  display: none;
  background: rgba(5, 150, 105, 0.94);
  border-color: rgba(167, 243, 208, 0.85);
}

.left-panel-expand-btn:hover,
.left-panel-collapse-btn:hover {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(52, 211, 153, 0.8);
}

.left-panel-expand-btn:focus-visible,
.left-panel-collapse-btn:focus-visible {
  outline: 2px solid var(--accent-light-green);
  outline-offset: 3px;
}

.left-panel.is-collapsed {
  width: 0;
}

.left-panel.is-collapsed > .panel-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.left-panel.is-collapsed .left-panel-expand-btn {
  display: grid;
}

.panel-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title span {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Zone Select Buttons */
.zone-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.zone-item:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateX(4px);
}

.zone-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zone-icon {
  font-size: 1.2rem;
}

.zone-name {
  font-size: 0.875rem;
  font-weight: 600;
}

.zone-sub {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Environment Light Controls */
.env-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.env-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.env-btn:hover {
  color: var(--text-main);
  background: rgba(51, 65, 85, 0.8);
}

.env-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.4));
  border-color: var(--accent-green);
  color: var(--text-main);
}

.env-icon {
  font-size: 1.25rem;
}

/* Right Side Douyin / Reference Media Panel */
.douyin-media-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.douyin-media-container::-webkit-scrollbar {
  width: 4px;
}

.douyin-media-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.media-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.media-card:hover {
  border-color: var(--accent-amber);
  background: rgba(30, 41, 59, 0.8);
}

.media-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  position: relative;
  flex-shrink: 0;
  background-color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.play-badge {
  position: absolute;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
}

.media-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.media-title {
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1.2;
}

.media-meta {
  font-size: 0.7rem;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 3D Hotspot Canvas Markers - Minimalist & Non-Intrusive */
.hotspot-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  background: rgba(16, 185, 129, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  transform: translate(-50%, -50%);
  transition: transform 0.25s, background-color 0.25s;
  z-index: 20;
  pointer-events: auto;
}

.hotspot-marker:hover {
  transform: translate(-50%, -50%) scale(1.3);
  background: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.8);
  z-index: 30;
}

/* Hide text label by default, show ONLY on hover */
.hotspot-label {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  color: white;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hotspot-marker:hover .hotspot-label {
  display: block;
}

/* Hide detailed cards in 3D canvas by default */
.hotspot-card {
  display: none;
}

@keyframes pulse-hotspot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Detail Modal Box */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 540px;
  max-width: 90%;
  background: #1e293b;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light-green);
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: white;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-img-placeholder {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  background-color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 1px solid var(--border-glass);
}

.modal-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.modal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-light-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Audio & Settings floating toggle */
.bottom-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-glass);
  align-self: center;
}

.status-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

/* Immersive child exploration mode */
.game-mode-hud {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  pointer-events: none;
}

body.game-mode-active .game-mode-hud {
  display: block;
}

body.game-mode-active,
body.game-mode-active #canvas-container,
body.game-mode-active #webgl-canvas,
body.game-mode-active .game-mode-hud {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

body.game-mode-active .hud-layer,
body.game-mode-active #hotspot-overlay,
body.game-mode-active .hud-visibility-toggle,
body.game-mode-active .modal-backdrop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.game-avatar-status {
  position: absolute;
  top: 18px;
  left: 18px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: white;
  backdrop-filter: blur(12px);
}

.game-avatar-face,
.game-drink-indicator {
  font-size: 1.35rem;
}

.game-score,
.game-progress,
.game-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
  font-size: 0.82rem;
}

.multiplayer-join-panel {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(8, 15, 24, 0.62);
  backdrop-filter: blur(8px);
}

.multiplayer-join-panel.is-open {
  display: grid;
}

.multiplayer-join-dialog {
  width: min(390px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96);
  color: white;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.multiplayer-join-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.multiplayer-room-count {
  color: #a7f3d0;
  font-size: 0.86rem;
}

.multiplayer-join-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.multiplayer-join-form input,
.multiplayer-join-form button,
.multiplayer-cancel-btn {
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  letter-spacing: 0;
}

.multiplayer-join-form input {
  min-width: 0;
  padding: 0 12px;
  background: rgba(30, 41, 59, 0.96);
  color: white;
  user-select: text;
}

.multiplayer-join-form button {
  padding: 0 16px;
  background: #059669;
  color: white;
  cursor: pointer;
}

.multiplayer-join-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.multiplayer-status {
  min-height: 22px;
  margin-top: 10px;
  color: #fbbf24;
  font-size: 0.84rem;
}

.multiplayer-cancel-btn {
  width: 100%;
  margin-top: 8px;
  background: rgba(51, 65, 85, 0.9);
  color: white;
  cursor: pointer;
}

.game-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.65);
}

.mobile-joystick,
.mobile-look-zone,
.mobile-jump-btn {
  display: none;
}

.game-ranking-btn,
.game-view-btn,
.game-exit-btn {
  position: absolute;
  top: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  color: white;
  cursor: pointer;
  pointer-events: auto;
  font-size: 1.25rem;
}

.game-ranking-btn {
  right: 122px;
}

.game-view-btn {
  right: 70px;
}

.game-exit-btn {
  right: 18px;
  font-size: 1.65rem;
}

.english-checkpoint-panel,
.game-ranking-panel {
  position: fixed;
  z-index: 240;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  color: white;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

.english-checkpoint-panel.is-open,
.game-ranking-panel.is-open {
  display: block;
}

.english-checkpoint-panel {
  left: 50%;
  bottom: 24px;
  width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 18px;
}

.checkpoint-place {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-bottom: 5px;
}

.checkpoint-word {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.05;
  color: #fbbf24;
}

.checkpoint-phonetic,
.checkpoint-translation {
  display: inline-block;
  margin: 5px 8px 0 0;
  color: #a7f3d0;
  font-size: 0.9rem;
}

.checkpoint-sentence {
  margin-top: 9px;
  color: #f8fafc;
  font-size: 1rem;
}

.checkpoint-actions {
  display: grid;
  grid-template-columns: 42px 42px minmax(120px, 1fr) 42px;
  gap: 8px;
  margin-top: 14px;
}

.checkpoint-icon-btn,
.checkpoint-submit-btn,
.checkpoint-close-btn,
.ranking-header button,
.ranking-profile-controls button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(51, 65, 85, 0.92);
  color: white;
  cursor: pointer;
}

.checkpoint-icon-btn,
.checkpoint-submit-btn {
  width: 42px;
  height: 42px;
  font-size: 1.05rem;
}

.checkpoint-icon-btn.is-listening {
  background: #b91c1c;
  border-color: #fca5a5;
}

.checkpoint-spelling-input,
.ranking-profile-controls input,
.ranking-profile-controls select {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.94);
  color: white;
  padding: 0 12px;
  user-select: text;
  letter-spacing: 0;
}

.checkpoint-feedback {
  min-height: 22px;
  margin-top: 10px;
  color: #fbbf24;
  font-size: 0.82rem;
}

.checkpoint-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  font-size: 1.3rem;
}

.game-ranking-panel {
  top: 76px;
  right: 18px;
  width: min(380px, calc(100vw - 36px));
  padding: 14px;
}

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ranking-header button {
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.ranking-row {
  display: grid;
  grid-template-columns: 30px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.72);
}

.ranking-row.is-current {
  border-color: rgba(52, 211, 153, 0.85);
}

.ranking-row.is-waiting {
  opacity: 0.72;
}

.ranking-medal,
.ranking-avatar {
  text-align: center;
  font-size: 1.2rem;
}

.ranking-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.ranking-points {
  color: #fbbf24;
  font-size: 0.8rem;
}

.ranking-profile-controls {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) 42px 42px;
  gap: 7px;
  margin-top: 12px;
}

.ranking-profile-controls button {
  height: 42px;
  font-size: 1.25rem;
}

@media (max-width: 900px) {
  .camera-mode-bar {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    justify-content: center;
  }

  .mode-tab {
    flex: 0 0 auto;
    padding: 8px 12px;
  }

  .game-avatar-status {
    max-width: calc(100vw - 184px);
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .camera-mode-bar {
    justify-content: flex-start;
  }

  .multiplayer-join-form {
    grid-template-columns: 1fr;
  }

  .game-avatar-status {
    max-width: calc(100vw - 190px);
    gap: 6px;
  }
}

@media (hover: none), (pointer: coarse), (max-width: 600px) {
  .mobile-joystick,
  .mobile-look-zone,
  .mobile-jump-btn {
    display: block;
  }

  .mobile-joystick {
    position: absolute;
    left: max(24px, env(safe-area-inset-left));
    bottom: max(24px, env(safe-area-inset-bottom));
    width: 132px;
    height: 132px;
    pointer-events: auto;
    touch-action: none;
    z-index: 3;
  }

  .mobile-joystick-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.3);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.08);
  }

  .mobile-joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.72);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  }

  .mobile-look-zone {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 58%;
    height: 72%;
    pointer-events: auto;
    touch-action: none;
    z-index: 2;
  }

  .mobile-look-icon {
    position: absolute;
    right: 42%;
    bottom: 38%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.2);
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.05rem;
  }

  .mobile-jump-btn {
    position: absolute;
    right: max(28px, env(safe-area-inset-right));
    bottom: max(30px, env(safe-area-inset-bottom));
    z-index: 4;
    width: 66px;
    height: 66px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.78);
    color: white;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    font-size: 2rem;
    pointer-events: auto;
    touch-action: manipulation;
  }

  body.game-overlay-open .mobile-joystick,
  body.game-overlay-open .mobile-look-zone,
  body.game-overlay-open .mobile-jump-btn {
    opacity: 0.18;
    pointer-events: none;
  }
}
