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

html, body {
  width: 100%; height: 100%;
  background: #060401;
  overflow: hidden;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: #f0ebe0;
}

#app { display: flex; width: 100vw; height: 100vh; }

/* ── SCENE ── */
#scene {
  position: relative;
  flex: 1; min-width: 0;
  overflow: hidden;
  cursor: grab;
}
#scene.dragging  { cursor: grabbing; }
#scene.hovering  { cursor: pointer; }

#glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(
    ellipse 52% 60% at 50% 50%,
    #6b3f00 0%,
    #331d00 28%,
    #0e0700 56%,
    #060401 100%
  );
}

#c { position: absolute; inset: 0; z-index: 1; display: block; }

#grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 190px;
  mix-blend-mode: overlay;
}

/* ── CHROME ── */
#about-btn {
  position: absolute; top: 22px; left: 24px; z-index: 20;
  background: transparent;
  border: 1px solid rgba(240,235,220,0.32);
  border-radius: 20px;
  padding: 5px 18px;
  color: #f0ebe0;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 13px; letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.2s;
}
#about-btn:hover { border-color: rgba(240,235,220,0.7); }

#title {
  position: absolute; top: 26px;
  left: 50%; transform: translateX(-50%);
  z-index: 20;
  font-size: 19px; font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
}

#hint {
  position: absolute; bottom: 32px; left: 0; right: 0;
  z-index: 20; text-align: center;
  font-size: 13.5px;
  color: rgba(240,235,220,0.48);
  pointer-events: none;
  line-height: 1.7; letter-spacing: 0.02em;
}

/* ── SCENE TABS ── */
#scene-tabs {
  position: absolute;
  top: 18px; right: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: stretch;
  background: rgba(6,4,1,0.72);
  border: 1px solid rgba(240,235,220,0.14);
  border-radius: 24px;
  padding: 3px;
  backdrop-filter: blur(10px);
}

#scene-tab-pill {
  position: absolute;
  inset: 3px 50% 3px 3px;
  background: rgba(240,178,38,0.14);
  border: 1px solid rgba(240,178,38,0.32);
  border-radius: 20px;
  transition: inset 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}

#scene-tab-pill.tab-mine {
  inset: 3px 3px 3px 50%;
}

.scene-tab-btn {
  position: relative; z-index: 1;
  background: transparent; border: none;
  padding: 5px 18px;
  color: rgba(240,235,220,0.38);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 12px; letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.25s;
  border-radius: 20px;
  white-space: nowrap;
}

.scene-tab-btn.active {
  color: rgba(240,185,45,0.92);
}

/* ── PANEL ── */
#panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 29;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#panel {
  width: 0; min-width: 0; height: 100vh;
  overflow: hidden; flex-shrink: 0;
  transition: width 0.44s cubic-bezier(0.22,1,0.36,1);
  border-left: 1px solid rgba(240,235,220,0.06);
  background: rgba(6,4,1,0.92);
  backdrop-filter: blur(12px);
  z-index: 30;
}
#panel.open { width: 310px; }

/* Mobile: overlay panel on top of scene */
@media (max-width: 768px) {
  #panel-backdrop {
    display: block;
  }
  #panel-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  #panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 0;
    border-left: none;
    border-right: 1px solid rgba(240,235,220,0.06);
  }
  #panel.open {
    width: 100%;
    max-width: 340px;
  }
}

#panel-inner {
  width: 310px; height: 100%;
  padding: 68px 26px 40px;
  overflow-y: auto; overflow-x: hidden;
}
#panel-inner::-webkit-scrollbar { width: 2px; }
#panel-inner::-webkit-scrollbar-thumb { background: rgba(240,235,220,0.15); border-radius: 2px; }

#panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#panel-inner h2 {
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.05em;
  margin: 0;
  color: rgba(240,235,220,0.9);
  text-transform: uppercase;
}

/* ── PANEL TABS ── */
#panel-tabs {
  position: relative;
  display: flex; align-items: stretch;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(240,235,220,0.09);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 20px;
}

#panel-tab-pill {
  position: absolute;
  inset: 3px 50% 3px 3px;
  background: rgba(240,178,38,0.12);
  border: 1px solid rgba(240,178,38,0.26);
  border-radius: 16px;
  transition: inset 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}

#panel-tab-pill.tab-mine {
  inset: 3px 3px 3px 50%;
}

.panel-tab-btn {
  flex: 1; position: relative; z-index: 1;
  background: transparent; border: none;
  padding: 7px 0;
  color: rgba(240,235,220,0.32);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s;
  border-radius: 16px;
}

.panel-tab-btn.active {
  color: rgba(240,185,45,0.9);
}

#panel-close {
  background: transparent;
  border: 1px solid rgba(240,235,220,0.22);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: rgba(240,235,220,0.6);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}
#panel-close:hover {
  border-color: rgba(240,235,220,0.5);
  color: rgba(240,235,220,0.9);
  background: rgba(255,255,255,0.04);
}

.card {
  margin-bottom: 15px;
  animation: fadeUp 0.3s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-label {
  font-size: 9px; letter-spacing: 0.14em;
  color: rgba(240,235,220,0.32);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.card-label strong { color: rgba(240,185,45,0.75); font-weight: 700; }

.card-body {
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.065);
  border-radius: 8px;
  padding: 13px 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.card-text {
  flex: 1;
  font-size: 13.5px; line-height: 1.62;
  color: rgba(240,235,220,0.83);
}
.card-img {
  width: 84px; height: 84px;
  border-radius: 5px; object-fit: cover;
  flex-shrink: 0;
}

/* ── MODAL ── */
#modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 100;
  align-items: center; justify-content: center;
}
#modal-bg.show { display: flex; }
#modal {
  background: #0d0a05;
  border: 1px solid rgba(240,235,220,0.1);
  border-radius: 12px; padding: 38px 42px;
  max-width: 380px; width: 90%;
}
#modal h3 { font-size: 18px; font-weight: 500; margin-bottom: 12px; }
#modal p  { font-size: 13.5px; line-height: 1.72; color: rgba(240,235,220,0.65); margin-bottom: 8px; }
#modal-close {
  margin-top: 22px; background: transparent;
  border: 1px solid rgba(240,235,220,0.28);
  border-radius: 20px; padding: 5px 20px;
  color: #f0ebe0;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 13px; letter-spacing: 0.05em;
  cursor: pointer;
}
#modal-close:hover { border-color: rgba(240,235,220,0.6); }

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 768px) {
  /* Make hint text smaller and wrap better on mobile */
  #hint {
    font-size: 11.5px;
    padding: 0 16px;
    line-height: 1.5;
  }

  /* Make title smaller on very narrow screens */
  #title {
    font-size: 16px;
  }

  /* Ensure modal fits on small screens */
  #modal {
    padding: 28px 32px;
    max-width: 90%;
  }

  /* Adjust panel padding for mobile */
  #panel-inner {
    padding: 56px 20px 32px;
  }

  /* Make touch targets larger for mobile */
  #about-btn, #modal-close {
    padding: 7px 20px;
    font-size: 14px;
  }

  #panel-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}

/* Very small screens (phones in portrait) */
@media (max-width: 480px) {
  #title {
    font-size: 14px;
    top: 22px;
  }

  #hint {
    font-size: 10.5px;
    bottom: 24px;
  }

  #about-btn {
    top: 18px;
    left: 18px;
  }

  /* Full-width panel on small phones */
  #panel.open {
    width: 100%;
    max-width: 100%;
  }
}
