﻿:root {
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-rgb: 14, 165, 233;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --purple: #8b5cf6;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --gold: #fbbf24;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #090d16 radial-gradient(circle at 50% 0%, #1e3a8a 0%, #090d16 80%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 70px;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* TOP HEADER */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  gap: 6px;
  align-items: center;
}

.day-badge {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 9999px;
}

.time-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 9999px;
}

.game-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #38bdf8, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  color: #fff;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.icon-btn.danger-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* RESOURCE DASHBOARD BAR */
.res-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid var(--bg-card-border);
  font-size: 12px;
}

.res-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.res-item.highlight {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  border-color: rgba(251, 191, 36, 0.4);
}

.res-icon {
  font-size: 14px;
  line-height: 1.2;
}

.res-val {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 11px;
}

.res-item.highlight .res-val {
  color: #fbbf24;
}

/* QUICK CG STRIP */
.cg-progress-strip {
  background: linear-gradient(90deg, #1e1b4b, #312e81, #1e1b4b);
  border-bottom: 1px solid rgba(168, 85, 247, 0.4);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cg-progress-strip:hover {
  background: linear-gradient(90deg, #2e1065, #3730a3, #2e1065);
}

.cg-strip-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.cg-strip-info strong {
  color: #c084fc;
}

.cg-count {
  font-weight: 700;
  color: #facc15;
}

.cg-meter-bg {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 9999px;
  overflow: hidden;
}

.cg-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #f59e0b);
  border-radius: 9999px;
  transition: width 0.4s ease-out;
}

.cg-strip-hint {
  font-size: 10px;
  color: #cbd5e1;
  text-align: right;
  opacity: 0.8;
}

/* MAIN CONTENT */
.game-main {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
  display: flex;
}

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

/* GENERAL CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3, .card-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.badge.highlight-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge.gold-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(251, 191, 36, 0.4));
  color: #fef08a;
  border: 1px solid #facc15;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: #fff;
  gap: 6px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--bg-card-border);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

.btn-purple {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.35);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* TAB 1: CAMP */
.camp-hero-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--bg-card-border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.camp-bg-visual {
  height: 160px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.9) 100%),
              url('assets/cg/cg_02.png') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  position: relative;
}

.camp-overlay-text h2 {
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.camp-overlay-text p {
  font-size: 11px;
  color: #cbd5e1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  margin-bottom: 8px;
}

.campfire-btn {
  align-self: flex-start;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.5);
  animation: pulseFire 2s infinite ease-in-out;
}

@keyframes pulseFire {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(249, 115, 22, 0.5); }
  50% { transform: scale(1.04); box-shadow: 0 0 24px rgba(249, 115, 22, 0.8); }
}

/* RAFT PROGRESS */
.progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: rgba(0,0,0,0.4);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.raft-actions {
  display: flex;
  gap: 8px;
}

.raft-actions .btn {
  flex: 1;
}

/* COOKING GRID */
.cook-recipes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recipe-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.recipe-box.highlight-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(180, 83, 9, 0.2));
  border-color: rgba(245, 158, 11, 0.4);
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.recipe-icon {
  font-size: 22px;
}

.recipe-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.recipe-info strong {
  font-size: 12px;
  color: #f1f5f9;
}

.recipe-req {
  font-size: 11px;
  color: #94a3b8;
}

.effect {
  font-size: 10px;
  color: #38bdf8;
  font-weight: 700;
}

/* MAIDEN AFFECTION */
.maiden-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.maiden-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  padding: 8px 10px;
  transition: transform 0.15s ease;
}

.maiden-row:hover {
  transform: translateX(2px);
  border-color: rgba(244, 114, 182, 0.4);
}

.maiden-avatar {
  font-size: 24px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maiden-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.maiden-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.maiden-head strong {
  font-size: 13px;
  color: #fce7f3;
}

.maiden-role {
  font-size: 10px;
  color: #94a3b8;
}

.affection-bar {
  width: 100%;
  height: 5px;
  background: rgba(0,0,0,0.4);
  border-radius: 9999px;
  overflow: hidden;
}

.affection-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #f43f5e);
  border-radius: 9999px;
  transition: width 0.3s;
}

.maiden-status {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #cbd5e1;
}

.bonus-tag {
  color: #38bdf8;
  font-weight: 700;
}

.maiden-dialogue {
  font-size: 10px;
  color: #a5b4fc;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-gift {
  background: linear-gradient(135deg, #ec4899, #db2777);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
  white-space: nowrap;
}

/* TAB 2: EXPLORE ZONES */
.explore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.zone-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.zone-banner {
  height: 70px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  background-size: cover;
  background-position: center;
}

.banner-beach {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%),
              url('assets/cg/cg_03.png') center/cover no-repeat;
}

.banner-fishing {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%),
              url('assets/cg/cg_04.png') center/cover no-repeat;
}

.banner-jungle {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%),
              url('assets/cg/cg_05.png') center/cover no-repeat;
}

.banner-cave {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%),
              url('assets/cg/cg_08.png') center/cover no-repeat;
}

.zone-info h3 {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 4px #000;
}

.zone-info p {
  font-size: 10px;
  color: #cbd5e1;
  text-shadow: 0 1px 3px #000;
}

.zone-cost {
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
}

.zone-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.zone-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.zone-drops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.drop-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #cbd5e1;
}

.btn-group-row {
  display: flex;
  gap: 6px;
}

.btn-group-row .btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 11px;
}

/* LOG CARD */
.log-stream {
  max-height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-family: 'Pretendard', sans-serif;
  padding-right: 4px;
}

.log-stream::-webkit-scrollbar {
  width: 4px;
}

.log-stream::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.log-entry {
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid #64748b;
  color: #e2e8f0;
}

.log-entry.system { border-color: #38bdf8; color: #bae6fd; }
.log-entry.reward { border-color: #facc15; color: #fef08a; }
.log-entry.unlock { border-color: #ec4899; color: #fbcfe8; font-weight: 700; }
.log-entry.danger { border-color: #ef4444; color: #fca5a5; }

/* TAB 3: CG GALLERY */
.gallery-header-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-title-area h2 {
  font-size: 17px;
  font-weight: 900;
  color: #f1f5f9;
}

.gallery-title-area p {
  font-size: 12px;
  color: var(--text-muted);
}

.gallery-filter-buttons {
  display: flex;
  gap: 6px;
}

.filter-btn {
  flex: 1;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

.cg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cg-card {
  position: relative;
  aspect-ratio: 4/3;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bg-card-border);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.cg-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

.cg-card.locked {
  filter: grayscale(0.9);
  opacity: 0.65;
}

.cg-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: filter 0.3s;
}

.cg-card.locked img {
  filter: blur(8px) brightness(0.4);
}

.cg-badge-number {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
}

.cg-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  color: #f1f5f9;
  text-align: center;
  padding: 8px;
  gap: 4px;
  z-index: 3;
}

.cg-lock-icon {
  font-size: 20px;
}

.cg-lock-hint {
  font-size: 9px;
  color: #cbd5e1;
  line-height: 1.2;
}

.cg-title-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  padding: 14px 6px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

/* MASTER POSTER CARD */
.poster-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bg-card-border);
  aspect-ratio: 16/9;
  cursor: pointer;
}

.poster-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.poster-preview img.poster-locked {
  filter: blur(5px) brightness(0.6);
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fef08a;
}

/* TAB 4: GACHA */
.gacha-showcase {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gacha-visual-box {
  background: radial-gradient(circle at center, #312e81 0%, #0f172a 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gacha-chest {
  font-size: 64px;
  animation: chestBounce 2s infinite ease-in-out;
  cursor: pointer;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
}

@keyframes chestBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.gacha-text h2 {
  font-size: 18px;
  font-weight: 900;
  color: #fde047;
}

.gacha-text p {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
}

.pity-counter {
  margin-top: 8px;
  display: inline-block;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  color: #fef08a;
}

.rates-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rate-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
}

.rate-grade.grade-cg { color: #f472b6; font-weight: 700; }
.rate-grade.grade-res { color: #38bdf8; }
.rate-grade.grade-aff { color: #fbbf24; }

.gacha-buttons-row {
  display: flex;
  gap: 10px;
}

.btn-gacha {
  flex: 1;
  flex-direction: column;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  padding: 14px 10px;
}

.btn-gacha-multi {
  flex: 1;
  flex-direction: column;
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  padding: 14px 10px;
}

.gacha-btn-title {
  font-size: 15px;
  font-weight: 900;
}

.gacha-btn-cost {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 400;
}

.tips-list {
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* BOTTOM NAVIGATION */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-around;
  padding: 6px 10px;
  backdrop-filter: blur(16px);
  z-index: 50;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  position: relative;
  transition: color 0.15s, transform 0.15s;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: #38bdf8;
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 14px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  animation: pulseFire 1.5s infinite;
}

/* MODALS */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  z-index: 10;
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CG VIEWER MODAL */
.cg-viewer-wrap {
  display: flex;
  flex-direction: column;
}

.cg-viewer-img-box {
  width: 100%;
  background: #000;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  overflow: hidden;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cg-viewer-img-box img {
  width: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
}

.cg-viewer-meta {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cg-meta-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cg-number-badge {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
}

.cg-meta-header h2 {
  font-size: 18px;
  font-weight: 900;
  color: #f1f5f9;
}

.cg-theme-tag {
  font-size: 11px;
  color: #a855f7;
}

.cg-story-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

.cg-dialogue-box {
  background: rgba(30, 41, 59, 0.7);
  border-left: 3px solid #ec4899;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}

.cg-dialogue-box strong {
  color: #f472b6;
}

.cg-bonus-box {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  gap: 6px;
}

.cg-bonus-label {
  color: #fbbf24;
  font-weight: 700;
}

.cg-bonus-desc {
  color: #fef08a;
}

.cg-viewer-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.cg-viewer-actions .btn {
  flex: 1;
}

/* UNLOCK CELEBRATION MODAL */
.unlock-celebration-content {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.celebration-badge {
  background: linear-gradient(90deg, #ec4899, #f59e0b);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 1px;
}

.unlock-img-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #fbbf24;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

.unlock-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.unlock-bonus {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #fef08a;
  font-weight: 700;
}

/* FISHING MODAL */
.fishing-modal-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.fishing-sea-view {
  height: 140px;
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 60%, #0c4a6e 100%);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fishing-bobber {
  font-size: 32px;
  transition: transform 0.15s ease;
}

.fishing-bobber.nibble {
  animation: bobberBite 0.25s infinite;
}

@keyframes bobberBite {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

.fishing-status-text {
  margin-top: 10px;
  font-size: 12px;
  color: #e0f2fe;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.fishing-bar-wrap {
  width: 100%;
  height: 24px;
  background: #1e293b;
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.fishing-bar-target {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(250, 204, 21, 0.45);
  border: 1px solid #facc15;
  border-radius: 4px;
  width: 25%;
  left: 40%;
}

.fishing-bar-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  left: 0%;
  border-radius: 2px;
}

.fishing-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* BOAR BATTLE MODAL */
.battle-modal-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.battle-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
}

.enemy-side, .party-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.enemy-avatar {
  font-size: 54px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  transition: transform 0.15s;
}

.enemy-avatar.hit {
  animation: hitShake 0.3s;
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); filter: brightness(2); }
  75% { transform: translateX(8px); }
}

.party-avatars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 11px;
  color: #f1f5f9;
  font-weight: 600;
  width: 100%;
}

.hp-gauge-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hp-label {
  font-size: 10px;
  color: #cbd5e1;
}

.hp-bar {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 9999px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.hp-fill.enemy-hp { background: #ef4444; }
.hp-fill.party-hp { background: #10b981; }

.battle-log {
  background: rgba(0,0,0,0.3);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #bae6fd;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.battle-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* MASTER POSTER MODAL */
.poster-modal-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poster-modal-img-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--bg-card-border);
}

.poster-modal-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.poster-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
