@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;
}

/* Animations: Rainbow & Funny Wobble */
@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 funnyJiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.08, 0.92) rotate(-3deg); }
  50% { transform: scale(0.92, 1.08) rotate(3deg); }
  75% { transform: scale(1.04, 0.96) rotate(-1deg); }
}

@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: 1020px; margin: 0 auto; }

.breadcrumb { font-size: 14px; margin-bottom: 20px; animation: fadeUp .4s ease backwards; }
.crumb { color: #f5f6fa; text-decoration: none; font-weight: 700; transition: color .15s; 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; gap: 18px; margin-bottom: 26px;
  animation: fadeUp .5s ease backwards; animation-delay: .05s;
  padding: 16px 20px;
  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;
}

.logo-fallback {
  width: 54px; height: 54px; border-radius: 0;
  background: var(--surface-light);
  color: #f5f6fa; font-size: 28px; 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;
  animation: funnyFloat 2.8s ease-in-out infinite;
}

.kicker {
  display: inline-block; font-size: 11px; font-weight: 700;
  font-family: var(--pixel-font); text-transform: uppercase; letter-spacing: 1px;
  color: #f5f6fa; background: var(--surface-light);
  border: 2px solid var(--border); border-radius: 0; padding: 2px 10px; margin-bottom: 6px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.1), 0 2px 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; }

.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;
}

.section-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: #f5f6fa; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px;
  text-shadow: 1px 1px 0 #000, 2px 2px 4px rgba(0,0,0,.8);
}

.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; align-items: stretch;
}

.folder-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 2px 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,.5), 0 6px 0 #08090c;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  animation: fadeUp .45s ease backwards; overflow: hidden;
}
.folder-card:hover {
  border-color: #555e70;
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.18), 0 10px 0 #08090c;
}
.folder-card.has-preview { border-color: #4a5368; }
.folder-card.has-preview:hover { border-color: #555e70; }

.folder-card-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; text-decoration: none; color: var(--text-primary);
  padding: 20px 16px; transition: transform .12s;
}
.folder-icon { font-size: 38px; line-height: 1; transition: transform .15s; }
.folder-card:hover .folder-icon {
  animation: funnyJiggle 0.45s ease-in-out infinite;
}
.folder-icon-img {
  width: 62px; height: 62px; border-radius: 0; object-fit: cover;
  border: 2px solid var(--border); box-shadow: inset 1px 1px 0 rgba(255,255,255,.15), 0 4px 0 #08090c;
}
.folder-name {
  font-size: 15px; font-weight: 700; word-break: break-word; line-height: 1.25;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.folder-badge {
  font-size: 11px; font-family: var(--pixel-font); color: #f5f6fa;
  background: var(--surface-light); border: 1.5px solid var(--border);
  border-radius: 0; padding: 2px 9px; box-shadow: inset 1px 1px 0 rgba(255,255,255,.1), 0 2px 0 #08090c;
  text-shadow: 1px 1px 0 #000;
}
.folder-stats { font-size: 12px; color: var(--text-secondary); margin-top: 2px; text-shadow: 1px 1px 0 #000; }

.card-preview-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(90deg, #ff3366, #ff9933, #ffee00, #33cc66, #00d4ff, #b844ff, #ff3366);
  background-size: 300% 300%;
  color: #120800; text-decoration: none; font-weight: 800; font-size: 13px;
  padding: 10px; animation: terrariaRainbow 4s linear infinite;
  border-top: 2px solid var(--border);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  transition: filter .15s;
}
.card-preview-btn:hover { filter: brightness(1.2); }

.pair-actions { display: flex; gap: 2px; background: #08090c; border-top: 2px solid var(--border); }
.pair-item { flex: 1; display: flex; }
.card-pair-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--surface-light); color: #f5f6fa; text-decoration: none;
  font-weight: 700; font-size: 12.5px; padding: 10px 6px;
  transition: background .12s, color .12s, border-color .12s; text-shadow: 1px 1px 0 #000;
}
.card-pair-btn span { opacity: .8; font-weight: 500; font-size: 11px; }
.card-pair-btn:hover { background: #323846; border-color: #555e70; color: #fff; text-shadow: 1px 1px 0 #000; }
.pair-copy {
  flex-shrink: 0; width: 32px; background: var(--surface-light); border: none;
  border-left: 2px solid var(--border); color: #f5f6fa; cursor: pointer;
  font-size: 12px; transition: background .12s, color .12s; text-shadow: 1px 1px 0 #000;
}
.pair-copy:hover { background: #323846; color: #fff; }

.folder-card.has-pair .folder-card-link { padding-bottom: 14px; }
.card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.card-copy, .card-download {
  background: var(--surface-light); border: 2px solid var(--border); color: #f5f6fa;
  border-radius: 0; width: 28px; height: 28px; cursor: pointer; font-size: 13px;
  opacity: 0; transition: opacity .15s, background .15s, color .15s, transform .12s;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.12), 0 2px 0 #08090c; text-shadow: 1px 1px 0 #000;
}
.folder-card:hover .card-copy, .folder-card:hover .card-download { opacity: 1; }
.card-copy:hover, .card-download:hover { background: #323846; border-color: #555e70; color: #fff; transform: scale(1.1); }

.file-list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 2px solid var(--border); border-radius: 0; padding: 10px 16px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.06), 0 3px 0 #08090c; transition: all .12s; animation: fadeUp .4s ease backwards;
}
.row:hover {
  border-color: #555e70; transform: translateX(3px);
}
.row.has-preview {
  border-color: #4a5368;
  background: linear-gradient(90deg, rgba(74,83,104,.2), var(--surface) 45%);
}
.row.has-preview:hover { border-color: #555e70; }

.icon { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.name {
  flex: 1; color: var(--text-primary); text-decoration: none; font-size: 14.5px;
  font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.name:hover { color: #fff; text-decoration: underline; }
.size { color: var(--text-secondary); font-size: 12px; width: 80px; text-align: right; flex-shrink: 0; font-family: var(--pixel-font); text-shadow: 1px 1px 0 #000; }
.copy-btn {
  background: var(--surface-light); border: 2px solid var(--border); color: #f5f6fa;
  border-radius: 0; padding: 6px 14px; cursor: pointer; font-size: 12.5px; font-weight: 700;
  font-family: inherit; flex-shrink: 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;
}
.copy-btn: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;
  text-shadow: 1px 1px 0 #000;
}
.copy-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #08090c; }

.view-btn {
  background: linear-gradient(90deg, #ff3366, #ff9933, #33cc66, #00d4ff, #ff3366);
  background-size: 300% 300%;
  color: #120900; text-decoration: none; border-radius: 0; padding: 6px 14px;
  font-size: 12.5px; font-weight: 800; font-family: inherit; flex-shrink: 0;
  border: 2px solid var(--border); box-shadow: inset 1px 1px 0 #fff, 0 3px 0 #08090c;
  animation: terrariaRainbow 4s linear infinite; transition: all .12s;
}
.view-btn:hover { filter: brightness(1.25); transform: translateY(-2px); box-shadow: 0 5px 0 #08090c; }
.view-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #08090c; }

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

.zip-banner {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 2px solid var(--border); border-radius: 0; padding: 14px 18px; margin-bottom: 20px;
  font-size: 13.5px; color: #f5f6fa; animation: fadeUp .4s ease backwards;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.08), 0 4px 0 #08090c;
  text-shadow: 1px 1px 0 #000;
}
.zip-banner .dl-zip {
  margin-left: auto;
  background: var(--surface-light);
  color: #f5f6fa; text-decoration: none; font-weight: 800; font-size: 13px;
  padding: 8px 16px; border-radius: 0; border: 2px solid var(--border);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.15), 0 3px 0 #08090c; flex-shrink: 0; white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
  transition: all .12s;
}
.zip-banner .dl-zip: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;
}
.zip-banner .dl-zip:active { transform: translateY(2px); box-shadow: 0 1px 0 #08090c; }

.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: 999;
  text-shadow: 1px 1px 0 #000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
