/* News ticker on the hub */
.news-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ticker-label {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--entropy);
    border: 1px solid var(--entropy);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
}

.ticker-wrap {
    flex: 1 1 auto;
    min-width: 0;               /* a long headline is clipped here, not allowed to widen the board */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ticker-track {
    overflow: hidden;
    text-overflow: ellipsis;
    animation: tickerSlide 0.4s ease-out;
}

.ticker-item {
    color: var(--text);
    font-size: 0.95rem;
}

.ticker-item em {
    color: var(--muted);
    font-style: normal;
    margin-left: 0.5rem;
}

@keyframes tickerSlide {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Press clipping modal shown after case completion */
.press-modal-root {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: rootIn 0.3s ease-out;
}

.press-modal-root.fade-out {
    animation: rootOut 0.3s ease-out forwards;
}

.press-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.press-card {
    position: relative;
    background: linear-gradient(135deg, #1a1f29, #151920);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: cardIn 0.4s ease-out;
}

.press-card .stamp {
    display: inline-block;
    background: var(--entropy);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.press-source {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.press-date {
    margin-left: 0.5rem;
}

.press-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1.3;
}

.press-summary {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

.press-card .actions {
    text-align: right;
}

.press-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.press-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.press-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 212, 240, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.press-icon svg {
    width: 22px;
    height: 22px;
}

.press-brand-name {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--text);
}

.press-brand-sub {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.press-source-line {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.press-source-line strong {
    color: var(--text);
    font-weight: 600;
}

.press-meta-dot {
    color: var(--border);
}

.press-duration {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.typewriter-headline {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.6rem;
    line-height: 1.25;
    margin: 0 0 1rem 0;
    min-height: 2.6rem;
}

.press-article .typewriter-headline {
    color: #f0f4f8;
}

.press-video .typewriter-headline {
    color: var(--entropy);
}

.press-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 0 0 1rem 0;
}

.press-card.press-article {
    background: linear-gradient(135deg, #1c212b, #161a22);
    border-left: 4px solid var(--accent);
}

.press-card.press-video {
    background: linear-gradient(135deg, #251d18, #1a1612);
    border-left: 4px solid var(--entropy);
}

.press-card.press-video .stamp {
    background: var(--entropy);
    color: #000;
}

.press-card.press-article .stamp {
    background: rgba(0, 212, 240, 0.15);
    color: var(--accent);
}

/* Live page Entropy panel enhancements */
.live-entropy-panel {
    text-align: center;
}

.live-entropy-panel .entropy-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.live-entropy-panel .entropy-avatar.sprite {
    position: relative;
    z-index: 2;
    border-radius: 50%;
    animation: entropyFloat 3s ease-in-out infinite;
}

.entropy-aura {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.25) 0%, transparent 70%);
    z-index: 1;
    animation: entropyAura 2.5s ease-in-out infinite;
}

.entropy-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 152, 0, 0.4);
    z-index: 1;
    animation: entropyRing 2s linear infinite;
}

.live-entropy-panel.warning .entropy-aura {
    background: radial-gradient(circle, rgba(255, 82, 82, 0.35) 0%, transparent 70%);
}

.live-entropy-panel.warning .entropy-ring {
    border-color: rgba(255, 82, 82, 0.6);
    animation-duration: 0.6s;
}

.entropy-avatar.thinking-active .entropy-aura {
    background: radial-gradient(circle, rgba(0, 212, 240, 0.45) 0%, transparent 70%);
    animation-duration: 0.7s;
}

.entropy-avatar.thinking-active .entropy-ring {
    border-color: rgba(0, 212, 240, 0.7);
    animation-duration: 0.9s;
}

.entropy-avatar.thinking-active.sprite {
    filter: drop-shadow(0 0 24px rgba(0, 212, 240, 0.55));
}

.live-entropy-panel.warning .entropy-avatar.sprite {
    animation: entropyShake 0.4s ease-in-out infinite;
}

.live-dot {
    color: var(--error);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    animation: liveBlink 1.5s infinite;
}

.live-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    background: rgba(0, 212, 240, 0.08);
    border: 1px solid rgba(0, 212, 240, 0.2);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.live-status-bar.warning {
    background: rgba(255, 82, 82, 0.08);
    border-color: rgba(255, 82, 82, 0.3);
    color: var(--error);
}

.live-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
    animation: liveBlink 1.2s infinite;
}

.live-status-bar.warning .live-status-dot {
    background: var(--error);
}

.live-status-text {
    flex: 1;
}

.live-status-scenario {
    color: var(--muted);
    text-align: right;
}

#btn-needs-epoch {
    width: 100%;
    margin-top: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.live-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.75rem 0 0;
    line-height: 1.45;
}

@keyframes entropyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes entropyAura {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes entropyRing {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { transform: rotate(180deg) scale(1.05); opacity: 0.6; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

@keyframes entropyShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-2deg); }
    75% { transform: translateX(3px) rotate(2deg); }
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Spreadsheet / CSV viewer */
.spreadsheet-view {
    padding: 0;
    overflow: hidden;
}

.csv-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.csv-toolbar label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.csv-toolbar select,
.csv-toolbar input {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.csv-toolbar input {
    width: 3rem;
    text-align: center;
}

.csv-meta {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--muted);
}

.csv-toggle {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.csv-raw {
    margin: 0;
    padding: 1rem;
    background: #0d1016;
    color: var(--text);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    max-height: 320px;
}

.csv-table-wrap {
    overflow-x: auto;
    max-height: 360px;
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.csv-table th,
.csv-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.csv-table th {
    background: rgba(0, 212, 240, 0.08);
    color: var(--accent);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.csv-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.csv-table tr.duplicate-row {
    background: rgba(255, 82, 82, 0.12);
}

.csv-table tr.duplicate-row td:first-child {
    border-left: 3px solid var(--error);
}

.csv-table th {
    cursor: pointer;
    user-select: none;
}

.csv-table th:hover {
    background: rgba(0, 212, 240, 0.18);
}

.csv-sort-icon {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.csv-filter-row {
    background: rgba(0, 0, 0, 0.2);
}

.csv-filter-row td {
    padding: 0.25rem 0.5rem;
    border-top: none;
}

.csv-filter {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
}

.csv-filter:focus {
    outline: none;
    border-color: var(--accent);
}

.csv-chart-btn {
    margin-left: auto;
}

.csv-mini-chart {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border);
}

.csv-mini-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
}

.csv-mini-chart-header select {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.csv-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 160px;
    padding: 0.5rem 0;
    overflow-x: auto;
}

.csv-bar {
    flex: 1;
    min-width: 24px;
    max-width: 48px;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(0, 212, 240, 0.6) 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.csv-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.02);
    transform-origin: bottom;
}

.csv-bar-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text);
    white-space: nowrap;
}

.csv-mini-chart-empty {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
}

