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

body {
  background: #1a1e12;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(90,102,53,0.08), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(161,61,40,0.06), transparent 40%);
}

html { scroll-behavior: smooth; }

/* Font weight helpers */
.font-300 { font-weight: 300; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }

/* Subtle scanline / photocopy degradation */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 4px);
}

/* Aged official paper texture */
.paper-texture {
  background-color: #d8d2bd;
  background-image:
    linear-gradient(rgba(138,109,63,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138,109,63,0.04) 1px, transparent 1px),
    radial-gradient(circle at 30% 20%, rgba(161,61,40,0.06), transparent 30%),
    radial-gradient(circle at 70% 80%, rgba(138,109,63,0.08), transparent 35%);
  background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
}

.doc-paper {
  background-color: #d8d2bd;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(138,109,63,0.06) 22px, rgba(138,109,63,0.06) 23px),
    radial-gradient(circle at 90% 10%, rgba(161,61,40,0.05), transparent 25%);
  box-shadow: inset 0 0 40px rgba(138,109,63,0.15);
}

/* Riveted box corners */
.rivet-box {
  position: relative;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
}
.rivet-box::before, .rivet-box::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #b8925a, #8a6d3f);
}
.rivet-box::before { top: 6px; left: 6px; box-shadow: calc(100% + 0px) 0 0 -0px #8a6d3f; }
.rivet-box::after { bottom: 6px; right: 6px; }

/* Seal spin */
@keyframes sealSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.seal-spin svg { animation: sealSpin 40s linear infinite; }

/* Stamp title thunk on load */
@keyframes stampThunk {
  0% { transform: scale(1.4); opacity: 0; }
  60% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1); }
}
.stamp-title { animation: stampThunk 0.6s ease-out; }

/* Stamp overlay pulse */
.stamp-overlay { animation: stampThunk 0.8s ease-out 0.3s both; }

/* Megafonía fade */
@keyframes paFade { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.pa-fade { animation: paFade 0.5s ease-out; }

/* Fade in up */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp 0.5s ease-out forwards; opacity: 0; }

/* Stamp appear (ink thunk) */
@keyframes stampAppear {
  0% { transform: scale(1.6) rotate(-4deg); opacity: 0; }
  55% { transform: scale(0.9) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.stamp-appear { animation: stampAppear 0.4s cubic-bezier(0.2,0.9,0.3,1.2); }

/* Stamp thunk loading icon */
@keyframes thunkBounce { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
.stamp-thunk { animation: thunkBounce 1s ease-in-out infinite; }

/* Loading bar */
@keyframes loadingBar { 0% { width: 0; } 100% { width: 100%; } }
.loading-bar-anim { animation: loadingBar 3s ease-in-out infinite; }

/* Stamp button press */
.stamp-btn { transition: transform 0.1s ease, box-shadow 0.15s ease; }
.stamp-btn:active { transform: translateY(2px) scale(0.98); box-shadow: 0 0 12px rgba(161,61,40,0.4); }

/* Cursor blink */
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.cursor-blink::after { content: '▌'; animation: blink 0.8s step-end infinite; color: #a13d28; }

/* Marquee */
@keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
.marquee-text { animation: marquee 28s linear infinite; white-space: nowrap; }

/* Folder cards */
.folder-card { position: relative; margin-top: 14px; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.folder-tab {
  position: absolute; top: -14px; left: 12px;
  padding: 3px 12px; border-radius: 4px 4px 0 0;
  border: 2px solid #8a6d3f; border-bottom: none;
}
.folder-normal {
  background: linear-gradient(180deg, #2d3319, #232811);
  border: 2px solid #8a6d3f;
  box-shadow: inset 0 1px 0 rgba(184,146,90,0.15);
}
.folder-featured {
  background: linear-gradient(180deg, #3d4526, #2d3319);
  border: 3px solid #b8925a;
  box-shadow: 0 0 20px rgba(184,146,90,0.2), inset 0 1px 0 rgba(184,146,90,0.3);
}
.folder-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.5), 0 0 16px rgba(184,146,90,0.15);
}
.card-lift { transition: transform 0.25s ease; }
.card-lift:hover { transform: translateY(-3px); }

/* Star buttons */
.star-btn { cursor: pointer; background: none; border: none; transition: transform 0.12s ease; }
.star-btn:hover { transform: scale(1.3); }

/* Poll bar */
@keyframes pollGrow { from { width: 0; } }
.poll-bar { animation: pollGrow 0.9s ease-out; transition: width 0.4s ease; }

/* Board display (LED-ish) */
.board-display {
  background: #0d0f08;
  border: 3px inset #2d3319;
  color: #c74b30;
  text-shadow: 0 0 8px rgba(199,75,48,0.7);
  font-family: 'Space Mono', monospace;
}
.board-flash { animation: boardFlash 0.4s ease-in-out 3; }
@keyframes boardFlash { 0%,100% { background: #0d0f08; } 50% { background: #4a1a10; } }

/* Ticket tear edge */
.ticket-tear { border-bottom: 3px dashed #8a6d3f; }

/* Hit counter */
.hit-counter {
  font-family: 'Space Mono', monospace;
  background: #000; border: 2px inset #3d4526;
  padding: 4px 12px; color: #b8925a; letter-spacing: 3px;
  text-shadow: 0 0 6px rgba(184,146,90,0.5);
}

/* Blueprint grid for map */
.grid-blueprint {
  background-color: #0d0f08;
  background-image:
    linear-gradient(rgba(184,146,90,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,146,90,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 2px solid rgba(184,146,90,0.3);
}

/* Masonry */
.masonry-grid { column-count: 1; column-gap: 14px; }
@media (min-width: 640px) { .masonry-grid { column-count: 2; } }
@media (min-width: 1024px) { .masonry-grid { column-count: 3; } }
.masonry-grid > * { break-inside: avoid; margin-bottom: 14px; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1a1e12; }
::-webkit-scrollbar-thumb { background: #3d4526; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #b8925a; }

/* Padding top so nav doesn't overlap */
body { padding-top: 0; }