@import url('https://fonts.googleapis.com/css2?family=Neucha&family=Pixelify+Sans:wght@600;700&display=swap');

@font-face {
  font-family: 'AndyBold';
  src: url('/vendor/AndyBold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --terraria-font: 'AndyBold', 'Andy', 'Neucha', 'Comic Sans MS', cursive, sans-serif;
  --pixel-font: 'Pixelify Sans', 'AndyBold', 'Neucha', monospace;
  --primary: #252a34;
  --primary-hover: #323846;
  --bg: #111317;
  --surface: #1a1d24;
  --surface-light: #252a34;
  --text-primary: #f5f6fa;
  --text-secondary: #9da6b7;
  --border: #383e4d;
  --border-hover: #555e70;
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-family: var(--terraria-font);
  font-size: 15px;
  letter-spacing: 0.3px;
  padding: 32px 20px 64px;
}

@keyframes terrariaRainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes funnyWobble {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-1.5deg); }
  50% { transform: translateY(2px) rotate(1deg); }
  75% { transform: translateY(-2px) rotate(1.5deg); }
}

@keyframes funnyFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-6px) scale(1.04); }
}

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

.rainbow-title, .rainbow-text {
  background: linear-gradient(90deg, #ff3366, #ff9933, #ffee00, #33cc66, #00d4ff, #b844ff, #ff3366);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: terrariaRainbow 3.5s linear infinite;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.wobble-title {
  display: inline-block;
  animation: funnyWobble 2.6s ease-in-out infinite;
}

.float-icon {
  display: inline-flex;
  animation: funnyFloat 2.8s ease-in-out infinite;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 14px;
  margin-bottom: 20px;
  animation: fadeUp .4s ease backwards;
}

.crumb {
  color: #f5f6fa;
  text-decoration: none;
  font-weight: 700;
  text-shadow: 1px 1px 0 #000;
}

.crumb:hover {
  text-decoration: underline;
  color: #fff;
}

.sep {
  color: #555e70;
  margin: 0 6px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  flex-wrap: wrap;
  animation: fadeUp .5s ease backwards;
  animation-delay: .05s;
  padding: 16px 22px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.08), inset -1px -1px 0 rgba(0,0,0,.6), 0 6px 0 #08090c;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-fallback {
  width: 54px;
  height: 54px;
  border-radius: 0;
  background: var(--surface-light);
  color: #f5f6fa;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid var(--border);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.15), inset -2px -2px 0 rgba(0,0,0,.6), 0 4px 0 #08090c;
  text-shadow: 1px 1px 0 #000;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ff3366, #ff9933, #ffee00, #33cc66, #00d4ff, #b844ff, #ff3366);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: terrariaRainbow 4s linear infinite, funnyWobble 3s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 3px;
  text-shadow: 1px 1px 0 #000;
}

.nav-link {
  background: var(--surface-light);
  border: 2px solid var(--border);
  color: #f5f6fa;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.12), 0 3px 0 #08090c;
  transition: all .12s;
  text-shadow: 1px 1px 0 #000;
}

.nav-link:hover {
  background: #323846;
  border-color: #555e70;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.22), 0 5px 0 #08090c;
}

.nav-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #08090c;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f5f6fa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 6px 14px;
  background: var(--surface-light);
  border: 2px solid var(--border);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.12), 0 3px 0 #08090c;
  transition: all .12s;
  text-shadow: 1px 1px 0 #000;
}

.back-link:hover {
  background: #323846;
  border-color: #555e70;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.22), 0 5px 0 #08090c;
}

.back-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #08090c;
}

.empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 60px;
  font-size: 16px;
  text-shadow: 1px 1px 0 #000;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #181d24;
  border: 3px solid #33cc66;
  color: #7affb0;
  padding: 12px 28px;
  border-radius: 0;
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 1px 1px 0 #afffd0, 0 6px 0 #08090c, 0 0 30px rgba(51, 204, 102, 0.4);
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  z-index: 200;
  text-shadow: 1px 1px 0 #000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* PHOTO GRID */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.1), 0 4px 0 #090510;
  animation: fadeUp .4s ease backwards;
  transition: transform .15s, border-color .15s;
}

.photo-card:hover {
  transform: scale(1.03);
  border-color: #555e70;
  z-index: 1;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.2), 0 6px 0 #090510;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
  padding: 20px 8px 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  transition: opacity .15s;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-date {
  font-size: 10px;
  color: #e6d1ff;
}

.photo-actions {
  display: flex;
  gap: 4px;
}

.photo-actions button,
.photo-actions a {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  border-radius: 0;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.photo-actions button:hover,
.photo-actions a:hover {
  background: #323846;
  border-color: #555e70;
  color: #fff;
}

/* LIGHTBOX */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,6,16,.95);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#lightbox.open {
  display: flex;
}

#lightbox img {
  max-width: 92vw;
  max-height: 78vh;
  border-radius: 0;
  border: 3px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.8);
}

#lightbox .lb-meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
}

#lightbox .lb-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

#lightbox .lb-actions a,
#lightbox .lb-actions button {
  background: var(--surface-light);
  border: 2px solid var(--border);
  color: #fff;
  border-radius: 0;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 3px 0 #090510;
}

#lightbox .lb-actions a:hover,
#lightbox .lb-actions button:hover {
  background: #323846;
  border-color: #555e70;
  color: #fff;
}

#lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

#lightbox .lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: 2px solid var(--border);
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 4px 0 #090510;
}

#lightbox .lb-prev { left: 16px; }
#lightbox .lb-next { right: 16px; }

#lightbox .lb-nav:hover {
  background: #323846;
  border-color: #555e70;
  color: #fff;
}

/* SOUNDS */
.sound-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sound-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 12px 16px;
  flex-wrap: wrap;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.08), 0 3px 0 #090510;
  animation: fadeUp .4s ease backwards;
  transition: border-color .15s, transform .12s;
}

.sound-row:hover {
  border-color: #555e70;
  transform: translateX(3px);
}

.sound-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.sound-icon {
  font-size: 20px;
}

.sound-name {
  font-size: 13.5px;
  font-weight: 600;
  text-shadow: 1px 1px 0 #000;
}

.sound-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  text-shadow: 1px 1px 0 #000;
}

.sound-row audio {
  flex: 1;
  min-width: 220px;
  height: 34px;
  border-radius: 0;
}

.sound-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.sound-actions button,
.sound-actions a {
  background: var(--surface-light);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  border-radius: 0;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 0 #090510;
  transition: background .15s, color .15s;
}

.sound-actions button:hover,
.sound-actions a:hover {
  background: #323846;
  border-color: #555e70;
  color: #fff;
}
