:root {
  --accent:     #FF7B54;
  --accent-dim: rgba(255, 123, 84, 0.15);
  --accent-mid: rgba(255, 123, 84, 0.4);
  --teak:       #3D2314;
  --gold:       #C8A96E;
  --black:      #05080A;
  --panel-bg:   rgba(10, 12, 15, 0.85);
  --text:       #E8E0D4;
  --muted:      rgba(232, 224, 212, 0.55);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono:  'Space Mono', monospace;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

#canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: block; cursor: crosshair;
}

.hidden { display: none !important; }

/* TELEPORTATION FADE OVERLAY */
#fade-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: #000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.8s ease-in-out;
}
#fade-overlay.active { opacity: 1; pointer-events: all; }

#mobile-ui {
position: fixed;
inset: 0;
z-index: 999;
pointer-events: none;
}

#joystick {
position: absolute;
bottom: 30px;
left: 30px;
width: 120px;
height: 120px;
pointer-events: all;
}

#joy-base {
width: 100%;
height: 100%;
border-radius: 50%;
background: rgba(255,255,255,0.08);
border: 1px solid rgba(255,255,255,0.2);
}

#joy-stick {
position: absolute;
width: 50px;
height: 50px;
left: 35px;
top: 35px;
border-radius: 50%;
background: rgba(255,255,255,0.3);
}

#btn-jump, #btn-action {
position: absolute;
bottom: 40px;
right: 30px;
width: 70px;
height: 70px;
border-radius: 50%;
border: none;
background: rgba(255,123,84,0.8);
color: black;
font-size: 12px;
pointer-events: all;
}

#btn-action {
bottom: 120px;
}

/* LOADING SCREEN */
#loading-screen { position: fixed; inset: 0; z-index: 1000; background: var(--black); display: flex; align-items: center; justify-content: center; flex-direction: column; }
.loading-content { display: flex; flex-direction: column; align-items: center; gap: 16px; animation: fadeIn 1s var(--ease-out) both; }
.logo-mark svg { width: 72px; height: 72px; animation: rotateSlow 12s linear infinite; filter: drop-shadow(0 0 12px rgba(255,123,84,0.4)); }
.studio-name { font-size: 10px; letter-spacing: 0.4em; color: var(--accent); opacity: 0.7; margin-top: 8px; }
.world-name { font-family: var(--font-serif); font-size: 42px; font-weight: 300; letter-spacing: 0.1em; color: var(--text); }
.loading-bar-track { width: 240px; height: 1px; background: rgba(255,255,255,0.08); margin-top: 24px; position: relative; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s var(--ease-out); box-shadow: 0 0 8px var(--accent); }
.loading-status { font-size: 9px; letter-spacing: 0.25em; color: var(--muted); margin-top: 10px; min-height: 14px; }

/* ENTRY PROMPT */
#entry-prompt { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: rgba(5,8,10,0.4); backdrop-filter: blur(8px); animation: fadeIn 0.6s var(--ease-out); }
.ep-content { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.ep-tagline { font-family: var(--font-serif); font-size: 28px; font-weight: 300; color: var(--text); font-style: italic; letter-spacing: 0.05em; }
#btn-enter { background: transparent; border: 1px solid var(--accent); color: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; padding: 14px 40px; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; }
#btn-enter::before { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease-out); z-index: -1; }
#btn-enter:hover { color: var(--black); }
#btn-enter:hover::before { transform: scaleX(1); }
.ep-note { font-size: 9px; letter-spacing: 0.2em; color: var(--muted); }

/* HUD */
#hud { position: fixed; inset: 0; z-index: 500; pointer-events: none; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; }
.hud-logo { display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: 0.3em; opacity: 0.85; }
.hud-zone { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 0.35em; color: var(--accent); }
.zone-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s ease-in-out infinite; }
.hud-controls-hint { display: flex; gap: 20px; font-size: 9px; letter-spacing: 0.2em; color: var(--muted); }

/* CROSSHAIR */
.crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; transition: all 0.2s; }
.ch-h { position: absolute; top: 50%; left: -12px; width: 24px; height: 1px; background: rgba(255,123,84,0.5); transform: translateY(-50%); transition: all 0.2s; }
.ch-v { position: absolute; left: 50%; top: -12px; height: 24px; width: 1px; background: rgba(255,123,84,0.5); transform: translateX(-50%); transition: all 0.2s; }
.ch-dot { position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 6px var(--accent); transition: all 0.2s; }
.crosshair.active .ch-h, .crosshair.active .ch-v { background: var(--accent); width: 32px; height: 2px; }
.crosshair.active .ch-v { width: 2px; height: 32px; }
.crosshair.active .ch-dot { width: 8px; height: 8px; background: #fff; box-shadow: 0 0 10px #fff; }

.interact-prompt { position: absolute; bottom: 30%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--panel-bg); border: 1px solid var(--accent-mid); padding: 10px 20px; font-size: 10px; letter-spacing: 0.25em; color: var(--accent); animation: floatUp 2s ease-in-out infinite; backdrop-filter: blur(5px); }
.ip-icon { font-size: 8px; animation: pulse 1.5s ease-in-out infinite; }

/* INFO PANEL */
.info-panel { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); width: 360px; background: var(--panel-bg); border: 1px solid rgba(255,123,84,0.2); padding: 40px; pointer-events: all; animation: slideInRight 0.5s var(--ease-out); backdrop-filter: blur(24px); box-shadow: -10px 10px 40px rgba(0,0,0,0.5); }
.info-panel::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: linear-gradient(to bottom, var(--accent), transparent); }
.ip-close { position: absolute; top: 16px; right: 16px; font-size: 12px; color: var(--muted); cursor: pointer; transition: color 0.2s; }
.ip-close:hover { color: var(--accent); }
.ip-category { font-size: 9px; letter-spacing: 0.35em; color: var(--accent); margin-bottom: 12px; }
.ip-title { font-family: var(--font-serif); font-size: 36px; font-weight: 400; line-height: 1.1; }
.ip-divider { width: 60px; height: 1px; background: var(--gold); margin: 20px 0; }
.ip-description { font-family: var(--font-serif); font-size: 16px; font-weight: 300; line-height: 1.6; color: var(--muted); margin-bottom: 24px; }
.ip-specs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.spec-item { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.2em; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.spec-item span { color: var(--muted); }

/* BUTTONS */
.ip-actions { display: flex; flex-direction: column; gap: 10px; }
.ip-cta { width: 100%; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.25em; padding: 16px; cursor: pointer; transition: all 0.3s; }
.ip-cta.primary { background: var(--accent); border: none; color: var(--black); }
.ip-cta.primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,123,84,0.3); }
.ip-cta.secondary { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.ip-cta.secondary:hover { background: rgba(255,123,84,0.1); color: #fff; }

.hud-bottom { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; pointer-events: all; background: linear-gradient(to top, rgba(5,8,10,0.9) 0%, transparent 100%); }
.zone-nav, .time-toggle { display: flex; gap: 6px; }
.zone-btn, .time-btn { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; padding: 10px 18px; cursor: pointer; transition: all 0.25s; backdrop-filter: blur(4px); }
.zone-btn:hover, .time-btn:hover { border-color: var(--accent-mid); color: var(--text); }
.zone-btn.active, .time-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* INTERIOR HUD */
#interior-hud { position: fixed; inset: 0; z-index: 600; pointer-events: none; display: flex; flex-direction: column; align-items: center; padding-top: 40px; }
#btn-leave-villa { pointer-events: all; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 12px 24px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; cursor: pointer; backdrop-filter: blur(8px); transition: all 0.3s; }
#btn-leave-villa:hover { background: var(--accent); border-color: var(--accent); color: var(--black); }
.interior-label { margin-top: 12px; font-size: 9px; letter-spacing: 0.3em; color: var(--muted); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotateSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes floatUp { 0%, 100% { transform: translateX(-50%) translateY(0px); } 50% { transform: translateX(-50%) translateY(-6px); } }
@keyframes slideInRight { from { opacity: 0; transform: translateY(-50%) translateX(30px); } to { opacity: 1; transform: translateY(-50%) translateX(0); } }