@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Cinzel:wght@400;700&family=Courier+Prime&display=swap');

:root {
  --parch:   #c8b89a;
  --parch2:  #e2d5be;
  --dark:    #1a1208;
  --brown:   #3d2b1a;
  --gold:    #a07830;
  --gold2:   #c8a050;
  --ink:     #2a1f10;
  --rust:    #7a3c18;
  --moss:    #3d4a28;
  --fog:     #8a9880;
  --cream:   #f0e8d5;
  --shadow:  rgba(10,6,2,0.7);
}

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

body {
  background-color: var(--dark);
  background-image:
    radial-gradient(ellipse at 50% 0%, #2d1f0a 0%, #0d0800 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  color: var(--parch);
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 14px;
  min-height: 100vh;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='10' cy='10' r='4' fill='none' stroke='%23c8a050' stroke-width='1.5'/%3E%3Cline x1='10' y1='2' x2='10' y2='6' stroke='%23c8a050' stroke-width='1'/%3E%3Cline x1='10' y1='14' x2='10' y2='18' stroke='%23c8a050' stroke-width='1'/%3E%3Cline x1='2' y1='10' x2='6' y2='10' stroke='%23c8a050' stroke-width='1'/%3E%3Cline x1='14' y1='10' x2='18' y2='10' stroke='%23c8a050' stroke-width='1'/%3E%3C/svg%3E") 10 10, crosshair;
}

/* ======== LOADING ======== */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 28px;
}

.loading-symbol {
  width: 80px;
  height: 80px;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

#loading-text {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

#loading-bar-wrap {
  width: 260px;
  height: 3px;
  background: #1a1208;
  border: 1px solid var(--gold);
}

#loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rust), var(--gold2));
  transition: width 0.1s linear;
}

/* ======== WRAPPER ======== */
#page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  position: relative;
  z-index: 1;
}

/* ======== DECORATIVE BORDER ======== */
.page-border {
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 4px var(--dark),
    0 0 0 5px #3a2a10,
    inset 0 0 60px rgba(0,0,0,0.5);
  position: relative;
  padding: 30px;
  background: linear-gradient(160deg, #120d05 0%, #1e1508 50%, #120d05 100%);
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--gold2);
  border-style: solid;
}
.corner-tl { top: -1px;    left: -1px;  border-width: 2px 0 0 2px; }
.corner-tr { top: -1px;    right: -1px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: -1px; left: -1px;  border-width: 0 0 2px 2px; }
.corner-br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ======== HEADER ======== */
#header {
  text-align: center;
  padding: 20px 0 30px;
  border-bottom: 1px solid #3a2a10;
  position: relative;
}

.site-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.7;
}

.site-title {
  font-family: 'Cinzel', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--parch2);
  text-shadow:
    0 0 30px rgba(160,120,48,0.4),
    2px 2px 0 var(--dark);
  letter-spacing: 3px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.site-subtitle {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.header-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px auto 0;
  max-width: 500px;
}

.header-divider::before,
.header-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header-divider-symbol {
  color: var(--gold2);
  font-size: 18px;
}

/* ======== MARQUEE ======== */
.marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  border-top: 1px solid #2a1f10;
  border-bottom: 1px solid #2a1f10;
  background: rgba(0,0,0,0.3);
  margin-bottom: 28px;
}

.marquee-inner {
  display: inline-block;
  animation: marquee 30s linear infinite;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}

.marquee-inner .sep { margin: 0 24px; color: var(--rust); }

@keyframes marquee {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}

/* ======== LAYOUT ======== */
#main {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ======== SIDEBAR ======== */
#sidebar {
  width: 200px;
  min-width: 200px;
}

.sidebar-panel {
  border: 1px solid #3a2a10;
  margin-bottom: 20px;
  background: rgba(0,0,0,0.3);
}

.sidebar-panel-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 7px 10px;
  border-bottom: 1px solid #3a2a10;
  text-align: center;
  background: rgba(0,0,0,0.2);
}

.sidebar-panel ul {
  list-style: none;
  padding: 8px 10px;
}

.sidebar-panel ul li {
  padding: 4px 0;
  border-bottom: 1px dotted #2a1f10;
  font-size: 12px;
  color: var(--parch);
}

.sidebar-panel ul li:last-child { border-bottom: none; }

.sidebar-panel ul li a {
  color: var(--parch);
  text-decoration: none;
  font-style: italic;
}

.sidebar-panel ul li a:hover { color: var(--gold2); }

.hit-counter {
  text-align: center;
  padding: 10px;
}

.counter-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.counter-digits {
  font-family: 'Courier Prime', monospace;
  background: #000;
  border: 1px solid #3a2a10;
  padding: 4px 8px;
  font-size: 20px;
  color: var(--gold2);
  letter-spacing: 4px;
  display: inline-block;
}

/* ======== CONTENT ======== */
#content { flex: 1; min-width: 0; }

/* ======== SECTION ======== */
.section {
  margin-bottom: 28px;
  border: 1px solid #3a2a10;
  background: rgba(0,0,0,0.25);
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold2);
  padding: 8px 14px;
  border-bottom: 1px solid #3a2a10;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '◆';
  color: var(--rust);
  font-size: 10px;
}

.section-body { padding: 16px; }

/* ======== GAME ENTRY ======== */
.game-entry {
  display: flex;
  gap: 16px;
}

.game-art {
  width: 140px;
  min-width: 140px;
  height: 100px;
  border: 1px solid #3a2a10;
  position: relative;
  overflow: hidden;
  background: #000;
}

.game-art canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.game-info { flex: 1; }

.game-name {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--parch2);
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(160,120,48,0.3);
}

.game-tagline {
  font-style: italic;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 10px;
}

.game-meta {
  font-size: 12px;
  color: #8a7a60;
  line-height: 2;
  margin-bottom: 10px;
  font-family: 'Courier Prime', monospace;
}

.game-meta strong { color: var(--parch); }

.game-desc {
  font-size: 13px;
  color: #b0a080;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 14px;
  border-left: 2px solid var(--rust);
  padding-left: 12px;
}

.game-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag {
  border: 1px solid #3a2a10;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 2px 8px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.3);
}

.stars {
  color: var(--gold2);
  font-size: 14px;
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.dl-count {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  color: #6a5a40;
  margin-bottom: 14px;
}

/* ======== BUTTONS ======== */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.dl-btn {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--parch2);
  background: linear-gradient(180deg, #3a2810 0%, #1e1408 100%);
  border: 1px solid var(--gold);
  padding: 8px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  position: relative;
}

.dl-btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(200,160,80,0.2);
  pointer-events: none;
}

.dl-btn:hover {
  background: linear-gradient(180deg, #5a3c18 0%, #3a2410 100%);
  color: var(--gold2);
  box-shadow: 0 0 12px rgba(160,120,48,0.3);
}

.dl-btn.mirror {
  border-color: #3a2a10;
  color: #8a7a60;
  font-size: 10px;
}

.dl-btn.mirror:hover {
  border-color: var(--gold);
  color: var(--parch);
}

/* ======== TABLE ======== */
table.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

table.dl-table th {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 10px;
  border-bottom: 1px solid var(--gold);
  border-top: 1px solid #3a2a10;
  text-align: left;
  background: rgba(0,0,0,0.3);
}

table.dl-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #1e1508;
  color: #a09070;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
}

table.dl-table tr:hover td {
  background: rgba(160,120,48,0.05);
  color: var(--parch);
}

table.dl-table td a {
  color: var(--parch);
  text-decoration: none;
  font-family: 'IM Fell English', serif;
  font-style: italic;
}

table.dl-table td a:hover { color: var(--gold2); }

.new-badge {
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--dark);
  background: var(--gold2);
  padding: 1px 5px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 4px;
}

/* ======== REQUIREMENTS ======== */
.req-list {
  list-style: none;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  color: #8a7a60;
  line-height: 2.2;
}

.req-list li::before {
  content: '›  ';
  color: var(--gold);
}

.req-list li strong { color: var(--parch); }

/* ======== WARNING ======== */
.warning-box {
  border: 1px solid var(--rust);
  background: rgba(122,60,24,0.1);
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 12px;
  color: #c0906a;
  font-style: italic;
}

.warning-box::before {
  content: '⚠  ';
  font-style: normal;
}

/* ======== FOOTER ======== */
footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #3a2a10;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: #4a3a28;
  text-transform: uppercase;
  line-height: 2.2;
}

footer a { color: #6a5a40; text-decoration: none; }
footer a:hover { color: var(--gold); }

.footer-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-badge {
  border: 1px solid #3a2a10;
  padding: 3px 10px;
  font-size: 9px;
  color: #5a4a30;
  letter-spacing: 2px;
}

/* ======== MODAL ======== */
#dl-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#dl-modal.active { display: flex; }

.modal-box {
  background: #100c05;
  border: 1px solid var(--gold);
  width: 400px;
  max-width: 95vw;
  box-shadow: 0 0 40px rgba(160,120,48,0.2);
  position: relative;
}

.modal-box::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(160,120,48,0.15);
  pointer-events: none;
}

.modal-titlebar {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 10px 16px;
  border-bottom: 1px solid #3a2a10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.3);
}

.modal-close {
  width: 20px;
  height: 20px;
  border: 1px solid #3a2a10;
  color: var(--rust);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
}

.modal-close:hover { border-color: var(--rust); color: var(--parch); }

.modal-body { padding: 20px; }

.modal-symbol {
  text-align: center;
  font-size: 36px;
  margin-bottom: 14px;
  animation: fade-pulse 2s ease-in-out infinite;
}

.modal-filename {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--parch);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.modal-progress-wrap {
  border: 1px solid #3a2a10;
  height: 6px;
  background: #000;
  margin-bottom: 8px;
}

.modal-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rust), var(--gold2));
  transition: width 0.1s linear;
}

.modal-progress-text {
  text-align: center;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  color: #6a5a40;
  margin-bottom: 8px;
}

.modal-info {
  display: flex;
  justify-content: space-between;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  color: #4a3a28;
  margin-bottom: 16px;
}

.modal-btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ======== SCROLLBAR ======== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0700; }
::-webkit-scrollbar-thumb { background: #3a2a10; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ======== AMBIENT CANVAS ======== */
#ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
}

/* ======== MISC ======== */
hr.sep {
  border: none;
  border-top: 1px solid #1e1508;
  margin: 12px 0;
}
