:root {
  --ink: #f2f2f2;
  --dim-ink: #cfcfcf;
  --panel: #0b0b12;
  --accent: #e74c3c;
  --accent-dark: #9a2b21;
  --green: #88ff88;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: #0a0a0a;
  color: var(--ink);
  overflow: hidden;
  font-family: "VT323", monospace;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 10, 0.98);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 18px;
}

.ring-svg {
  width: 180px;
  height: 180px;
  position: absolute;
  top: 0;
  left: 0;
}
.ring-bg {
  fill: none;
  stroke: #222;
  stroke-width: 6;
}
.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 282.74;
  stroke-dashoffset: 212.06;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: ring-spin 1.2s linear infinite;
}
@keyframes ring-spin {
  0% { stroke-dashoffset: 282.74; }
  100% { stroke-dashoffset: 0; }
}
.loading-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-47%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.loading-text {
  color: var(--ink);
  font-size: 1.5rem;
  margin-top: 8px;
  letter-spacing: 2px;
}

@media (max-width: 600px) {
  .loading-ring {
    width: 120px;
    height: 120px;
  }
  .ring-svg {
    width: 120px;
    height: 120px;
  }
  .loading-logo {
    width: 70px;
    height: 70px;
  }
  .loading-text {
    font-size: 1.1rem;
  }
}


.container {
  display: flex;
  height: 100vh;
}
#globe-container {
  flex: 1;
  position: relative;
}

/* ─── SIDEBAR: CRT panel look ───────────────────────────────────────── */
.sidebar {
  width: 340px;
  background: var(--panel);
  position: relative;
  overflow-y: auto;
  padding: 16px 14px 18px;
  border-left: 2px solid #fff; /* outer white frame */
  box-shadow: inset 0 0 0 2px var(--panel-edge),
    /* inner dark frame */ inset 0 0 0 6px var(--panel-inner),
    /* thick inner bezel */ 0 0 0 1px #000; /* crisp outer edge */
  image-rendering: pixelated;
  font-family: "VT323", ui-monospace, monospace;
}

/* CRT scanlines */
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0px,
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.35; /* adjust intensity */
  mix-blend-mode: overlay;
}

/* Header block */
.header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(#0f0f1e, #0b0b15);
  border: 2px solid #fff;
  box-shadow: inset 0 0 0 2px #1d1d30, 0 3px 0 0 rgba(255, 255, 255, 0.15);
  padding: 14px 12px 12px;
  text-align: center;
}

.header h1 {
  font-family: "VT323", ui-monospace, monospace;
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--ink);
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

/* dashed rule like the mock */
.header .rule {
  height: 2px;
  margin: 6px auto 8px;
  width: 92%;
  background: repeating-linear-gradient(
    to right,
    #fff 0 6px,
    transparent 6px 12px
  );
  opacity: 0.85;
  filter: drop-shadow(0 1px 0 #000);
}

.header p {
  font-size: 18px;
  line-height: 1;
  color: var(--dim-ink);
  letter-spacing: 2px;
  text-shadow: 0 1px 0 #000;
}

.sticker-count {
  margin: 14px 4px 10px;
  padding: 8px 10px;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--dim-ink);
  border: 2px solid #fff;
  box-shadow: inset 0 0 0 2px #1d1d30;
  background: #05050a;
}

#sticker-list {
  padding: 0 4px 12px;
  position: relative;
  z-index: 1;
}

/* Item layout: title (left) + date (right), coords below */
.sticker-item {
  background: #0a0a12;
  border: 2px solid #2b2b35;
  margin: 10px 4px;
  padding: 8px 10px 7px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 2px #141422;
  transition: transform 0.06s linear, box-shadow 0.06s linear,
    border-color 0.06s linear;
}
.sticker-item:hover {
  border-color: #3b3b45;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.85), inset 0 0 0 2px #17172a;
  transform: translateY(-1px);
}

.sticker-item.active {
  background: var(--accent);
  border-color: #ffffff;
  color: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.9),
    inset 0 0 0 2px var(--accent-dark),
    inset 0 -8px 0 0 rgba(0, 0, 0, 0.15); /* bottom bevel like mock */
  transform: translateY(0);
}

.sticker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.sticker-title {
  font-size: 22px;
  letter-spacing: 2px;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-date {
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--dim-ink);
  text-shadow: 0 1px 0 #000;
}

.sticker-item.active .sticker-date {
  color: #fff;
}

.sticker-coords {
  font-size: 18px;
  color: var(--green);
  letter-spacing: 2px;
  text-shadow: 0 0 4px rgba(136, 255, 136, 0.25), 0 1px 0 #000;
  opacity: 0.95;
}

/* Hide the old square photo link button in this look */
.sticker-link {
  display: none;
}

/* Scrollbar – subtle, monochrome */
.sidebar::-webkit-scrollbar {
  width: 12px;
}
.sidebar::-webkit-scrollbar-track {
  background: #0b0b12;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #dcdcdc;
  border: 3px solid #0b0b12;
}

/* --- CONTROLS PANEL (retro CRT theme) --- */
.controls {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
  padding: 14px 18px 10px;
  font-family: "VT323", monospace;
  font-size: 18px;
  letter-spacing: 2px;
  color: #f2f2f2;
  background: #0e0e15;
  border: 2px solid #f2f2f2;
  box-shadow: inset 0 0 0 2px #1d1d30, 0 0 12px rgba(255, 255, 255, 0.1),
    2px 2px 0 rgba(0, 0, 0, 0.8);
  image-rendering: pixelated;
  position: absolute;
  overflow: hidden;
}

/* Subtle scanline overlay inside controls */
.controls::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0px,
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.controls p {
  margin: 3px 0;
  color: #b8b8b8;
  text-shadow: 0 1px 0 #000;
}

/* add a small heading bar to match sidebar style */
.controls::before {
  content: "+ CONTROLS +";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: #0e0e15;
  padding: 0 6px;
  font-size: 16px;
  letter-spacing: 2px;
  color: #f2f2f2;
}
.logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}
.logo img {
  height: 150px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: 220px;
    border-left: none;
    border-top: 2px solid var(--ink);
  }
  #globe-container {
    height: calc(100vh - 220px);
  }
}
