/* AssetShop Realm Engine v1 - shared visual language CSS
   PASS 25. Loaded by every realm. */

:root {
  --asx-c: #00e5ff;
  --asx-m: #ff2dd5;
  --asx-g: #ffc846;
  --asx-mint: #7cffc4;
  --asx-rose: #ff8fb1;
  --asx-violet: #a560ff;
  --asx-bg-0: #050613;
  --asx-bg-1: #0c0f24;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%; overflow: hidden;
  background: linear-gradient(180deg, var(--asx-bg-0) 0%, var(--asx-bg-1) 100%);
  color: #e6f5ff;
  font-family: 'Rajdhani', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.as-realm-canvas {
  position: fixed; inset: 0; z-index: 1;
  width: 100vw; height: 100vh;
  display: block;
}

/* ---- top HUD ---- */
.as-realm-hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(5,6,19,0.85), rgba(5,6,19,0.4) 60%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}
.as-realm-hud-glyph {
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 6px;
  background: linear-gradient(135deg, var(--asx-c), var(--asx-m), var(--asx-g));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
}
.as-realm-hud-name {
  font-family: 'Cinzel', serif;
  font-size: 16px; letter-spacing: 0.06em;
  color: #fff; text-transform: capitalize;
}
.as-realm-hud-dot {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}
.as-realm-hud-spacer { flex: 1; }
.as-realm-hud-btn {
  padding: 7px 13px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.30);
  color: var(--asx-c);
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; cursor: pointer;
  border-radius: 5px;
  transition: all 0.18s ease;
}
.as-realm-hud-btn:hover {
  background: rgba(0,229,255,0.18);
  border-color: rgba(0,229,255,0.55);
  color: #7ad9ff;
}
.as-realm-hud-btn-primary {
  background: linear-gradient(135deg, rgba(255,200,70,0.18), rgba(255,45,213,0.10));
  border: 1px solid rgba(255,200,70,0.55);
  color: var(--asx-g);
}
.as-realm-hud-btn-primary:hover {
  background: linear-gradient(135deg, rgba(255,200,70,0.30), rgba(255,45,213,0.16));
  color: #fff;
}

/* ---- palette dots for HUD ---- */
.as-palette-gold     { background: var(--asx-g); color: var(--asx-g); }
.as-palette-cyan     { background: var(--asx-c); color: var(--asx-c); }
.as-palette-magenta  { background: var(--asx-m); color: var(--asx-m); }
.as-palette-mint     { background: var(--asx-mint); color: var(--asx-mint); }
.as-palette-rose     { background: var(--asx-rose); color: var(--asx-rose); }
.as-palette-violet   { background: var(--asx-violet); color: var(--asx-violet); }
.as-palette-amber    { background: #ffa624; color: #ffa624; }
.as-palette-crimson  { background: #ff4d4d; color: #ff4d4d; }
.as-palette-emerald  { background: #34d995; color: #34d995; }
.as-palette-azure    { background: #4ca6ff; color: #4ca6ff; }
.as-palette-silver   { background: #d6dbe6; color: #d6dbe6; }
.as-palette-obsidian { background: #5a5a72; color: #5a5a72; }

/* ---- bottom-right build pill ---- */
.as-realm-pill {
  position: fixed; right: 10px; bottom: 10px; z-index: 99999;
  padding: 4px 10px; border-radius: 10px;
  background: rgba(0,0,0,0.55);
  color: #7ad9ff;
  font: 600 9px/1.3 ui-monospace, monospace;
  letter-spacing: 0.14em;
  border: 1px solid rgba(0,229,255,0.35);
  pointer-events: none; user-select: none;
  opacity: 0.7;
}

/* ---- mobile joystick ---- */
.as-realm-stick {
  position: fixed; left: 20px; bottom: 24px; z-index: 130;
  width: 124px; height: 124px;
  touch-action: none; user-select: none; pointer-events: auto;
}
.as-realm-stick::before {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,200,70,0.12), rgba(20,14,6,0.6));
  border: 2px solid rgba(255,200,70,0.7);
  box-shadow: 0 0 18px rgba(255,200,70,0.26), inset 0 0 22px rgba(255,200,70,0.08);
}
.as-realm-stick::after {
  content: 'MOVE';
  position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%);
  font-family: Rajdhani, sans-serif; font-size: 9px; letter-spacing: .24em;
  color: rgba(255,200,70,0.72); pointer-events: none;
}
.as-realm-stick-knob {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin-left: -26px; margin-top: -26px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,224,150,0.96), rgba(220,160,40,0.8));
  border: 1.5px solid rgba(255,238,190,0.92);
  box-shadow: 0 2px 10px rgba(0,0,0,0.45), 0 0 14px rgba(255,200,70,0.5);
  transition: transform 80ms ease-out;
}
@media (min-width: 900px) {
  .as-realm-stick { display: none; }
}

/* ---- portal proximity hint ---- */
.as-realm-portal-hint {
  position: fixed; left: 50%; bottom: 110px; z-index: 80;
  transform: translateX(-50%);
  padding: 10px 22px;
  background: rgba(5,6,19,0.85);
  border: 1px solid rgba(255,200,70,0.55);
  border-radius: 24px;
  font-family: 'Cinzel', serif;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--asx-g);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ---- realm-map overlay ---- */
.as-realm-map-overlay {
  position: fixed; inset: 0; z-index: 99500;
  background: radial-gradient(ellipse at center, rgba(10,16,28,0.94), rgba(2,4,12,0.98));
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.as-realm-map-card {
  max-width: 720px; width: 100%;
  padding: 32px 28px;
  background: linear-gradient(180deg, rgba(20,28,48,0.94), rgba(8,12,24,0.98));
  border: 1px solid rgba(0,229,255,0.34);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(0,229,255,0.10);
}
.as-realm-map-eyebrow {
  font-family: 'Cinzel', serif; font-size: 11px;
  letter-spacing: 0.36em; color: var(--asx-g);
  text-transform: uppercase; margin-bottom: 4px;
}
.as-realm-map-title {
  font-family: 'Cinzel', serif; font-size: 24px;
  margin: 0 0 22px;
  background: linear-gradient(135deg, #fff, #c8e7ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.as-realm-map-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 22px;
}
.as-realm-map-tile {
  padding: 14px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer; text-align: left;
  transition: all 0.18s ease;
  position: relative;
}
.as-realm-map-tile::after {
  content: ''; position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.as-realm-map-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(0,229,255,0.50);
  box-shadow: 0 8px 24px rgba(0,229,255,0.15);
}
.as-realm-map-tile-name {
  font-family: 'Cinzel', serif; font-size: 14px;
  font-weight: 600; color: #fff;
  margin-bottom: 4px; letter-spacing: 0.04em;
}
.as-realm-map-tile-desc {
  font-size: 11px; color: rgba(255,255,255,0.55);
}
.as-realm-map-close {
  padding: 10px 22px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; cursor: pointer;
  border-radius: 6px;
  display: block; margin: 0 auto;
}
.as-realm-map-close:hover {
  border-color: rgba(0,229,255,0.55);
  color: var(--asx-c);
}

/* ---- boot splash ---- */
.as-realm-boot-splash {
  position: fixed; inset: 0; z-index: 99700;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 45, 213, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at center, rgba(20, 12, 32, 0.97) 0%, rgba(2, 4, 12, 1) 100%);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  transition: opacity 0.6s ease;
  overflow: hidden;
}
.as-realm-boot-splash::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.8), transparent 50%),
    radial-gradient(1px 1px at 26% 72%, rgba(255, 200, 70, 0.7), transparent 50%),
    radial-gradient(2px 2px at 45% 32%, rgba(0, 229, 255, 0.6), transparent 50%),
    radial-gradient(1px 1px at 64% 58%, rgba(255, 255, 255, 0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 78% 28%, rgba(255, 45, 213, 0.7), transparent 50%),
    radial-gradient(1px 1px at 88% 84%, rgba(255, 255, 255, 0.6), transparent 50%),
    radial-gradient(1px 1px at 18% 92%, rgba(255, 200, 70, 0.5), transparent 50%);
  background-size: 100% 100%;
  animation: as-stars-drift 18s linear infinite;
  pointer-events: none;
}
@keyframes as-stars-drift {
  from { transform: translateY(0) scale(1); opacity: 0.6; }
  50%  { opacity: 1; }
  to   { transform: translateY(-12px) scale(1.04); opacity: 0.6; }
}
.as-realm-boot-splash::after {
  content: ""; position: absolute; inset: -50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(0, 229, 255, 0.04) 60deg,
    transparent 120deg,
    rgba(255, 45, 213, 0.04) 180deg,
    transparent 240deg,
    rgba(255, 200, 70, 0.04) 300deg,
    transparent 360deg
  );
  animation: as-conic-sweep 24s linear infinite;
  pointer-events: none;
}
@keyframes as-conic-sweep {
  to { transform: rotate(360deg); }
}
.as-realm-boot-splash-glyph {
  font-size: 88px; margin-bottom: 18px; line-height: 1;
  background: linear-gradient(135deg, var(--asx-c) 0%, var(--asx-m) 50%, var(--asx-g) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter:
    drop-shadow(0 0 28px rgba(0, 229, 255, 0.5))
    drop-shadow(0 0 12px rgba(255, 45, 213, 0.3));
  position: relative; z-index: 2;
  animation: as-glyph-pulse 2.4s ease-in-out infinite;
}
@keyframes as-glyph-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 28px rgba(0, 229, 255, 0.5)) drop-shadow(0 0 12px rgba(255, 45, 213, 0.3)); }
  50%      { transform: scale(1.08) rotate(2deg); filter: drop-shadow(0 0 40px rgba(0, 229, 255, 0.75)) drop-shadow(0 0 20px rgba(255, 45, 213, 0.5)); }
}
.as-realm-boot-splash-title {
  font-family: 'Cinzel', 'Times New Roman', serif; font-size: 26px; font-weight: 700;
  letter-spacing: 0.05em; margin: 0 0 8px;
  color: #fff;
  text-shadow:
    0 0 12px rgba(0, 229, 255, 0.45),
    0 0 24px rgba(0, 229, 255, 0.2);
  position: relative; z-index: 2;
  animation: as-title-glow 3s ease-in-out infinite;
}
@keyframes as-title-glow {
  0%, 100% { text-shadow: 0 0 12px rgba(0, 229, 255, 0.45), 0 0 24px rgba(0, 229, 255, 0.2); }
  50%      { text-shadow: 0 0 18px rgba(0, 229, 255, 0.65), 0 0 36px rgba(0, 229, 255, 0.35); }
}
.as-realm-boot-splash-sub {
  font-family: 'Rajdhani', system-ui, sans-serif;
  color: rgba(255, 200, 70, 0.9); font-size: 11px;
  letter-spacing: 0.28em; text-transform: uppercase;
  margin-bottom: 22px;
  position: relative; z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .as-realm-boot-splash::before,
  .as-realm-boot-splash::after,
  .as-realm-boot-splash-glyph,
  .as-realm-boot-splash-title { animation: none; }
}
.as-realm-boot-spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(0,229,255,0.2);
  border-top-color: var(--asx-c);
  border-radius: 50%;
  animation: as-realm-spin 0.9s linear infinite;
}
@keyframes as-realm-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .as-realm-boot-spinner { animation-duration: 2.5s; }
  .as-realm-hud-btn { transition: none; }
  .as-realm-map-tile { transition: none; }
}

/* PASS 26 additions */
.as-realm-signage {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
}
.as-realm-sign {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  background: rgba(5, 6, 19, 0.78);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: currentColor;
  box-shadow: 0 0 14px currentColor;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.15s ease;
}


/* Pass 50: camera mode toggle */
#as-cam-toggle {
  position: fixed;
  left: 18px;
  bottom: 300px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(5, 6, 19, 0.78);
  border: 1.5px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#as-cam-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.55);
  border-color: rgba(0, 229, 255, 0.85);
}
#as-cam-toggle:active { transform: scale(0.96); }
#as-cam-toggle .as-cam-icon { font-size: 18px; line-height: 1; color: #00e5ff; }
#as-cam-toggle .as-cam-label { font-size: 9px; letter-spacing: 0.10em; opacity: 0.85; }


/* Pass 51: minimap / compass widget */
#as-realm-minimap {
  position: fixed;
  top: 88px;
  left: 18px;
  z-index: 60;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.35));
  opacity: 0.92;
  transition: opacity 0.2s ease;
}
#as-realm-minimap:hover { opacity: 1; }
