/* Constitutional Crisis Simulator v2.1 — style.css */
/* Design: Institutional dark — sharp, authoritative, editorial */

:root {
    --bg:         #0e1117;
    --surface:    #161b24;
    --surface2:   #1e2535;
    --border:     #2a3347;
    --accent:     #c8a44a;   /* Gold — institutional authority */
    --accent2:    #3b7dd8;   /* Blue — democratic */
    --danger:     #e84040;
    --success:    #22c55e;
    --warn:       #f59e0b;
    --text:       #e8ecf1;
    --text-muted: #8899aa;
    --radius:     6px;
    --radius-lg:  12px;
    --law-color:  #3b7dd8;
    --pub-color:  #22c55e;
    --stab-color: #f59e0b;
    --font-head:  'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --font-body:  'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
}

/* ── BASE ── */
#ccs-app * { box-sizing: border-box; margin: 0; padding: 0; }

#ccs-app {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text);
    max-width: 960px;
    margin: 0 auto;
    background: var(--bg) !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}

/* Keep WordPress theme styles from leaking into the game. */
#ccs-app,
#ccs-app * {
    color-scheme: dark;
}

#ccs-app button,
#ccs-app textarea,
#ccs-app input {
    font-family: var(--font-body) !important;
}

#ccs-app button {
    appearance: none;
    -webkit-appearance: none;
    background-image: none !important;
    box-shadow: none;
}

#ccs-app p,
#ccs-app h2,
#ccs-app h3,
#ccs-app h4,
#ccs-app strong,
#ccs-app small,
#ccs-app span,
#ccs-app label {
    color: inherit;
}

.ccs-hidden { display: none !important; }

/* ── HERO ── */
.ccs-hero {
    background: linear-gradient(135deg, #0a0e17 0%, #12192d 60%, #0e1520 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 36px 36px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.ccs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 50%, rgba(200,164,74,0.08) 0%, transparent 60%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(255,255,255,0.015) 40px,
            rgba(255,255,255,0.015) 41px
        );
    pointer-events: none;
}

.ccs-hero-text h2 {
    font-family: var(--font-head);
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 6px 0 10px;
}

.ccs-hero-text p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 480px;
    line-height: 1.6;
}

.ccs-kicker {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}

.ccs-hero-badge {
    flex-shrink: 0;
    background: rgba(200,164,74,0.12);
    border: 1px solid rgba(200,164,74,0.35);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ccs-badge-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ── PANELS ── */
.ccs-panel {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.ccs-panel h3 {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.ccs-panel h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.ccs-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── START / ROLE GRID ── */
#ccs-start-screen { margin: 24px; }

.ccs-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.ccs-role-card {
    background: var(--surface2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ccs-role-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200,164,74,0.15);
}

.ccs-role-card.ccs-role-selected {
    border-color: var(--accent);
    background: rgba(200,164,74,0.08) !important;
    box-shadow: 0 0 0 3px rgba(200,164,74,0.2);
}

.ccs-role-icon { font-size: 28px; line-height: 1; }

.ccs-role-card strong {
    font-family: var(--font-head);
    font-size: 16px;
    color: #fff;
    font-weight: 700;
}

.ccs-role-card small {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ccs-role-stat {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.ccs-role-stat span {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ccs-role-preview {
    background: rgba(59,125,216,0.08);
    border: 1px solid rgba(59,125,216,0.3);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 0 0 16px;
}

.ccs-role-preview p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

/* ── BUTTONS ── */
.ccs-primary, .ccs-secondary {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    letter-spacing: 0.3px;
}

.ccs-primary {
    background: var(--accent) !important;
    color: #0e1117 !important;
    margin-top: 4px;
}

.ccs-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(200,164,74,0.35);
}

.ccs-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ccs-secondary {
    background: var(--surface2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

.ccs-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── TOPBAR ── */
.ccs-topbar {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: center;
}

.ccs-topbar-item { display: flex; flex-direction: column; gap: 2px; }

.ccs-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.ccs-topbar-item strong { font-size: 15px; color: #fff; }

.ccs-crisis-label { padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.ccs-crisis-stable   { background: rgba(34,197,94,0.15); color: #22c55e; }
.ccs-crisis-moderate { background: rgba(245,158,11,0.15); color: #f59e0b; }
.ccs-crisis-elevated { background: rgba(232,64,64,0.15); color: #e84040; }
.ccs-crisis-critical { background: rgba(232,64,64,0.3); color: #ff6060; animation: pulse 1s infinite; }

/* ── METERS ── */
.ccs-meter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.ccs-meter {
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}

.ccs-meter:last-child { border-right: none; }

.ccs-meter-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.ccs-meter-head strong {
    font-family: var(--font-head);
    font-size: 20px;
    color: #fff;
}

.ccs-bar-track {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.ccs-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 50%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s;
}

.ccs-bar-low  { background: var(--danger); }
.ccs-bar-mid  { background: var(--warn); }
.ccs-bar-high { background: var(--success); }

.ccs-meter small {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ── LAYOUT ── */
.ccs-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    min-height: 500px;
}

.ccs-main-panel {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border);
    padding: 28px;
}

.ccs-side {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg) !important;
}

.ccs-side .ccs-panel {
    padding: 16px;
    border-radius: var(--radius);
}

/* ── SCENARIO ── */
.ccs-scenario-header { margin-bottom: 12px; }

.ccs-scenario-header h3 {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}

.ccs-scenario-body {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.75;
    margin-bottom: 16px;
}

.ccs-context-bar {
    background: rgba(59,125,216,0.1);
    border-left: 3px solid var(--accent2);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.ccs-context-bar span {
    font-size: 12px;
    color: #8fb8f0;
    font-weight: 600;
}

/* ── ACTION CARDS ── */
.ccs-action-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.ccs-action-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.ccs-action-card {
    background: var(--surface2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.ccs-action-card:hover {
    border-color: var(--accent);
    transform: translateX(2px);
}

.ccs-action-card.ccs-action-selected {
    border-color: var(--accent);
    background: rgba(200,164,74,0.08) !important;
    box-shadow: inset 3px 0 0 var(--accent);
}

.ccs-action-card-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ccs-action-icon { font-size: 22px; flex-shrink: 0; }

.ccs-action-body { flex: 1; }

.ccs-action-body strong { display: block; font-size: 14px; color: #fff; margin-bottom: 2px; }

.ccs-action-body p { font-size: 12px; color: var(--text-muted); margin: 0; }

.ccs-action-risk {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ccs-risk-low    { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.ccs-risk-med    { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.ccs-risk-high   { background: rgba(232,64,64,0.15); color: #e84040; border: 1px solid rgba(232,64,64,0.3); }
.ccs-risk-severe { background: rgba(232,64,64,0.25); color: #ff5555; border: 1px solid rgba(232,64,64,0.5); animation: pulse 1.5s infinite; }

/* ── CUSTOM INPUT ── */
.ccs-custom-box {
    margin-bottom: 16px;
}

.ccs-custom-box label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.ccs-custom-box label span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.ccs-custom-box textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text) !important;
    font-family: var(--font-body);
    font-size: 13px;
    padding: 10px 12px;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.6;
}

.ccs-custom-box textarea:focus {
    outline: none;
    border-color: var(--accent2);
}

.ccs-custom-box textarea::placeholder { color: var(--text-muted); }

/* ── FEEDBACK BOX ── */
.ccs-feedback-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ccs-feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ccs-ai-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.ccs-score-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid;
}

.ccs-ai-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 14px;
    white-space: pre-line;
}

.ccs-impact-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ccs-impact {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
}

.ccs-impact.pos { background: rgba(34,197,94,0.12); color: #22c55e; }
.ccs-impact.neg { background: rgba(232,64,64,0.12); color: #e84040; }

.ccs-event-flash {
    background: rgba(245,158,11,0.1);
    border-left: 3px solid var(--warn);
    padding: 8px 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 12px;
    color: var(--warn);
    font-weight: 600;
    margin-bottom: 14px;
}

/* ── ADVISOR FEED ── */
.ccs-feed { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }

.ccs-advisor-entry {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    animation: slideIn 0.25s ease;
}

.ccs-advisor-entry strong { color: var(--text); display: block; margin-bottom: 2px; }

.ccs-advisor-event {
    background: rgba(245,158,11,0.08);
    border-left: 2px solid var(--warn);
}

.ccs-feed-empty, .ccs-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── BADGES ── */
.ccs-badges { display: flex; flex-direction: column; gap: 6px; }

.ccs-badge-item {
    background: rgba(200,164,74,0.08);
    border: 1px solid rgba(200,164,74,0.25);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    display: block;
}

/* Badge popup */
.ccs-badge-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface2);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    max-width: 240px;
}

.ccs-badge-popup-show {
    opacity: 1;
    transform: translateY(0);
}

.ccs-badge-popup strong { font-size: 14px; color: var(--accent); }
.ccs-badge-popup small { font-size: 11px; color: var(--text-muted); }

/* ── HISTORY ── */
.ccs-history-feed { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }

.ccs-history-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ccs-hist-round {
    background: var(--border);
    color: var(--text-muted);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.ccs-hist-label { flex: 1; color: var(--text); }

.ccs-hist-net { font-weight: 700; font-size: 11px; white-space: nowrap; }
.ccs-hist-net.pos { color: var(--success); }
.ccs-hist-net.neg { color: var(--danger); }

/* ── END SCREEN ── */
#ccs-end-screen { margin: 24px; }

.ccs-final-report {}

.ccs-final-grade {
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.ccs-final-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.ccs-final-score {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ccs-final-score-icon { font-size: 22px; }
.ccs-final-score strong { font-family: var(--font-head); font-size: 28px; color: #fff; }
.ccs-final-score small { font-size: 11px; color: var(--text-muted); }

.ccs-final-outcomes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.ccs-final-outcomes p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 10px 14px;
    background: var(--surface2);
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
}

.ccs-final-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ccs-end-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
    .ccs-layout {
        grid-template-columns: 1fr;
    }
    .ccs-meter-grid {
        grid-template-columns: 1fr;
    }
    .ccs-meter { border-right: none; border-bottom: 1px solid var(--border); }
    .ccs-meter:last-child { border-bottom: none; }
    .ccs-main-panel { border-right: none; }
    .ccs-hero { flex-direction: column; }
    .ccs-role-grid { grid-template-columns: 1fr 1fr; }
    .ccs-final-scores { grid-template-columns: 1fr; }
    .ccs-topbar { gap: 16px; }
}

@media (max-width: 400px) {
    .ccs-role-grid { grid-template-columns: 1fr; }
}


/* ── THEME CONFLICT GUARD ── */
#ccs-app .ccs-hero,
#ccs-app .ccs-topbar,
#ccs-app .ccs-meter-grid,
#ccs-app .ccs-main-panel,
#ccs-app .ccs-feedback-box,
#ccs-app .ccs-advisor-entry,
#ccs-app .ccs-final-score,
#ccs-app .ccs-final-outcomes p,
#ccs-app .ccs-history-entry,
#ccs-app .ccs-context-bar,
#ccs-app .ccs-event-flash,
#ccs-app .ccs-role-preview,
#ccs-app .ccs-badge-popup {
    color: var(--text) !important;
}

#ccs-app .ccs-panel { background-color: var(--surface) !important; }
#ccs-app .ccs-side,
#ccs-app .ccs-feed .ccs-advisor-entry { background-color: var(--bg) !important; }
#ccs-app .ccs-role-card,
#ccs-app .ccs-action-card,
#ccs-app .ccs-secondary,
#ccs-app .ccs-feedback-box,
#ccs-app .ccs-final-score,
#ccs-app .ccs-final-outcomes p { background-color: var(--surface2) !important; }
#ccs-app .ccs-primary { background-color: var(--accent) !important; color: #0e1117 !important; }
#ccs-app textarea { background-color: var(--bg) !important; color: var(--text) !important; }

/* ── v2.0.2 HOTFIX: theme background/font/layout cleanup ── */
#ccs-app {
    max-width: min(1180px, 100%) !important;
    font-family: var(--font-body) !important;
}

/* Stop WordPress/theme paragraph and heading styles from painting white boxes. */
#ccs-app .ccs-hero-text,
#ccs-app .ccs-hero-text p,
#ccs-app .ccs-hero-text h2,
#ccs-app .ccs-panel h3,
#ccs-app .ccs-panel h4,
#ccs-app .ccs-subtitle,
#ccs-app .ccs-kicker,
#ccs-app .ccs-role-card strong,
#ccs-app .ccs-role-card small,
#ccs-app .ccs-custom-box label,
#ccs-app .ccs-scenario-body,
#ccs-app .ccs-action-body strong,
#ccs-app .ccs-action-body p {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Make sure all game text stays readable over the dark UI. */
#ccs-app .ccs-hero-text h2,
#ccs-app .ccs-panel h3,
#ccs-app .ccs-role-card strong,
#ccs-app .ccs-action-body strong {
    color: #f4f7fb !important;
}

#ccs-app .ccs-hero-text p,
#ccs-app .ccs-subtitle,
#ccs-app .ccs-role-card small,
#ccs-app .ccs-action-body p,
#ccs-app .ccs-scenario-body {
    color: #b8c3d1 !important;
}

#ccs-app .ccs-kicker,
#ccs-app .ccs-hero-badge {
    color: var(--accent) !important;
}

/* Re-assert dark surfaces against aggressive theme button/card styles. */
#ccs-app .ccs-panel {
    background: var(--surface) !important;
}

#ccs-app .ccs-role-card,
#ccs-app .ccs-action-card,
#ccs-app .ccs-secondary {
    background: var(--surface2) !important;
    background-color: var(--surface2) !important;
    color: var(--text) !important;
}

#ccs-app .ccs-primary {
    background: var(--accent) !important;
    background-color: var(--accent) !important;
    color: #10131a !important;
    font-weight: 800 !important;
}

#ccs-app .ccs-role-stat span {
    background: #0f1522 !important;
    background-color: #0f1522 !important;
    color: #f0f4fa !important;
}

/* Give the opening screen room to breathe again. */
#ccs-app .ccs-hero {
    padding: 52px 42px 42px !important;
}

#ccs-app .ccs-hero-text h2 {
    font-size: clamp(34px, 5vw, 54px) !important;
    line-height: 1.02 !important;
    letter-spacing: -1.2px !important;
    margin: 10px 0 12px !important;
}

#ccs-app .ccs-hero-text p {
    max-width: 680px !important;
    font-size: 17px !important;
    line-height: 1.65 !important;
}

#ccs-app .ccs-kicker {
    font-size: 12px !important;
    letter-spacing: 2.5px !important;
}

#ccs-app #ccs-start-screen {
    margin: 36px !important;
    padding: 32px !important;
}

#ccs-app .ccs-panel h3 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
}

#ccs-app .ccs-subtitle {
    font-size: 16px !important;
    margin-bottom: 24px !important;
}

#ccs-app .ccs-role-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap: 18px !important;
    margin: 24px 0 24px !important;
}

#ccs-app .ccs-role-card {
    padding: 28px 22px !important;
    min-height: 210px !important;
    justify-content: center !important;
    gap: 12px !important;
}

#ccs-app .ccs-role-icon {
    font-size: 36px !important;
}

#ccs-app .ccs-role-card strong {
    font-size: 21px !important;
}

#ccs-app .ccs-role-card small {
    font-size: 15px !important;
    line-height: 1.6 !important;
}

#ccs-app .ccs-role-stat span {
    font-size: 11px !important;
    padding: 3px 8px !important;
}

#ccs-app #ccs-start-game {
    margin-top: 6px !important;
    padding: 13px 26px !important;
    font-size: 15px !important;
}

@media (max-width: 680px) {
    #ccs-app .ccs-hero { padding: 34px 24px 30px !important; }
    #ccs-app #ccs-start-screen { margin: 20px !important; padding: 24px !important; }
    #ccs-app .ccs-role-grid { grid-template-columns: 1fr !important; }
}


/* ── v2.0.3 HOTFIX: role preview white background + custom decision UX ── */
#ccs-app #ccs-role-preview,
#ccs-app .ccs-role-preview {
    background: rgba(59,125,216,0.08) !important;
    background-color: rgba(59,125,216,0.08) !important;
    border: 1px solid rgba(59,125,216,0.3) !important;
    box-shadow: none !important;
}

#ccs-app #ccs-role-preview *,
#ccs-app .ccs-role-preview *,
#ccs-app #ccs-role-preview-text {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#ccs-app #ccs-submit:not(:disabled) {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ── v2.0.4 HOTFIX: feedback/advisor theme bleed + prominent next phase ── */
#ccs-app #ccs-feedback-box,
#ccs-app #ccs-feedback-box .ccs-feedback-header,
#ccs-app #ccs-feedback-box #ccs-ai-analysis,
#ccs-app #ccs-feedback-box .ccs-ai-text,
#ccs-app #ccs-feedback-box .ccs-ai-badge,
#ccs-app #ccs-feedback-box p,
#ccs-app #ccs-feedback-box span:not(.ccs-impact):not(.ccs-score-tag),
#ccs-app #ccs-feedback-box strong,
#ccs-app #ccs-advisor-feed,
#ccs-app #ccs-advisor-feed p,
#ccs-app #ccs-advisor-feed span,
#ccs-app #ccs-advisor-feed strong,
#ccs-app .ccs-advisor-entry,
#ccs-app .ccs-advisor-entry * {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#ccs-app #ccs-feedback-box {
    background: var(--surface2) !important;
    background-color: var(--surface2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}

#ccs-app #ccs-ai-analysis,
#ccs-app .ccs-ai-text,
#ccs-app #ccs-advisor-feed,
#ccs-app #ccs-advisor-feed p,
#ccs-app .ccs-advisor-entry,
#ccs-app .ccs-advisor-entry p {
    color: #b8c3d1 !important;
}

#ccs-app .ccs-advisor-entry {
    background: #0f1522 !important;
    background-color: #0f1522 !important;
    border: 1px solid rgba(42,51,71,0.85) !important;
}

#ccs-app .ccs-advisor-event {
    background: rgba(245,158,11,0.10) !important;
    background-color: rgba(245,158,11,0.10) !important;
    border-left: 3px solid var(--warn) !important;
}

#ccs-app .ccs-advisor-entry strong {
    color: #f4f7fb !important;
}

#ccs-app .ccs-impact.pos {
    background: rgba(34,197,94,0.14) !important;
    background-color: rgba(34,197,94,0.14) !important;
    color: #22c55e !important;
}

#ccs-app .ccs-impact.neg {
    background: rgba(232,64,64,0.14) !important;
    background-color: rgba(232,64,64,0.14) !important;
    color: #ff6060 !important;
}

#ccs-app #ccs-event-flash,
#ccs-app .ccs-event-flash {
    background: rgba(245,158,11,0.12) !important;
    background-color: rgba(245,158,11,0.12) !important;
    color: #f6b33f !important;
    border-left: 3px solid var(--warn) !important;
}

#ccs-app #ccs-next-round {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 18px !important;
    padding: 16px 22px !important;
    border-radius: 10px !important;
    border: 2px solid rgba(200,164,74,0.9) !important;
    background: linear-gradient(135deg, #c8a44a 0%, #f0cf6a 100%) !important;
    background-color: var(--accent) !important;
    color: #0e1117 !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    box-shadow: 0 0 0 4px rgba(200,164,74,0.16), 0 10px 28px rgba(0,0,0,0.35) !important;
    animation: ccs-next-pulse 1.6s ease-in-out infinite !important;
}

#ccs-app #ccs-next-round:hover,
#ccs-app #ccs-next-round:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 0 0 5px rgba(200,164,74,0.22), 0 14px 34px rgba(0,0,0,0.45) !important;
    outline: none !important;
}

@keyframes ccs-next-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(200,164,74,0.14), 0 10px 28px rgba(0,0,0,0.35); }
    50% { box-shadow: 0 0 0 8px rgba(200,164,74,0.24), 0 12px 34px rgba(0,0,0,0.42); }
}


/* ── v2.0.6: collapse decision inputs after submission and feature analysis ── */
#ccs-app #ccs-game-screen.ccs-decision-submitted .ccs-action-label,
#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-action-cards,
#ccs-app #ccs-game-screen.ccs-decision-submitted .ccs-custom-box,
#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-submit {
    display: none !important;
    visibility: hidden !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-feedback-box {
    display: block !important;
    margin-top: 4px !important;
    padding: 28px 28px 26px !important;
    background: linear-gradient(180deg, #20283a 0%, #161d2b 100%) !important;
    background-color: #20283a !important;
    border: 2px solid rgba(200,164,74,0.72) !important;
    border-radius: 16px !important;
    box-shadow: 0 0 0 4px rgba(200,164,74,0.10), 0 18px 40px rgba(0,0,0,0.35) !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-feedback-box .ccs-feedback-header {
    margin-bottom: 18px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(200,164,74,0.25) !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-feedback-box .ccs-ai-badge {
    color: #f0cf6a !important;
    font-size: 15px !important;
    letter-spacing: 1.4px !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-ai-analysis {
    color: #e8ecf1 !important;
    font-size: 17px !important;
    line-height: 1.85 !important;
    margin-bottom: 18px !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-impact-row {
    gap: 12px !important;
    margin-bottom: 16px !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-impact-row .ccs-impact {
    font-size: 14px !important;
    padding: 7px 12px !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-event-flash {
    font-size: 14px !important;
    padding: 11px 14px !important;
    margin-bottom: 20px !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-next-round {
    margin-top: 22px !important;
    padding: 20px 24px !important;
    font-size: 20px !important;
}


/* ── PACK SELECTOR / TEACHER PACKS ── */
#ccs-app .ccs-pack-panel {
    background: rgba(59,125,216,0.08) !important;
    border: 1px solid rgba(59,125,216,0.28) !important;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin: 18px 0 20px;
    color: var(--text) !important;
}

#ccs-app .ccs-pack-panel label {
    display: block;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    background: transparent !important;
}

#ccs-app .ccs-pack-panel select {
    width: 100%;
    min-height: 42px;
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    padding: 8px 10px;
    font-family: var(--font-body);
    font-size: 14px;
    box-shadow: none !important;
}

#ccs-app .ccs-pack-description {
    color: var(--text-muted) !important;
    background: transparent !important;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
}


/* ── v2.2.0: mixed mode, scenario count, and final report readability ── */
#ccs-app .ccs-round-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: transparent !important;
}

#ccs-app .ccs-round-panel label {
    display: block;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    background: transparent !important;
}

#ccs-app .ccs-round-panel select {
    width: 100%;
    min-height: 42px;
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    padding: 8px 10px;
    font-family: var(--font-body);
    font-size: 14px;
    box-shadow: none !important;
}

#ccs-app .ccs-round-description {
    color: var(--text-muted) !important;
    background: transparent !important;
    font-size: 12px;
    margin-top: 7px;
}

#ccs-app #ccs-end-screen {
    margin: 28px !important;
    padding: 32px !important;
}

#ccs-app .ccs-final-report {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#ccs-app .ccs-final-hero {
    background: linear-gradient(135deg, rgba(200,164,74,0.16), rgba(59,125,216,0.08)) !important;
    border: 1px solid rgba(200,164,74,0.32) !important;
    border-radius: var(--radius-lg);
    padding: 24px 26px;
}

#ccs-app .ccs-final-kicker {
    display: block;
    color: var(--text-muted) !important;
    background: transparent !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

#ccs-app .ccs-final-grade {
    font-size: clamp(30px, 4vw, 46px) !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    background: transparent !important;
}

#ccs-app .ccs-final-scores {
    gap: 18px !important;
    margin-bottom: 0 !important;
}

#ccs-app .ccs-final-score {
    padding: 24px 18px !important;
    border-radius: var(--radius-lg) !important;
}

#ccs-app .ccs-final-score-icon {
    font-size: 30px !important;
}

#ccs-app .ccs-final-score strong {
    font-size: 46px !important;
    line-height: 1 !important;
}

#ccs-app .ccs-final-score small {
    font-size: 13px !important;
    letter-spacing: 0.5px;
}

#ccs-app .ccs-final-section {
    background: rgba(255,255,255,0.035) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg);
    padding: 20px;
}

#ccs-app .ccs-final-section h4 {
    color: #ffffff !important;
    background: transparent !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0 0 14px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--border) !important;
}

#ccs-app .ccs-final-outcomes {
    gap: 12px !important;
    margin-bottom: 0 !important;
}

#ccs-app .ccs-final-outcomes p {
    font-size: 15px !important;
    line-height: 1.7 !important;
    padding: 16px 18px !important;
    margin: 0 !important;
}

#ccs-app .ccs-final-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
    gap: 20px;
}

#ccs-app .ccs-final-badges {
    gap: 10px !important;
    margin-bottom: 0 !important;
}

#ccs-app .ccs-final-decision-log {
    max-height: none !important;
    gap: 8px !important;
}

#ccs-app .ccs-final-decision-log .ccs-history-entry {
    background: var(--surface2) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: var(--radius);
    padding: 9px 10px !important;
}

@media (max-width: 760px) {
    #ccs-app .ccs-final-grid,
    #ccs-app .ccs-final-scores {
        grid-template-columns: 1fr !important;
    }
    #ccs-app #ccs-end-screen {
        margin: 16px !important;
        padding: 20px !important;
    }
}


/* v2.4 Civic Decision Engine final-report issue flags */
.ccs-final-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
}
.ccs-issue-chip {
    display: inline-block;
    background: rgba(232,64,64,0.12) !important;
    border: 1px solid rgba(232,64,64,0.35);
    color: #ff8a8a !important;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}
.ccs-final-note {
    color: var(--text-muted) !important;
    background: var(--surface2) !important;
    border-left: 3px solid var(--warn);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: 8px 0 0;
    font-size: 13px;
}


/* ── v3.1 additions ─────────────────────────── */

/* Doctrine box */
.ccs-explain-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    background: transparent;
    border: 1.5px solid var(--ccs-border);
    border-radius: 6px;
    color: var(--ccs-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.ccs-explain-btn:hover {
    background: var(--ccs-surface2);
    color: var(--ccs-text);
    border-color: var(--ccs-accent);
}
.ccs-doctrine-box {
    margin-top: 10px;
    padding: 14px 16px;
    background: var(--ccs-surface2, #f8fafc);
    border-left: 3px solid var(--ccs-accent, #6366f1);
    border-radius: 0 6px 6px 0;
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--ccs-text, #1e293b);
    white-space: pre-wrap;
}

/* Scenario memory banner */
.ccs-context-bar {
    position: relative;
}

/* Trajectory note in final report */
.ccs-trajectory-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--ccs-surface2, #f1f5f9);
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ccs-accent, #6366f1);
}

/* ARIA improvements — focus rings */
.ccs-action-card:focus-visible,
.ccs-role-card:focus-visible {
    outline: 3px solid var(--ccs-accent, #6366f1);
    outline-offset: 2px;
}

/* History entry tooltip on hover (shows per-meter breakdown) */
.ccs-hist-net {
    cursor: help;
}


/* ── v3.4.0 VISUAL REFRESH: lighter civic UI + roomier layout ── */
:root {
    --bg:         #edf2f7;
    --surface:    #ffffff;
    --surface2:   #f7f9fc;
    --border:     #d3dce8;
    --accent:     #b98218;
    --accent2:    #2563eb;
    --danger:     #b91c1c;
    --success:    #15803d;
    --warn:       #b45309;
    --text:       #172033;
    --text-muted: #526178;
    --law-color:  #2563eb;
    --pub-color:  #15803d;
    --stab-color: #b45309;
    --shadow:     0 18px 48px rgba(15, 23, 42, 0.16);
    --shadow-sm:  0 8px 20px rgba(15, 23, 42, 0.10);
}

#ccs-app,
#ccs-app * {
    color-scheme: light !important;
}

#ccs-app {
    max-width: min(1220px, 100%) !important;
    background: #edf2f7 !important;
    color: var(--text) !important;
    border: 1px solid #dbe3ef !important;
    box-shadow: var(--shadow) !important;
}

#ccs-app .ccs-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 58%, #fff7e6 100%) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 34px 38px 30px !important;
}

#ccs-app .ccs-hero::before {
    background:
        radial-gradient(ellipse at 82% 38%, rgba(185,130,24,0.14) 0%, transparent 60%),
        repeating-linear-gradient(90deg, transparent, transparent 42px, rgba(37,99,235,0.035) 42px, rgba(37,99,235,0.035) 43px) !important;
}

#ccs-app .ccs-hero-text h2,
#ccs-app .ccs-panel h3,
#ccs-app .ccs-scenario-header h3,
#ccs-app .ccs-role-card strong,
#ccs-app .ccs-action-body strong,
#ccs-app .ccs-topbar-item strong,
#ccs-app .ccs-meter-head strong,
#ccs-app .ccs-final-score strong,
#ccs-app .ccs-final-section h4 {
    color: #111827 !important;
}

#ccs-app .ccs-hero-text p,
#ccs-app .ccs-subtitle,
#ccs-app .ccs-scenario-body,
#ccs-app .ccs-action-body p,
#ccs-app .ccs-role-card small,
#ccs-app .ccs-meter-head,
#ccs-app .ccs-final-score small,
#ccs-app .ccs-round-description,
#ccs-app #ccs-ai-analysis,
#ccs-app .ccs-ai-text,
#ccs-app .ccs-advisor-entry,
#ccs-app .ccs-advisor-entry p {
    color: var(--text-muted) !important;
}

#ccs-app .ccs-kicker,
#ccs-app .ccs-final-grade,
#ccs-app .ccs-badge-item,
#ccs-app .ccs-hero-badge {
    color: var(--accent) !important;
}

#ccs-app .ccs-panel,
#ccs-app #ccs-start-screen,
#ccs-app #ccs-end-screen {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
}

#ccs-app .ccs-topbar,
#ccs-app .ccs-meter-grid,
#ccs-app .ccs-main-panel,
#ccs-app .ccs-side {
    background: var(--surface2) !important;
    background-color: var(--surface2) !important;
    border-color: var(--border) !important;
}

#ccs-app .ccs-layout {
    grid-template-columns: minmax(0, 1fr) 330px !important;
    min-height: 560px !important;
}

#ccs-app .ccs-main-panel {
    padding: 32px !important;
}

#ccs-app .ccs-side {
    padding: 20px !important;
}

#ccs-app #ccs-start-screen,
#ccs-app #ccs-end-screen {
    margin: 28px !important;
}

#ccs-app .ccs-role-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 16px !important;
}

#ccs-app .ccs-role-card,
#ccs-app .ccs-action-card,
#ccs-app .ccs-secondary,
#ccs-app .ccs-final-score,
#ccs-app .ccs-final-section,
#ccs-app .ccs-final-outcomes p,
#ccs-app .ccs-history-entry {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    box-shadow: 0 6px 18px rgba(15,23,42,0.07) !important;
}

#ccs-app .ccs-role-card:hover,
#ccs-app .ccs-action-card:hover,
#ccs-app .ccs-action-card.ccs-action-selected,
#ccs-app .ccs-role-card.ccs-role-selected {
    border-color: var(--accent) !important;
    background: #fffaf0 !important;
    background-color: #fffaf0 !important;
    box-shadow: 0 10px 24px rgba(185,130,24,0.16) !important;
}

#ccs-app .ccs-custom-box textarea,
#ccs-app .ccs-round-panel select {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.04) !important;
}

#ccs-app .ccs-context-bar {
    background: #eaf2ff !important;
    background-color: #eaf2ff !important;
    border-left-color: var(--accent2) !important;
}

#ccs-app .ccs-context-bar span { color: #1d4ed8 !important; }

#ccs-app .ccs-bar-track,
#ccs-app .ccs-role-stat span {
    background: #e7edf6 !important;
    background-color: #e7edf6 !important;
    border-color: var(--border) !important;
}

#ccs-app .ccs-feed .ccs-advisor-entry,
#ccs-app .ccs-advisor-entry {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    box-shadow: 0 4px 12px rgba(15,23,42,0.05) !important;
}

#ccs-app .ccs-advisor-entry strong { color: #111827 !important; }

#ccs-app .ccs-advisor-event,
#ccs-app #ccs-event-flash,
#ccs-app .ccs-event-flash {
    background: #fff7ed !important;
    background-color: #fff7ed !important;
    color: #9a3412 !important;
    border-left-color: var(--warn) !important;
}

#ccs-app #ccs-feedback-box,
#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-feedback-box {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    background-color: #ffffff !important;
    color: var(--text) !important;
    border: 2px solid rgba(185,130,24,0.45) !important;
    box-shadow: 0 16px 36px rgba(15,23,42,0.14), 0 0 0 4px rgba(185,130,24,0.10) !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-ai-analysis {
    color: #172033 !important;
}

#ccs-app .ccs-score-tag,
#ccs-app .ccs-impact {
    box-shadow: none !important;
}

#ccs-app .ccs-primary,
#ccs-app #ccs-next-round {
    background: linear-gradient(135deg, #b98218 0%, #e0b84f 100%) !important;
    background-color: var(--accent) !important;
    color: #111827 !important;
    border-color: rgba(185,130,24,0.85) !important;
}

#ccs-app #ccs-next-round {
    box-shadow: 0 0 0 4px rgba(185,130,24,0.14), 0 10px 24px rgba(15,23,42,0.15) !important;
}

@media (max-width: 880px) {
    #ccs-app .ccs-layout { grid-template-columns: 1fr !important; }
    #ccs-app .ccs-main-panel { border-right: none !important; }
}


/* ── v3.4.1 COLOR REFRESH: civic blue + Fuji apple accents ── */
:root {
    /* Slightly darker than sky blue, with enough contrast for dark navy text */
    --bg:         #cfe2f1;
    --surface:    #eaf3fa;
    --surface2:   #dbeaf5;
    --border:     #9fbad0;

    /* Fuji apple highlight: warm red/pink, used sparingly for calls-to-action */
    --accent:     #e3485f;
    --accent2:    #2f6f9f;
    --danger:     #b42335;
    --success:    #197a52;
    --warn:       #a75c00;

    --text:       #102a3d;
    --text-muted: #3f6076;
    --law-color:  #2f6f9f;
    --pub-color:  #197a52;
    --stab-color: #a75c00;
    --shadow:     0 18px 48px rgba(16, 42, 61, 0.22);
    --shadow-sm:  0 8px 20px rgba(16, 42, 61, 0.14);
}

#ccs-app,
#ccs-app * {
    color-scheme: light !important;
}

#ccs-app {
    background: linear-gradient(180deg, #c7ddeb 0%, #b8d3e5 100%) !important;
    color: var(--text) !important;
    border-color: #8fb0c9 !important;
}

#ccs-app .ccs-hero {
    background: linear-gradient(135deg, #c0daec 0%, #d7e8f4 58%, #f6d6dc 100%) !important;
    border-bottom-color: #9fbad0 !important;
}

#ccs-app .ccs-hero::before {
    background:
        radial-gradient(ellipse at 82% 38%, rgba(227,72,95,0.20) 0%, transparent 58%),
        repeating-linear-gradient(90deg, transparent, transparent 42px, rgba(16,42,61,0.045) 42px, rgba(16,42,61,0.045) 43px) !important;
}

#ccs-app .ccs-panel,
#ccs-app #ccs-start-screen,
#ccs-app #ccs-end-screen,
#ccs-app .ccs-feedback-box {
    background: rgba(234, 243, 250, 0.98) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

#ccs-app .ccs-side,
#ccs-app .ccs-topbar,
#ccs-app .ccs-meter-grid {
    background: #bdd6e8 !important;
    border-color: var(--border) !important;
}

#ccs-app .ccs-role-card,
#ccs-app .ccs-action-card,
#ccs-app .ccs-final-score,
#ccs-app .ccs-final-outcomes p,
#ccs-app .ccs-feed .ccs-advisor-entry,
#ccs-app .ccs-history-entry,
#ccs-app .ccs-role-stat span {
    background: var(--surface2) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

#ccs-app .ccs-role-card:hover,
#ccs-app .ccs-action-card:hover,
#ccs-app .ccs-secondary:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 8px 22px rgba(227, 72, 95, 0.18) !important;
}

#ccs-app .ccs-role-card.ccs-role-selected,
#ccs-app .ccs-action-card.ccs-action-selected {
    background: rgba(227, 72, 95, 0.10) !important;
    border-color: var(--accent) !important;
    box-shadow: inset 4px 0 0 var(--accent), 0 0 0 3px rgba(227, 72, 95, 0.14) !important;
}

#ccs-app .ccs-context-bar {
    background: rgba(47, 111, 159, 0.13) !important;
    border-left-color: var(--accent2) !important;
}

#ccs-app .ccs-context-bar span {
    color: #234e70 !important;
}

#ccs-app .ccs-custom-box textarea,
#ccs-app textarea {
    background: #f2f8fc !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

#ccs-app .ccs-custom-box textarea:focus,
#ccs-app textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(227, 72, 95, 0.14) !important;
}

#ccs-app .ccs-primary,
#ccs-app #ccs-next-phase,
#ccs-app .ccs-next-phase {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: #bd2e43 !important;
    box-shadow: 0 10px 24px rgba(227, 72, 95, 0.24) !important;
}

#ccs-app .ccs-primary:hover:not(:disabled),
#ccs-app #ccs-next-phase:hover,
#ccs-app .ccs-next-phase:hover {
    background: #cf344b !important;
    color: #ffffff !important;
}

#ccs-app .ccs-secondary {
    background: #dbeaf5 !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

#ccs-app .ccs-kicker,
#ccs-app .ccs-final-grade,
#ccs-app .ccs-badge-item,
#ccs-app .ccs-hero-badge,
#ccs-app .ccs-ai-badge {
    color: #bd2e43 !important;
}

#ccs-app .ccs-hero-badge,
#ccs-app .ccs-badge-item {
    background: rgba(227, 72, 95, 0.11) !important;
    border-color: rgba(227, 72, 95, 0.35) !important;
}

#ccs-app .ccs-bar-track {
    background: #aecbdd !important;
}

#ccs-app .ccs-bar-fill.ccs-bar-low,
#ccs-app .ccs-bar-low { background: var(--danger) !important; }
#ccs-app .ccs-bar-fill.ccs-bar-mid,
#ccs-app .ccs-bar-mid { background: var(--warn) !important; }
#ccs-app .ccs-bar-fill.ccs-bar-high,
#ccs-app .ccs-bar-high { background: var(--success) !important; }

#ccs-app .ccs-hero-text h2,
#ccs-app .ccs-panel h3,
#ccs-app .ccs-scenario-header h3,
#ccs-app .ccs-role-card strong,
#ccs-app .ccs-action-body strong,
#ccs-app .ccs-topbar-item strong,
#ccs-app .ccs-meter-head strong,
#ccs-app .ccs-final-score strong,
#ccs-app .ccs-final-section h4,
#ccs-app .ccs-custom-box label {
    color: var(--text) !important;
}

#ccs-app .ccs-hero-text p,
#ccs-app .ccs-subtitle,
#ccs-app .ccs-scenario-body,
#ccs-app .ccs-action-body p,
#ccs-app .ccs-role-card small,
#ccs-app .ccs-meter-head,
#ccs-app .ccs-final-score small,
#ccs-app .ccs-round-description,
#ccs-app #ccs-ai-analysis,
#ccs-app .ccs-ai-text,
#ccs-app .ccs-advisor-entry,
#ccs-app .ccs-advisor-entry p,
#ccs-app .ccs-custom-box label span,
#ccs-app .ccs-feed-empty,
#ccs-app .ccs-empty {
    color: var(--text-muted) !important;
}

#ccs-app .ccs-score-tag {
    background: #f2f8fc !important;
    color: var(--text) !important;
}

/* ── v3.6.0 layout and sizing polish ── */
#ccs-app {
    max-width: min(1180px, calc(100vw - 28px)) !important;
}

#ccs-app .ccs-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px) !important;
    align-items: start !important;
    min-height: auto !important;
}

#ccs-app .ccs-main-panel,
#ccs-app .ccs-panel,
#ccs-app .ccs-feedback-box,
#ccs-app .ccs-role-preview,
#ccs-app .ccs-context-bar {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

#ccs-app .ccs-scenario-header h3 {
    font-size: clamp(20px, 2.4vw, 28px) !important;
    line-height: 1.18 !important;
}

#ccs-app .ccs-scenario-body {
    font-size: clamp(14px, 1.5vw, 16px) !important;
    line-height: 1.7 !important;
    max-width: 78ch !important;
}

#ccs-app .ccs-context-bar span {
    display: block !important;
    line-height: 1.55 !important;
}

#ccs-app .ccs-action-grid {
    gap: 10px !important;
}

#ccs-app .ccs-action-card-inner {
    align-items: flex-start !important;
}

#ccs-app .ccs-action-body strong {
    font-size: 15px !important;
    line-height: 1.25 !important;
}

#ccs-app .ccs-action-body p {
    line-height: 1.45 !important;
}

#ccs-app .ccs-custom-box textarea {
    min-height: 96px !important;
    height: auto;
    max-height: 260px !important;
    overflow-y: auto !important;
    line-height: 1.55 !important;
}

#ccs-app .ccs-primary,
#ccs-app .ccs-secondary,
#ccs-app #ccs-submit,
#ccs-app #ccs-next-round,
#ccs-app #ccs-start-game,
#ccs-app #ccs-share,
#ccs-app #ccs-restart {
    white-space: normal !important;
    line-height: 1.2 !important;
    min-height: 46px !important;
    padding: 12px 18px !important;
    text-align: center !important;
}

#ccs-app #ccs-submit {
    min-width: 160px !important;
    font-size: 14px !important;
}

#ccs-app #ccs-next-round {
    width: 100% !important;
    margin-top: 18px !important;
    font-size: clamp(16px, 2vw, 20px) !important;
    padding: 16px 22px !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted .ccs-feedback-box {
    margin-top: 8px !important;
    padding: clamp(22px, 3vw, 34px) !important;
}

#ccs-app #ccs-game-screen.ccs-decision-submitted #ccs-ai-analysis {
    font-size: clamp(15px, 1.65vw, 18px) !important;
    line-height: 1.75 !important;
}

#ccs-app .ccs-impact-row {
    gap: 12px !important;
}

#ccs-app .ccs-impact {
    line-height: 1.25 !important;
}

#ccs-app .ccs-feed,
#ccs-app .ccs-history-feed {
    max-height: none !important;
}

#ccs-app .ccs-side .ccs-panel {
    overflow-wrap: anywhere !important;
}

@media (max-width: 940px) {
    #ccs-app .ccs-layout {
        grid-template-columns: 1fr !important;
    }
    #ccs-app .ccs-main-panel {
        border-right: none !important;
    }
    #ccs-app .ccs-side {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}


/* v3.9 Diagnostic report additions */
.ccs-final-diagnostic p {
    margin: 0 0 10px;
    line-height: 1.6;
}
.ccs-final-diagnostic strong {
    color: var(--accent);
}
