@import url('https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&display=swap');

/* ─── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0f14;
  --surface: #161b25;
  --surface2: #1e2636;
  --border: #2e3a52;
  --accent: #c8a04a;
  --text: #d4c8a8;
  --text-muted: #7a8499;
  --danger: #c0392b;
  --modal-bg: rgba(10, 13, 20, 0.92);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Georgia', serif;
  overflow: hidden;
}

/* PT Serif imported above — used for modal rumor text */

/* ─── Header ───────────────────────────────────────────────────── */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.4rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 52px;
  flex-shrink: 0;
}

.site-tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-style: normal;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
}

.site-header h1 {
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

#music-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
#music-btn:hover { border-color: var(--accent); background: var(--surface2); }

/* ─── Lang switcher ────────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  gap: 0.2rem;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'Segoe UI', Arial, sans-serif;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color 0.15s, border-color 0.15s;
}

.lang-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: bold;
}

#music-hint {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
}

#volume-slider {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

/* ─── Main / map ───────────────────────────────────────────────── */
main {
  height: calc(100vh - 52px);
  display: block;
  padding: 0;
  overflow: hidden;
}

#map-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* cursor managed entirely by JS via inline style */
}

/* Cursor fully managed by JS (setMapCursor) via inline style on #map-container */

/* Map image */
#map-image {
  position: absolute;
  inset: 0;
  background: url('images/map.png') center center / cover no-repeat;
  background-color: #111820;
  transition: filter 0.8s ease;
}

/* ─── Blur stages ──────────────────────────────────────────────── */
#map-image.blur-1 { filter: blur(2px); }
#map-image.blur-2 { filter: blur(5px); }
#map-image.blur-3 { filter: blur(12px); }

/* ─── POI layer ────────────────────────────────────────────────── */
#poi-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  cursor: inherit;
}

.poi-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  line-height: 1;
  pointer-events: auto;
  transition: transform 0.2s;
  user-select: none;
  color: #ffffff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.9));
}

.poi-marker:hover { transform: translate(-50%, -50%) scale(1.25); }

.poi-marker.hidden { opacity: 0; pointer-events: none; }

/* Question mark — bigger, bolder, brighter, pulsing */
.poi-marker.question {
  font-size: 5rem;
  font-weight: 900;
  color: #ffffff;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.95)) drop-shadow(0 0 6px rgba(255,255,255,0.6)) drop-shadow(0 2px 8px rgba(0,0,0,0.9));
  animation: pulse 1.4s ease-in-out infinite;
}

/* Completed event marker — bright green */
.poi-marker.marker-event {
  color: #39ff6a;
  filter: drop-shadow(0 0 8px rgba(57,255,106,0.8)) drop-shadow(0 2px 8px rgba(0,0,0,0.9));
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-50%, -50%) scale(1.2); }
}

/* ─── Drunk overlay ────────────────────────────────────────────── */
#drunk-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,6,2,0.55);
  backdrop-filter: blur(2px);
  z-index: 10;
  transition: opacity 0.6s;
  text-align: center;
  pointer-events: none;
}

#drunk-overlay p {
  font-size: 1.8rem;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(200,160,74,0.6);
  line-height: 1.6;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(13,15,20,0.8);
}

#drunk-overlay.hidden { opacity: 0; pointer-events: none; }

/* ─── Drunk meter on map ───────────────────────────────────────── */
#drunk-hud {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  pointer-events: none;
  user-select: none;
}

#drunk-hud .drunk-label {
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0,0,0,1), 0 0 12px rgba(0,0,0,0.9);
}

#drunk-display {
  display: flex;
  gap: 6px;
  transition: color 0.5s;
}

.drunk-pip {
  width: 28px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 1px 6px rgba(0,0,0,0.8);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

/* filled states controlled via JS inline styles */

/* Hide the header drunk indicator */
.drunk-indicator { display: none; }

/* ─── Modal ────────────────────────────────────────────────────── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
  transition: opacity 0.25s;
}

#modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

#modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 2.4rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 48px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,160,74,0.08);
  transform: translateY(0);
  transition: transform 0.25s;
}

#modal-backdrop.hidden #modal { transform: translateY(20px); }

#modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s;
}
#modal-close:hover { color: var(--text); }

#modal-content h2 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

#modal-content p {
  color: var(--text);
  font-family: 'PT Serif', Georgia, serif;
  font-size: 0.97rem;
  font-style: normal;
  line-height: 1.75;
  margin-bottom: 1.2rem;
  letter-spacing: 0.01em;
}

.modal-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn {
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}
.btn-primary:hover { background: #e0b855; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }

/* ─── Drunk meter colours ──────────────────────────────────────── */
.drunk-0 { color: var(--text-muted); }
.drunk-1 { color: #c8a04a; }
.drunk-2 { color: #e06030; }
.drunk-3 { color: var(--danger); }

/* ─── Debug panel ──────────────────────────────────────────────── */
#debug-panel {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  background: #0d1117ee;
  border: 1px solid #ff4444;
  border-radius: 8px;
  padding: .6rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 190px;
}
#debug-panel.hidden { display: none; }
.debug-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #ff6666;
  margin-bottom: .15rem;
}
.dbg-btn {
  font-size: .75rem;
  padding: .3rem .6rem;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1a1f2b;
  color: #ccc;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.dbg-btn:hover { background: #2a3040; }
.dbg-btn.dbg-danger { border-color: #aa2222; color: #ff7070; }
.dbg-btn.dbg-danger:hover { background: #3a1010; }

/* ─── Debug grid ───────────────────────────────────────────────── */
#debug-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

/* ─── Drag toast ───────────────────────────────────────────────── */
.drag-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 15, 20, 0.92);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.4s;
  pointer-events: none;
}
.drag-toast.error { border-color: var(--danger); color: var(--danger); }

