/* =============================================================
   DOGECOIN ON CLAUDE - Much Wow Interface
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Bangers&display=swap');

:root {
  /* Dogecoin Gold Theme */
  --bg-primary: #1a1612;
  --bg-secondary: #211c16;
  --bg-tertiary: #2a231b;
  --bg-panel: #1e1914;
  
  /* Dogecoin Gold Colors */
  --doge-gold: #c2a633;
  --doge-gold-light: #f0d060;
  --doge-gold-dark: #9a8429;
  --doge-glow: rgba(194, 166, 51, 0.4);
  
  /* Accent color - Dogecoin gold */
  --accent-primary: #c2a633;
  --accent-secondary: #f0d060;
  
  /* Legacy cyan vars mapped to gold for compatibility */
  --cyan-primary: #c2a633;
  --cyan-dark: #9a8429;
  --cyan-glow: rgba(194, 166, 51, 0.4);
  
  --text-primary: #f5e6c8;
  --text-secondary: #b8a67a;
  --text-muted: #6a5d42;
  
  --border-color: #3d3425;
  
  /* Much Wow Green for success states */
  --wow-green: #7ec850;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Comic Neue', cursive, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* =============================================================
   OVERLAY EFFECTS
   ============================================================= */

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none !important;
  z-index: 9999;
  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");
}

/* Hide overlays on mobile to improve performance and prevent touch issues */
@media (max-width: 700px) {
  .noise-overlay,
  .scan-line {
    display: none !important;
  }
}

/* =============================================================
   APP LAYOUT
   ============================================================= */

.app-container {
  display: flex;
  height: 100%;
}

/* =============================================================
   SIDEBAR
   ============================================================= */

.sidebar {
  width: 200px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--doge-gold), transparent);
  opacity: 0.2;
}

.sidebar-header {
  padding: 25px 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.logo-text {
  font-size: 2.5rem;
  color: var(--doge-gold);
  text-shadow: 0 0 20px var(--doge-glow);
  font-family: 'Bangers', cursive;
}

.logo-sub {
  font-family: 'Comic Neue', cursive;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.status-line {
  height: 2px;
  background: linear-gradient(90deg, var(--doge-gold), transparent);
  margin-top: 12px;
  opacity: 0.5;
}

.nav-menu {
  flex: 1;
  padding: 15px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--doge-gold);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--doge-gold);
  background: rgba(194, 166, 51, 0.1);
}

.nav-item:hover::before,
.nav-item.active::before {
  transform: scaleY(1);
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

/* Contract Address */
.ca-container {
  margin-top: 15px;
  padding: 12px;
  background: rgba(194, 166, 51, 0.08);
  border: 1px solid rgba(194, 166, 51, 0.2);
  border-radius: 8px;
}

.ca-label {
  font-size: 0.7rem;
  color: var(--doge-gold);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.ca-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ca-address:hover {
  background: rgba(194, 166, 51, 0.15);
  transform: translateY(-1px);
}

.ca-text {
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.4;
}

.ca-copy-icon {
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.ca-address:hover .ca-copy-icon {
  opacity: 1;
}

.ca-copied {
  display: none;
  text-align: center;
  font-size: 0.75rem;
  color: var(--wow-green);
  margin-top: 6px;
  animation: fadeIn 0.3s ease;
}

.ca-copied.show {
  display: block;
}

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

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--wow-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(126, 200, 80, 0.6);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* =============================================================
   MAIN CONTENT - Split View
   ============================================================= */

.main-content {
  flex: 1;
  display: flex;
  background: var(--bg-primary);
  position: relative;
}

/* =============================================================
   CHARACTER CONTAINER - 3D Doge Area
   ============================================================= */

.character-container {
  width: 55%;
  min-width: 450px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(26, 22, 18, 0.95) 0%, rgba(26, 22, 18, 0.7) 40%, rgba(26, 22, 18, 0) 100%),
    radial-gradient(circle at 30% 30%, rgba(194, 166, 51, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(240, 208, 96, 0.05) 0%, transparent 50%),
    var(--bg-primary);
  overflow: hidden;
}

#live2d-canvas,
#vrm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  opacity: 0;
  transition: opacity 1.2s ease-out;
  touch-action: none;
}

.character-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.character-placeholder.hidden {
  display: none;
}

.placeholder-content {
  text-align: center;
  padding: 40px;
  border: 3px dashed var(--doge-gold);
  border-radius: 20px;
  background: rgba(33, 28, 22, 0.95);
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  opacity: 0.8;
}

.placeholder-content p {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  color: var(--doge-gold);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.placeholder-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: block;
  font-weight: 700;
}

.character-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.glow-effect {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 40%;
  background: radial-gradient(ellipse at center bottom, var(--doge-glow) 0%, transparent 70%);
  opacity: 0.4;
}

.character-name-tag {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 28, 22, 0.95);
  border: 2px solid var(--doge-gold);
  padding: 12px 30px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 20;
}

.character-name-tag .name {
  font-family: 'Bangers', cursive;
  font-size: 1.3rem;
  color: var(--doge-gold);
  letter-spacing: 0.1em;
}

.character-name-tag .status {
  font-size: 0.8rem;
  color: var(--wow-green);
  font-weight: 700;
}

/* =============================================================
   CHAT WINDOW
   ============================================================= */

.chat-window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  position: relative;
}

.chat-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--doge-gold), transparent);
  opacity: 0.25;
}

.chat-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.header-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
}

.header-text {
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  color: var(--doge-gold);
  letter-spacing: 0.2em;
}

.messages-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--doge-gold), var(--doge-gold-dark));
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: var(--doge-gold-light);
}

.messages-container {
  scrollbar-width: thin;
  scrollbar-color: var(--doge-gold-dark) var(--bg-primary);
}

.message {
  animation: messageIn 0.3s ease-out;
}

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

.msg-sender {
  display: block;
  font-family: 'Bangers', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.message.aoi .msg-sender { color: var(--doge-gold); }
.message.user .msg-sender { color: var(--wow-green); }

.msg-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  padding-left: 12px;
  border-left: 3px solid var(--border-color);
}

.message.aoi .msg-text { border-left-color: rgba(194, 166, 51, 0.5); }
.message.user .msg-text { border-left-color: rgba(126, 200, 80, 0.5); }

.msg-text .action {
  color: var(--text-muted);
  font-style: italic;
}

.typing-indicator {
  display: flex;
  gap: 5px;
  padding-left: 12px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--doge-gold);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

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

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

.input-container {
  padding: 15px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

#chatForm {
  display: flex;
  gap: 10px;
}

#messageInput {
  flex: 1;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  padding: 12px 20px;
  font-family: 'Comic Neue', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

#messageInput::placeholder {
  color: var(--text-muted);
}

#messageInput:focus {
  border-color: var(--doge-gold);
  box-shadow: 0 0 0 3px rgba(194, 166, 51, 0.15);
}

#sendBtn {
  width: 50px;
  height: 50px;
  background: var(--doge-gold);
  border: none;
  border-radius: 50%;
  color: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#sendBtn svg {
  width: 20px;
  height: 20px;
}

#sendBtn:hover {
  background: var(--doge-gold-light);
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--doge-glow);
}

#sendBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 1100px) {
  .character-container {
    width: 40%;
    min-width: 300px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 60px;
  }
  
  .logo-sub, .nav-label, .status-text {
    display: none;
  }
  
  .logo-container {
    justify-content: center;
  }
  
  .logo-text {
    font-size: 1.8rem;
  }
  
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  
  .character-container {
    width: 35%;
    min-width: 250px;
  }
}

/* =============================================================
   ANIMATIONS
   ============================================================= */

.app-container {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.character-container.expression-change #live2d-canvas {
  animation: expressionPulse 0.3s ease-out;
}

@keyframes expressionPulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
  100% { filter: brightness(1); }
}

/* =============================================================
   JOURNAL PANEL - Doge's Thoughts
   ============================================================= */

.panel-section {
  display: none;
}

.panel-section.active {
  display: flex;
  flex-direction: column;
}

.journal-panel,
.settings-panel {
  width: 45%;
  min-width: 320px;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
}

.journal-panel.active,
.settings-panel.active {
  display: flex;
}

.journal-intro {
  flex: 0 0 auto;
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(194, 166, 51, 0.05);
}

.journal-warning {
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  color: var(--wow-green);
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.journal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.journal-sub {
  font-family: monospace;
  font-size: 0.75rem;
  color: #666;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.generate-entry-btn {
  background: linear-gradient(135deg, rgba(194, 166, 51, 0.2), rgba(240, 208, 96, 0.2));
  border: 2px solid rgba(194, 166, 51, 0.5);
  color: var(--doge-gold-light);
  padding: 12px 24px;
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 25px;
}

.generate-entry-btn:hover {
  background: linear-gradient(135deg, rgba(194, 166, 51, 0.3), rgba(240, 208, 96, 0.3));
  border-color: var(--doge-gold);
  box-shadow: 0 0 25px var(--doge-glow);
  transform: translateY(-2px);
}

.generate-entry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  margin-right: 8px;
}

.journal-entries {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px;
  -webkit-overflow-scrolling: touch;
}

.journal-entries::-webkit-scrollbar {
  width: 8px;
}

.journal-entries::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.journal-entries::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--doge-gold), var(--doge-gold-dark));
  border-radius: 4px;
}

.journal-entries::-webkit-scrollbar-thumb:hover {
  background: var(--doge-gold-light);
  box-shadow: 0 0 10px var(--doge-glow);
}

.journal-entries {
  scrollbar-width: thin;
  scrollbar-color: var(--doge-gold-dark) var(--bg-primary);
}

.loading-journal {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
  font-style: italic;
  font-weight: 700;
}

.journal-entry {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-color);
  border-left: 4px solid;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.journal-entry:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateX(5px);
}

/* Mood colors - Doge themed */
.journal-entry.mood-happy { border-left-color: #fbbf24; }
.journal-entry.mood-sad { border-left-color: #6366f1; }
.journal-entry.mood-tired { border-left-color: #9ca3af; }
.journal-entry.mood-excited { border-left-color: #f59e0b; }
.journal-entry.mood-bored { border-left-color: #6b7280; }
.journal-entry.mood-hungry { border-left-color: #f97316; }
.journal-entry.mood-cozy { border-left-color: #a78bfa; }
.journal-entry.mood-annoyed { border-left-color: #ef4444; }
.journal-entry.mood-lovestruck { border-left-color: #ec4899; }
.journal-entry.mood-silly { border-left-color: #34d399; }
.journal-entry.mood-anxious { border-left-color: #f43f5e; }
.journal-entry.mood-peaceful { border-left-color: #14b8a6; }
.journal-entry.mood-lazy { border-left-color: #8b5cf6; }
.journal-entry.mood-determined { border-left-color: #3b82f6; }
.journal-entry.mood-neutral { border-left-color: #64748b; }
.journal-entry.mood-curious { border-left-color: #8b5cf6; }
.journal-entry.mood-playful { border-left-color: #ec4899; }
.journal-entry.mood-thoughtful { border-left-color: #6366f1; }
.journal-entry.mood-calm { border-left-color: #14b8a6; }
.journal-entry.mood-restless { border-left-color: #ef4444; }
.journal-entry.mood-hopeful { border-left-color: var(--wow-green); }
.journal-entry.mood-nostalgic { border-left-color: #a855f7; }
.journal-entry.mood-amused { border-left-color: #f472b6; }
.journal-entry.mood-haunted { border-left-color: #8b5cf6; }
.journal-entry.mood-confused { border-left-color: #f59e0b; }
.journal-entry.mood-desperate { border-left-color: #ef4444; }
.journal-entry.mood-disturbed { border-left-color: #ec4899; }
.journal-entry.mood-lonely { border-left-color: #6366f1; }
.journal-entry.mood-cryptic { border-left-color: #14b8a6; }
.journal-entry.mood-fearful { border-left-color: #f43f5e; }
.journal-entry.mood-sleepy { border-left-color: #9ca3af; }
.journal-entry.mood-content { border-left-color: var(--wow-green); }
/* Doge specific moods */
.journal-entry.mood-wow { border-left-color: var(--doge-gold); }
.journal-entry.mood-moon { border-left-color: #f0d060; }
.journal-entry.mood-hodl { border-left-color: #7ec850; }

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.entry-date {
  font-family: 'Bangers', cursive;
  font-size: 0.8rem;
  color: var(--accent-primary);
  letter-spacing: 1px;
}

.entry-mood {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.entry-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  font-style: italic;
}

.entry-content::before {
  content: '"';
  color: var(--accent-primary);
  font-size: 1.3rem;
}

.entry-content::after {
  content: '"';
  color: var(--accent-primary);
  font-size: 1.3rem;
}

.journal-entry.new-entry {
  animation: newEntryGlow 1s ease-out;
}

@keyframes newEntryGlow {
  0% {
    box-shadow: 0 0 30px var(--doge-glow);
    background: rgba(194, 166, 51, 0.15);
  }
  100% {
    box-shadow: none;
    background: rgba(0, 0, 0, 0.3);
  }
}

/* Journal Pagination */
.journal-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 20px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
}

.pagination-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-family: 'Comic Neue', cursive;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 20px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-family: 'Bangers', cursive;
  font-size: 0.85rem;
  color: var(--accent-primary);
  letter-spacing: 1px;
}

/* Settings Panel */
.settings-content {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

/* =============================================================
   GALLERY PANEL
   ============================================================= */

.gallery-panel {
  width: 45%;
  min-width: 320px;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
}

.gallery-panel.active {
  display: flex;
}

.gallery-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.gallery-intro {
  text-align: center;
  margin-bottom: 25px;
}

.gallery-title {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  color: var(--doge-gold);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.gallery-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  background: var(--bg-tertiary);
}

.gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--doge-gold);
  box-shadow: 0 8px 30px rgba(194, 166, 51, 0.3);
}

.gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: var(--text-primary);
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Gallery lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.gallery-lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(194, 166, 51, 0.4);
}

.gallery-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--doge-gold);
  border: none;
  color: var(--bg-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.gallery-lightbox-close:hover {
  transform: scale(1.1);
}

/* =============================================================
   TECH PANEL
   ============================================================= */

.tech-panel {
  width: 45%;
  min-width: 320px;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
}

.tech-panel.active {
  display: flex;
}

.tech-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 25px;
  -webkit-overflow-scrolling: touch;
}

.tech-content::-webkit-scrollbar {
  width: 8px;
}

.tech-content::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.tech-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--doge-gold), var(--doge-gold-dark));
  border-radius: 4px;
}

.tech-content::-webkit-scrollbar-thumb:hover {
  background: var(--doge-gold-light);
}

.tech-content {
  scrollbar-width: thin;
  scrollbar-color: var(--doge-gold-dark) var(--bg-primary);
}

.tech-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-section:last-of-type {
  border-bottom: none;
}

.tech-title {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  color: var(--accent-primary);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.tech-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tech-highlight {
  color: var(--wow-green);
  font-weight: 700;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.tech-tag {
  background: rgba(194, 166, 51, 0.15);
  border: 2px solid rgba(194, 166, 51, 0.4);
  color: var(--accent-primary);
  padding: 8px 14px;
  font-size: 0.75rem;
  font-family: 'Comic Neue', cursive;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 20px;
}

.tech-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.tech-footer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.8;
}

/* =============================================================
   HAMBURGER MENU (Mobile)
   ============================================================= */

.hamburger-btn {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border: 2px solid var(--doge-gold);
  border-radius: 50%;
  cursor: pointer;
  padding: 12px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--doge-gold);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
}

/* =============================================================
   LOADING PROGRESS BAR
   ============================================================= */

.loading-progress {
  width: 200px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
  margin: 15px auto;
  border: 2px solid var(--border-color);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--doge-gold), var(--doge-gold-light));
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px var(--doge-glow);
}

/* =============================================================
   SOUND CONTROLS
   ============================================================= */

.sound-controls {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
}

.sound-control-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sound-icon {
  font-size: 1rem;
  color: var(--doge-gold);
}

.sound-label {
  font-family: 'Bangers', cursive;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sound-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.sound-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sound-btn svg {
  width: 18px;
  height: 18px;
}

.sound-btn:hover {
  background: rgba(194, 166, 51, 0.15);
  border-color: var(--doge-gold);
  color: var(--doge-gold);
}

.sound-btn.active {
  background: rgba(194, 166, 51, 0.25);
  border-color: var(--doge-gold);
  color: var(--doge-gold);
  box-shadow: 0 0 15px var(--doge-glow);
}

.volume-control {
  margin-top: 8px;
}

.volume-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-tertiary);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--doge-gold);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--doge-glow);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--doge-gold);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px var(--doge-glow);
}

/* =============================================================
   TTS CONTROLS
   ============================================================= */

.tts-controls {
  padding: 10px 20px;
  border-top: 1px solid var(--border-color);
}

.tts-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.tts-toggle input {
  display: none;
}

.tts-slider {
  width: 44px;
  height: 24px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  position: relative;
  transition: all 0.3s ease;
}

.tts-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.tts-toggle input:checked + .tts-slider {
  background: rgba(194, 166, 51, 0.25);
  border-color: var(--doge-gold);
}

.tts-toggle input:checked + .tts-slider::after {
  left: 23px;
  background: var(--doge-gold);
  box-shadow: 0 0 10px var(--doge-glow);
}

.tts-label {
  font-family: 'Bangers', cursive;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* =============================================================
   SCROLL TO BOTTOM BUTTON
   ============================================================= */

.scroll-bottom-btn {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 2px solid var(--doge-gold);
  border-radius: 50%;
  color: var(--doge-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 10;
}

.scroll-bottom-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-bottom-btn:hover {
  background: rgba(194, 166, 51, 0.2);
  box-shadow: 0 0 15px var(--doge-glow);
}

.scroll-bottom-btn svg {
  width: 20px;
  height: 20px;
}

/* =============================================================
   MOBILE RESPONSIVE
   ============================================================= */

@media (max-width: 900px) {
  .hamburger-btn {
    display: flex;
  }
  
  .mobile-overlay {
    display: block;
  }
  
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100%;
    width: 240px;
    z-index: 100;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .character-container {
    width: 100%;
    min-width: auto;
  }
  
  .logo-sub, .nav-label, .status-text {
    display: block;
  }
  
  .logo-container {
    justify-content: flex-start;
  }
  
  .logo-text {
    font-size: 2rem;
  }
  
  .nav-item {
    justify-content: flex-start;
    padding: 12px 20px;
  }
}

/* =============================================================
   MOBILE STYLES (max-width: 700px)
   ============================================================= */

@media (max-width: 700px) {
  .sidebar {
    display: none;
  }
  
  .sidebar.open {
    display: flex;
  }
  
  .main-content {
    width: 100%;
    height: 100vh;
    display: block;
    position: relative;
  }
  
  .character-container {
    width: 100%;
    height: 200px;
    min-width: 0;
    position: relative;
  }
  
  #vrm-canvas {
    touch-action: none;
  }
  
  .panel-section {
    display: none;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
  
  .panel-section.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
  }
  
  .chat-window .chat-header {
    flex: 0 0 50px;
  }
  
  .chat-window .messages-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }
  
  .chat-window .input-container {
    flex: 0 0 72px;
    padding: 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
  }
  
  #chatForm {
    display: flex;
    gap: 10px;
    align-items: center;
    height: 100%;
  }
  
  #messageInput {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    height: 48px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
  }
  
  #sendBtn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--doge-gold);
    border: none;
  }
  
  .journal-panel .chat-header {
    flex: 0 0 50px;
  }
  
  .journal-panel .journal-intro {
    flex: 0 0 auto;
    max-height: 100px;
    overflow: hidden;
    padding: 10px 15px;
  }
  
  .journal-panel .journal-entries {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }
  
  .journal-entry {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .journal-pagination {
    display: none;
  }
  
  .tech-panel .chat-header {
    flex: 0 0 50px;
  }
  
  .tech-panel .tech-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 15px;
  }
  
  .tech-section {
    margin-bottom: 18px;
    padding-bottom: 15px;
  }
  
  .tech-title {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }
  
  .tech-section p {
    font-size: 0.85rem;
    line-height: 1.6;
  }
  
  .tech-stack {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .tech-tag {
    padding: 6px 12px;
    font-size: 0.65rem;
  }
  
  .character-name-tag {
    bottom: 10px;
    padding: 8px 16px;
  }
  
  .character-name-tag .name {
    font-size: 1rem;
  }
  
  .character-name-tag .status {
    font-size: 0.7rem;
  }
  
  .entry-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .entry-date {
    font-size: 0.7rem;
  }
  
  .entry-mood {
    font-size: 0.65rem;
  }
  
  .entry-content {
    font-size: 0.9rem;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .character-container {
    height: 180px;
    flex: 0 0 180px;
  }
  
  .placeholder-icon {
    font-size: 2.5rem;
  }
  
  .placeholder-content p {
    font-size: 1.1rem;
  }
  
  .chat-header {
    padding: 10px 12px;
  }
  
  .header-text {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
  }
  
  .header-line {
    display: none;
  }
  
  .msg-sender {
    font-size: 0.75rem;
  }
  
  .msg-text {
    font-size: 0.9rem;
    padding-left: 10px;
    line-height: 1.6;
  }
  
  .journal-intro {
    padding: 12px;
  }
  
  .journal-warning {
    font-size: 0.75rem;
    letter-spacing: 2px;
  }
  
  .journal-desc {
    font-size: 0.8rem;
    line-height: 1.5;
  }
  
  .journal-sub {
    display: none;
  }
  
  .journal-entries {
    padding: 10px;
  }
  
  .journal-entry {
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .entry-content {
    font-size: 0.85rem;
  }
  
  .tech-content {
    padding: 12px;
  }
  
  .tech-section {
    margin-bottom: 15px;
    padding-bottom: 12px;
  }
  
  .tech-title {
    font-size: 0.8rem;
  }
  
  .tech-section p {
    font-size: 0.8rem;
  }
  
  .tech-tag {
    padding: 5px 8px;
    font-size: 0.6rem;
  }
  
  .sound-controls,
  .tts-controls {
    padding: 10px 12px;
  }
  
  .sound-btn {
    width: 36px;
    height: 36px;
  }
}

/* Extra Small (max-width: 360px) */
@media (max-width: 360px) {
  .character-container {
    height: 150px;
    flex: 0 0 150px;
  }
  
  .character-name-tag {
    display: none;
  }
  
  .tech-tag {
    padding: 4px 6px;
    font-size: 0.55rem;
  }
  
  .journal-warning {
    display: none;
  }
}

/* =============================================================
   TOUCH DEVICE OVERRIDES
   ============================================================= */

@media (hover: none) and (pointer: coarse) {
  #messageInput,
  #sendBtn,
  .nav-item,
  .sound-btn,
  .pagination-btn {
    min-height: 44px;
  }
  
  .nav-item:active,
  .sound-btn:active,
  #sendBtn:active,
  .pagination-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
  
  .nav-item:hover,
  .sound-btn:hover,
  .journal-entry:hover {
    background: transparent;
    transform: none;
  }
}

/* =============================================================
   iOS SAFARI SPECIFIC FIXES
   ============================================================= */

@supports (-webkit-touch-callout: none) {
  .messages-container,
  .journal-entries,
  .tech-content {
    -webkit-overflow-scrolling: touch;
    overflow-y: scroll;
  }
}
