/* ============================================================
   INTEL FEED — Terminal UI / Data-rain background
   ============================================================ */

/* ── Data-rain canvas ─────────────────────────────────────── */
#intel-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ── Page background ──────────────────────────────────────── */
body[data-page-id="intel"] {
    background: #050000;
}

/* ── Header ──────────────────────────────────────────────── */
.intel-header-bar {
    position: relative;
    z-index: var(--z-ui);
    border-bottom: 1px solid rgba(255, 40, 20, 0.2);
}

/* ── Page layout ─────────────────────────────────────────── */
.intel-main {
    position: relative;
    z-index: var(--z-ui);
    min-height: calc(100vh - var(--header-height));
    padding: 2rem 1.25rem 3rem;
    box-sizing: border-box;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.intel-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.intel-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s;
}

.intel-breadcrumb a:hover {
    color: #f5c842;
}

.intel-breadcrumb span:nth-child(2) {
    color: rgba(255, 255, 255, 0.2);
}

.intel-breadcrumb span:last-child {
    color: rgba(255, 255, 255, 0.4);
}

/* ── Inline CTA button in breadcrumb ─────────────────────── */
.intel-breadcrumb .breadcrumb-cta-btn {
    margin-left: auto;
    padding: 0.3rem 0.85rem;
    background: transparent;
    border: 1px solid rgba(245, 200, 66, 0.5);
    color: #f5c842;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s, border-color 0.2s;
    animation: intel-cta-btn-pulse 2s ease-in-out infinite;
    white-space: nowrap;
}

.intel-breadcrumb .breadcrumb-cta-btn:hover {
    background: rgba(245, 200, 66, 0.12);
    border-color: #f5c842;
}

@keyframes intel-cta-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 200, 66, 0); }
    50%      { box-shadow: 0 0 12px 2px rgba(245, 200, 66, 0.25); }
}

/* ── Terminal window ─────────────────────────────────────── */
.intel-terminal {
    width: 100%;
    max-width: 860px;
    background: rgba(6, 1, 1, 0.88);
    border: 1px solid rgba(255, 40, 20, 0.35);
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow:
        0 0 60px rgba(200, 30, 10, 0.14),
        0 0 0 1px rgba(255, 40, 20, 0.08),
        inset 0 1px 0 rgba(255, 80, 40, 0.06);
    display: flex;
    flex-direction: column;
}

/* ── Terminal title bar ──────────────────────────────────── */
.intel-terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: rgba(180, 20, 5, 0.12);
    border-bottom: 1px solid rgba(255, 40, 20, 0.2);
    flex-shrink: 0;
}

.intel-terminal-dots {
    display: flex;
    gap: 5px;
}

.intel-terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.intel-terminal-dots span:nth-child(1) { background: rgba(255, 80, 60, 0.7); }
.intel-terminal-dots span:nth-child(2) { background: rgba(255, 160, 40, 0.5); }
.intel-terminal-dots span:nth-child(3) { background: rgba(60, 200, 80, 0.4); }

.intel-terminal-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    color: rgba(180, 235, 180, 0.85);
    text-transform: uppercase;
    flex: 1;
    text-align: center;
}

.intel-terminal-status {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: rgba(255, 80, 40, 0.7);
    animation: intel-status-pulse 2s ease-in-out infinite;
}

.intel-terminal-status.connected {
    color: rgba(60, 220, 100, 0.8);
    animation: none;
}

@keyframes intel-status-pulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* ── Boot lines ──────────────────────────────────────────── */
.intel-boot {
    padding: 0.75rem 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.intel-boot-line {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: rgba(140, 220, 140, 0.9);
    text-transform: uppercase;
    opacity: 0;
    animation: intel-boot-in 0.3s ease forwards;
}

.intel-boot-line:nth-child(1) { animation-delay: 0.1s; }
.intel-boot-line:nth-child(2) { animation-delay: 0.5s; }
.intel-boot-line:nth-child(3) { animation-delay: 0.9s; }
.intel-boot-line:nth-child(4) { animation-delay: 1.3s; }

@keyframes intel-boot-in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Feed container ──────────────────────────────────────── */
.intel-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0 0;
    min-height: 200px;
}

/* ── Loading ─────────────────────────────────────────────── */
.intel-loading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    padding: 3rem 0;
}

.intel-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 60, 30, 0.8);
    animation: intel-dot-pulse 1.2s ease-in-out infinite;
}
.intel-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.intel-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes intel-dot-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40%            { opacity: 1;   transform: scale(1);   }
}

.intel-loading-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: rgba(255, 80, 40, 0.5);
    margin-left: 0.5rem;
}

/* ── Empty state ─────────────────────────────────────────── */
.intel-empty {
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: rgba(255, 80, 40, 0.4);
    padding: 4rem 1.25rem;
}

/* ── Card / entry ────────────────────────────────────────── */
.intel-card {
    position: relative;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 40, 20, 0.1);
    transition: background 0.2s;
}

.intel-card:hover {
    background: rgba(255, 30, 10, 0.04);
}

/* Left accent line */
.intel-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 60, 30, 0.2);
    transition: background 0.2s;
}

.intel-card:hover::before {
    background: rgba(255, 80, 40, 0.7);
}

/* Reveal animation */
.intel-card--hidden {
    opacity: 0;
    transform: translateX(-12px);
}

.intel-card:not(.intel-card--hidden) {
    animation: intel-card-reveal 0.4s ease forwards;
}

@keyframes intel-card-reveal {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Card meta row ───────────────────────────────────────── */
.intel-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
}

.intel-card-meta::before {
    content: '▶';
    color: rgba(255, 60, 30, 0.5);
    font-size: 0.55rem;
}

.intel-type-glyph {
    color: rgba(255, 80, 40, 0.8);
    font-size: 0.75rem;
    margin-right: 0.1rem;
}

.intel-type-tag {
    color: rgba(160, 225, 160, 0.9);
    text-transform: uppercase;
}

/* Classification badge */
.intel-class-tag {
    padding: 0.12rem 0.4rem;
    border-radius: 2px;
    font-weight: 600;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.intel-class--restricted   { background: rgba(180, 120, 40, 0.15); color: #c8941a; border: 1px solid rgba(180,120,40,0.25); }
.intel-class--confidential { background: rgba(40, 120, 180, 0.15); color: #4a9fd4; border: 1px solid rgba(40,120,180,0.25); }
.intel-class--topsecret    { background: rgba(200, 30, 30, 0.18);  color: #e05050; border: 1px solid rgba(200,30,30,0.3);   }

/* Date */
.intel-date {
    margin-left: auto;
    color: rgba(255, 80, 40, 0.35);
    font-size: 0.6rem;
}

/* NEW TRANSMISSION badge */
.intel-new-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.45rem;
    background: rgba(255, 40, 20, 0.12);
    border: 1px solid rgba(255, 40, 20, 0.35);
    color: #ff5030;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    border-radius: 2px;
    animation: intel-new-pulse 2s ease-in-out infinite;
}

.intel-new-badge::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff5030;
    animation: intel-new-pulse 2s ease-in-out infinite;
}

@keyframes intel-new-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Title ───────────────────────────────────────────────── */
.intel-card-title {
    font-family: var(--font-mono, monospace);
    font-size: clamp(0.82rem, 1.8vw, 0.98rem);
    letter-spacing: 0.08em;
    color: #e8f5e8;
    font-weight: 600;
    margin: 0 0 0.6rem;
    text-transform: uppercase;
    line-height: 1.35;
}

/* ── Body ────────────────────────────────────────────────── */
.intel-body-wrap {
    position: relative;
}

.intel-card-body {
    font-family: var(--font-mono, monospace);
    font-size: 0.73rem;
    line-height: 1.75;
    color: rgba(180, 225, 180, 0.95);
    margin: 0;
    white-space: pre-wrap;
}

.intel-card-body--blurred {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* Lock overlay */
.intel-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(5, 0, 0, 0.65);
}

.intel-lock-icon {
    font-size: 1.2rem;
    color: rgba(255, 80, 40, 0.5);
}

.intel-lock-msg {
    font-family: var(--font-mono, monospace);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    color: rgba(255, 100, 60, 0.6);
    text-transform: uppercase;
}

.intel-lock-cta {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.3rem 0.85rem;
    border: 1px solid rgba(255, 60, 30, 0.45);
    color: #ff5030;
    font-family: var(--font-mono, monospace);
    font-size: 0.63rem;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.2s;
}

.intel-lock-cta:hover {
    background: rgba(255, 50, 20, 0.1);
}

/* ── Source tag ──────────────────────────────────────────── */
.intel-source {
    margin-top: 0.75rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    color: rgba(255, 80, 40, 0.3);
    text-align: right;
    text-transform: uppercase;
}

/* ── Terminal prompt bar ─────────────────────────────────── */
.intel-terminal-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-top: 1px solid rgba(255, 40, 20, 0.12);
    background: rgba(180, 20, 5, 0.06);
    flex-shrink: 0;
}

.intel-prompt-caret {
    color: rgba(255, 80, 40, 0.6);
    font-size: 0.6rem;
}

.intel-prompt-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: rgba(160, 225, 160, 0.7);
    text-transform: uppercase;
}

.intel-cursor {
    display: inline-block;
    width: 7px;
    height: 12px;
    background: rgba(255, 80, 40, 0.6);
    animation: intel-cursor-blink 1s step-end infinite;
    vertical-align: middle;
}

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

/* ============================================================
   AGENT INTEL — Two-column layout (log panel + terminal)
   ============================================================ */

.intel-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    width: 100%;
    min-height: calc(100vh - var(--header-height, 64px) - 3rem);
}

.intel-right-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

/* ── Log panel (left) ───────────────────────────────────── */
.intel-log-panel {
    background: rgba(6, 1, 1, 0.85);
    border: 1px solid rgba(255, 40, 20, 0.25);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-self: start;
    max-height: calc(100vh - var(--header-height, 64px) - 3rem);
}

.intel-log-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgba(180, 20, 5, 0.1);
    border-bottom: 1px solid rgba(255, 40, 20, 0.18);
    flex-shrink: 0;
}

.intel-log-header-icon {
    color: rgba(245, 200, 66, 0.8);
    font-size: 0.7rem;
}

.intel-log-header-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    color: rgba(180, 235, 180, 0.75);
    text-transform: uppercase;
}

.intel-log-list {
    overflow-y: auto;
    padding: 0.4rem 0;
    flex: 1;
}

.intel-log-list::-webkit-scrollbar {
    width: 3px;
}

.intel-log-list::-webkit-scrollbar-track {
    background: transparent;
}

.intel-log-list::-webkit-scrollbar-thumb {
    background: rgba(255, 60, 30, 0.2);
    border-radius: 2px;
}

/* Log entry */
.intel-log-entry {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    position: relative;
}

.intel-log-entry:hover {
    background: rgba(255, 40, 20, 0.06);
    border-left-color: rgba(255, 60, 30, 0.4);
}

.intel-log-entry--active {
    background: rgba(255, 40, 20, 0.1);
    border-left-color: rgba(255, 80, 40, 0.8);
}

.intel-log-entry--active .intel-log-entry-title {
    color: #e8f5e8;
}

.intel-log-entry + .intel-log-entry {
    border-top: 1px solid rgba(255, 40, 20, 0.06);
}

.intel-log-entry-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.5rem;
    letter-spacing: 0.1em;
}

.intel-log-entry-glyph {
    color: rgba(255, 80, 40, 0.6);
    font-size: 0.6rem;
}

.intel-log-entry-type {
    color: rgba(160, 225, 160, 0.7);
    text-transform: uppercase;
}

.intel-log-entry-class {
    padding: 0.08rem 0.3rem;
    border-radius: 2px;
    font-weight: 600;
    font-size: 0.48rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.intel-log-entry-date {
    margin-left: auto;
    color: rgba(255, 80, 40, 0.3);
    font-family: var(--font-mono, monospace);
    font-size: 0.48rem;
    letter-spacing: 0.08em;
}

.intel-log-entry-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    color: rgba(200, 220, 200, 0.7);
    text-transform: uppercase;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.intel-log-entry-new {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff5030;
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    animation: intel-new-pulse 2s ease-in-out infinite;
}

.intel-log-loading {
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.15em;
    color: rgba(255, 80, 40, 0.35);
    padding: 2rem 0.85rem;
    text-transform: uppercase;
}

.intel-log-empty {
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: rgba(255, 80, 40, 0.3);
    padding: 2rem 0.85rem;
    text-transform: uppercase;
    line-height: 1.6;
}

/* ── Date folder groups ─────────────────────────────────── */
.intel-log-folder {
    border-bottom: 1px solid rgba(255, 40, 20, 0.08);
}

.intel-log-folder-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.intel-log-folder-header:hover {
    background: rgba(255, 40, 20, 0.04);
}

.intel-log-folder-arrow {
    font-size: 0.45rem;
    color: rgba(255, 80, 40, 0.5);
    transition: transform 0.2s;
    display: inline-block;
}

.intel-log-folder--open > .intel-log-folder-header .intel-log-folder-arrow {
    transform: rotate(90deg);
}

.intel-log-folder-icon {
    font-size: 0.6rem;
    color: rgba(255, 80, 40, 0.45);
}

.intel-log-folder--open > .intel-log-folder-header .intel-log-folder-icon {
    color: rgba(255, 120, 60, 0.7);
}

.intel-log-folder-date {
    font-family: var(--font-mono, monospace);
    font-size: 0.54rem;
    letter-spacing: 0.12em;
    color: rgba(200, 180, 160, 0.6);
    text-transform: uppercase;
}

.intel-log-folder-count {
    margin-left: auto;
    font-family: var(--font-mono, monospace);
    font-size: 0.46rem;
    letter-spacing: 0.1em;
    color: rgba(255, 80, 40, 0.3);
    text-transform: uppercase;
}

.intel-log-folder-entries {
    display: none;
    padding-left: 0.4rem;
}

.intel-log-folder--open > .intel-log-folder-entries {
    display: block;
}

/* Locked entry for non-authed users */
.intel-log-entry--locked {
    opacity: 0.45;
    cursor: default;
}

.intel-log-entry--locked:hover {
    background: none;
    border-left-color: transparent;
}

.intel-log-entry-lock-icon {
    font-size: 0.5rem;
    color: rgba(255, 80, 40, 0.4);
    margin-left: auto;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .intel-layout {
        grid-template-columns: 1fr;
    }
    .intel-log-panel {
        max-height: 220px;
    }
}

@media (max-width: 600px) {
    .intel-main { padding: 1.25rem 0.75rem 2rem; }
    .intel-card { padding: 0.85rem 1rem; }
    .intel-date { margin-left: 0; width: 100%; }
    .intel-terminal-title { display: none; }
    .intel-log-panel {
        max-height: 180px;
    }
    .intel-breadcrumb {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
        margin-bottom: 0.75rem;
    }
    .intel-breadcrumb .breadcrumb-cta-btn {
        font-size: 0.5rem;
        padding: 0.25rem 0.6rem;
        letter-spacing: 0.08em;
    }
}

@media (max-width: 480px) {
    .intel-main { padding: 1rem 0.5rem 2rem; }
    .intel-card { padding: 0.75rem 0.75rem; }
    .intel-breadcrumb {
        font-size: 0.58rem;
        letter-spacing: 1px;
    }
}

/* ============================================================
   CIPHER CHALLENGE — Daily encrypted intel puzzles
   ============================================================ */

.cipher-challenge {
    width: 100%;
    max-width: 860px;
    margin: 0 auto 1.5rem;
    background: rgba(6, 1, 1, 0.92);
    border: 1px solid rgba(255, 60, 30, 0.3);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(12px);
    box-shadow:
        0 0 40px rgba(200, 30, 10, 0.1),
        inset 0 1px 0 rgba(255, 80, 40, 0.06);
}

/* Tier selector */
.cipher-tier-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cipher-tier-btn {
    background: rgba(255, 40, 20, 0.06);
    border: 1px solid rgba(255, 60, 30, 0.2);
    color: rgba(255, 80, 40, 0.5);
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.cipher-tier-btn:hover {
    background: rgba(255, 50, 20, 0.12);
    color: rgba(255, 100, 60, 0.8);
}

.cipher-tier-btn--locked {
    opacity: 0.35;
    cursor: not-allowed;
    border-style: dashed;
}
.cipher-tier-btn--locked:hover {
    background: rgba(255, 40, 20, 0.06);
    color: rgba(255, 80, 40, 0.5);
}

.cipher-tier-btn--active {
    background: rgba(255, 50, 20, 0.18);
    border-color: rgba(255, 60, 30, 0.5);
    color: #ff5030;
}

/* Header + timer */
.cipher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cipher-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: rgba(180, 235, 180, 0.8);
    text-transform: uppercase;
}

.cipher-timer {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: rgba(255, 60, 30, 0.8);
    font-variant-numeric: tabular-nums;
}

/* Cipher text display */
.cipher-text-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 40, 20, 0.15);
    border-radius: 3px;
    padding: 1rem;
    font-family: var(--font-mono, monospace);
    font-size: clamp(0.65rem, 1.5vw, 0.82rem);
    letter-spacing: 0.2em;
    color: rgba(180, 255, 180, 0.95);
    line-height: 1.8;
    word-break: break-all;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    min-height: 3rem;
}

/* Meta: type + hint */
.cipher-meta {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    color: rgba(255, 80, 40, 0.45);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

/* Input row */
.cipher-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cipher-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 60, 30, 0.25);
    border-radius: 3px;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: rgba(180, 255, 180, 0.95);
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
}

.cipher-input:focus {
    border-color: rgba(255, 80, 40, 0.5);
}

.cipher-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cipher-submit-btn {
    background: rgba(255, 50, 20, 0.12);
    border: 1px solid rgba(255, 60, 30, 0.4);
    color: #ff5030;
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding: 0.5rem 1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.cipher-submit-btn:hover:not(:disabled) {
    background: rgba(255, 50, 20, 0.22);
}

.cipher-submit-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Result messages */
.cipher-result {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    min-height: 1.2rem;
    margin-bottom: 0.5rem;
}

.cipher-result--correct {
    color: rgba(60, 220, 100, 0.9);
    animation: cipher-flash 0.6s ease;
}

.cipher-result--solved {
    color: rgba(60, 220, 100, 0.6);
}

.cipher-result--wrong {
    color: rgba(255, 80, 40, 0.8);
    animation: cipher-shake 0.3s ease;
}

@keyframes cipher-flash {
    0%, 100% { opacity: 1; }
    30%       { opacity: 0.3; }
    60%       { opacity: 1; }
}

@keyframes cipher-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* Colony progress */
.cipher-progress {
    font-family: var(--font-mono, monospace);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    color: rgba(255, 80, 40, 0.35);
    text-transform: uppercase;
}

/* ── Cipher instructions ─────────────────────────────────── */
.cipher-instructions {
    font-family: var(--font-mono, monospace);
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    line-height: 1.65;
    color: rgba(180, 200, 180, 0.7);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid rgba(255, 80, 40, 0.2);
    border-radius: 0 3px 3px 0;
}

/* ── Public cipher CTA ──────────────────────────────────── */
.cipher-cta {
    display: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    color: rgba(245, 200, 66, 0.7);
    text-transform: uppercase;
    margin-top: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(245, 200, 66, 0.04);
    border: 1px solid rgba(245, 200, 66, 0.15);
    border-radius: 3px;
    text-align: center;
}

.cipher-cta--visible {
    display: block;
    animation: cipher-flash 0.6s ease;
}

.cipher-cta-link {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(245, 200, 66, 0.35);
    color: #f5c842;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.2s;
}

.cipher-cta-link:hover {
    background: rgba(245, 200, 66, 0.08);
}

/* Public cipher: remove max-width to fill right column */
.cipher-challenge--public {
    max-width: none;
    margin: 0 0 1rem;
}

/* ── Cipher inside terminal ────────────────────────────── */
.cipher-terminal-view {
    padding: 1rem 1.25rem;
}

/* Cipher log entry in left panel */
.intel-log-entry--cipher {
    border-left: 2px solid rgba(245, 200, 66, 0.5);
}

.intel-log-entry--cipher .intel-log-entry-glyph {
    color: rgba(245, 200, 66, 0.8);
}

.intel-log-entry--cipher .intel-log-entry-title {
    color: rgba(245, 200, 66, 0.85);
}

.intel-log-entry--cipher.intel-log-entry--active {
    background: rgba(245, 200, 66, 0.08);
    border-left-color: #f5c842;
}

/* Mobile */
@media (max-width: 600px) {
    .cipher-challenge { padding: 0.75rem; margin-bottom: 1rem; }
    .cipher-tier-bar { gap: 0.3rem; }
    .cipher-tier-btn { padding: 0.25rem 0.4rem; font-size: 0.52rem; }
    .cipher-input-row { flex-direction: column; }
    .cipher-submit-btn { width: 100%; }
}

/* ============================================================
   CIPHER GATEWAY — Encrypted intel placeholder
   ============================================================ */

.intel-cipher-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 280px;
    animation: cipherGatePulse 3s ease-in-out infinite;
}

.intel-cipher-gate-icon {
    font-size: 3rem;
    color: rgba(255, 80, 40, 0.7);
    margin-bottom: 1.2rem;
    animation: cipherGateGlow 2s ease-in-out infinite alternate;
}

.intel-cipher-gate-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: rgba(255, 80, 40, 0.9);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.intel-cipher-gate-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: rgba(255, 200, 160, 0.6);
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.intel-cipher-gate-hint {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(255, 80, 40, 0.4);
    letter-spacing: 0.15em;
}

@keyframes cipherGatePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes cipherGateGlow {
    0% { text-shadow: 0 0 8px rgba(255, 80, 40, 0.3); }
    100% { text-shadow: 0 0 20px rgba(255, 80, 40, 0.6), 0 0 40px rgba(255, 40, 20, 0.2); }
}

/* ── Clearance-locked intel drops ────────────────────────────────── */
.intel-log-entry--clearance-locked {
    opacity: 0.6;
    border-left: 2px solid rgba(245, 166, 35, 0.4);
}
.intel-log-entry--clearance-locked:hover {
    opacity: 0.8;
    border-left-color: rgba(245, 166, 35, 0.7);
}
.intel-log-entry-clearance-badge {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    color: #f5a623;
    letter-spacing: 0.1em;
    border: 1px solid rgba(245, 166, 35, 0.3);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    margin-left: 0.4rem;
}

/* Clearance gate overlay in terminal panel */
.intel-clearance-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 280px;
    animation: clearanceGatePulse 3s ease-in-out infinite;
}
.intel-clearance-gate-icon {
    font-size: 3rem;
    color: rgba(245, 166, 35, 0.7);
    margin-bottom: 1.2rem;
    animation: clearanceGateGlow 2s ease-in-out infinite alternate;
}
.intel-clearance-gate-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: rgba(245, 166, 35, 0.9);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.intel-clearance-gate-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: rgba(245, 200, 160, 0.6);
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.intel-clearance-gate-hint {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(245, 166, 35, 0.4);
    letter-spacing: 0.15em;
}

@keyframes clearanceGatePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}
@keyframes clearanceGateGlow {
    0% { text-shadow: 0 0 8px rgba(245, 166, 35, 0.3); }
    100% { text-shadow: 0 0 20px rgba(245, 166, 35, 0.6), 0 0 40px rgba(245, 130, 20, 0.2); }
}

/* ── Cipher Challenge History ────────────────────────────────────── */
.cipher-history {
    padding: 1rem;
}
.cipher-history-back {
    margin-bottom: 1rem;
}
.cipher-history-loading {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    text-align: center;
    padding: 3rem 0;
}
.cipher-history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}
.cipher-history-stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}
.cipher-history-stat-val {
    font-family: var(--font-mono, monospace);
    font-size: 1rem;
    color: #f5c842;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.cipher-history-stat-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.12em;
}
.cipher-history-tiers {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.cipher-history-tier-badge {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.cipher-history-tier--recruit { color: #66cc66; border-color: rgba(102, 204, 102, 0.3); }
.cipher-history-tier--operative { color: #f5c842; border-color: rgba(245, 200, 66, 0.3); }
.cipher-history-tier--commander { color: #ff6644; border-color: rgba(255, 102, 68, 0.3); }

.cipher-history-list {
    max-height: 320px;
    overflow-y: auto;
}
.cipher-history-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
}
.cipher-history-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}
.cipher-history-entry-date {
    color: rgba(255, 255, 255, 0.5);
    min-width: 80px;
}
.cipher-history-entry-tier {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    min-width: 80px;
}
.cipher-history-entry-time {
    color: rgba(255, 255, 255, 0.4);
    min-width: 50px;
}
.cipher-history-entry-credits {
    color: #f5c842;
    margin-left: auto;
}
.cipher-history-empty {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 2rem 0;
    letter-spacing: 0.08em;
}
.cipher-history-more {
    display: block;
    width: 100%;
    margin-top: 1rem;
}
.cipher-history-toggle {
    margin-left: auto;
    font-size: 0.6rem;
}

@media (max-width: 600px) {
    .cipher-history-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .cipher-history-entry {
        gap: 0.5rem;
        font-size: 0.6rem;
    }
}
