/* Estilo base */
:root {
    --bg-page: #000;
    --bg-panel: #111;
    --bg-panel-soft: rgba(9, 15, 9, 0.78);
    --text-primary: #a7ff9f;
    --text-strong: #efffeb;
    --text-muted: #d8ffd8;
    --text-subtle: #c6efc6;
    --border-strong: #80ff80;
    --border-soft: rgba(128, 255, 128, 0.36);
    --accent: #7cff7a;
    --accent-hover: #9bff9a;
    --accent-strong: #90ff90;
    --accent-contrast: #031003;
    --warning-text: #ffe8a3;
    --warning-border: rgba(255, 214, 102, 0.5);
    --warning-bg: rgba(255, 214, 102, 0.1);
    --focus-ring: #d7ffd1;
    --focus-shadow: rgba(124, 255, 122, 0.35);
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    padding: 2rem;
    line-height: 1.5;
    font-size: 1rem;
}

@keyframes darkRgbTextShift {
    0% {
        color: #80ff80;
    }
    34% {
        color: #66e0ff;
    }
    68% {
        color: #ff7a7a;
    }
    100% {
        color: #80ff80;
    }
}

body .site-title a,
body .legal-footer a,
body .site-nav-row a {
    animation: darkRgbTextShift 24s linear infinite;
}

/* Titulos */
h1, h2 {
    text-align: center;
    line-height: 1.3;
}

.site-header {
    margin: 1rem auto 1.5rem;
    text-align: center;
}

.home-hero-header {
    max-width: 760px;
}

.home-hero-center {
    text-align: center;
}

.site-header-compact {
    margin-bottom: 1rem;
}

.site-title {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 3rem);
    letter-spacing: 0.04em;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-title a:hover {
    text-decoration: none;
}

@keyframes crtTitleGlow {
    0%,
    100% {
        text-shadow:
            0 0 0.12rem rgba(128, 255, 128, 0.52),
            0 0 0.32rem rgba(128, 255, 128, 0.18),
            -0.025rem 0 0 rgba(102, 224, 255, 0.18),
            0.025rem 0 0 rgba(255, 122, 122, 0.12);
    }
    46% {
        text-shadow:
            0 0 0.16rem rgba(128, 255, 128, 0.62),
            0 0 0.42rem rgba(128, 255, 128, 0.24),
            -0.03rem 0 0 rgba(102, 224, 255, 0.22),
            0.03rem 0 0 rgba(255, 122, 122, 0.15);
    }
    48% {
        text-shadow:
            0 0 0.11rem rgba(128, 255, 128, 0.48),
            0 0 0.28rem rgba(128, 255, 128, 0.16),
            -0.02rem 0 0 rgba(102, 224, 255, 0.15),
            0.02rem 0 0 rgba(255, 122, 122, 0.11);
    }
    50% {
        text-shadow:
            0 0 0.18rem rgba(128, 255, 128, 0.68),
            0 0 0.5rem rgba(128, 255, 128, 0.28),
            -0.035rem 0 0 rgba(102, 224, 255, 0.24),
            0.035rem 0 0 rgba(255, 122, 122, 0.17);
    }
}

@keyframes crtTitleSweep {
    0% {
        transform: translateX(-130%);
        opacity: 0;
    }
    8% {
        opacity: 0.55;
    }
    14% {
        transform: translateX(130%);
        opacity: 0;
    }
    100% {
        transform: translateX(130%);
        opacity: 0;
    }
}

.news-header-crt .site-title {
    position: relative;
    overflow: hidden;
}

.news-title-crt {
    position: relative;
    display: inline-block;
    color: #80ff80;
    font-family: inherit;
    letter-spacing: inherit;
    text-transform: none;
    animation: crtTitleGlow 12s linear infinite !important;
}

body .news-header-crt .site-title,
body .news-header-crt .site-title a,
body .news-title-crt {
    color: #80ff80 !important;
}

.news-title-crt .glitch-char {
    position: relative;
    display: inline-block;
    width: 1ch;
    height: 1em;
    line-height: 1;
    vertical-align: top;
    transition: text-shadow 90ms linear, opacity 90ms linear;
    will-change: text-shadow, opacity;
}

.news-title-crt .glitch-char::after {
    content: attr(data-glitch-char);
    position: absolute;
    inset: 0;
    color: var(--glitch-color, #66e0ff);
    font-family: var(--glitch-font, inherit);
    opacity: 0;
    pointer-events: none;
    text-shadow:
        -0.04em 0 0 rgba(102, 224, 255, 0.45),
        0.04em 0 0 rgba(255, 122, 122, 0.38),
        0 0 0.3rem currentColor;
    transition: opacity 90ms linear;
}

.news-title-crt .glitch-char.is-glitching {
    opacity: 0.95;
}

.news-title-crt .glitch-char.is-glitching::after {
    opacity: 1;
}

.news-title-crt .glitch-gap {
    display: inline-block;
    width: 0.5ch;
}

.news-title-crt::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -25%;
    width: 22%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(128, 255, 128, 0.08) 20%,
        rgba(128, 255, 128, 0.3) 50%,
        rgba(102, 224, 255, 0.14) 60%,
        transparent 100%
    );
    mix-blend-mode: screen;
    pointer-events: none;
    animation: crtTitleSweep 8.5s linear infinite;
}

.site-nav-row {
    text-align: center;
    margin: 0.75rem 0 0;
    line-height: 1.8;
}

.legal-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 1rem;
    line-height: 1.7;
}

.search-shell {
    max-width: 760px;
    margin: 0 auto 1.5rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1 1 320px;
    min-width: 0;
}

.search-submit {
    width: auto;
    min-width: 120px;
}

.search-summary {
    text-align: center;
    margin: 1rem auto 1.5rem;
    max-width: 760px;
}

.search-language-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
}

.search-summary-note {
    color: var(--text-muted);
}

.table-empty-state {
    text-align: center;
}

.latest-signals {
    max-width: 1120px;
    margin: 0 auto 2.4rem;
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.signal-card {
    min-width: 0;
}

.signal-card-link {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    min-height: 100%;
    aspect-ratio: 1 / 1;
    padding: 0.20rem;
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(128, 255, 128, 0.12), transparent 38%),
        linear-gradient(145deg, rgba(8, 16, 8, 0.94), rgba(3, 6, 3, 0.98));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.signal-card-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--signal-a) 18%, transparent), transparent 42%),
        linear-gradient(315deg, color-mix(in srgb, var(--signal-b) 16%, transparent), transparent 46%);
    opacity: 0.95;
    pointer-events: none;
}

.signal-card-link:hover {
    text-decoration: none;
}

.signal-card-link:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
    box-shadow: 0 0 0 0.35rem var(--focus-shadow);
}

.signal-card-link:hover .signal-art,
.signal-card-link:focus-visible .signal-art {
    transform: scale(1.02);
}

.signal-art {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    margin-bottom: 0.72rem;
    padding: 0.45rem;
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--signal-a) 50%, transparent), transparent 28%),
        radial-gradient(circle at 80% 24%, color-mix(in srgb, var(--signal-b) 40%, transparent), transparent 22%),
        radial-gradient(circle at 48% 80%, color-mix(in srgb, var(--signal-c) 32%, transparent), transparent 24%),
        linear-gradient(180deg, rgba(7, 12, 7, 0.92), rgba(4, 8, 4, 0.98));
    border: 1px solid rgba(128, 255, 128, 0.2);
    transition: transform 180ms ease;
}

.signal-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(128, 255, 128, 0.035) 0, rgba(128, 255, 128, 0.035) 1px, transparent 1px, transparent 10px);
    opacity: 0.55;
    mix-blend-mode: screen;
    pointer-events: none;
}

.signal-art-ascii {
    padding: 0.55rem;
    place-items: stretch;
    background:
        radial-gradient(circle at top left, rgba(128, 255, 128, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(6, 10, 6, 0.96), rgba(3, 6, 3, 1));
}

.signal-randomart {
    position: relative;
    z-index: 1;
    margin: 0;
    width: 100%;
    height: 100%;
    padding: 0.7rem 0.75rem;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.48);
    color: #a8ff9e;
    font-family: 'Courier New', monospace;
    font-size: clamp(0.42rem, 0.72vw, 0.62rem);
    line-height: 1.04;
    letter-spacing: 0;
    white-space: pre;
}

.signal-svg {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 15.5rem);
    height: auto;
    max-width: 100%;
    max-height: 100%;
    box-shadow:
        0 0 0.35rem color-mix(in srgb, var(--signal-a) 18%, transparent),
        0 0 0.8rem color-mix(in srgb, var(--signal-b) 10%, transparent);
    opacity: 0.96;
}

.signal-art-label {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    z-index: 1;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(128, 255, 128, 0.18);
    color: #d4ffd4;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
}

.signal-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.45rem;
}

.archive-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.18rem 0.5rem;
    border: 1px solid rgba(255, 214, 102, 0.65);
    border-radius: 999px;
    background: rgba(255, 214, 102, 0.12);
    color: #ffd666;
    font-family: "Courier New", monospace;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.archive-badge-inline {
    margin-right: 0.55rem;
    vertical-align: middle;
}

.signal-card.is-archived {
    opacity: 0.9;
}

.signal-copy h2 {
    margin: 0;
    font-size: clamp(1rem, 1.85vw, 1.14rem);
    line-height: 1.22;
    text-align: left;
    overflow-wrap: anywhere;
    color: var(--text-strong);
    animation: none !important;
}

.signal-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    animation: none !important;
}

@media (min-width: 961px) {
    .latest-signals {
        padding: 0.20rem;
    }

    .signal-grid {
        gap: 0.75rem;
        align-items: start;
    }

    .signal-card-link {
        aspect-ratio: auto;
        min-height: 25rem;
        grid-template-rows: minmax(13rem, 60%) auto;
    }

    .signal-art {
        height: 100%;
        aspect-ratio: auto;
    }

    .signal-copy {
        align-content: start;
        min-height: 0;
        padding-top: 0.65rem;
    }

    .signal-copy h2 {
        display: block;
        overflow: visible;
    }

    .signal-copy p {
        overflow-wrap: anywhere;
    }
}

.share-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem 0.85rem;
    flex-wrap: wrap;
}

.share-list li {
    margin: 0;
}

.error-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(124, 255, 122, 0.12), transparent 28rem),
        radial-gradient(circle at bottom right, rgba(124, 255, 122, 0.08), transparent 24rem),
        #030603;
}

.error-header {
    margin-bottom: 2rem;
}

.error-kicker {
    margin: 0 0 0.75rem;
    text-align: center;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #b9ffb9;
    font-size: 0.82rem;
}

.error-main {
    max-width: 1100px;
    margin: 0 auto;
}

.error-hero {
    padding: 2rem;
    border: 1px solid rgba(124, 255, 122, 0.7);
    border-radius: 24px;
    background: rgba(8, 18, 8, 0.82);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.error-code {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(124, 255, 122, 0.7);
    border-radius: 999px;
    color: #030603;
    background: #7cff7a;
    font-weight: bold;
    letter-spacing: 0.12em;
}

.error-copy {
    max-width: 44rem;
    margin: 1rem auto 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

.error-action {
    min-width: 200px;
    padding: 0.95rem 1.2rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: bold;
    text-align: center;
}

.error-action:hover {
    text-decoration: none;
    background: var(--accent-hover);
}

.error-action-secondary {
    background: transparent;
    color: #7cff7a;
    border: 1px solid rgba(124, 255, 122, 0.8);
}

.error-action-secondary:hover {
    background: rgba(124, 255, 122, 0.08);
}

.error-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.error-card {
    display: grid;
    gap: 0.55rem;
    padding: 1.2rem;
    border: 1px solid rgba(124, 255, 122, 0.36);
    border-radius: 18px;
    background: rgba(9, 15, 9, 0.78);
    min-height: 132px;
}

.error-card:hover {
    text-decoration: none;
    border-color: rgba(124, 255, 122, 0.78);
    transform: translateY(-1px);
}

.error-card span {
    color: var(--text-muted);
}

/* Clases de utilidad para accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-strong);
    color: #000;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
    font-weight: bold;
}

.skip-link:focus {
    top: 6px;
}

/* Estados de foco mejorados */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    box-shadow: 0 0 0 0.25rem var(--focus-shadow);
}

a:focus, button:focus, input:focus, textarea:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

/* Texto de ayuda */
.help-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-style: italic;
}

/* Articulos */
article {
    max-width: 700px;
    margin: 2rem auto;
    padding: 1.5rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-panel);
    box-sizing: border-box;
}

article h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.3;
}

article p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    border: 1px solid #80ff80;
    padding: 0.5rem;
    text-align: left;
}

th {
    background-color: var(--bg-panel);
}

/* Links */
a {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover {
    text-decoration: underline;
}

a[aria-current="page"] {
    color: var(--text-strong);
    font-weight: 700;
    text-decoration-thickness: 0.14em;
}

.site-nav-row a,
.search-language-filter a,
.pagination-btn,
.tag,
.error-action {
    border-radius: 0.4rem;
}

/* Formulario */
form {
    box-sizing: border-box;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    background: var(--bg-panel);
    padding: 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
}

form label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

form input,
form textarea {
    width: 100%;
    background: var(--bg-page);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    padding: 0.5rem;
    font-family: monospace;
    font-size: 1rem;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

form button {
    background: var(--accent);
    color: #000;
    padding: 0.8rem 1.5rem;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
    display: block;
}

form button:hover {
    background: var(--accent-hover);
}

form button:focus {
    outline: 2px solid #90ff90;
    outline-offset: 2px;
}

/* Mensaje */
#msg {
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Responsive: ocultar columna fuente en movil */
@media (max-width: 600px) {
    #news-table th:nth-child(2),
    #news-table td:nth-child(2) {
        display: none;
    }

    .search-results-table th:nth-child(3),
    .search-results-table td:nth-child(3) {
        display: none;
    }

    #news-table td a {
        word-break: break-word;
        font-size: 1.1rem;
        line-height: 1.5;
    }

    #news-table td {
        padding: 0.8rem;
    }

    #news-table th {
        font-size: 1rem;
        padding: 0.8rem;
    }

    .pagination-container {
        gap: 0.75rem;
    }

    .pagination-container button,
    .pagination-container .pagination-btn,
    .pagination-container span {
        font-size: 0.95rem;
    }

    .error-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive: mejora visual movil */
@media (max-width: 768px) {
    body {
        padding: 0.8rem;
        font-size: 1rem;
        line-height: 1.55;
    }

    h1, h2 {
        font-size: 1.55rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .site-header {
        margin: 0.5rem auto 1rem;
    }

    .site-title {
        font-size: 1.85rem;
    }

    .news-header-crt .site-title {
        overflow: visible;
    }

    .news-title-crt,
    .news-title-crt.mobile-title-static,
    body .site-title a,
    body .signal-copy h2 {
        animation: none !important;
    }

    .news-title-crt,
    .news-title-crt.mobile-title-static {
        position: static;
        display: inline;
        color: #80ff80 !important;
        background: none !important;
        text-shadow: none !important;
        mix-blend-mode: normal;
        -webkit-text-fill-color: #80ff80;
    }

    .news-title-crt::after,
    .news-title-crt .glitch-char::after,
    .news-title-crt.mobile-title-static::after {
        content: none !important;
        display: none !important;
    }

    .site-nav-row {
        margin-top: 0.6rem;
    }

    .signal-copy h2 {
        font-size: 1.02rem;
        line-height: 1.26;
        text-align: left;
    }

    article {
        max-width: 100%;
        margin: 1rem auto;
        padding: 1.1rem;
        font-size: 1rem;
        line-height: 1.65;
    }

    article h2 {
        font-size: 1.3rem;
        margin-bottom: 0.85rem;
        line-height: 1.35;
        text-wrap: balance;
    }

    article p {
        margin-bottom: 1rem;
        font-size: 1rem;
        line-height: 1.65;
    }

    form {
        padding: 1rem;
    }

    form input,
    form textarea {
        font-size: 1.1rem;
        padding: 0.8rem;
    }

    form button {
        font-size: 1.1rem;
        padding: 0.8rem;
    }

    .search-form {
        padding: 0;
        border: 0;
        background: transparent;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }

    .search-input,
    .search-submit {
        width: 100%;
    }

    .search-summary {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .legal-footer {
        font-size: 0.95rem;
        line-height: 1.9;
        padding-bottom: 1.5rem;
    }

    .error-hero {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .error-code {
        margin-bottom: 0.75rem;
    }

    .error-copy {
        font-size: 0.95rem;
    }

    .error-action {
        width: 100%;
        min-width: 0;
    }

    .error-card {
        min-height: 0;
        padding: 1rem;
    }

    /* Mejoras para etiquetas en movil */
    .tags-container {
        margin: 2rem 0;
    }

    .tags-container strong {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .tags-wrapper {
        gap: 0.8rem;
    }

    .tag {
        font-size: 1.1rem;
        padding: 0.6rem 1rem;
        border-radius: 6px;
        font-weight: bold;
        letter-spacing: 0.5px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mejoras para enlaces de compartir */
    .share-links {
        font-size: 1.2rem;
        margin-top: 2.5rem;
    }

    .share-links h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .share-links a {
        margin: 0.4rem 0.6rem;
        font-size: 1.1rem;
        /* Removido: estilos de boton para mantener como enlaces simples */
    }
}

/* Mejoras especificas para iPhone y pantallas muy pequenas */
@media (max-width: 390px) {
    body {
        padding: 0.5rem;
        font-size: 0.98rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .site-header {
        margin: 0.35rem auto 0.85rem;
    }

    .site-title {
        font-size: 1.65rem;
    }

    .site-nav-row {
        font-size: 0.95rem;
    }

    .error-kicker {
        letter-spacing: 0.16em;
    }

    .error-hero h2 {
        font-size: 1.4rem;
    }

    article {
        padding: 0.9rem;
        margin: 0.5rem auto;
        border-width: 2px;
        width: 100%;
        box-sizing: border-box;
    }

    article h2 {
        font-size: 1.15rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    article p {
        font-size: 0.98rem;
        line-height: 1.7;
        margin-bottom: 1rem;
    }

    #news-table td a {
        font-size: 1rem;
        line-height: 1.45;
    }

    #news-table td,
    #news-table th {
        padding: 0.65rem 0.5rem;
    }

    .pagination-container {
        justify-content: stretch;
    }

    .pagination-container button,
    .pagination-container .pagination-btn {
        flex: 1 1 calc(50% - 0.5rem);
        text-align: center;
        padding: 0.65rem 0.8rem;
    }

    .pagination-container span {
        width: 100%;
        text-align: center;
    }

    /* Informacion de fuente y fecha mas legible */
    article p:last-of-type,
    article p small {
        font-size: 1.1rem;
    }

    /* Etiquetas especificas para iPhone */
    .tags-container {
        margin: 2.5rem 0;
    }

    .tags-container strong {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
        color: #80ff80;
    }

    .tags-wrapper {
        gap: 1rem;
    }

    .tag {
        font-size: 1.2rem;
        padding: 0.8rem 1.2rem;
        border-radius: 8px;
        font-weight: bold;
        letter-spacing: 0.5px;
        min-height: 48px;
        text-align: center;
        line-height: 1.2;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .share-links h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .share-links a {
        display: inline-block;
        margin: 0.5rem 0.8rem;
        font-size: 1.05rem;
        /* Removido: estilos de boton para mantener como enlaces simples */
    }

    /* Boton de volver mas visible */
    a[href="/"] {
        font-size: 1rem;
        padding: 0.8rem 1rem;
        display: inline-block;
        margin: 1.5rem 0;
        background: #80ff80;
        color: black;
        border-radius: 4px;
        font-weight: bold;
        text-decoration: none;
    }

    a[href="/"]:hover {
        background: #66ff66;
    }

    /* Video embed mas pequeno en movil */
    #noticia-embed {
        margin: 1.5rem 0;
    }

    #noticia-embed iframe,
    #noticia-embedded-content iframe {
        max-width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
    }
}

@media (max-width: 960px) {
    .signal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .latest-signals {
        margin-bottom: 1.8rem;
    }

    .signal-grid {
        grid-template-columns: 1fr;
    }

    .signal-card-link {
        aspect-ratio: auto;
        min-height: 20rem;
    }

    .signal-copy h2 {
        font-size: 1.08rem;
        line-height: 1.28;
    }

    .signal-copy p,
    .signal-art-label,
    .archive-badge {
        font-size: 0.95rem;
    }
}

@media (min-width: 601px) {
    form button {
        width: auto;
        display: block;
        margin: 0 auto;
        padding: 0.8rem 2rem;
    }
}

/* Videos centrados y responsivos (contenido legacy + embeddedContent) */
#noticia-embed,
#noticia-embedded-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

#noticia-embed iframe,
#noticia-embedded-content iframe,
iframe.consent-iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 18rem;
    border: none;
    background: black;
    animation: fadeIn 0.8s ease-in;
}

#noticia-embedded-content .twitter-tweet {
    margin: 0 auto !important;
}

.embedded-social-card {
    width: 100%;
    max-width: 38rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid currentColor;
    border-radius: 0.75rem;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.18);
}

.embedded-social-card-label,
.embedded-social-card-url {
    font-size: 0.9rem;
    opacity: 0.82;
}

.embedded-social-card-url {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.embedded-social-card strong {
    font-size: 1.1rem;
}

.archive-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning-text);
    line-height: 1.55;
}

/* Estilo para las redes sociales */
.share-links {
    text-align: center;
    margin-top: 2rem;
    font-size: 1rem;
}

.share-links a {
    margin: 0 0.5rem;
    color: var(--accent-strong);
}

.share-links a:hover {
    text-decoration: underline;
}

.donation-callout {
    margin: 1rem auto 0;
    max-width: 42rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.btc-address {
    display: inline-block;
    margin-left: 0.35rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 0.95rem;
}

/* Cursor terminal parpadeante solo en modo oscuro */
body .terminal-cursor {
    display: inline-block;
    margin-left: 4px;
    animation: blink-cursor 0.8s steps(2, start) infinite;
    color: #80ff80;
    font-weight: bold;
    font-size: 1rem;
}

/* Animaciones */
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Estilo para los botones de paginacion del index */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem auto;
}

.pagination-container button,
.pagination-container .pagination-btn {
    background-color: var(--accent);
    color: #000;
    padding: 0.5rem 1.2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.pagination-container button:hover:not(:disabled),
.pagination-container .pagination-btn:hover:not(.disabled) {
    background-color: var(--accent-hover);
}

.pagination-container button:focus,
.pagination-container .pagination-btn:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.pagination-container button:disabled,
.pagination-container .pagination-btn.disabled {
    background-color: #1f1f1f;
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
    cursor: not-allowed;
}

.pagination-container span {
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* Estilos para etiquetas/tags */
.tags-container {
    margin: 1.5rem 0;
}

.tags-container strong {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: var(--text-strong);
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--accent);
    color: #000;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    line-height: 1.2;
}

.tag:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    text-decoration: none;
    color: black;
}

.tag:focus-visible,
.error-action:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.tag:active {
    transform: translateY(0);
}

.no-tags {
    color: var(--text-subtle);
    font-style: italic;
    font-size: 0.9rem;
}

/* Estilos adicionales para elementos semanticos */
.article-content {
    margin: 1.5rem 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-facts,
.article-importance,
.article-metrics {
    margin: 1.75rem 0;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--border-soft);
    border-radius: 0.95rem;
    background:
        linear-gradient(180deg, rgba(128, 255, 128, 0.05), rgba(128, 255, 128, 0.02)),
        rgba(9, 15, 9, 0.58);
}

.article-facts h3,
.article-importance h3,
.article-metrics h3 {
    margin: 0 0 0.8rem;
    line-height: 1.3;
}

.article-facts ul,
.article-metrics ul {
    margin: 0;
    padding-left: 1.25rem;
}

.article-facts li,
.article-metrics li {
    margin: 0.55rem 0;
    color: var(--text-muted);
}

.article-importance-copy p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
}

.article-importance-copy p + p {
    margin-top: 1rem;
}

.article-importance-copy a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-content p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-content a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-stage {
    max-width: 700px;
    margin: 0 auto;
}

.article-meta {
    margin: 2rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 255, 128, 0.28);
    min-width: 0;
}

.article-meta p {
    margin: 0.5rem 0;
    overflow-wrap: anywhere;
}

.article-meta a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-summary,
.article-content,
.article-meta,
.search-summary,
.legal-footer,
.error-copy,
.error-card span,
.search-language-filter,
.site-nav-row {
    color: var(--text-muted);
}

.article-content p,
.article-content li,
.article-content blockquote,
.article-meta li,
article p,
td,
th {
    color: var(--text-muted);
}

.article-content strong,
.article-meta strong,
article h2,
h1,
h2,
h3 {
    color: var(--text-strong);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Mejoras para caption y fieldset */
table caption {
    margin-bottom: 1rem;
    font-weight: bold;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Estilos para indicadores de campos requeridos */
span[aria-label="requerido"] {
    color: #ff8080;
    font-weight: bold;
}

/* Cookie consent banner styles */
.cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.95);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    z-index: 10000;
    display: none;
}
.cookie-banner .cookie-actions { display:flex; gap:0.5rem; margin-top:0.5rem; align-items:center; }
.cookie-preferences {
    display:none;
    position:fixed;
    right:1rem;
    bottom:5rem;
    z-index:10001;
    background:#fffdf7;
    color:#111;
    padding:1rem;
    border-radius:8px;
    border:1px solid #d8d2bf;
    box-shadow:0 10px 30px rgba(0,0,0,0.25);
}
.cookie-preferences h3,
.cookie-preferences legend,
.cookie-preferences label,
.cookie-preferences p {
    color:#111;
}
.cookie-preferences fieldset {
    border:1px solid #c8c1ab;
    border-radius:6px;
    padding:1rem;
    background:#fff;
}
.cookie-preferences legend {
    display:block;
    padding:0 0.35rem;
    margin:0 0 0.75rem 0.5rem;
    background:#fff;
    line-height:1.2;
}
.cookie-preferences input[type="checkbox"] {
    accent-color:#2f7d32;
}
.cookie-preferences-actions { margin-top:0.8rem; display:flex; gap:0.5rem; }
.cookie-link { color: #90ff90; display:inline-block; margin-top:0.5rem; }

.btn.primary { background:#70ff70; color:black; padding:.5rem 1rem; border-radius:6px; border:none; cursor:pointer; }
.btn.outline { background:transparent; border:1px solid #ccc; color:#fff; padding:.4rem .8rem; border-radius:6px; cursor:pointer; }
.cookie-preferences .btn.primary {
    background:#2f7d32;
    color:#fff;
}
.cookie-preferences .btn.outline {
    background:#fff;
    border:1px solid #6b7280;
    color:#111;
}

@media (max-width: 980px) {
    .article-stage {
        max-width: 100%;
    }

    .article-facts,
    .article-importance,
    .article-metrics {
        padding: 1rem;
    }
}
