/* ===========================================================
   MadPlates — neobrutalismo con memoria de los 90:
   bordes gruesos, sombras duras (sin blur), paleta ácida sobre
   crema, tipografía contundente. Pensado como marca fija (no
   se adapta a modo oscuro del sistema), como un fanzine impreso.
   =========================================================== */

:root {
  --ink: #161616;
  --paper: #f3ecdb;         /* crema, textura de papel viejo */
  --card: #fffaf0;
  --pink: #ff3d78;          /* acento principal, atrevido */
  --yellow: #ffcf3f;        /* acento secundario, hazard stripe */
  --blue: #2f6fed;          /* acento terciario */
  --green: #17c384;
  --muted: #6b6558;
  --border-w: 3px;
  --radius: 10px;
  --shadow-off: 6px;
  --shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);

  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  background-image:
    radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -11px -11px;
  color: var(--ink);
}

/* ---------------- Header / marca ---------------- */

.topbar {
  background: var(--paper);
  border-bottom: var(--border-w) solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem 0.9rem;
  max-width: 720px;
  margin: 0 auto;
}

/* Logo: foto real de la matrícula MADPLATE.COM, ligeramente girada como
   el resto de elementos "pegados" del sitio, con sombra dura a juego. */
.plate-logo-img {
  height: 46px;
  width: auto;
  transform: rotate(-2deg);
  filter: drop-shadow(4px 4px 0 var(--ink));
  flex-shrink: 0;
}

.tagline {
  margin: 0;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  max-width: 22rem;
}

.hazard-strip {
  height: 9px;
  background: repeating-linear-gradient(
    45deg,
    var(--ink),
    var(--ink) 11px,
    var(--yellow) 11px,
    var(--yellow) 22px
  );
}

/* ---------------- Layout general ---------------- */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem calc(5.5rem + env(safe-area-inset-bottom));
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------- Nav inferior + FAB ---------------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--card);
  border-top: var(--border-w) solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .55rem 0 .45rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  cursor: pointer;
}
.nav-btn svg { display: block; }
.nav-btn.active { color: var(--pink); }

.fab {
  position: fixed;
  right: 1.1rem;
  bottom: calc(4.7rem + env(safe-area-inset-bottom));
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: var(--yellow);
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  z-index: 21;
  display: none;
}
.fab.visible { display: block; }
.fab:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }

/* ---------------- Feed ---------------- */

.feed-toolbar {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.1rem;
}
.feed-toolbar input {
  flex: 1;
}
.ghost-btn {
  font-family: var(--font-display);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: #fff;
  border: var(--border-w) solid var(--ink);
  border-radius: 8px;
  padding: 0 .8rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.ghost-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.feed-more { display: block; width: 100%; margin-top: 1rem; padding: .7rem; }
.feed-more.hidden, .hidden { display: none !important; }

/* ---------------- Mis matrículas ---------------- */

.watch-intro { margin-bottom: 1rem; color: var(--muted); font-size: .92rem; }
.watch-legal { margin-top: 1.4rem; }

#watch-list { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .8rem; }

.watch-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: .8rem 1rem;
}
.watch-card .plate {
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: .2rem .55rem;
  flex-shrink: 0;
}
.watch-card .channels { flex: 1; display: flex; gap: .5rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.watch-card .channel-badge {
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: .15rem .6rem;
  background: #fff;
}
.watch-card .channel-badge.pending { color: var(--muted); border-style: dashed; }
.watch-card .remove-btn {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.watch-card .remove-btn:hover { background: var(--pink); color: #fff; }

form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.row { display: flex; gap: 1rem; }
.row label { flex: 1; min-width: 0; }

input, textarea {
  width: 100%;
  font: 1rem var(--font-body);
  font-weight: 500;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: var(--border-w) solid var(--ink);
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--blue);
}

small, .hint {
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  font-size: .78rem;
}
.checkbox { flex-direction: row; align-items: center; gap: .6rem; }
.checkbox input { width: auto; accent-color: var(--pink); }

button[type="submit"] {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--yellow);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  padding: .9rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
button[type="submit"]:hover { background: var(--pink); color: #fff; }
button[type="submit"]:active {
  transform: translate(var(--shadow-off), var(--shadow-off));
  box-shadow: 0 0 0 var(--ink);
}
button[type="submit"]:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- Resultados ---------------- */

#results { margin-top: 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; }

.msg-card {
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
}
.msg-card:nth-child(3n) { transform: rotate(-.6deg); }
.msg-card:nth-child(3n+1) { transform: rotate(.5deg); }
.msg-card:nth-child(3n+2) { transform: rotate(-.2deg); }

.msg-card .plate {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .08em;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: .2rem .55rem;
}
.msg-card .meta {
  color: var(--muted);
  font-size: .75rem;
  margin-top: .45rem;
  font-family: var(--font-mono);
}
.msg-card .body {
  margin: .7rem 0;
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.45;
}
.msg-card .media { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.msg-card .media img, .msg-card .media video {
  max-width: 140px;
  max-height: 140px;
  border-radius: 6px;
  border: 2px solid var(--ink);
}
.msg-card .media img {
  cursor: zoom-in;
}

/* ---------------- Visor de imagen a pantalla completa ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  border: var(--border-w) solid #fff;
}
.lightbox-close, #lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: var(--border-w) solid var(--ink);
  background: var(--yellow);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.msg-card .report-btn {
  background: #fff;
  border: 2px solid var(--ink);
  color: var(--ink);
  border-radius: 6px;
  padding: .35rem .65rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: .7rem;
}
.msg-card .report-btn:hover { background: var(--ink); color: var(--yellow); }

.msg-card .report-menu {
  margin-top: .6rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.msg-card .report-menu select {
  font: .78rem var(--font-body);
  padding: .35rem .5rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
}
.msg-card .report-menu .report-send {
  background: var(--pink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: .35rem .65rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  cursor: pointer;
}
