/* ===== Retro cutre mode ===== */
:root{
  --bg: #d7d7d7;          /* fondo liso */
  --ink: #111;
  --card: #efefef;
  --line: #000;
  --shadow: 4px 4px 0 #000;
  --shadow2: 2px 2px 0 #000;
  --radius: 0px;          /* sin redondeo, más "viejo" */
  --link: #0000ee;
  --visited: #551a8b;
  --primary: #ffe600;     /* amarillo chillón */
  --danger: #ff4d4d;
  --ghost: #ffffff;
}

*{ box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);

  /* fuentes cutres/retro */
  font-family: "Comic Sans MS", "Courier New", monospace;
}

/* Layout */
.app{
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px 12px 30px;
}

.page{
  width: min(980px, 100%);
  display: none;
}
.page.active{ display: block; }

/* Cards */
.card{
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px;
}

.hero{
  text-align: center;
  padding: 28px 18px;
}

.badge{
  width: 60px;
  height: 60px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  font-size: 30px;

  background: #fff;
  border: 3px solid var(--line);
  box-shadow: var(--shadow2);
}

/* Text */
h1, h2, h3{
  margin: 8px 0 10px;
  letter-spacing: .3px;
}

h1{
  font-size: clamp(28px, 4.3vw, 46px);
  text-transform: uppercase;
  text-decoration: underline;
}

h2{
  font-size: clamp(20px, 3vw, 30px);
  text-transform: uppercase;
}

p{
  margin: 10px 0;
  line-height: 1.5;
}

.lead{
  font-size: 1.05rem;
}

.muted{
  opacity: .8;
}

.tiny{
  font-size: .9rem;
}

/* Topbar */
.topbar{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.titleBlock{
  text-align: right;
}

/* Tip box */
.tip{
  margin-top: 0;
  padding: 10px 12px;
  border: 2px dashed var(--line);
  background: #fff;
}

/* Buttons */
.btn{
  appearance: none;
  border: 3px solid var(--line);
  background: var(--ghost);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow2);
  text-transform: uppercase;
}

.btn:hover{
  filter: brightness(1.02);
}

.btn:active{
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn.primary{
  background: var(--primary);
}

.btn.ghost{
  background: #fff;
}

.btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

/* Actions row */
.actions{
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.actions.left{ justify-content: flex-start; }

/* Gallery */
.gallery{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.thumb{
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow2);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.thumb:hover{
  outline: 3px dotted var(--line);
  outline-offset: 2px;
}

.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(1.05);
}

.thumb .tag{
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 4px 8px;
  background: #fff;
  border: 2px solid var(--line);
  font-size: .85rem;
  box-shadow: var(--shadow2);
}

/* Letter */
.letter p{
  font-size: 1.02rem;
}

.letter .highlight{
  padding: 10px 12px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow2);
}

.sign{
  font-weight: 900;
  text-decoration: underline;
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display: none;
}

.modal.show{ display: block; }

.modalBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.modalContent{
  position: relative;
  width: min(900px, calc(100% - 20px));
  margin: 6vh auto 0;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: 8px 8px 0 #000;
  overflow: hidden;
}

.modalContent img{
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}

.modalContent p{
  margin: 0;
  padding: 10px 12px;
  border-top: 3px solid var(--line);
}

.close{
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Responsive */
@media (max-width: 820px){
  .gallery{ grid-template-columns: repeat(3, 1fr); }
  .titleBlock{ text-align: left; }
  .topbar{ flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px){
  .gallery{ grid-template-columns: repeat(2, 1fr); }
}
