@font-face {
  font-family: 'Krylon';
  src: url('../brand/fonts/Krylon-Regular.woff2') format('woff2'),
       url('../brand/fonts/Krylon-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-primary: #23272a;
  --brand-accent: #e4be98;
  --brand-surface: #23272a;
  --brand-text: #ece6da;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { height: 100%; width: 100%; overflow: hidden; background: var(--brand-surface); font-family: Arial, Helvetica, sans-serif; color: var(--brand-text); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; pointer-events: none; z-index: 10; }
#brand-logo { height: 30px; width: auto; }
#brand-name { font-weight: bold; font-size: 15px; }
#tour-title { font-family: 'Krylon', Arial, sans-serif; font-size: 15px; letter-spacing: .04em; opacity: .85; }

#minimap { position: absolute; bottom: 20px; right: 12px; z-index: 9; background: rgba(20,22,24,.72); border: 1px solid var(--brand-accent); border-radius: 12px; padding: 6px; touch-action: none; cursor: grab; }
#minimap-canvas { display: block; width: 340px; height: 169px; touch-action: none; }
#minimap-floor { font-family: 'Krylon', Arial, sans-serif; font-size: 11px; letter-spacing: .06em; text-align: center; margin-top: 4px; padding: 5px 0 4px; user-select: none; -webkit-user-select: none; background: rgba(228,190,152,.16); border: 1px solid rgba(228,190,152,.45); border-radius: 7px; color: var(--brand-accent); }
#minimap-move { position: absolute; left: 1px; top: 1px; width: 30px; height: 30px; cursor: grab; touch-action: none; border-radius: 10px 0 0 0; display: flex; align-items: center; justify-content: center; color: var(--brand-accent); font-size: 14px; opacity: .95; z-index: 2; }
#minimap-move::before { content: '⠿'; font-family: Arial, sans-serif; }
#minimap-move.grabbing { cursor: grabbing; }
#minimap-ruler { position: absolute; right: 1px; top: 1px; width: 30px; height: 30px; cursor: pointer; touch-action: none; border-radius: 0 10px 0 0; display: flex; align-items: center; justify-content: center; opacity: .95; z-index: 2; }
#minimap-ruler::before { content: ''; width: 15px; height: 5px; transform: rotate(-45deg); border: 1px solid var(--brand-accent); background: repeating-linear-gradient(90deg, var(--brand-accent) 0 1px, transparent 1px 4px); }
#minimap.measuring #minimap-ruler { background: var(--brand-accent); border-radius: 6px; }
#minimap.measuring #minimap-ruler::before { border-color: #23272a; background: repeating-linear-gradient(90deg, #23272a 0 1px, transparent 1px 4px); }
#minimap-size { position: absolute; right: 1px; bottom: 1px; width: 30px; height: 30px; cursor: nwse-resize; touch-action: none; border-radius: 0 0 10px 0;
  background: linear-gradient(135deg, transparent 55%, var(--brand-accent) 55%, var(--brand-accent) 62%, transparent 62%, transparent 72%, var(--brand-accent) 72%, var(--brand-accent) 79%, transparent 79%, transparent 89%, var(--brand-accent) 89%, var(--brand-accent) 96%, transparent 96%); opacity: .9; }
#minimap-size:active { opacity: 1; }
@media (max-width: 600px) {
  #minimap { bottom: 96px; right: 10px; padding: 5px; }
  #minimap-canvas { width: 170px; height: 85px; }
  #minimap-floor { font-size: 12px; padding: 9px 0 7px; }
  #minimap-size { width: 42px; height: 42px; }
  #minimap-move { width: 42px; height: 42px; font-size: 18px; }
  #minimap-ruler { width: 42px; height: 42px; }
}

#floor-bar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; }
.floor-btn { border: 1px solid var(--brand-accent); background: rgba(0,0,0,.55); color: var(--brand-text); padding: 8px 14px; border-radius: 18px; font-family: 'Krylon', Arial, sans-serif; font-size: 14px; letter-spacing: .05em; cursor: pointer; white-space: nowrap; }
.floor-btn.active { background: var(--brand-accent); color: var(--brand-primary); font-weight: bold; }

#pano-label { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); font-family: 'Krylon', Arial, sans-serif; font-size: 13px; letter-spacing: .04em; background: rgba(0,0,0,.45); padding: 4px 12px; border-radius: 12px; z-index: 5; }


#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 7; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; background: var(--brand-surface); z-index: 20; }
#error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; font-size: 15px; background: var(--brand-surface); color: #ff9d9d; z-index: 30; }
.hidden { display: none !important; }


#present-toggle { position: absolute; top: 14px; right: 14px; z-index: 12; font-family: 'Krylon', Arial, sans-serif; font-size: 11px; letter-spacing: .08em; background: rgba(20,22,24,.72); color: var(--brand-accent); border: 1px solid var(--brand-accent); border-radius: 999px; padding: 6px 14px; cursor: pointer; touch-action: manipulation; }
body.presenting #topbar, body.presenting #floor-bar, body.presenting #pano-label, body.presenting #minimap { display: none !important; }
body.presenting #present-toggle { opacity: .3; }

/* NavVis-style panel ergonomics: collapse to chip, expand to fullscreen */
#minimap-expand { position: absolute; right: 33px; top: 1px; width: 30px; height: 30px; cursor: pointer; touch-action: none; display: flex; align-items: center; justify-content: center; opacity: .95; z-index: 2; }
#minimap-expand::before { content: ''; width: 13px; height: 13px; border: 1.5px solid var(--brand-accent); border-radius: 2px; box-shadow: inset 3px -3px 0 -1.5px var(--brand-accent); }
#minimap-collapse { position: absolute; right: 1px; top: 31px; width: 30px; height: 30px; cursor: pointer; touch-action: none; display: flex; align-items: center; justify-content: center; color: var(--brand-accent); font-size: 12px; opacity: .95; z-index: 2; }
#minimap-collapse::before { content: '\25BE'; font-family: Arial, sans-serif; } /* down chevron: collapse */
#minimap.collapsed #minimap-collapse::before { content: '\25B4'; } /* up chevron: expand */
#minimap.collapsed #minimap-canvas,
#minimap.collapsed #minimap-ruler,
#minimap.collapsed #minimap-size,
#minimap.collapsed #minimap-move,
#minimap.collapsed #minimap-expand { display: none; }
#minimap.collapsed { padding: 3px; }
#minimap.collapsed #minimap-floor { margin-top: 0; cursor: pointer; white-space: nowrap; }
#minimap.collapsed #minimap-collapse { position: static; display: inline-flex; width: 22px; height: 22px; vertical-align: middle; }
#minimap.fullscreen { position: fixed; left: 10px; right: 10px; top: 10px; bottom: 10px; z-index: 40; display: flex; flex-direction: column; }
#minimap.fullscreen #minimap-canvas { margin: auto 0; }
#minimap.fullscreen #minimap-size,
#minimap.fullscreen #minimap-move { display: none; }
@media (max-width: 640px) {
  #minimap-expand { right: 45px; width: 42px; height: 42px; }
  #minimap-collapse { top: 43px; width: 42px; height: 42px; font-size: 15px; }
}
