/* Rättvisespelet: fördjupning, nio rum */
.room-tab { padding: .5rem .75rem; min-height: 44px; border-radius: .375rem; background: #374151; color: #e5e7eb; font-size: .875rem; font-weight: 600; border: 2px solid transparent; cursor: pointer; }
.room-tab:hover { background: #4b5563; }
.room-tab.is-current { background: #2563eb; color: #fff; border-color: #bfdbfe; }
.room-tab:focus-visible, .room-nav button:focus-visible, .rd-btn:focus-visible, .rd-card a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.room-nav { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; flex-wrap: wrap; }
.room-nav button { min-height: 44px; padding: .5rem 1.25rem; border-radius: .375rem; font-weight: 700; background: #1f2937; color: #fff; cursor: pointer; }
.room-nav button:disabled { opacity: .35; cursor: not-allowed; }
.rd-quote { margin: 1.25rem 0; padding: 1rem 1.25rem; border-left: 5px solid #6366f1; background: #eef2ff; border-radius: 0 .5rem .5rem 0; }
.rd-quote p { font-size: 1.1rem; font-style: italic; line-height: 1.5; color: #1e1b4b; }
.rd-quote footer { margin-top: .5rem; font-size: .8rem; color: #374151; line-height: 1.5; }
.rd-quote a, .rd-prose a, .rd-card a { color: #1d4ed8; text-decoration: underline; overflow-wrap: anywhere; }
.rd-prose p { margin-bottom: 1rem; line-height: 1.65; }
.rd-prose h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.rd-prose ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1rem; line-height: 1.6; }
.rd-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.25rem 0; }
@media (min-width: 768px) { .rd-grid.two { grid-template-columns: 1fr 1fr; } }
.rd-card { padding: 1rem 1.1rem; border-radius: .5rem; border: 1px solid #d1d5db; background: #f9fafb; }
.rd-card h4 { font-weight: 700; margin-bottom: .35rem; }
.rd-card.crit { border-left: 5px solid #b91c1c; background: #fef2f2; }
.rd-card.resp { border-left: 5px solid #047857; background: #ecfdf5; }
.rd-note { padding: .75rem 1rem; border-radius: .5rem; background: #fffbeb; border: 1px solid #f59e0b; color: #78350f; font-size: .9rem; margin: 1rem 0; }
.rd-lab { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: .75rem; padding: 1rem; margin: 1.5rem 0; }
.rd-lab h3 { font-weight: 800; font-size: 1.2rem; margin-bottom: .25rem; }
.rd-controls { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 640px) { .rd-controls { grid-template-columns: 1fr 1fr; } }
.rd-controls label { font-weight: 600; display: block; margin-bottom: .25rem; }
.rd-controls input[type=range] { width: 100%; height: 32px; }
.rd-check { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 600; }
.rd-check input { width: 22px; height: 22px; }
.rd-btn { min-height: 44px; padding: .5rem 1rem; border-radius: .375rem; font-weight: 700; background: #1d4ed8; color: #fff; cursor: pointer; }
.rd-btn.alt { background: #fff; color: #1f2937; border: 2px solid #1f2937; }
.rd-btn:disabled { opacity: .45; cursor: not-allowed; }
.rd-scene { width: 100%; border-radius: .5rem; border: 1px solid #cbd5e1; overflow: hidden; background: #fff; }
.rd-scene svg { display: block; width: 100%; height: auto; }
.rd-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .75rem; font-size: .9rem; }
@media (min-width: 640px) { .rd-stats { grid-template-columns: repeat(4, 1fr); } }
.rd-stats div { background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; padding: .5rem .6rem; }
.rd-stats strong { display: block; font-size: 1.2rem; }
#reflection-text { width: 100%; min-height: 9rem; padding: .75rem; border: 2px solid #9ca3af; border-radius: .5rem; }

/* SVG scenes */
.sv-bg { fill: #f1f5f9; }
.sv-label { font: 600 12px 'Segoe UI', sans-serif; fill: #1f2937; }
.sv-num { font: 700 12px 'Segoe UI', sans-serif; fill: #111827; }
.sv-light { fill: #fff; }
.sv-dim { fill: #6b7280; }
.sv-warn { fill: #b91c1c; }
.sv-own-private { fill: #92400e; transition: fill .4s; }
.sv-own-collective { fill: #047857; }
.sv-chimney { fill: #475569; }
.sv-gear-body { fill: #cbd5e1; stroke: #475569; stroke-width: 2; }
.sv-gear { animation: rd-spin 3s linear infinite; }
.sv-smoke { fill: #94a3b8; opacity: .0; animation: rd-smoke 2.4s ease-out infinite; }
.sv-person circle, .sv-person rect { fill: #475569; }
.sv-owner circle, .sv-owner rect { fill: #92400e; }
.sv-manager circle, .sv-manager rect { fill: #b91c1c; }
.sv-income-token { fill: #d97706; animation: rd-income 2.8s ease-in-out infinite; }
.sv-worker circle, .sv-worker rect { fill: #1d4ed8; }
.sv-child circle, .sv-child rect { fill: #dc2626; }
.sv-customer circle, .sv-customer rect { fill: #0f766e; }
.sv-customer-lost circle, .sv-customer-lost rect { fill: #cbd5e1; }
.sv-bar-owner { fill: #b45309; }
.sv-bar-worker { fill: #3b82f6; }
.sv-capture { fill: #dc2626; }
.sv-crate { fill: #f59e0b; stroke: #92400e; }
.sv-owners { transition: opacity .5s; }
.social-tax-feedback{padding:12px 16px;border:2px solid #94a3b8;border-radius:8px;background:#f8fafc;color:#334155}
.social-tax-feedback[data-tax-status="low"],.social-tax-feedback[data-tax-status="high"]{border-color:#b91c1c;background:#fef2f2;color:#991b1b}
.social-tax-warning{color:#b91c1c}
#social-scene[data-tax-status="low"],#social-scene[data-tax-status="high"]{border:2px solid #b91c1c}
#social-scene[data-tax-status="low"] .sv-state,#social-scene[data-tax-status="high"] .sv-state{fill:#b91c1c}
#social-scene[data-tax-status="low"] .sv-flow-tax,#social-scene[data-tax-status="high"] .sv-flow-tax{stroke:#b91c1c}
#marx-scene[data-closed="true"] .sv-gear,#marx-scene[data-closed="true"] .sv-smoke,#marx-scene[data-closed="true"] .sv-income-token{animation:none;opacity:0}
#marx-scene[data-closed="true"] .sv-factory{opacity:.45}
#marx-scene[data-closed="true"] *{animation:none!important}
#marx-management{width:100%;max-width:100%;padding:8px;border:1px solid #94a3b8;border-radius:6px;background:white}
#marx-run:disabled,#marx-transfer:disabled{opacity:.55;cursor:default}
.sv-owners.is-gone { opacity: .25; }
.sv-workers.is-conflict g { animation: rd-shake .5s ease-in-out infinite alternate; }
.sv-workers.is-owners .sv-worker circle, .sv-workers.is-owners .sv-worker rect { fill: #059669; }
.sv-conflict { stroke: #dc2626; stroke-width: 4; stroke-linecap: round; fill: none; stroke-dasharray: 10 10; animation: rd-dash 1s linear infinite; }
.sv-trade { stroke: #0f766e; stroke-width: 1.2; stroke-dasharray: 6 6; animation: rd-dash 1.2s linear infinite; opacity: .6; }
.sv-bob { animation: rd-shake .6s ease-in-out infinite alternate; }
.sv-state { fill: #1e3a8a; }
.sv-admin { fill: #fecaca; stroke: #b91c1c; }
.sv-school { fill: #0f766e; }
.sv-transfer { fill: #7c3aed; }
.sv-bar-gross { fill: #cbd5e1; }
.sv-bar-net { fill: #1d4ed8; }
.sv-flow { fill: none; stroke: #64748b; stroke-linecap: butt; animation: rd-dash 1s linear infinite; }
.sv-flow-tax { stroke: #1e3a8a; }
.sv-flow-admin { stroke: #b91c1c; }
.sv-flow-service { stroke: #0f766e; }
.sv-flow-transfer { stroke: #7c3aed; }
.room:not(.active) * { animation-play-state: paused !important; }
@keyframes rd-spin { to { transform: rotate(360deg); } }
@keyframes rd-dash { to { stroke-dashoffset: -16; } }
@keyframes rd-shake { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes rd-smoke { 0% { opacity: .6; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-22px); } }
@keyframes rd-income { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .room, .sv-gear, .sv-smoke, .sv-conflict, .sv-trade, .sv-bob, .sv-flow, .sv-income-token, .sv-workers.is-conflict g { animation: none !important; }
    .sv-owners, .sv-own-private { transition: none; }
    .sv-smoke { opacity: .3; }
}
