/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pixel: 4px;
  --bg-dark: #0a0a14;
  --bg-mid: #0d1528;
  --bg-panel: #0a2847;
  --accent-gold: #ffe100;
  --accent-amber: #ff9500;
  --accent-green: #00ff41;
  --accent-green-light: #39ff7f;
  --accent-red: #ff1744;
  --accent-blue: #00e5ff;
  --accent-pink: #ff1744;
  --text-primary: #e8e8e8;
  --text-secondary: #a8a8b8;
  --text-dim: #6a6a7a;
  --border-pixel: #3a3a5c;
  --crt-line: rgba(0, 0, 0, 0.08);
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'DotGothic16', 'Noto Sans KR', sans-serif;
  --font-kr: 'Noto Sans KR', sans-serif;
}

html {
  scroll-behavior: auto;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.8;
  position: relative;
}

/* ===== CRT SCANLINE OVERLAY ===== */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--crt-line) 2px,
    var(--crt-line) 4px
  );
  will-change: transform;
}

/* CRT vignette */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
  will-change: transform;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAV BAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(26, 26, 46, 0.95);
  border-bottom: var(--pixel) solid var(--border-pixel);
  backdrop-filter: blur(4px);
  will-change: backdrop-filter;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo span {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent-gold);
  letter-spacing: 1px;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
  text-transform: uppercase;
  line-height: 1;
}

.nav-links a:hover {
  color: var(--accent-gold);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--accent-gold);
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.section-header h2 {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--accent-gold);
  letter-spacing: 2px;
  margin-bottom: 12px;
  line-height: 1;
}

.section-header .header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.section-header .header-bar::before,
.section-header .header-bar::after {
  content: '';
  width: 60px;
  height: var(--pixel);
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.section-header .subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  position: relative;
  overflow: hidden;
}

/* Floating pixel particles */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-gold);
  opacity: 0;
  animation: floatParticle 8s infinite;
}

@keyframes floatParticle {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-20px) scale(1); opacity: 0; }
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

/* RPG Dialogue Box */
.dialogue-box {
  background: var(--bg-mid);
  border: calc(var(--pixel) * 2) solid var(--accent-gold);
  padding: 160px 40px 65px 220px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  box-shadow:
    inset calc(var(--pixel) * -2) calc(var(--pixel) * -2) 0 0 rgba(255,255,255,0.05),
    inset calc(var(--pixel) * 2) calc(var(--pixel) * 2) 0 0 rgba(0,0,0,0.3),
    0 0 80px rgba(226, 183, 20, 0.1);
}

/* Dialogue box corner decorations */
.dialogue-box::before {
  content: '';
  position: absolute;
  top: -16px;
  left: -16px;
  right: -16px;
  bottom: -16px;
  border: 4px solid rgba(226, 183, 20, 0.2);
  pointer-events: none;
}

.dialogue-box .speaker {
  position: absolute;
  top: -24px;
  left: -36px;
  background: var(--bg-dark);
  padding: 8px 32px;
  border: calc(var(--pixel) * 2) solid var(--accent-gold);
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--accent-gold);
  letter-spacing: 2px;
  line-height: 1;
  min-height: 44px;
}

/* Typing animation styles */
.typing-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 80px;
  margin-bottom: 0;
  position: relative;
}

/* Character licking animation */
.moeater-character {
  position: absolute;
  bottom: -36px;
  left: -530px;
  width: 525px;
  height: 252px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.moeater-character.walking {
  animation: characterWalk 1.6s ease-out forwards;
}

.moeater-character.walking .character-img {
  animation: walkBounce 0.3s steps(2) infinite;
}

.moeater-character.arrived {
  opacity: 1;
}

.moeater-character.arrived .character-img {
  animation: none;
}

.character-img {
  width: 525px;
  height: 252px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(226, 183, 20, 0.5));
  transition: filter 0.3s;
  pointer-events: none;
}

.character-hitbox {
  position: absolute;
  left: 28%;
  top: 19%;
  width: 39%;
  height: 56%;
  pointer-events: auto;
  cursor: pointer;
}


@keyframes rainbowTongueGlow {
  0%   { filter: drop-shadow(0 0 8px #ff0000) brightness(1.5) hue-rotate(0deg); }
  100% { filter: drop-shadow(0 0 8px #ff0000) brightness(1.5) hue-rotate(360deg); }
}

@keyframes rainbowGlow {
  0%   { filter: drop-shadow(0 0 12px #ff0000) drop-shadow(0 0 24px #ff0000); }
  16%  { filter: drop-shadow(0 0 12px #ff9900) drop-shadow(0 0 24px #ff9900); }
  33%  { filter: drop-shadow(0 0 12px #ffff00) drop-shadow(0 0 24px #ffff00); }
  50%  { filter: drop-shadow(0 0 12px #00ff00) drop-shadow(0 0 24px #00ff00); }
  66%  { filter: drop-shadow(0 0 12px #0099ff) drop-shadow(0 0 24px #0099ff); }
  83%  { filter: drop-shadow(0 0 12px #cc00ff) drop-shadow(0 0 24px #cc00ff); }
  100% { filter: drop-shadow(0 0 12px #ff0000) drop-shadow(0 0 24px #ff0000); }
}

.character-tongue {
  position: absolute;
  top: 42%;
  left: 67%;
  width: 6px;
  height: 6px;
  background: #ff1744;
  image-rendering: pixelated;
  box-shadow:
    0 6px 0 #ff1744, 6px 6px 0 #ff1744,
    6px 12px 0 #ff1744, 12px 12px 0 #ff1744,
    12px 18px 0 #ff1744, 18px 18px 0 #ff1744,
    18px 24px 0 #cc1a5e, 24px 24px 0 #cc1a5e,
    18px 30px 0 #cc1a5e, 24px 30px 0 #cc1a5e,
    18px 36px 0 #cc1a5e, 24px 36px 0 #cc1a5e, 30px 36px 0 #cc1a5e,
    24px 42px 0 #cc1a5e, 30px 42px 0 #cc1a5e, 36px 42px 0 #cc1a5e,
    18px 48px 0 #a01048, 24px 48px 0 #a01048, 30px 48px 0 #a01048, 36px 48px 0 #a01048,
    24px 54px 0 #a01048, 30px 54px 0 #a01048, 36px 54px 0 #a01048, 42px 54px 0 #a01048,
    24px 60px 0 #a01048, 30px 60px 0 #a01048, 36px 60px 0 #a01048, 42px 60px 0 #a01048,
    30px 66px 0 #a01048, 36px 66px 0 #a01048, 42px 66px 0 #a01048,
    30px 72px 0 #a01048, 36px 72px 0 #a01048;
  transform-origin: 3px 0;
  opacity: 0;
}

.moeater-character.licking .character-tongue {
  opacity: 1;
  animation: tongueAppear 0.6s ease-out forwards;
}

.moeater-character.lick-loop {
  pointer-events: auto;
}

.moeater-character.lick-loop .character-tongue {
  opacity: 1;
  animation: tongueLoop 1.2s ease-in-out infinite alternate;
}

.moeater-character.lick-loop:hover .character-tongue {
  animation-duration: 0.24s;
}

@keyframes characterWalk {
  0%   { left: -530px; opacity: 0; }
  5%   { opacity: 1; }
  100% { left: calc(50% - 515px); opacity: 1; }
}

@keyframes walkBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}

@keyframes tongueAppear {
  0%   { opacity: 0; transform: scaleY(0); }
  100% { opacity: 1; transform: scaleY(1); }
}

@keyframes tongueLoop {
  0%   { transform: scaleY(0.9) rotate(0deg); }
  25%  { transform: scaleY(1) rotate(3deg); }
  50%  { transform: scaleY(0.9) rotate(0deg); }
  75%  { transform: scaleY(1) rotate(-3deg); }
  100% { transform: scaleY(0.9) rotate(0deg); }
}

.typing-text {
  font-family: var(--font-pixel);
  font-size: 48px;
  color: var(--accent-gold);
  letter-spacing: 6px;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  line-height: 1;
}

.typing-text .moe-text {
  color: var(--accent-gold);
  transition: text-shadow 0.3s, color 0.3s;
}

.typing-text .moe-text.licked {
  color: #ffee33;
  text-shadow:
    0 0 8px rgba(226, 183, 20, 0.9),
    0 0 20px rgba(226, 183, 20, 0.6),
    0 0 40px rgba(226, 183, 20, 0.3);
}

.typing-text .ater-text {
  color: var(--accent-gold);
  transition: color 0.3s, text-shadow 0.3s;
}

.typing-text .ater-text.licked {
  color: #ff1744;
  text-shadow:
    0 0 8px rgba(255, 23, 68, 0.9),
    0 0 20px rgba(255, 23, 68, 0.6),
    0 0 40px rgba(255, 23, 68, 0.3);
}

.typing-cursor {
  font-family: var(--font-pixel);
  font-size: 40px;
  color: var(--accent-gold);
  animation: blink 1s step-end infinite;
  line-height: 1;
}

.typing-cursor.hidden {
  visibility: hidden;
}

/* Lick text */
.lick-text {
  font-family: var(--font-kr);
  font-size: 28px;
  color: #ff1744;
  letter-spacing: 4px;
  position: absolute;
  top: 130px;
  right: 40px;
  min-height: 40px;
  text-shadow: 0 0 16px rgba(255, 23, 68, 0.6);
}

.lick-text.wobble {
  animation: wobble 2s ease-in-out infinite;
  transition: color 0.3s, text-shadow 0.3s;
}

.moeater-character.lick-loop:hover ~ .lick-text,
.lick-text.rainbow {
  animation: wobble 0.4s ease-in-out infinite, rainbowText 1.5s linear infinite;
}

@keyframes rainbowText {
  0%   { color: #ff0000; text-shadow: 0 0 16px #ff0000, 0 0 32px #ff0000; }
  16%  { color: #ff9900; text-shadow: 0 0 16px #ff9900, 0 0 32px #ff9900; }
  33%  { color: #ffff00; text-shadow: 0 0 16px #ffff00, 0 0 32px #ffff00; }
  50%  { color: #00ff00; text-shadow: 0 0 16px #00ff00, 0 0 32px #00ff00; }
  66%  { color: #0099ff; text-shadow: 0 0 16px #0099ff, 0 0 32px #0099ff; }
  83%  { color: #cc00ff; text-shadow: 0 0 16px #cc00ff, 0 0 32px #cc00ff; }
  100% { color: #ff0000; text-shadow: 0 0 16px #ff0000, 0 0 32px #ff0000; }
}

@keyframes wobble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-2deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-2px) rotate(2deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Triangle indicator at bottom of dialogue box */
.dialogue-indicator {
  position: absolute;
  bottom: 24px;
  right: 40px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid var(--accent-gold);
  animation: indicatorBounce 1.2s step-start infinite;
}

@keyframes indicatorBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.scroll-indicator span {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

.scroll-arrow {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto;
  border-right: 3px solid var(--accent-gold);
  border-bottom: 3px solid var(--accent-gold);
  transform: rotate(45deg);
  animation: scrollBounce 2s step-start infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 1; }
  50% { transform: rotate(45deg) translate(4px, 4px); opacity: 0.4; }
}

/* ===== PROJECTS SECTION ===== */
.projects {
  padding: 80px 0;
  position: relative;
}

/* Quest Log Style */
.quest-log {
  background: var(--bg-mid);
  border: var(--pixel) solid var(--border-pixel);
  box-shadow:
    inset calc(var(--pixel) * -1) calc(var(--pixel) * -1) 0 0 rgba(255,255,255,0.05),
    inset var(--pixel) var(--pixel) 0 0 rgba(0,0,0,0.3);
  overflow: hidden;
}

.quest-log-header {
  background: var(--bg-panel);
  padding: 12px 24px;
  border-bottom: var(--pixel) solid var(--border-pixel);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-log-header .icon {
  font-size: 16px;
}

.quest-log-header h3 {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--accent-amber);
  letter-spacing: 2px;
  line-height: 1;
}

/* Quest Item */
.quest-item {
  padding: 32px;
  border-bottom: 2px solid var(--border-pixel);
  display: flex;
  gap: 28px;
  align-items: flex-start;
  transition: background 0.2s;
}

.quest-item:last-child {
  border-bottom: none;
}

.quest-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.quest-thumb {
  flex-shrink: 0;
  width: 200px;
  height: 140px;
  overflow: hidden;
  border: var(--pixel) solid var(--border-pixel);
  position: relative;
  background: var(--bg-dark);
}

.quest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  display: block;
}

.quest-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Conveyor belt animation for factory game */
.conveyor-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--bg-dark) 0px,
    var(--bg-dark) 16px,
    #252540 16px,
    #252540 20px,
    var(--bg-dark) 20px,
    var(--bg-dark) 36px,
    #252540 36px,
    #252540 40px
  );
  animation: conveyorMove 2s linear infinite;
}

@keyframes conveyorMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.factory-icon-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gear-icon {
  width: 40px;
  height: 40px;
  border: 4px solid var(--accent-amber);
  border-radius: 50%;
  position: relative;
  animation: gearSpin 4s linear infinite;
}

.gear-icon::before,
.gear-icon::after {
  content: '';
  position: absolute;
  background: var(--accent-amber);
}

.gear-icon::before {
  width: 8px;
  height: 52px;
  top: -10px;
  left: 12px;
}

.gear-icon::after {
  width: 52px;
  height: 8px;
  top: 12px;
  left: -10px;
}

@keyframes gearSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.factory-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--accent-amber);
  letter-spacing: 1px;
  line-height: 1;
}

.quest-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 1px;
  line-height: 1;
  z-index: 3;
}

.status-active {
  background: var(--accent-green);
  color: #fff;
}

.status-planning {
  background: var(--accent-amber);
  color: var(--bg-dark);
}

.quest-info {
  flex: 1;
}

.quest-info .quest-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--accent-gold);
  margin-bottom: 4px;
  line-height: 1;
}

.quest-info .quest-title-kr {
  font-family: var(--font-kr);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.quest-info .quest-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 16px;
}

.quest-info .quest-desc em {
  color: var(--accent-green-light);
  font-style: normal;
}

/* Quest stats like RPG item stats */
.quest-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.quest-stat {
  background: rgba(255,255,255,0.04);
  border: 2px solid var(--border-pixel);
  padding: 4px 12px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  line-height: 1;
  min-width: 80px;
}

.quest-stat .stat-val {
  color: var(--accent-gold);
  margin-left: 4px;
}

.quest-link {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--bg-dark);
  background: var(--accent-gold);
  padding: 8px 20px;
  text-decoration: none;
  border: none;
  letter-spacing: 1px;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  line-height: 1;
}

.quest-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
}

.quest-link:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}

/* ===== TEAM SECTION ===== */
.team {
  padding: 80px 0;
}

.party-select {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.party-member {
  background: var(--bg-mid);
  border: var(--pixel) solid var(--border-pixel);
  padding: 32px 24px;
  text-align: center;
  width: 260px;
  position: relative;
  transition: border-color 0.3s, transform 0.2s;
  box-shadow:
    inset calc(var(--pixel) * -1) calc(var(--pixel) * -1) 0 0 rgba(255,255,255,0.05),
    inset var(--pixel) var(--pixel) 0 0 rgba(0,0,0,0.3),
    var(--pixel) var(--pixel) 0 0 rgba(0,0,0,0.5);
}

.party-member:hover {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
}

.party-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border: var(--pixel) solid var(--border-pixel);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  image-rendering: pixelated;
}

.party-avatar .initial {
  font-family: var(--font-pixel);
  font-size: 28px;
  color: var(--accent-gold);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  line-height: 1;
}

.party-member .member-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--accent-gold);
  margin-bottom: 4px;
  letter-spacing: 1px;
  line-height: 1;
}

.party-member .member-name-en {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 2px;
  line-height: 1;
}

.party-member .class-tag {
  display: inline-block;
  background: var(--bg-panel);
  border: 2px solid var(--border-pixel);
  padding: 4px 12px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--accent-green-light);
  margin-bottom: 16px;
  letter-spacing: 1px;
  line-height: 1;
}

.party-member .member-skills {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* HP/MP bars */
.stat-bars {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-bar .label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  width: 24px;
  letter-spacing: 1px;
  line-height: 1;
}

.stat-bar .bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-dark);
  border: 2px solid var(--border-pixel);
  position: relative;
  overflow: hidden;
}

.stat-bar .bar-fill {
  height: 100%;
  transition: width 1s steps(10);
}

.bar-fill.hp { background: var(--accent-green); }
.bar-fill.mp { background: var(--accent-blue); }
.bar-fill.atk { background: var(--accent-amber); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-mid);
  border-top: var(--pixel) solid var(--border-pixel);
  padding: 40px 0 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.footer-links a {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.footer-links a:hover {
  color: var(--accent-gold);
}

.footer-divider {
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-pixel), transparent);
  margin: 0 auto 20px;
}

.footer-copy {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 1px;
  line-height: 1;
}

/* ===== SCROLL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s steps(4), transform 0.4s steps(4);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 46, 0.98);
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: var(--pixel) solid var(--border-pixel);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }

  .dialogue-box {
    padding: 48px 40px;
  }

  .typing-text {
    font-size: 36px;
  }

  .moeater-character {
    width: 405px;
    height: 189px;
    bottom: -27px;
  }

  .character-img {
    width: 405px;
    height: 189px;
  }

  @keyframes characterWalk {
    0%   { left: -410px; opacity: 0; }
    5%   { opacity: 1; }
    100% { left: calc(50% - 397px); opacity: 1; }
  }

  .quest-item {
    flex-direction: column;
    padding: 20px;
  }

  .quest-thumb {
    width: 100%;
    height: 160px;
  }

  .section-header h2 {
    font-size: 14px;
  }

  .party-select {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .party-member {
    width: 100%;
    max-width: 320px;
  }

  .footer-links {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .moeater-character {
    width: 330px;
    height: 147px;
    bottom: -21px;
  }

  .character-img {
    width: 330px;
    height: 147px;
  }

  @keyframes characterWalk {
    0%   { left: -335px; opacity: 0; }
    5%   { opacity: 1; }
    100% { left: calc(50% - 324px); opacity: 1; }
  }

  .typing-text {
    font-size: 28px;
  }

  .dialogue-box .speaker {
    font-size: 16px;
    padding: 4px 20px;
  }

  .quest-info .quest-title {
    font-size: 11px;
  }

  .quest-stats {
    gap: 6px;
  }

  .quest-stat {
    font-size: 6px;
    padding: 3px 8px;
  }
}

/* ===== SPECIAL EFFECTS ===== */

/* Pixel noise background subtle */
.pixel-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  will-change: transform;
}

/* Highlighted quest link for pixel factory */
.quest-link-outline {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent-amber);
  background: transparent;
  padding: 8px 20px;
  text-decoration: none;
  border: 3px solid var(--accent-amber);
  letter-spacing: 1px;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  line-height: 1;
}

.quest-link-outline:hover {
  background: rgba(245, 166, 35, 0.1);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.3);
}

/* Emphasis styling for factory game */
.pixel-emphasis {
  position: relative;
  display: inline;
}

.pixel-emphasis::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-amber);
  opacity: 0.6;
}