/* ========== CSS Variables - Anthropic Warm Palette ========== */
:root {
  --bg: #F5F0E8;
  --bg2: #EDE7DB;
  --bg3: #E5DDD0;
  --bg4: #DDD5C6;
  --ink: #3D3229;
  --muted: #5A4D42;
  --rule: #A89B8A;
  --accent: #C17F24;
  --accent2: #5B7FA5;
  --accent3: #A0622A;
  --green: #6B8E5A;
  --red: #C45B4A;
  --font-pixel: 'Cinzel', 'Georgia', serif;
  --font-mono: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
}

/* ========== Reset ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ========== Card Border Utility ========== */
.pixel-border {
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 2px 12px rgba(0,0,0,0.06);
}

.pixel-border-accent {
  border: 1px solid var(--accent);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 2px 16px rgba(212,168,92,0.1);
}

/* ========== Layout ========== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 4rem 0;
}

/* ========== HUD Bar ========== */
.hud-bar {
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.hud-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.hud-item .dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 0 4px currentColor;
}

.hud-item .val {
  color: var(--accent);
}

.hud-nav {
  display: flex;
  gap: 12px;
}

.hud-nav a {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: rgba(255,255,255,0.5);
  transition: all 0.2s;
}

.hud-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(212,168,92,0.06);
}

/* ========== Hero ========== */
.hero {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(193,127,36,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(91,127,165,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(193,127,36,0.15);
  image-rendering: auto;
  margin-bottom: 1.5rem;
  background: var(--bg3);
  object-fit: cover;
  object-position: 37% top;
}

.hero h1 {
  font-family: var(--font-pixel);
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--muted);
  font-style: italic;
}

/* === Hero 3D Coverflow Carousel === */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 1.75rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.carousel-stage {
  position: relative;
  width: 420px;
  max-width: 100%;
  height: 140px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 100px;
  margin-left: -70px;
  margin-top: -50px;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.5s ease-out,
              box-shadow 0.3s;
  transform-style: preserve-3d;
  will-change: transform;
}

.carousel-card-inner {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--rule);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
  backface-visibility: hidden;
}

.carousel-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.carousel-card-keyword {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.3;
}

.carousel-card-desc {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.carousel-card-desc:empty {
  display: none;
}

.carousel-card.active {
  z-index: 10;
}

.carousel-card.active .carousel-card-inner {
  border-color: var(--accent);
  box-shadow:
    0 8px 28px rgba(193,127,36,0.15),
    0 2px 8px rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.85);
}

.carousel-card.side {
  z-index: 5;
  opacity: 0.6;
}

.carousel-card.side .carousel-card-inner {
  background: rgba(255,255,255,0.5);
}

.carousel-card.far {
  z-index: 1;
  opacity: 0.25;
}

.carousel-card.hidden-card {
  opacity: 0;
  pointer-events: none;
}

/* Hover zones - invisible until hovered */
.carousel-hover-zone {
  flex-shrink: 0;
  width: 48px;
  height: 100%;
  cursor: pointer;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  transition: background 0.3s ease;
}

.carousel-hover-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.carousel-hover-left::before {
  background: linear-gradient(to right, rgba(193,127,36,0.08), transparent);
}

.carousel-hover-right::before {
  background: linear-gradient(to left, rgba(193,127,36,0.08), transparent);
}

.carousel-hover-zone:hover::before {
  opacity: 1;
}

.carousel-hover-zone::after {
  content: '';
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.carousel-hover-left::after {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.carousel-hover-right::after {
  transform: rotate(45deg);
  margin-right: 4px;
}

.carousel-hover-zone:hover::after {
  opacity: 0.5;
}









/* ========== Section Headers ========== */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-num {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.section-header .desc {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========== Map Navigation ========== */
.map-section {
  background: var(--bg2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.map-container {
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.map-zone {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.map-zone:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.map-zone .zone-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.map-zone .zone-name {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
  letter-spacing: 0.1em;
}

.map-zone .zone-cn {
  font-size: 0.85rem;
  color: var(--muted);
}

.map-paths {
  display: none;
}

/* ========== Dialogue Box ========== */
.dialogue-box {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  position: relative;
  margin: 1.5rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.dialogue-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.5);
  pointer-events: none;
}

.dialogue-speaker {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.15em;
}

.dialogue-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.9;
  min-height: 2em;
}

.dialogue-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ========== Profile Card ========== */
.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border: 2px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  image-rendering: auto;
  object-fit: cover;
  object-position: 37% top;
}

.profile-info h3 {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}

.stat-row .stat-name { color: var(--muted); }
.stat-row .stat-value { color: var(--accent); }

/* ========== Quest Cards ========== */
.quest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.quest-card {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.quest-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.quest-status {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 4px 10px;
  display: inline-block;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

.quest-status.completed {
  background: rgba(107,142,90,0.12);
  color: var(--green);
  border: 1px solid rgba(107,142,90,0.3);
}

.quest-status.ongoing {
  background: rgba(212,168,92,0.1);
  color: var(--accent);
  border: 1px solid rgba(193,127,36,0.25);
}

.quest-title {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
}

.quest-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.quest-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quest-link-tag {
  text-decoration: none;
  transition: transform 0.15s;
  position: relative;
  z-index: 10;
}

.quest-link-tag:hover {
  transform: translateY(-2px);
}

.quest-link-tag .reward-tag {
  color: var(--accent);
  border-color: var(--accent);
  cursor: pointer;
}

.quest-link-tag:hover .reward-tag {
  background: rgba(193,127,36,0.12);
}

.reward-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--accent2);
}

.quest-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: all 0.2s;
  background: rgba(212,168,92,0.06);
}

.quest-link:hover {
  background: var(--accent);
  color: #fff;
}

/* ========== Skill Tree ========== */
.skill-category {
  margin-bottom: 2rem;
}

.skill-category-title {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.1em;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.skill-name {
  width: 140px;
  font-size: 0.9rem;
  color: var(--ink);
  flex-shrink: 0;
}

.skill-bar-bg {
  flex: 1;
  height: 18px;
  background: var(--bg3);
  border: 1px solid var(--rule);
  border-radius: 9px;
  position: relative;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  transition: width 1s ease-out;
  border-radius: 9px;
}

.skill-level {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--muted);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* ========== Adventure Log ========== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--rule) 100%);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(212,168,92,0.1);
}

.timeline-period {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
  letter-spacing: 0.1em;
}

.timeline-title {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}

.timeline-achievements {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
}

.timeline-achievements li {
  font-size: 0.8rem;
  color: var(--ink);
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.3rem;
}

.timeline-achievements li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1rem;
}

/* ========== Achievement Gallery ========== */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.achievement-badge {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.25s;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.achievement-badge:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.achievement-badge .badge-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.achievement-badge .badge-title {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
}

.achievement-badge .badge-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ========== Contact ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.contact-item {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.contact-item:hover {
  border-color: var(--accent2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.contact-item .contact-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.contact-item .contact-label {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.contact-item .contact-value {
  font-size: 0.9rem;
  color: var(--ink);
  word-break: break-all;
}

.contact-item a {
  color: var(--accent2);
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

/* ========== Secret Section ========== */
.secret-section {
  background: var(--bg2);
  border-top: 1px solid var(--rule);
}

.secret-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ========== Language Toggle ========== */
.lang-toggle {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.1em;
}

.lang-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* ========== Vertical Sidebar Nav ========== */
.side-nav {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: rgba(245, 240, 232, 0.95);
  border-right: 1px solid var(--rule);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: auto;
  max-width: 160px;
  border-radius: 0 12px 12px 0;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 6px;
  transition: all 0.2s;
  position: relative;
}

.side-nav-item:hover {
  background: rgba(212,168,92,0.06);
  border-left-color: var(--accent);
}

.side-nav-item.active {
  background: rgba(212,168,92,0.06);
  border-left-color: var(--accent);
}

.side-nav-num {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--muted);
  min-width: 16px;
}

.side-nav-item.active .side-nav-num,
.side-nav-item:hover .side-nav-num {
  color: var(--accent);
}

.side-nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.side-nav-label {
  font-size: 0.78rem;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.side-nav-item:hover .side-nav-label,
.side-nav-item.active .side-nav-label {
  opacity: 1;
  color: var(--accent);
}

/* Collapsed state - icon only */
.side-nav.collapsed .side-nav-label,
.side-nav.collapsed .side-nav-num {
  display: none;
}

.side-nav.collapsed .side-nav-item {
  justify-content: center;
  padding: 8px;
}

/* Push content right to avoid sidebar overlap */
.container {
  margin-left: 180px;
}

/* Hero also needs offset */
.hero {
  margin-left: 180px;
}

/* HUD bar full width but content offset */
.hud-bar .container {
  margin-left: 180px;
}

/* Footer offset */
footer .container {
  margin-left: 180px;
}

/* Mobile nav toggle button */
.side-nav-toggle {
  display: none;
  position: fixed;
  left: 12px;
  top: 70px;
  z-index: 201;
  background: rgba(245,240,232,0.9);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--ink);
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
}

/* ========== Contact Simple Layout ========== */
.contact-grid-simple {
  grid-template-columns: 1fr 1fr;
  max-width: 500px;
  margin: 0 auto;
}

/* ========== Quest Explore Hint ========== */
.quest-explore {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent2);
  letter-spacing: 0.1em;
}

/* ========== Enhanced Contact Cards ========== */
.contact-card {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.contact-card:hover {
  border-color: var(--accent2);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.contact-card .contact-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.contact-card-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.contact-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.contact-cta {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* ========== Modal ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(61,50,41,0.45);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  max-width: 600px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,0.5);
  border-radius: 16px 16px 0 0;
}

.modal-title {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.modal-close {
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  border-radius: 6px;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body-swipe {
  padding: 0.75rem;
}

.modal-body-sticky {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

/* ========== Modal Content Styles ========== */
.modal-intro {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.modal-achievements {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.modal-achievements li {
  font-size: 0.85rem;
  color: var(--ink);
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.modal-achievements li::before {
  content: '*';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.2rem;
}

.modal-visit-btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: #fff;
  background: var(--accent);
  padding: 10px 20px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
}

.modal-visit-btn:hover {
  background: var(--accent3);
}

.modal-comingsoon {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
}

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
}

.toast {
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--ink);
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-top: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Dialogue Choice Buttons (for future interactive) ========== */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.choice-btn {
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  border-radius: 8px;
}

.choice-btn:hover {
  border-color: var(--accent);
  background: rgba(212,168,92,0.06);
  transform: translateX(4px);
}

.choice-btn .choice-icon {
  color: var(--accent);
  margin-right: 8px;
}

.choice-back {
  background: none;
  border: 1px dashed var(--rule);
  color: var(--muted);
  padding: 8px 16px;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  cursor: pointer;
  margin-top: 1rem;
}

.choice-back:hover {
  color: var(--accent2);
  border-color: var(--accent2);
}

/* ========== Footer ========== */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  text-align: center;
}

footer p {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.15em;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 2px solid var(--bg2);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}



/* Image wrap with zoom button */
.inv-carousel-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  cursor: zoom-in;
}

.inv-carousel-img-wrap img {
  transition: transform 0.2s;
}

.inv-carousel-img-wrap:hover img {
  transform: scale(1.01);
}

.inv-carousel-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
}

.inv-carousel-img-wrap:hover .inv-carousel-zoom {
  opacity: 1;
}

.inv-carousel-zoom:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Detail link button */
.inv-detail-link {
  padding: 0 1.5rem 1rem;
  text-align: center;
}

.inv-link-btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.2s;
}

.inv-link-btn:hover {
  background: var(--accent3);
  transform: translateY(-1px);
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 2001;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1rem; }
  .hero-sub { font-size: 1.1rem; }
  .hero-stats { gap: 1rem; }

  .map-grid { grid-template-columns: 1fr 1fr; }
  .quest-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .achievement-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-card { grid-template-columns: 1fr; text-align: center; }
  .profile-avatar { margin: 0 auto; }
  .profile-stats { grid-template-columns: 1fr; }

  .hud-inner { justify-content: center; }
  .hud-nav { display: none; }

  .section-header h2 { font-size: 0.85rem; }

  .dialogue-box { padding: 1rem; }

  .skill-name { width: 100px; font-size: 0.8rem; }
  .skill-level { width: 40px; }

  /* Sidebar becomes collapsible on mobile */
  .side-nav {
    transform: translateY(-50%) translateX(-100%);
    transition: transform 0.3s;
  }
  .side-nav.mobile-open {
    transform: translateY(-50%) translateX(0);
  }
  .side-nav-toggle {
    display: block;
  }
  /* Remove content offset on mobile */
  .container,
  .hero,
  .hud-bar .container,
  footer .container {
    margin-left: auto;
    margin-right: auto;
  }
  .container { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 480px) {
  .map-grid { grid-template-columns: 1fr; }
  .achievement-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .contact-grid-simple { grid-template-columns: 1fr; }
}

/* ========== Animations ========== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.float-anim {
  animation: float 3s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--rule); }
  50% { border-color: var(--accent); }
}

.pulse-border {
  animation: pulse-border 2s ease-in-out infinite;
}

/* ========== Gender Selection Screen ========== */
.gender-select {
  text-align: center;
  padding: 1rem 0;
}

.gender-select-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.gender-select-prompt {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.gender-options {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gender-option {
  background: var(--bg2);
  border: 1px solid var(--rule);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  width: 160px;
  border-radius: 8px;
}

.gender-option:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

.gender-option img {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  border: 2px solid var(--rule);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.gender-option-label {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--ink);
  line-height: 1.5;
}

/* ========== Chat Dialogue Interface ========== */
.dialogue-chat {
  max-height: 380px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  max-width: 82%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}

.chat-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-msg.visitor {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.host {
  align-self: flex-start;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  border: 2px solid var(--rule);
  border-radius: 8px;
  flex-shrink: 0;
}

.chat-bubble {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.65;
}

.chat-msg.host .chat-bubble {
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 2px 8px 8px 8px;
}

.chat-msg.visitor .chat-bubble {
  background: rgba(212,168,92,0.1);
  border: 1px solid var(--accent);
  color: var(--ink);
  border-radius: 8px 2px 8px 8px;
}

.chat-name {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

.chat-msg.visitor .chat-name {
  text-align: right;
  color: var(--accent);
}

.chat-msg.host .chat-name {
  color: var(--accent);
}

/* Chat Choices */
.chat-choices {
  margin-top: 1rem;
}

.chat-choices-prompt {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent2);
  margin-bottom: 0.6rem;
  text-align: center;
}

.chat-choice {
  display: block;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-size: 0.85rem;
  font-family: var(--font-body);
  margin-bottom: 0.4rem;
  border-radius: 6px;
}

.chat-choice:hover {
  border-color: var(--accent);
  background: rgba(212,168,92,0.06);
  transform: translateX(4px);
}

.chat-choice.exit {
  border-style: dashed;
  color: var(--accent2);
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
}

.chat-choice.exit:hover {
  border-color: var(--accent2);
  background: rgba(91,127,165,0.06);
}

/* ========== Card Swipe Interface (Reigns-inspired) ========== */
.card-swipe-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  padding: 0;
}

/* Stage: holds card stack */
.swipe-stage {
  position: relative;
  width: 100%;
  max-width: 360px;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

/* Card stack depth - cards behind the main card */
.swipe-card-back-1,
.swipe-card-back-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: 340px;
  background: var(--bg3);
  border: 1px solid var(--rule);
  border-radius: 14px;
  pointer-events: none;
}

.swipe-card-back-1 {
  transform: translate(-50%, -50%) translateY(-6px) scale(0.96);
  opacity: 0.5;
  height: 440px;
  z-index: 0;
}

.swipe-card-back-2 {
  transform: translate(-50%, -50%) translateY(-12px) scale(0.92);
  opacity: 0.25;
  height: 440px;
  z-index: -1;
}

/* The card itself - tall, centered, like a Reigns character card */
.swipe-card-interactive {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 340px;
  height: 320px;
  background: linear-gradient(180deg, #fff 0%, var(--bg2) 100%);
  border: 1px solid var(--rule);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: grab;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
}

.swipe-card-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.swipe-card-interactive.dragging {
  cursor: grabbing;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 100;
}

/* Card portrait area - top section with character icon */
.swipe-card-portrait {
  flex: 0 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg3) 0%, var(--bg2) 100%);
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.swipe-card-portrait::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(0,0,0,0.02) 20px, rgba(0,0,0,0.02) 40px);
  pointer-events: none;
}

.swipe-card-icon {
  font-size: 3.5rem;
  animation: characterFloat 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.swipe-card-icon.speaking {
  animation: characterSpeak 0.4s ease-out;
}

@keyframes characterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes characterSpeak {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Card content - text area */
.swipe-card-content {
  flex: 1 1 0;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.swipe-card-prompt {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.swipe-card-question {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

.swipe-card-answer {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.75;
}

/* Card choices - inside the card at bottom (Reigns style) */
.swipe-card-choices {
  flex: 0 0 auto;
  display: flex;
  border-top: 1px solid var(--rule);
  background: rgba(0,0,0,0.03);
  flex-shrink: 0;
}

.swipe-choice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  user-select: none;
  min-height: 52px;
}

.swipe-choice-left {
  justify-content: flex-start;
  border-right: 1px solid var(--rule);
}

.swipe-choice-right {
  justify-content: flex-end;
  text-align: right;
}

.swipe-choice:hover {
  background: rgba(212,168,92,0.06);
}

.swipe-choice-arrow {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.swipe-choice-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
  line-height: 1.35;
  transition: color 0.2s ease;
}

.swipe-choice-text.skip-text {
  color: var(--muted);
  font-style: italic;
}

/* Active state during drag */
.swipe-choice-left.active {
  background: rgba(212,168,92,0.1);
}

.swipe-choice-left.active .swipe-choice-arrow,
.swipe-choice-left.active .swipe-choice-text {
  color: var(--accent);
}

.swipe-choice-left.active .swipe-choice-arrow {
  transform: translateX(-4px);
}

.swipe-choice-right.active {
  background: rgba(212,168,92,0.1);
}

.swipe-choice-right.active .swipe-choice-arrow,
.swipe-choice-right.active .swipe-choice-text {
  color: var(--accent);
}

.swipe-choice-right.active .swipe-choice-arrow {
  transform: translateX(4px);
}

/* Progress Indicator */
.swipe-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.5rem 0;
}

.swipe-progress-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--rule);
  background: var(--bg3);
  transition: all 0.3s;
  border-radius: 50%;
}

.swipe-progress-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 6px rgba(193,127,36,0.3);
}

.swipe-progress-dot.done {
  border-color: var(--green);
  background: var(--green);
}

.swipe-progress-text {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* Deal Phase */
.swipe-deal-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem 1rem;
  gap: 0.75rem;
  position: relative;
}

.swipe-deal-title {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  color: var(--accent);
}

.swipe-deal-subtitle {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.15em;
}

.swipe-deal-cards {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.swipe-deal-card {
  width: 40px;
  height: 56px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s;
  border-radius: 6px;
}

.swipe-deal-card.dealt {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(193,127,36,0.15);
  animation: dealCardPop 0.3s ease-out backwards;
}

.swipe-deal-card.dealt:nth-child(1) { animation-delay: 0.1s; }
.swipe-deal-card.dealt:nth-child(2) { animation-delay: 0.2s; }
.swipe-deal-card.dealt:nth-child(3) { animation-delay: 0.3s; }
.swipe-deal-card.dealt:nth-child(4) { animation-delay: 0.4s; }
.swipe-deal-card.dealt:nth-child(5) { animation-delay: 0.5s; }
.swipe-deal-card.dealt:nth-child(6) { animation-delay: 0.6s; }

.swipe-deal-card.hidden {
  opacity: 0.15;
  border-style: dashed;
}

@keyframes dealCardPop {
  0% { transform: translateY(-20px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.swipe-deal-count {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent);
}

.swipe-deal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.swipe-deal-btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent);
  background: var(--bg2);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
}

.swipe-deal-btn:hover:not(.disabled) {
  background: var(--accent);
  color: #fff;
}

.swipe-deal-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--rule);
  color: var(--rule);
}

.swipe-deal-redeal {
  border-color: var(--accent2);
  color: var(--accent2);
}

.swipe-deal-redeal:hover:not(.disabled) {
  background: var(--accent2);
  color: #fff;
}

.swipe-deal-noredeal {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--red);
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
}

.swipe-deal-hint {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Tutorial Overlay */
.swipe-tutorial {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245,240,232,0.94);
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: tutorialFadeIn 0.5s ease-out;
  padding: 1rem;
}

.swipe-tutorial.active {
  display: flex;
}

.swipe-tutorial.fade-out {
  animation: tutorialFadeOut 0.5s ease-out forwards;
}

@keyframes tutorialFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes tutorialFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.05); }
}

.tutorial-title,
.swipe-tutorial-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent);
  line-height: 1.6;
  text-align: center;
}

.tutorial-steps,
.swipe-tutorial-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.tutorial-step,
.swipe-tutorial-step {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink);
  text-align: center;
  opacity: 0;
  animation: stepAppear 0.4s ease-out forwards;
}

.tutorial-step:nth-child(1),
.swipe-tutorial-step:nth-child(1) { animation-delay: 0.2s; }
.tutorial-step:nth-child(2),
.swipe-tutorial-step:nth-child(2) { animation-delay: 0.5s; }
.tutorial-step:nth-child(3),
.swipe-tutorial-step:nth-child(3) { animation-delay: 0.8s; }

@keyframes stepAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tutorial dismiss button */
.swipe-tutorial-dismiss {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: #fff;
  background: var(--accent);
  border: none;
  box-shadow: 0 2px 12px rgba(193,127,36,0.2);
  padding: 10px 24px;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
  border-radius: 8px;
  animation: stepAppear 0.4s ease-out forwards;
  animation-delay: 1.2s;
  opacity: 0;
}

.swipe-tutorial-dismiss:hover {
  background: var(--accent3);
  transform: translateY(-2px);
}

/* Card Swipe Out Animations */
.swipe-card-interactive.swipe-out-left {
  animation: swipeOutLeft 0.35s ease-in forwards;
}

.swipe-card-interactive.swipe-out-right {
  animation: swipeOutRight 0.35s ease-in forwards;
}

@keyframes swipeOutLeft {
  to { transform: translateX(-120%) rotate(-15deg); opacity: 0; }
}

@keyframes swipeOutRight {
  to { transform: translateX(120%) rotate(15deg); opacity: 0; }
}

/* Swipe Summary */
.swipe-summary {
  text-align: center;
  padding: 2rem 1.5rem;
  animation: summaryAppear 0.5s ease-out;
  position: relative;
}

@keyframes summaryAppear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.swipe-summary-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.swipe-summary-text {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ========== Daily Limit Screen ========== */
.swipe-daily-limit {
  text-align: center;
  padding: 2.5rem 1.5rem;
  position: relative;
  animation: summaryAppear 0.5s ease-out;
}

.daily-limit-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.daily-limit-title {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.daily-limit-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.daily-limit-countdown {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent2);
  margin-bottom: 0.5rem;
}

.countdown-label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.daily-limit-reset {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.2s;
}
.daily-limit-reset:hover {
  opacity: 0.8;
  color: var(--accent);
}

/* Developer reset hint during card play */
.swipe-dev-hint {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--muted);
  opacity: 0.2;
  cursor: pointer;
  transition: opacity 0.2s;
  z-index: 5;
  user-select: none;
}
.swipe-dev-hint:hover {
  opacity: 0.7;
  color: var(--accent);
}

.swipe-contact-btn {
  display: block !important;
  margin: 1.5rem auto 0 !important;
  text-align: center !important;
  font-size: 0.7rem !important;
  padding: 12px 32px !important;
}

/* Continue hint - shown after 5s of waiting */
.continue-hint {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent2);
  padding: 8px;
  animation: hintPulse 1.5s ease-in-out infinite;
  cursor: pointer;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.85rem;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 2px 8px 8px 8px;
  align-self: flex-start;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== Sticky Notes Board ========== */
.sticky-notes-board {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding: 0.5rem 0;
}

.sticky-note {
  position: relative;
  width: 220px;
  height: 240px;
  background: var(--note-color, #f2e59f);
  border-radius: 2px;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.1);
  transform: rotate(var(--note-rot, 0deg));
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.sticky-note:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
  box-shadow: 5px 8px 20px rgba(0,0,0,0.12);
  z-index: 10;
}

.sticky-note.expanded {
  width: 100%;
  max-width: 520px;
  height: auto;
  min-height: 280px;
  transform: rotate(0deg) scale(1);
  z-index: 20;
  cursor: default;
}

.sticky-note-front,
.sticky-note-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sticky-note-back {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.sticky-note.expanded .sticky-note-front {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.sticky-note.expanded .sticky-note-back {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  position: relative;
}

.sticky-note-pin {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  z-index: 5;
}

.sticky-note-title {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: #4a3228;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
  line-height: 1.5;
}

.sticky-note-front-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.88rem;
  color: #5c4030;
  line-height: 1.7;
  font-weight: 500;
  padding: 0 0.5rem;
}

.sticky-note-corner {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.06) 50%);
  border-top-left-radius: 4px;
  transition: all 0.2s;
}

.sticky-note:hover .sticky-note-corner {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.1) 50%);
}

.sticky-note-back-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sticky-note-back-list li {
  font-size: 0.82rem;
  color: #4a3228;
  line-height: 1.8;
  padding: 0.4rem 0;
  padding-left: 1.2rem;
  position: relative;
  border-bottom: 1px solid rgba(90, 64, 48, 0.1);
}

.sticky-note-back-list li:last-child {
  border-bottom: none;
}

.sticky-note-back-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #8b6914;
  font-size: 0.7rem;
}

/* Sticky Note Gallery */
.sticky-gallery {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  animation: fadeInUp 0.4s ease-out;
}

.sticky-gallery-title {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1rem;
}

.sticky-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.sticky-gallery-item {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.sticky-gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.sticky-gallery-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--rule);
}

.sticky-gallery-item span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.5rem;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes detailPop {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== Inventory / Backpack System ========== */
.inv-backpack {
  padding: 0.5rem 0;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Inventory Slot */
.inv-slot {
  position: relative;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inv-slot:hover {
  transform: translateY(-5px) scale(1.05);
  z-index: 5;
}

.inv-slot:hover .inv-item {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* Item Card */
.inv-item {
  position: relative;
  width: 100%;
  min-height: 160px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--rule);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  overflow: hidden;
  transition: all 0.25s ease;
  border-radius: 12px;
}

.inv-item-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--glow-color, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.inv-slot:hover .inv-item-glow {
  opacity: 0.12;
}

.inv-item-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  z-index: 1;
}

.inv-item-name {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--ink);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 0.35rem;
  z-index: 1;
}

.inv-item-type {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  z-index: 1;
}

.inv-item-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.inv-slot:hover .inv-item-shine {
  left: 150%;
}

/* Rarity variants */
.rarity-rare {
  --glow-color: #8ab4ff;
  border-color: rgba(122,184,255,0.35);
}

.rarity-rare .inv-item-type,
.rarity-rare .inv-detail-rarity {
  color: #7ab8ff;
}

.rarity-epic {
  --glow-color: #b088d4;
  border-color: rgba(176,136,212,0.35);
}

.rarity-epic .inv-item-type,
.rarity-epic .inv-detail-rarity {
  color: #b088d4;
}

.rarity-legendary {
  --glow-color: #d4a85c;
  border-color: rgba(212,168,92,0.35);
}

.rarity-legendary .inv-item-type,
.rarity-legendary .inv-detail-rarity {
  color: #d4a85c;
}

.rarity-narrative {
  --glow-color: #d4886c;
  border-color: rgba(212,136,108,0.35);
}

.rarity-narrative .inv-item-type,
.rarity-narrative .inv-detail-rarity {
  color: #d4886c;
}

/* Slot hint */
.inv-slot-hint {
  margin-top: 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

.inv-slot:hover .inv-slot-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Legend */
.inv-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

.inv-legend-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--rule);
  border-radius: 50%;
}

.rarity-common { background: var(--bg4); border-color: var(--muted); }
.rarity-rare { background: #7ab8ff; border-color: #7ab8ff; }
.rarity-epic { background: #b088d4; border-color: #b088d4; }
.rarity-legendary { background: #d4a85c; border-color: #d4a85c; }
.rarity-narrative { background: #d4886c; border-color: #d4886c; }

.inv-legend-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Detail Overlay */
.inv-detail-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(61,50,41,0.4);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  animation: fadeInUp 0.3s ease-out;
}

.inv-detail-overlay.active {
  display: flex;
}

/* Detail Card */
.inv-detail-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: detailPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 16px;
}

.inv-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--rule);
  color: var(--muted);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  z-index: 10;
  transition: all 0.2s;
  border-radius: 6px;
}

.inv-detail-close:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Detail Header */
.inv-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.5);
  border-bottom: 1px solid var(--rule);
  border-radius: 16px 16px 0 0;
}

.inv-detail-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg2);
  border: 1px solid var(--rule);
  flex-shrink: 0;
  border-radius: 10px;
}

.inv-detail-icon.rarity-rare { border-color: #7ab8ff; box-shadow: 0 0 12px rgba(122,184,255,0.1); }
.inv-detail-icon.rarity-epic { border-color: #b088d4; box-shadow: 0 0 12px rgba(176,136,212,0.1); }
.inv-detail-icon.rarity-legendary { border-color: #d4a85c; box-shadow: 0 0 12px rgba(212,168,92,0.1); }
.inv-detail-icon.rarity-narrative { border-color: #d4886c; box-shadow: 0 0 12px rgba(212,136,108,0.1); }

.inv-detail-meta {
  flex: 1;
  min-width: 0;
}

.inv-detail-name {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.inv-detail-rarity {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Detail Body */
.inv-detail-body {
  padding: 1.25rem 1.5rem;
}

.inv-detail-stats {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.inv-stat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.7;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.inv-stat-row:last-child {
  border-bottom: none;
}

.inv-stat-icon {
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1.7;
  flex-shrink: 0;
}

.inv-stat-text {
  flex: 1;
}

/* Carousel */
.inv-carousel {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg2);
  border-radius: 0 0 16px 16px;
}

.inv-carousel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inv-carousel-icon {
  font-size: 1rem;
}

.inv-carousel-title {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  flex: 1;
}

.inv-carousel-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Viewport */
.inv-carousel-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--rule);
  margin-bottom: 0.75rem;
  border-radius: 8px;
}

.inv-carousel-track {
  display: flex;
  overflow: hidden;
  width: 100%;
}

.inv-carousel-slide {
  flex: 0 0 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
}

.inv-carousel-slide.active {
  display: flex;
  animation: fadeInUp 0.3s ease-out;
}

.inv-carousel-slide img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  image-rendering: auto;
  border: 1px solid var(--rule);
  background: #fff;
  display: block;
  border-radius: 4px;
}

.inv-carousel-caption {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Arrows */
.inv-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 36px;
  height: 48px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s;
}

.inv-carousel-arrow:hover {
  border-color: var(--accent);
  background: rgba(212,168,92,0.06);
}

.inv-carousel-prev { left: 0; border-radius: 8px 0 0 8px; }
.inv-carousel-next { right: 0; border-radius: 0 8px 8px 0; }

/* Dots */
.inv-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.inv-carousel-dot {
  width: 10px;
  height: 10px;
  background: var(--bg3);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 50%;
}

.inv-carousel-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(193,127,36,0.3);
}

.inv-carousel-dot:hover {
  border-color: var(--accent);
}

/* ========== Modal Interactive Responsive ========== */
@media (max-width: 768px) {
  .gender-options { flex-direction: column; align-items: center; }
  .gender-option { width: 100%; max-width: 200px; }
  .dialogue-chat { max-height: 320px; }
  .chat-msg { max-width: 90%; }
  .swipe-stage { min-height: 420px; max-width: 100%; }
  .swipe-card-interactive { max-width: 100%; height: 300px; }
  .swipe-card-back-1, .swipe-card-back-2 { max-width: 96%; height: 400px; }
  .swipe-card-portrait { height: 60px; }
  .swipe-card-icon { font-size: 2.8rem; }
  .swipe-card-content { padding: 0.5rem 0.75rem; }
  .swipe-card-prompt { font-size: 0.9rem; }
  .swipe-card-answer { font-size: 0.8rem; }
  .swipe-choice-text { font-size: 0.72rem; }
  .swipe-choice { padding: 0.7rem 0.5rem; }
  .swipe-tutorial-title { font-size: 0.55rem; }
  .sticky-notes-board { flex-direction: column; align-items: center; }
  .sticky-note { width: 90%; max-width: 300px; transform: rotate(0deg) !important; }
  .sticky-note.expanded { width: 100% !important; max-width: 100% !important; }
  .sticky-gallery-grid { grid-template-columns: repeat(2, 1fr); }

  /* Inventory responsive */
  .inv-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .inv-item-icon { font-size: 2rem; }
  .inv-item-name { font-size: 0.45rem; }
  .inv-detail-card { max-width: 96%; }
  .inv-detail-header { padding: 1rem; gap: 0.75rem; }
  .inv-detail-icon { width: 44px; height: 44px; font-size: 1.5rem; }
  .inv-detail-name { font-size: 0.55rem; }
  .inv-detail-body { padding: 1rem; }
  .inv-stat-row { font-size: 0.82rem; }
  .inv-carousel { padding: 1rem; }
  .inv-carousel-slide img { max-height: 220px; }
  .inv-carousel-arrow { width: 30px; height: 40px; font-size: 1rem; }
}

/* ================================================================
   PHASE 1: SPATIAL DEPTH & 3D ENTRANCE ANIMATIONS
   ================================================================ */

/* === Parallax Background Layers === */
.parallax-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.parallax-layer-far {
  background-image:
    radial-gradient(circle at 15% 25%, rgba(193,127,36,0.05) 0%, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(91,127,165,0.05) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(160,98,42,0.03) 0%, transparent 40%);
  z-index: 1;
}

.parallax-layer-mid {
  background-image:
    radial-gradient(circle at 30% 60%, rgba(193,127,36,0.04) 0%, transparent 25%),
    radial-gradient(circle at 70% 30%, rgba(91,127,165,0.03) 0%, transparent 25%);
  z-index: 2;
}

/* Body content above parallax */
body > .hud-bar,
body > nav,
body > .hero,
body > section,
body > footer {
  position: relative;
  z-index: 10;
}

/* === Enhanced Sidebar Depth === */
.side-nav {
  box-shadow:
    2px 0 12px rgba(0,0,0,0.04),
    inset -1px 0 0 rgba(255,255,255,0.3);
  transform: translateY(-50%) translateZ(0);
}

/* === 3D Entrance Animations === */
[data-reveal] {
  opacity: 0;
  will-change: transform, opacity;
}

[data-reveal="card"] {
  transform: translateZ(-80px) rotateY(8deg);
  transition: opacity 0.6s ease-out, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-reveal="badge"] {
  transform: scale(0.6) rotateX(60deg);
  transition: opacity 0.5s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-reveal="timeline"] {
  transform: translateX(-60px) rotateZ(-3deg);
  transition: opacity 0.6s ease-out, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-reveal="section"] {
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal="skill"] {
  transform: translateZ(-40px);
  transition: opacity 0.5s ease-out, transform 0.6s ease-out;
}

[data-reveal="contact"] {
  transform: translateZ(-50px) rotateX(10deg);
  transition: opacity 0.5s ease-out, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateZ(0) rotateY(0) rotateX(0) rotateZ(0) scale(1) translateX(0) translateY(0);
}

[data-reveal].revealed.quest-card {
  transition: all 0.25s;
  transform: none;
}

/* Stagger delay via data-reveal-delay */
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }

/* === Quest Card 3D Container === */
.quest-grid {
  perspective: 1200px;
}

.quest-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* === Achievement Grid 3D === */
.achievement-grid {
  perspective: 800px;
}

/* === Timeline 3D === */
.timeline {
  perspective: 1000px;
}

/* === Contact Grid 3D === */
.contact-grid {
  perspective: 800px;
}

/* === Section Header Float === */
.section-header {
  will-change: transform, opacity;
}

/* === Profile Card 3D === */
.profile-card {
  perspective: 800px;
  will-change: transform, opacity;
}

/* === Skill Category 3D === */
.skill-category {
  will-change: transform, opacity;
}

/* === Reduce motion for users who prefer it === */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .parallax-layer {
    transform: none !important;
  }
}

/* === Mobile: Disable heavy 3D for performance === */
@media (max-width: 768px) {
  [data-reveal="card"] {
    transform: translateY(20px);
  }
  [data-reveal="badge"] {
    transform: scale(0.8);
  }
  [data-reveal="timeline"] {
    transform: translateX(-20px);
  }
  [data-reveal="contact"] {
    transform: translateY(20px);
  }
  .carousel-stage {
    width: 300px;
    height: 120px;
  }
  .carousel-card {
    width: 110px;
    height: 85px;
    margin-left: -55px;
    margin-top: -42px;
  }
  .carousel-card-icon {
    font-size: 1.3rem;
  }
  .carousel-card-keyword {
    font-size: 0.55rem;
  }
  .carousel-card-desc {
    font-size: 0.55rem;
  }



}

.inv-detail-links {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}
