:root {
  --bg: #F9F9F7;
  --fg: #111111;
  --muted: #737373;
  --divider: #111111;
  --accent-red: #CC0000;
}

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0 !important; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Lora', serif;
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23111111' fill-opacity='0.03' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
}

.layout-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
  width: 100%;
}

.font-serif { font-family: 'Playfair Display', serif; }
.font-body { font-family: 'Lora', serif; }
.font-sans { font-family: 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

header {
  border-bottom: 4px solid var(--fg);
  border-top: 1px solid var(--fg);
  padding: 12px 0;
  margin-bottom: 12px;
}

.meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.main-title {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 0.95;
  padding: 6px 0;
}

.sub-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  padding: 6px 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
}

.concept-ribbon {
  background: #111;
  color: #F9F9F7;
  padding: 10px 20px;
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.15rem;
  border: 2px solid #111;
  margin-bottom: 20px;
}

.newspaper-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 950px) {
  .newspaper-grid { grid-template-columns: 1fr; }
}

.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--fg);
  margin-bottom: 16px;
  background: #E5E5E0;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--fg);
  transition: background 0.1s;
}

.tab-btn:hover { background: #D5D5D0; }
.tab-btn.active { background: var(--fg); color: var(--bg); }

.news-card {
  border: 1px solid var(--fg);
  background: var(--bg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 3px 3px 0px 0px #111;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 6px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

table { width: 100%; border-collapse: collapse; }
th {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  background: var(--fg);
  color: var(--bg);
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--fg);
}
td { padding: 10px; border: 1px solid var(--divider); font-family: 'Inter', sans-serif; font-size: 0.88rem; }
tr:nth-child(even) td { background: #F0F0EC; }
.rank-num { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

/* TABLÓN DE ANUNCIOS AMPLIADO */
.bulletin-card {
  border: 2px solid var(--fg);
  background: #FFF;
  padding: 24px;
  margin-top: 24px;
  box-shadow: 4px 4px 0px #111;
}

.bulletin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

#bulletinBoard {
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 6px;
}

.post-item {
  border-bottom: 1px solid #E5E5E0;
  padding: 14px 0;
}
.post-item:last-child { border-bottom: none; }

.post-meta {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.post-body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #222;
}

.post-attachment-box {
  margin-top: 8px;
}

.post-img-preview {
  max-width: 260px;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid #111;
  display: block;
  cursor: pointer;
}

.pdf-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F0F0EC;
  border: 1px solid #111;
  color: #111;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
}
.pdf-link-btn:hover { background: #E0E0DC; }

.sidebar-widget {
  border: 2px solid var(--fg);
  background: #FFF;
  padding: 18px;
  box-shadow: 3px 3px 0px #111;
  margin-bottom: 20px;
}

.sidebar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 4px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.news-ticker-item {
  padding: 8px 0;
  border-bottom: 1px solid #E5E5E0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.news-ticker-item a { color: #111; text-decoration: none; font-weight: 600; }
.news-ticker-item a:hover { color: var(--accent-red); text-decoration: underline; }
.news-ticker-item:last-child { border-bottom: none; }

.match-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #E5E5E0;
  font-size: 0.82rem;
}
.match-row-item:last-child { border-bottom: none; }

.team-side {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 38%;
}
.team-side.home { justify-content: flex-start; text-align: left; }
.team-side.away { justify-content: flex-end; text-align: right; }

.club-badge {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.match-center-info {
  width: 24%;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.manager-shield-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 40px;
}
.manager-logo-large {
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
}

.pitch-container {
  background: #112516;
  border: 3px solid var(--fg);
  padding: 28px 12px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.6);
}
.pitch-line-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50% !important;
  pointer-events: none;
}
.pitch-line-mid {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}
.pitch-row { display: flex; justify-content: center; gap: 12px; z-index: 2; flex-wrap: wrap; }

.player-card {
  border: 2px solid #111;
  padding: 6px 4px;
  width: 105px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 2px 2px 0px #000;
  transition: transform 0.1s;
}
.player-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0px #000; }

.player-card.pos-por { background: #FFE5CC; }
.player-card.pos-def { background: #EAD1DC; }
.player-card.pos-med { background: #D0E1FD; }
.player-card.pos-del { background: #FFF2CC; }

.player-img {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border: 1.5px solid #111;
  background: #ddd;
  border-radius: 50% !important;
}
.player-pts { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700; color: var(--accent-red); }
.player-name { font-size: 0.7rem; font-weight: 600; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95px; font-family: 'Inter', sans-serif; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat-box { border: 1px solid var(--fg); background: #FFF; padding: 12px; }
.stat-label { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; text-transform: uppercase; color: var(--muted); }
.stat-val { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; margin-top: 2px; }

.matches-ticker-bar {
  border-top: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  background: #111;
  color: #FFF;
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  margin: 24px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}
.ticker-track { display: inline-block; animation: tickerScroll 35s linear infinite; }
.ticker-item { display: inline-block; padding: 0 30px; }
.ticker-item span { color: var(--accent-red); font-weight: 700; }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

footer {
  border-top: 2px solid var(--fg);
  background: #111;
  color: #F9F9F7;
  padding: 20px 0;
  font-size: 0.8rem;
}
.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-content a { color: #F7931A; text-decoration: none; }
.footer-content a:hover { text-decoration: underline; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--bg);
  border: 3px solid var(--fg);
  box-shadow: 6px 6px 0px #000;
  width: 100%;
  max-width: 420px;
  padding: 28px;
}
.input-field {
  width: 100%;
  background: #FFF;
  border: 1px solid var(--fg);
  padding: 8px 12px;
  font-size: 0.9rem;
  margin-bottom: 14px;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.select-input {
  background: #FFF;
  color: #111;
  border: 1px solid var(--fg);
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  outline: none;
}
.chart-box { width: 100%; height: 320px; position: relative; }
canvas { width: 100% !important; height: 100% !important; }
/* ESTILOS MENCIONES DE HONOR */
.honors-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.honors-table th {
  background: var(--fg);
  color: var(--bg);
  padding: 8px 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.honors-row {
  cursor: pointer;
  transition: background 0.15s;
}
.honors-row:hover {
  background: #EFEFEA !important;
}
.arrow-toggle {
  display: inline-block;
  width: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  transition: transform 0.2s;
}
.honor-desc {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.detail-row {
  background: #F4F4F0 !important;
}
.detail-container {
  padding: 10px 14px;
}
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: #FFF;
  border: 1px solid #E0E0DC;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
}
/* Insignia con iniciales de mánager cuando no hay foto */
.avatar-badge-initials {
  width: 24px;
  height: 24px;
  background: #111111;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #111;
}

.avatar-badge-initials-lg {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

/* Tarjeta de Identidad y Lore del Club */
.club-lore-card {
  border: 2px solid var(--fg);
  background: #FFF;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 3px 3px 0px #111;
}

.club-lore-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #111;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.club-shield-img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border: 1px solid #111;
  background: #F9F9F7;
  padding: 4px;
}

.club-info-line {
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.club-info-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}

.club-lore-text {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.88rem;
  line-height: 1.5;
  background: #F9F9F7;
  border-left: 3px solid var(--fg);
  padding: 10px 14px;
  margin-top: 8px;
}
/* REPRODUCTOR DE MÚSICA ADAPTATIVO */
.music-player-subbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #EFEFEA;
  border: 1px solid var(--fg);
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  max-width: 440px;
  flex: 1;
}
.player-ctrl-btn {
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.player-ctrl-btn:hover {
  background: var(--accent-red);
}
.player-track-wrapper {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}
.player-track-info {
  display: inline-block;
  font-weight: 600;
  color: var(--fg);
  animation: none;
}
.player-volume-slider {
  width: 50px;
  accent-color: var(--fg);
  cursor: pointer;
}

/* BOTONES DE EDICIÓN Y BORRADO DE ADMIN EN EL FORO */
.admin-post-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: 10px;
}
.btn-admin-action {
  background: none;
  border: 1px solid var(--fg);
  padding: 1px 6px;
  font-size: 0.68rem;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.btn-admin-action.delete {
  color: var(--accent-red);
  border-color: var(--accent-red);
}
.btn-admin-action.delete:hover {
  background: var(--accent-red);
  color: #FFF;
}
.btn-admin-action.edit:hover {
  background: var(--fg);
  color: var(--bg);
}

/* MODAL DE HISTORIA - MAQUETACIÓN EDITORIAL */
#historyModal .modal-card {
  max-width: 700px !important;
  width: 90% !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  padding: 24px !important;
  background: var(--bg) !important;
  border: 3px solid var(--fg) !important;
  box-shadow: 6px 6px 0px #000 !important;
}

.about-gazette-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 650px) {
  .about-gazette-modal-grid {
    grid-template-columns: 1fr;
  }
}

.about-col-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.about-col-text {
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #222;
}

.author-card-box {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  align-items: center;
  background: #FFF;
  border: 1px solid var(--fg);
  padding: 12px;
  margin-top: 8px;
}

.author-photo-slot {
  width: 55px !important;
  height: 55px !important;
  min-width: 55px !important;
  min-height: 55px !important;
  max-width: 55px !important;
  max-height: 55px !important;
  object-fit: cover !important;
  border: 1px solid var(--fg);
  background: #DDD;
  flex-shrink: 0;
}