/* ═══════════════════════════════════════════════════════════
   TRU SKOOL MALL — UI Layer
   Culture. Commerce. Code.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --gold: #c9a84c;
  --gold-dim: #8a7030;
  --platinum: #d4c8b8;
  --rose: #c94060;
  --faded-pink: #FFADED;
  --faded-dark: #420420;
  --sage: #60c890;
  --purple: #a060e0;
  --amber: #c09060;
  --bg-dark: #0a0a0f;
  --bg-panel: rgba(10, 10, 18, 0.92);
  --bg-card: rgba(20, 20, 30, 0.95);
  --text: #e8e0f0;
  --text-dim: #8880a0;
  --border: rgba(200, 180, 230, 0.1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  overflow: hidden;
  background: var(--bg-dark);
}

.hidden { display: none !important; }

/* ─── MODE SELECTOR ─── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(30,20,50,0.95), rgba(5,5,10,0.98));
  backdrop-filter: blur(20px);
}

.mode-card {
  text-align: center;
  max-width: 480px;
  padding: 60px 40px;
}

.mode-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.3em;
  color: var(--platinum);
  text-transform: uppercase;
}

.logo-tag {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.mode-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 24px;
  min-width: 130px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(201, 168, 76, 0.15);
}

.mode-icon { font-size: 32px; }
.mode-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
.mode-desc { font-size: 11px; color: var(--text-dim); }

/* ─── HUD ─── */
#hud {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

#hud > * { pointer-events: auto; }

#hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(10,10,18,0.8), transparent);
}

#location-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

#hud-controls { display: flex; gap: 8px; }

.hud-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hud-btn:hover, .hud-btn.active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.15);
}

/* ─── CHAT PANEL ─── */
#chat-panel {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 360px;
  max-height: 480px;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  transition: opacity 0.3s, transform 0.3s;
}

#chat-panel:not(.chat-open) {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

#chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 18, 30, 0.6);
}

.chat-persona { display: flex; align-items: center; gap: 10px; }

.persona-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
}

.persona-avatar.laviche {
  background: linear-gradient(135deg, var(--gold), #e8d8a8);
}

.persona-avatar.ginger {
  background: linear-gradient(135deg, #c04020, #e08050);
}

.persona-avatar.ahnika {
  background: linear-gradient(135deg, var(--faded-pink), var(--faded-dark));
}

.persona-info { display: flex; flex-direction: column; }
.persona-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.persona-role { font-size: 11px; color: var(--text-dim); }

.chat-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 320px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.msg-avatar.laviche { background: linear-gradient(135deg, var(--gold), #e8d8a8); }
.msg-avatar.ginger { background: linear-gradient(135deg, #c04020, #e08050); }
.msg-avatar.ahnika { background: linear-gradient(135deg, var(--faded-pink), var(--faded-dark)); }

.msg-body {
  padding: 10px 14px;
  border-radius: 12px 12px 12px 2px;
  background: rgba(40, 36, 56, 0.6);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  max-width: 260px;
}

.msg.user .msg-body {
  background: rgba(201, 168, 76, 0.15);
  border-radius: 12px 12px 2px 12px;
  color: var(--platinum);
}

#chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(15, 12, 25, 0.5);
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(30, 28, 44, 0.6);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}

#chat-input:focus { border-color: var(--gold); }

#chat-input::placeholder { color: var(--text-dim); }

#chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: var(--bg-dark);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

#chat-send:hover { background: #ddb850; }

/* ─── TELEPORT MENU ─── */
#teleport-menu {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 240px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.tp-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tp-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(30, 28, 44, 0.4);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.tp-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  transform: translateX(4px);
}

.tp-close {
  margin-top: 8px;
  padding: 8px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

/* ─── VOICE STATUS ─── */
#voice-status {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: 24px;
}

.voice-wave {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 20px;
}

.voice-wave span {
  width: 3px;
  height: 8px;
  background: var(--gold);
  border-radius: 2px;
  animation: voiceWave 1s ease-in-out infinite;
}

.voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes voiceWave {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

#voice-text { font-size: 12px; color: var(--text-dim); }

/* ─── MOVEMENT HINT ─── */
#move-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  background: rgba(10, 10, 18, 0.7);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* ─── MINIMAP ─── */
#minimap {
  position: absolute;
  top: 70px;
  left: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

#minimap-canvas { display: block; border-radius: var(--radius-sm); }

/* ─── MOBILE RESPONSIVENESS ─── */
@media (max-width: 600px) {
  #chat-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 60px;
    max-height: 380px;
  }

  .mode-buttons { flex-direction: column; align-items: center; }
  .mode-btn { width: 200px; min-width: unset; padding: 20px; }
  .mode-card { padding: 40px 20px; }
  .logo-mark { font-size: 36px; }

  #teleport-menu { width: calc(100vw - 24px); left: 12px; }
  #move-hint { font-size: 10px; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* ═══════════════════════════════════════════════════
   WELCOME TOOLTIP
   ═══════════════════════════════════════════════════ */

#welcome-tooltip {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  animation: wt-slide-up 0.5s ease-out, wt-fade-out 0.5s ease-in 7.5s;
}

.wt-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  max-width: 480px;
}

.wt-icon { font-size: 24px; flex-shrink: 0; }

.wt-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wt-text strong {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 14px;
}

.wt-text span {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.wt-text b { color: var(--text); }

.wt-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

.wt-close:hover { color: var(--text); }

@keyframes wt-slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes wt-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ═══════════════════════════════════════════════════
   CONTROLS HELP OVERLAY
   ═══════════════════════════════════════════════════ */

#help-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.help-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  width: calc(100vw - 32px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
}

.help-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}

.help-close:hover { color: var(--text); }

.help-title {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 22px;
  margin-bottom: 20px;
}

.help-section {
  margin-bottom: 20px;
}

.help-section h3 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.help-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: center;
}

.help-key {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

.help-key kbd {
  display: inline-block;
  background: rgba(200,180,230,0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  margin-right: 2px;
}

.help-desc {
  font-size: 13px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════
   STORE DIRECTORY PANEL
   ═══════════════════════════════════════════════════ */

#directory-panel {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dir-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.dir-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: calc(100vw - 32px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
}

.dir-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}

.dir-close:hover { color: var(--text); }

.dir-title {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 22px;
  margin-bottom: 4px;
}

.dir-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.dir-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dir-store {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(200,180,230,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.dir-store:hover {
  background: rgba(200,180,230,0.08);
  border-color: var(--sc, var(--gold));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.dir-icon {
  font-size: 28px;
  line-height: 1;
}

.dir-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--sc, var(--text));
}

.dir-tag {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

@media (max-width: 480px) {
  .dir-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dir-store { padding: 12px 8px; }
  .dir-icon { font-size: 22px; }
  .dir-name { font-size: 11px; }
  .help-card, .dir-card { padding: 20px; }
  .wt-inner { max-width: calc(100vw - 32px); }
}
