/* ==========================================================================
   C.Creek Property Walkthrough
   ========================================================================== */

/* ---------- Theme ---------- */
:root {
  color-scheme: dark;

  --paper: #faf4de;            /* main text */
  --lime: #dce69c;             /* accent */
  --lime-light: #ecf2b9;       /* accent hover */
  --muted: #c2c9b5;            /* secondary text */
  --ink: #263119;              /* text on lime buttons */
  --bg: #1a2a21;               /* page background */
  --glass: rgba(21, 30, 24, .89);
  --border: #f6f3da45;
  --border-soft: #f6f3da38;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --serif: Georgia, serif;
  --sans: system-ui, sans-serif;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--paper);
  font: 14px var(--sans);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Small uppercase label used in several places */
.kicker,
header small {
  font: 600 10px var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--lime);
}

/* ---------- 3D view ---------- */
#world {
  display: block;
  width: 100vw;
  height: 100dvh;
  touch-action: none;
}

/* Darkens the top and bottom edges so the UI stays readable */
#shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #111b1866, transparent 24%, transparent 68%, #101915a8);
}

/* Crosshair dot shown while walking */
.aim {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff9;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* ---------- Title (top left) ---------- */
header {
  position: fixed;
  top: 24px;
  left: 28px;
  text-shadow: 0 2px 12px #142018;
}

header h1 {
  margin: 3px 0 0;
  font: normal 38px var(--serif);
  letter-spacing: -.04em;
}

#location {
  margin-top: 5px;
  font-size: 12px;
  color: var(--paper);
}

/* ---------- Mini map (top right) ---------- */
#mapBox {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 228px;
  padding: 11px;
  background: var(--glass);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px #15241b55;
}

#mapTitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 8px;
}

#mapTitle span {
  font-size: 11px;
  color: var(--muted);
}

#map {
  display: block;
  width: 100%;
  border: 1px solid #ffffff43;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
}

#mapBox p {
  margin: 7px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Bottom-left controls ---------- */
.controls {
  position: fixed;
  left: 25px;
  bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.controls button,
.places button,
.touch button {
  padding: 9px 13px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Keep this after the button styles above so the hover colour wins */
button:hover {
  border-color: var(--lime);
  color: var(--lime);
}

#hint {
  padding: 9px;
  font-size: 12px;
  color: var(--paper);
  text-shadow: 0 1px 5px #000;
}

/* ---------- Start / locations panel ---------- */
.panel {
  position: fixed;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 36px));
  padding: 27px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 60px #10181188;
}

.panel h2 {
  margin: 8px 0 12px;
  font: normal 37px/1.03 var(--serif);
}

.panel p {
  margin: 0 0 18px;
  line-height: 1.5;
  color: var(--muted);
}

.primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
}

.primary:hover {
  background: var(--lime-light);
  color: var(--ink);
}

.places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}

.places button {
  font-size: 12px;
}

/* ---------- Touch arrow pad (bottom right) ---------- */
.touch {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  grid-template-columns: repeat(3, 42px);
  gap: 4px;
}

.touch button {
  padding: 9px;
  touch-action: none;
}

/* ---------- Responsive ---------- */
@media (pointer: coarse) {
  .touch { display: grid; }
  #hint  { display: none; }
}

@media (max-width: 630px) {
  header      { top: 15px; left: 15px; }
  header h1   { font-size: 28px; }
  #mapBox     { top: 13px; right: 12px; width: 145px; padding: 7px; }
  #mapBox p   { font-size: 9px; }
  .controls   { left: 12px; bottom: 15px; }
}
