/* ==========================================================================
   DADDY LONG LEGS TAMAGOTCHI - BRAND DESIGN SYSTEM
   Theme: Vintage Scrapbook & Early 20th Century Ivy League College
   ========================================================================== */

/* --- Design Tokens & Variables --- */
:root {
  --bg-parchment: #FAF6EE;
  --bg-parchment-dark: #F0EAD6;
  --bg-slate: #E2D9C8;
  --text-dark: #2C2520;
  --text-medium: #5D5047;
  --text-light: #9B8C7E;
  
  --accent-burgundy: #8C2D19;
  --accent-burgundy-hover: #A03B26;
  --accent-green: #2B5740;
  --accent-green-hover: #376F52;
  --accent-gold: #D69E2E;
  --accent-cream: #FAF9F6;
  
  --stat-energy: #E57373;
  --stat-study: #5D9CEC;
  --stat-social: #FC9A24;
  --stat-stress: #A0A5AD;
  --stat-daddy: #C85A80;
  
  --font-serif: "Gowun Batang", "Noto Serif KR", Georgia, serif;
  --font-cursive: "Cormorant Garamond", "Gowun Batang", cursive;
  --font-title: "Playfair Display", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-vintage: 0 4px 15px rgba(44, 37, 32, 0.08);
  --shadow-deep: 0 8px 30px rgba(44, 37, 32, 0.15);
}

/* --- Resets & Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #EFECE6;
  background-image: 
    radial-gradient(rgba(140, 45, 25, 0.03) 1px, transparent 0),
    radial-gradient(rgba(43, 87, 64, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  color: var(--text-dark);
  font-family: var(--font-serif);
  line-height: 1.6;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Layout & Structure --- */
.game-header {
  position: relative;
  width: 100%;
  max-width: 1280px;
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.25rem 2rem;
  background: var(--bg-parchment-dark);
  border: 3px double var(--text-medium);
  border-radius: 4px;
  box-shadow: var(--shadow-vintage);
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(140, 45, 25, 0.02) 20%, transparent 100%);
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 2;
}

.game-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.15em;
  color: var(--accent-burgundy);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
  margin-bottom: 0.25rem;
}

.game-subtitle {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-medium);
  letter-spacing: 0.1em;
}

.game-container {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 1.5rem;
  width: 100%;
  max-width: 1280px;
  flex-grow: 1;
}

@media (max-width: 1100px) {
  .game-container {
    grid-template-columns: 260px 1fr;
  }
  .right-panel {
    grid-column: 1 / -1;
    height: 350px;
  }
}

@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  .left-panel, .right-panel, .center-panel {
    grid-column: span 1;
  }
}

/* --- Panel Layouts --- */
.panel {
  display: flex;
  flex-direction: column;
}

.panel-inner {
  background-color: var(--bg-parchment);
  border: 1px solid var(--bg-slate);
  border-radius: 8px;
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.shadow-soft {
  box-shadow: var(--shadow-vintage);
}

.shadow-deep {
  box-shadow: var(--shadow-deep);
}

.shadow-inner {
  box-shadow: inset 0 2px 8px rgba(44, 37, 32, 0.05);
}

/* --- Left Panel UI Components --- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--bg-slate);
}

.avatar-container {
  position: relative;
  width: 70px;
  height: 70px;
}

.avatar-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid var(--accent-burgundy);
  border-radius: 50%;
  padding: 2px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  background-color: var(--bg-parchment-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.character-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.badge-row {
  display: flex;
  gap: 0.35rem;
}

.badge {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-year {
  background-color: var(--accent-burgundy);
  color: white;
}

.badge-season {
  background-color: var(--accent-green);
  color: white;
}

/* Calendar Card */
.calendar-card {
  background-color: var(--bg-parchment-dark);
  border-radius: 6px;
  padding: 0.85rem;
  border: 1px solid var(--bg-slate);
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

.calendar-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-date-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-burgundy);
}

.day-highlight {
  font-family: var(--font-title);
  background-color: rgba(140, 45, 25, 0.08);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}

.time-selector {
  display: flex;
  gap: 0.25rem;
  background-color: rgba(44, 37, 32, 0.05);
  padding: 0.2rem;
  border-radius: 4px;
}

.time-slot {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.3rem 0;
  border-radius: 3px;
  color: var(--text-light);
  font-weight: bold;
  transition: var(--transition-smooth);
}

.time-slot.active {
  background-color: var(--bg-parchment);
  color: var(--accent-burgundy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Stat progress bars */
.stats-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-medium);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-medium);
}

.stat-label i {
  margin-right: 0.25rem;
}

.icon-energy { color: var(--stat-energy); }
.icon-study { color: var(--stat-study); }
.icon-social { color: var(--stat-social); }
.icon-stress { color: var(--stat-stress); }
.icon-daddy { color: var(--stat-daddy); }

.progress-bar-bg {
  height: 8px;
  background-color: rgba(44, 37, 32, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.bar-energy { background-color: var(--stat-energy); }
.bar-study { background-color: var(--stat-study); }
.bar-social { background-color: var(--stat-social); }
.bar-stress { background-color: var(--stat-stress); }
.bar-daddy { background-color: var(--stat-daddy); }

/* Wallet components */
.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background-color: var(--bg-parchment-dark);
  border: 1px solid var(--bg-slate);
  border-radius: 6px;
  padding: 0.75rem;
}

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

.wallet-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-medium);
}

.money-amount {
  font-family: var(--font-title);
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--accent-green);
}

.letters-left-indicator {
  font-size: 0.7rem;
  text-align: right;
  margin-top: 0.2rem;
}

.warning-text {
  color: var(--accent-burgundy);
  font-weight: 500;
}

.warning-text b {
  font-size: 0.8rem;
}

/* --- Center Panel Components --- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--bg-slate);
  padding-bottom: 0.5rem;
}

.view-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-burgundy);
  font-family: var(--font-title);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.viewport-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--bg-parchment-dark);
  border: 1px solid var(--bg-slate);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-vintage);
}

.viewport-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.viewport-screen.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

.viewport-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}

/* Action Floating Overlay */
.action-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44, 37, 32, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 5;
  transition: var(--transition-smooth);
}

.action-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.floating-emoji {
  font-size: 3rem;
  animation: bounce 1.5s infinite ease-in-out;
}

.floating-text {
  color: var(--accent-cream);
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-family: var(--font-serif);
}

/* Speech Dialogue Box */
.speech-box-container {
  width: 100%;
  z-index: 3;
}

.speech-bubble {
  background: rgba(250, 246, 238, 0.92);
  border-left: 4px solid var(--accent-burgundy);
  border-radius: 4px;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  backdrop-filter: blur(4px);
}

.speech-bubble p {
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-dark);
}

/* --- Letter Writing Board --- */
.letter-board {
  position: absolute;
  top: 10px; bottom: 10px; left: 15px; right: 15px;
  background-color: var(--accent-cream);
  border: 1px solid var(--bg-slate);
  border-radius: 4px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 4;
  overflow: auto;
}

.letter-top {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-bottom: 1px solid var(--bg-slate);
  padding-bottom: 0.4rem;
}

.letter-date {
  font-family: var(--font-cursive);
  font-size: 1rem;
  text-align: right;
  color: var(--text-medium);
}

.letter-recipient {
  font-family: var(--font-cursive);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-burgundy);
}

.letter-content-area {
  flex-grow: 1;
  display: flex;
}

.letter-content-area textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-family: var(--font-cursive);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-dark);
  outline: none;
}

.letter-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border-top: 1px dashed var(--bg-slate);
  padding-top: 0.5rem;
}

.select-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.select-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-medium);
}

.select-group select {
  font-family: var(--font-serif);
  padding: 0.35rem;
  border: 1px solid var(--bg-slate);
  background-color: var(--bg-parchment);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-dark);
  outline: none;
}

.letter-bottom {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* --- New York Shop Screen --- */
.shop-board {
  padding: 1.25rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.shop-title {
  font-family: var(--font-title);
  color: var(--accent-burgundy);
  font-size: 1.25rem;
  border-bottom: 2px solid var(--bg-slate);
  padding-bottom: 0.25rem;
}

.shop-tagline {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: -0.5rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
}

.shop-item {
  display: flex;
  gap: 0.85rem;
  background-color: var(--bg-parchment);
  border: 1px solid var(--bg-slate);
  padding: 0.75rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.shop-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-vintage);
}

.item-icon {
  font-size: 1.75rem;
  color: var(--accent-burgundy);
  display: flex;
  align-items: center;
}

.item-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.2rem;
}

.item-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.item-desc {
  font-size: 0.7rem;
  color: var(--text-medium);
  line-height: 1.3;
}

.item-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.item-price {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-green);
}

/* Inventory Section */
.inventory-section {
  border-top: 1px dashed var(--bg-slate);
  padding-top: 0.75rem;
}

.inventory-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-medium);
  margin-bottom: 0.4rem;
}

.inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 40px;
  background-color: rgba(44, 37, 32, 0.03);
  padding: 0.5rem;
  border-radius: 4px;
}

.inv-badge {
  background-color: var(--bg-slate);
  color: var(--text-dark);
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.empty-text {
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
}

/* --- Album / Letters Box Board --- */
.album-board {
  padding: 1.25rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.album-title {
  font-family: var(--font-title);
  color: var(--accent-burgundy);
  font-size: 1.25rem;
  border-bottom: 2px solid var(--bg-slate);
  padding-bottom: 0.25rem;
}

.album-tagline {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: -0.5rem;
}

.album-split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  flex-grow: 1;
  height: calc(100% - 60px);
}

.archive-list {
  background-color: var(--bg-parchment);
  border: 1px solid var(--bg-slate);
  border-radius: 4px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.archive-tab {
  padding: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-bottom: 1px dashed var(--bg-slate);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.archive-tab:hover {
  background-color: var(--bg-parchment-dark);
}

.archive-tab.active {
  background-color: var(--accent-burgundy);
  color: white;
  border-bottom-style: solid;
}

.archive-reader {
  background-color: var(--accent-cream);
  border: 1px solid var(--bg-slate);
  border-radius: 4px;
  padding: 1.5rem;
  overflow-y: auto;
}

.reader-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 0.5rem;
}

.reader-empty i {
  font-size: 2rem;
}

.reader-empty p {
  font-size: 0.8rem;
}

/* Archive letter paper details */
.archived-letter {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-cursive);
}

.archived-title {
  font-family: var(--font-title);
  color: var(--accent-burgundy);
  font-size: 1.25rem;
  border-bottom: 1px solid var(--bg-slate);
  padding-bottom: 0.25rem;
}

.archived-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-medium);
}

.archived-body {
  font-size: 1.1rem;
  line-height: 1.6;
  white-space: pre-line;
}

/* --- Action Dock & Control Panels --- */
.action-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.2fr repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .action-dock {
    grid-template-columns: repeat(4, 1fr);
  }
  .btn-highlight-letter {
    grid-column: span 2;
  }
}

.btn-dock {
  background-color: var(--bg-parchment-dark);
  border: 1px solid var(--text-medium);
  border-radius: 4px;
  padding: 0.5rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-dock i {
  font-size: 1.25rem;
  color: var(--text-medium);
}

.btn-dock span {
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-act-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-dock:hover {
  background-color: var(--bg-slate);
  transform: translateY(-1px);
}

.btn-highlight-letter {
  background-color: var(--accent-burgundy);
  border-color: var(--accent-burgundy);
  color: white;
}

.btn-highlight-letter i {
  color: white;
}

.btn-highlight-letter:hover {
  background-color: var(--accent-burgundy-hover);
  border-color: var(--accent-burgundy-hover);
}

/* --- Diary & Log Panel (Right Panel) --- */
.diary-header {
  border-bottom: 2px solid var(--text-medium);
  padding-bottom: 0.5rem;
  text-align: center;
}

.diary-header h2 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--text-dark);
}

.diary-subtitle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}

.diary-body {
  flex-grow: 1;
  background-color: var(--bg-parchment-dark);
  border: 1px solid var(--bg-slate);
  border-radius: 6px;
  padding: 1rem;
  overflow-y: auto;
  max-height: 480px;
}

.diary-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-line {
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--accent-burgundy);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(44, 37, 32, 0.15);
}

.diary-entries-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.diary-paragraph {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-medium);
  border-bottom: 1px dashed rgba(44, 37, 32, 0.08);
  padding-bottom: 0.5rem;
}

.diary-paragraph strong {
  color: var(--accent-green);
  font-size: 0.75rem;
}

.diary-footer {
  margin-top: auto;
}

/* Buttons */
.btn-primary {
  background-color: var(--accent-green);
  border: 1px solid var(--accent-green);
  color: white;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-serif);
}

.btn-primary:hover {
  background-color: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
}

.btn-secondary {
  background-color: var(--bg-parchment-dark);
  border: 1px solid var(--text-light);
  color: var(--text-dark);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-serif);
}

.btn-secondary:hover {
  background-color: var(--bg-slate);
}

.btn-accent {
  background-color: var(--accent-burgundy);
  border: 1px solid var(--accent-burgundy);
  color: white;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-serif);
}

.btn-accent:hover {
  background-color: var(--accent-burgundy-hover);
  border-color: var(--accent-burgundy-hover);
}

.btn-micro {
  background-color: transparent;
  border: 1px solid var(--text-light);
  color: var(--text-medium);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.btn-micro:hover {
  background-color: var(--bg-slate);
  color: var(--text-dark);
}

.btn-full {
  width: 100%;
  display: block;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* --- Modal Overlays --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(44, 37, 32, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: var(--transition-smooth);
}

.modal-box {
  background-color: var(--bg-parchment);
  border: 2px solid var(--accent-burgundy);
  border-radius: 6px;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.modal-stamp {
  font-size: 2.5rem;
  color: var(--accent-burgundy);
  margin-bottom: -0.5rem;
}

.modal-title {
  font-family: var(--font-title);
  color: var(--accent-burgundy);
  font-size: 1.4rem;
}

.modal-content {
  font-size: 0.95rem;
  color: var(--text-medium);
  line-height: 1.5;
  background-color: var(--bg-parchment-dark);
  padding: 1rem;
  border-radius: 4px;
  border: 1px dashed var(--bg-slate);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* --- Ending Overlay Screen --- */
.ending-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #2C2520;
  background-image: 
    radial-gradient(rgba(214, 158, 46, 0.1) 1px, transparent 0);
  background-size: 32px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.ending-box {
  background-color: var(--bg-parchment);
  border: 3px double var(--accent-gold);
  border-radius: 8px;
  padding: 3rem 2rem;
  width: 90%;
  max-width: 650px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 15px 50px rgba(0,0,0,0.5);
}

.ending-wax-seal {
  font-size: 3.5rem;
  animation: rotateSeal 2s ease-out;
}

.ending-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--accent-burgundy);
}

.ending-subtitle {
  font-size: 0.85rem;
  color: var(--text-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: -1rem;
}

.ending-report {
  background-color: var(--bg-parchment-dark);
  border: 1px solid var(--bg-slate);
  border-radius: 6px;
  padding: 1rem;
}

.ending-stats-row {
  display: flex;
  justify-content: space-around;
}

.ending-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ending-stat .label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.ending-stat .val {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-burgundy);
}

.ending-story-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-dark);
  text-align: justify;
  background-color: var(--accent-cream);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px dashed var(--bg-slate);
  max-height: 250px;
  overflow-y: auto;
}

.btn-large {
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
}

/* --- CSS Keyframe Animations --- */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes rotateSeal {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0); }
}

.animate-popup {
  animation: popupScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popupScale {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Credits footer styling */
.credits-footer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 1.5rem;
  width: 100%;
}

/* Portrait Closets & Wardrobe */
.closet-board {
  padding: 1.25rem;
  background-color: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--bg-slate);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: auto;
}

.closet-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--accent-burgundy);
  margin-bottom: 0.25rem;
  border-bottom: 2px solid var(--bg-slate);
  padding-bottom: 0.25rem;
}

.closet-tagline {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

.closet-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  flex-grow: 1;
}

@media (max-width: 768px) {
  .closet-split {
    grid-template-columns: 1fr;
  }
}

/* Wood & Gold Vintage Picture Frame */
.portrait-frame-container {
  background-color: #3e2723; /* Deep dark brown wood tone */
  padding: 12px;
  border-radius: 8px;
  border: 5px solid #2e1c19;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 6px 15px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  box-sizing: border-box;
}

.portrait-wood-frame {
  width: 100%;
  height: 100%;
  border: 8px solid #8d6e63; /* Light wood molding */
  border-image: linear-gradient(135deg, #a1887f, #5d4037) 8;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.portrait-gold-inner {
  width: 100%;
  height: 100%;
  border: 5px double #d4af37; /* Burnished gold leaf edge */
  background-color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  aspect-ratio: 4 / 5;
}

.portrait-canvas {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease-in-out;
  position: relative;
}

.portrait-canvas::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, transparent 45%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}

/* Wardrobe Inspector */
.wardrobe-inspector {
  background-color: var(--accent-cream);
  border: 1px solid var(--bg-slate);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.wardrobe-header {
  border-bottom: 1px solid var(--bg-slate);
  padding-bottom: 0.4rem;
}

.wardrobe-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--accent-burgundy);
  margin: 0;
}

.wardrobe-details {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.wardrobe-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wardrobe-row .label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

.wardrobe-row .value {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-dark);
}

.wardrobe-row .value-badge {
  background-color: var(--bg-parchment);
  border: 1px solid var(--bg-slate);
  color: var(--accent-burgundy);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-block;
  width: fit-content;
}

.wardrobe-row .value-desc {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-medium);
  margin: 0;
  background-color: rgba(255, 255, 255, 0.45);
  padding: 0.6rem;
  border-radius: 4px;
  border: 1px dashed var(--bg-slate);
}

.wardrobe-collection {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.collection-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-medium);
  margin: 0;
}

.outfit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.outfit-badge-active {
  background-color: #e8f5e9 !important;
  color: #2e7d32 !important;
  border-color: #a5d6a7 !important;
}

