/* Google Fonts imported via style.css — duplicate removed (W6/M4) */

:root {
    --mp-bg-dark: #0a0a0f;
    --mp-bg-card: #12121c;
    --mp-bg-input: #1a1a2e;
    --mp-bg-sidebar: #0d0d16;
    --mp-bg-hover: #1e1e32;
    --mp-text-primary: #e0d8c8;
    --mp-text-secondary: #8b8072;
    --mp-text-muted: #5a5347;
    --mp-accent-gold: #d4af37;
    --mp-accent-gold-bright: #f0d060;
    --mp-accent-gold-dim: #8b7520;
    --mp-accent-green: #2ecc71;
    --mp-accent-green-bright: #58d68d;
    --mp-accent-red: #e74c3c;
    --mp-accent-red-bright: #f1948a;
    --mp-accent-blue: #3498db;
    --mp-accent-blue-bright: #5dade2;
    --mp-accent-purple: #9b59b6;
    --mp-border-color: #2a2a3e;
    --mp-border-light: #3a3a52;
    --mp-font-display: 'Cinzel', serif;
    --mp-font-body: 'Raleway', sans-serif;
    --mp-shadow-dark: 0 4px 24px rgba(0, 0, 0, 0.6);
    --mp-shadow-glow-gold: 0 0 15px rgba(212, 175, 55, 0.3);
    --mp-shadow-glow-red: 0 0 20px rgba(231, 76, 60, 0.4);
    --mp-transition: 0.3s ease;
    --mp-sidebar-width: 280px;
    --mp-topbar-height: 48px;
}

/* ============ ANIMATIONS ============ */

@keyframes mp-pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 40px rgba(212, 175, 55, 0.2); }
}

@keyframes mp-horror-flash {
    0% { background-color: rgba(139, 0, 0, 0); }
    15% { background-color: rgba(139, 0, 0, 0.5); }
    30% { background-color: rgba(139, 0, 0, 0); }
    45% { background-color: rgba(139, 0, 0, 0.3); }
    60% { background-color: rgba(139, 0, 0, 0); }
    100% { background-color: rgba(139, 0, 0, 0); }
}

@keyframes mp-slide-in-left {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes mp-slide-in-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes mp-fumble-pulse {
    0%, 100% { border-left-color: var(--mp-accent-red); }
    50% { border-left-color: var(--mp-accent-red-bright); box-shadow: 0 0 12px rgba(231, 76, 60, 0.5); }
}

@keyframes mp-critical-shine {
    0%, 100% { border-left-color: var(--mp-accent-gold); box-shadow: 0 0 5px rgba(212, 175, 55, 0.2); }
    50% { border-left-color: var(--mp-accent-gold-bright); box-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
}

@keyframes mp-tentacle-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

@keyframes mp-blood-drip {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* ============ LOBBY VIEW ============ */

.lobby-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--mp-bg-dark);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(231, 76, 60, 0.02) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
    animation: mp-fade-in 0.5s ease;
    font-family: var(--mp-font-body);
    color: var(--mp-text-primary);
}

.lobby-container {
    max-width: 900px;
    width: 100%;
    padding: 40px 20px;
    margin: 0 auto;
}

.lobby-header {
    text-align: center;
    margin-bottom: 40px;
}

.lobby-header .tentacle-icon {
    font-size: 3rem;
    color: var(--mp-accent-gold);
    display: block;
    margin-bottom: 12px;
    animation: mp-tentacle-sway 4s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.lobby-header h1 {
    font-family: var(--mp-font-display);
    font-size: 2.2rem;
    color: var(--mp-text-primary);
    margin: 0 0 8px 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.lobby-subtitle {
    font-size: 0.95rem;
    color: var(--mp-text-secondary);
    margin: 0;
    font-weight: 300;
    letter-spacing: 1px;
}

.lobby-room-code-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 8px 18px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid var(--mp-accent-gold);
    border-radius: 8px;
    animation: mp-fade-in 0.4s ease;
}

.lobby-room-code-label {
    font-size: 0.85rem;
    color: var(--mp-text-secondary);
    font-weight: 400;
}

.lobby-room-code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--mp-accent-gold-bright);
    letter-spacing: 3px;
    user-select: all;
}

.btn-copy-code {
    background: none;
    border: 1px solid var(--mp-border-light);
    border-radius: 4px;
    color: var(--mp-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    transition: var(--mp-transition);
}

.btn-copy-code:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--mp-accent-gold-bright);
    border-color: var(--mp-accent-gold);
}

@keyframes mp-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lobby-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.lobby-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    padding: 28px;
    transition: var(--mp-transition);
    position: relative;
    overflow: hidden;
}

.lobby-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mp-accent-gold), transparent);
    opacity: 0;
    transition: opacity var(--mp-transition);
}

.lobby-card:hover {
    border-color: var(--mp-border-light);
    box-shadow: var(--mp-shadow-dark);
    transform: translateY(-2px);
}

.lobby-card:hover::before {
    opacity: 1;
}

.lobby-card h3 {
    font-family: var(--mp-font-display);
    font-size: 1.15rem;
    color: var(--mp-accent-gold);
    margin: 0 0 8px 0;
}

.lobby-card > p {
    font-size: 0.82rem;
    color: var(--mp-text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.lobby-card .form-group {
    margin-bottom: 14px;
}

.lobby-card label {
    display: block;
    font-size: 0.78rem;
    color: var(--mp-text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lobby-card input[type="text"],
.lobby-card input[type="password"],
.lobby-card select {
    width: 100%;
    padding: 10px 14px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    color: var(--mp-text-primary);
    font-family: var(--mp-font-body);
    font-size: 0.9rem;
    transition: border-color var(--mp-transition);
    box-sizing: border-box;
}

.lobby-card input[type="text"]:focus,
.lobby-card input[type="password"]:focus,
.lobby-card select:focus {
    outline: none;
    border-color: var(--mp-accent-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}

.lobby-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lobby-card .btn-lg {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
}

.lobby-footer {
    text-align: center;
    margin-top: 24px;
}

.lobby-footer .btn-sm {
    color: var(--mp-text-muted);
    border-color: var(--mp-border-color);
}

/* ============ SERVER LIST ============ */

.lobby-card-serverlist {
    display: flex;
    flex-direction: column;
}

.serverlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.serverlist-header h3 {
    margin: 0;
}

.btn-refresh {
    background: none;
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-secondary);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 1.1rem;
    transition: var(--mp-transition);
    line-height: 1;
}

.btn-refresh:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--mp-accent-gold);
    color: var(--mp-accent-gold);
}

.btn-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.server-list {
    flex: 1;
    overflow-y: auto;
    max-height: 320px;
    margin-top: 12px;
    border: 1px solid var(--mp-border-color);
    border-radius: 8px;
    background: var(--mp-bg-input);
}

.server-list-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--mp-text-muted);
    font-size: 0.88rem;
}

.server-list-error {
    color: var(--mp-accent-red);
}

.server-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mp-border-color);
    transition: background var(--mp-transition);
    cursor: default;
}

.server-list-item:last-child {
    border-bottom: none;
}

.server-list-item:hover {
    background: var(--mp-bg-hover);
}

.server-list-item.room-full {
    opacity: 0.5;
}

.room-info {
    flex: 1;
    min-width: 0;
}

.room-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--mp-text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-lock-icon {
    color: var(--mp-accent-gold);
    font-size: 0.85rem;
}

.room-gm-icon {
    color: var(--mp-accent-gold);
    font-size: 0.85rem;
}

.room-meta {
    display: flex;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--mp-text-secondary);
    margin-bottom: 2px;
}

.room-era {
    background: rgba(212, 175, 55, 0.1);
    color: var(--mp-accent-gold);
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.room-state {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-state-lobby {
    background: rgba(46, 204, 113, 0.1);
    color: var(--mp-accent-green);
}

.room-state-active {
    background: rgba(52, 152, 219, 0.1);
    color: var(--mp-accent-blue);
}

.room-state-paused {
    background: rgba(155, 89, 182, 0.1);
    color: var(--mp-accent-purple);
}

.room-players {
    color: var(--mp-text-secondary);
}

.room-player-names {
    font-size: 0.75rem;
    color: var(--mp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-join-room-action {
    flex-shrink: 0;
    margin-left: 12px;
    padding: 6px 16px;
    background: var(--mp-accent-gold);
    color: var(--mp-bg-dark);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--mp-transition);
    font-family: var(--mp-font-body);
}

.btn-join-room-action:hover:not(:disabled) {
    background: var(--mp-accent-gold-bright);
    box-shadow: var(--mp-shadow-glow-gold);
}

.btn-join-room-action:disabled {
    background: var(--mp-border-color);
    color: var(--mp-text-muted);
    cursor: not-allowed;
}

/* ============ JOIN PASSWORD MODAL ============ */

#join-password-modal .mp-modal-sm {
    max-width: 380px;
    width: 90%;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    padding: 28px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#join-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#join-password-modal.hidden {
    display: none;
}

#join-password-modal .mp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 5;
}

#join-password-modal h3 {
    font-family: var(--mp-font-display);
    color: var(--mp-accent-gold);
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

#join-password-modal p {
    color: var(--mp-text-secondary);
    font-size: 0.88rem;
    margin: 0 0 16px 0;
}

#join-password-modal .form-group {
    margin-bottom: 16px;
}

#join-password-modal label {
    display: block;
    font-size: 0.78rem;
    color: var(--mp-text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#join-password-modal input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    color: var(--mp-text-primary);
    font-family: var(--mp-font-body);
    font-size: 0.9rem;
    box-sizing: border-box;
}

#join-password-modal input[type="password"]:focus {
    outline: none;
    border-color: var(--mp-accent-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}

.mp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============ RECLAIM IDENTITY MODAL ============ */

#reclaim-identity-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reclaim-identity-modal.hidden {
    display: none;
}

#reclaim-identity-modal .mp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 5;
}

#reclaim-identity-modal .mp-modal-sm {
    max-width: 400px;
    width: 90%;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    padding: 28px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#reclaim-identity-modal h3 {
    font-family: var(--mp-font-display);
    color: var(--mp-accent-gold);
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

#reclaim-identity-modal p {
    color: var(--mp-text-secondary);
    font-size: 0.88rem;
    margin: 0 0 16px 0;
}

.reclaim-player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 260px;
    overflow-y: auto;
}

.reclaim-player-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    color: var(--mp-text-primary);
    font-family: var(--mp-font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.reclaim-player-btn:hover {
    border-color: var(--mp-accent-gold);
    background: rgba(212, 175, 55, 0.08);
}

.reclaim-role-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--mp-border-color);
    color: var(--mp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.reclaim-role-badge.badge-gold {
    background: rgba(212, 175, 55, 0.2);
    color: var(--mp-accent-gold);
}

.reclaim-role-badge.badge-muted {
    background: rgba(128, 128, 128, 0.2);
    color: var(--mp-text-secondary);
}

/* ============ BACKUP MODAL ============ */

#backup-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#backup-list-modal.hidden {
    display: none;
}

#backup-list-modal .mp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 5;
}

#backup-list-modal .mp-modal-content {
    max-width: 480px;
    width: 90%;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    padding: 28px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#backup-list-modal h3 {
    font-family: var(--mp-font-display);
    color: var(--mp-accent-gold);
    margin: 0 0 16px 0;
    font-size: 1.1rem;
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 320px;
    overflow-y: auto;
}

.backup-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    gap: 10px;
}

.backup-list-item .backup-name {
    font-size: 0.9rem;
    color: var(--mp-text-primary);
    flex: 1;
}

.backup-list-item .backup-date {
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
}

.backup-list-item .backup-actions {
    display: flex;
    gap: 6px;
}

.backup-list-empty {
    text-align: center;
    color: var(--mp-text-secondary);
    padding: 24px;
    font-size: 0.88rem;
}

/* Grimoire Modal */
#mp-grimoire-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: none;
    background: transparent;
    width: auto;
}

#mp-grimoire-modal.hidden {
    display: none;
}

#mp-grimoire-modal .mp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 5;
}

#mp-grimoire-modal .mp-modal-content {
    max-width: 700px;
    width: 90%;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    padding: 28px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#mp-grimoire-modal h3 {
    font-family: var(--mp-font-display);
    color: var(--mp-accent-gold);
    margin: 0 0 12px 0;
    font-size: 1.1rem;
}

/* Portraits Modal */
#mp-portraits-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: none;
    background: transparent;
    width: auto;
}

#mp-portraits-modal.hidden {
    display: none;
}

#mp-portraits-modal .mp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 5;
}

#mp-portraits-modal .mp-modal-content {
    max-width: 800px;
    width: 90%;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    padding: 28px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#mp-portraits-modal h3 {
    font-family: var(--mp-font-display);
    color: var(--mp-accent-gold);
    margin: 0 0 12px 0;
    font-size: 1.1rem;
}

/* ============ CLAIM GM BUTTON ============ */

#btn-claim-gm {
    animation: mp-pulse-glow 2s ease-in-out infinite;
}


.lobby-footer .btn-sm:hover {
    color: var(--mp-text-secondary);
    border-color: var(--mp-border-light);
}

/* ============ SESSION TOP BAR ============ */

.session-top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--mp-bg-dark);
    border-bottom: 1px solid var(--mp-border-color);
    height: var(--mp-topbar-height);
    box-sizing: border-box;
    font-family: var(--mp-font-body);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.room-code-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--mp-accent-gold);
    border-radius: 4px;
    color: var(--mp-accent-gold-bright);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
}

#mp-session-name {
    font-size: 0.85rem;
    color: var(--mp-text-primary);
    font-weight: 600;
}

.session-timer {
    font-size: 0.8rem;
    color: var(--mp-text-muted);
    font-family: 'Courier New', monospace;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.session-actions .btn-sm {
    font-size: 0.75rem;
    padding: 4px 10px;
}

/* ============ SESSION LAYOUT ============ */

.session-layout {
    display: flex;
    min-height: calc(100vh - var(--mp-topbar-height));
    position: relative;
    font-family: var(--mp-font-body);
}

.session-main {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    padding: 0;
    width: 100%;
    position: relative;
}

.session-sidebar {
    position: fixed;
    top: var(--mp-topbar-height);
    height: calc(100vh - var(--mp-topbar-height));
    width: var(--mp-sidebar-width);
    min-width: var(--mp-sidebar-width);
    background: var(--mp-bg-sidebar);
    overflow-y: auto;
    padding: 0;
    z-index: 900;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    transition: transform var(--mp-transition), opacity var(--mp-transition);
    display: none;
    flex-direction: column;
}

.session-sidebar.open {
    display: flex;
    animation: mp-fade-in 0.25s ease;
}

.session-sidebar.session-sidebar-left {
    left: 0;
    border-right: 1px solid var(--mp-border-color);
}

.session-sidebar.session-sidebar-right {
    right: 0;
    border-left: 1px solid var(--mp-border-color);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mp-border-color);
    position: sticky;
    top: 0;
    background: var(--mp-bg-sidebar);
    z-index: 2;
}

.sidebar-header h4 {
    font-family: var(--mp-font-display);
    font-size: 0.9rem;
    color: var(--mp-accent-gold);
    margin: 0;
}

.sidebar-close {
    font-size: 1.2rem !important;
    padding: 2px 8px !important;
    line-height: 1;
    color: var(--mp-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
}

.sidebar-close:hover {
    color: var(--mp-text-primary);
}

.session-main {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    padding: 0;
    width: 100%;
    position: relative;
}

/* ============ PLAYER LIST ============ */

.player-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 8px;
    padding: 10px 12px;
    transition: var(--mp-transition);
    position: relative;
}

.player-card:hover {
    border-color: var(--mp-border-light);
}

.player-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.player-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mp-text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-connection-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mp-accent-green);
    display: inline-block;
    flex-shrink: 0;
}

.player-card.disconnected .player-connection-dot {
    background: var(--mp-accent-red);
}

.player-role-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-role-badge.gm {
    background: rgba(212, 175, 55, 0.15);
    color: var(--mp-accent-gold);
    border: 1px solid var(--mp-accent-gold-dim);
}

.player-role-badge.player {
    background: rgba(52, 152, 219, 0.15);
    color: var(--mp-accent-blue);
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.player-role-badge.spectator {
    background: rgba(139, 128, 114, 0.15);
    color: var(--mp-text-muted);
    border: 1px solid rgba(139, 128, 114, 0.3);
}

.player-mini-bars {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.player-mini-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.player-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--mp-transition);
}

.player-mini-bar-fill.hp {
    background: linear-gradient(90deg, var(--mp-accent-red), #c0392b);
}

.player-mini-bar-fill.san {
    background: linear-gradient(90deg, var(--mp-accent-green), var(--mp-accent-green-bright));
}

.player-mini-bar-label {
    font-size: 0.65rem;
    color: var(--mp-text-muted);
    margin-top: 2px;
    display: flex;
    justify-content: space-between;
}

.player-card.disconnected {
    opacity: 0.45;
}

.player-card.disconnected .player-card-name {
    text-decoration: line-through;
}

/* ============ DICE FEED ============ */

.dice-feed-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - var(--mp-topbar-height) - 52px);
    overflow-y: auto;
}

.dice-feed-entry {
    padding: 8px 12px;
    background: var(--mp-bg-card);
    border-left: 3px solid var(--mp-border-color);
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
    animation: mp-fade-in 0.3s ease;
    transition: var(--mp-transition);
}

.dice-feed-entry:hover {
    background: var(--mp-bg-hover);
}

.dice-feed-entry.success {
    border-left-color: var(--mp-accent-green);
}

.dice-feed-entry.failure {
    border-left-color: var(--mp-accent-red);
}

.dice-feed-entry.critical {
    border-left-color: var(--mp-accent-gold);
    animation: mp-critical-shine 2s ease-in-out infinite;
    background: rgba(212, 175, 55, 0.05);
}

.dice-feed-entry.fumble {
    border-left-color: var(--mp-accent-red);
    animation: mp-fumble-pulse 1.5s ease-in-out infinite;
    background: rgba(231, 76, 60, 0.05);
}

.dice-feed-entry-player {
    font-weight: 600;
    color: var(--mp-accent-blue);
    font-size: 0.72rem;
    margin-bottom: 2px;
}

.dice-feed-entry-roll {
    color: var(--mp-text-primary);
    font-weight: 700;
    font-size: 1rem;
}

.dice-feed-entry-detail {
    color: var(--mp-text-secondary);
    font-size: 0.7rem;
    margin-top: 2px;
}

.dice-feed-entry.success .dice-feed-entry-roll {
    color: var(--mp-accent-green-bright);
}

.dice-feed-entry.failure .dice-feed-entry-roll {
    color: var(--mp-accent-red-bright);
}

.dice-feed-entry.critical .dice-feed-entry-roll {
    color: var(--mp-accent-gold-bright);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.dice-feed-entry.fumble .dice-feed-entry-roll {
    color: var(--mp-accent-red-bright);
    text-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

.dice-feed-entry-time {
    color: var(--mp-text-muted);
    font-size: 0.65rem;
    margin-top: 3px;
}

/* ============ COMBAT TRACKER ============ */

.combat-tracker-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--mp-bg-dark);
    border-top: 2px solid var(--mp-accent-red);
    box-shadow: 0 -4px 20px rgba(231, 76, 60, 0.15);
    z-index: 1100;
    padding: 10px 16px;
    font-family: var(--mp-font-body);
    animation: mp-fade-in 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--mp-accent-red) transparent;
}

.combat-tracker-bar::-webkit-scrollbar {
    width: 6px;
}

.combat-tracker-bar::-webkit-scrollbar-thumb {
    background: var(--mp-accent-red);
    border-radius: 3px;
}

.combat-tracker-bar::-webkit-scrollbar-track {
    background: transparent;
}

.combat-tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--mp-accent-red-bright);
    font-family: var(--mp-font-display);
    font-size: 0.9rem;
}

.combat-tracker-actions {
    display: flex;
    gap: 6px;
}

.combat-initiative-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--mp-accent-gold-dim) transparent;
}

.combat-initiative-list::-webkit-scrollbar {
    height: 4px;
}

.combat-initiative-list::-webkit-scrollbar-thumb {
    background: var(--mp-accent-gold-dim);
    border-radius: 2px;
}

.combat-initiative-entry {
    flex-shrink: 0;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 6px 12px;
    min-width: 100px;
    text-align: center;
    transition: var(--mp-transition);
    cursor: pointer;
}

.combat-initiative-entry:hover {
    border-color: var(--mp-border-light);
}

.combat-initiative-entry.active {
    border-color: var(--mp-accent-gold);
    box-shadow: var(--mp-shadow-glow-gold);
    transform: scale(1.05);
    background: rgba(212, 175, 55, 0.08);
}

.combat-initiative-name {
    font-size: 0.8rem;
    color: var(--mp-text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.combat-initiative-value {
    font-size: 0.7rem;
    color: var(--mp-text-muted);
    margin-top: 2px;
}

/* ── Turn Order Bar (Kampfreihenfolge) ── */
.mp-turn-order-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--mp-border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--mp-accent-gold-dim) transparent;
}

.mp-turn-order-bar::-webkit-scrollbar {
    height: 4px;
}

.mp-turn-order-bar::-webkit-scrollbar-thumb {
    background: var(--mp-accent-gold-dim);
    border-radius: 2px;
}

.mp-turn-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.2s;
    cursor: default;
}

.mp-turn-chip:hover {
    border-color: var(--mp-border-light);
}

.mp-turn-chip-active {
    border-color: var(--mp-accent-gold);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.mp-turn-chip-dead {
    opacity: 0.35;
    text-decoration: line-through;
}

.mp-turn-chip-acted {
    opacity: 0.55;
}

.mp-turn-chip-icon {
    font-size: 0.85rem;
}

.mp-turn-chip-name {
    color: var(--mp-text-primary);
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-turn-chip-init {
    color: var(--mp-accent-gold);
    font-weight: 700;
    font-size: 0.7rem;
    background: rgba(212, 175, 55, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
}

.mp-turn-chip-hp {
    font-size: 0.7rem;
    font-weight: 500;
}

.mp-turn-chip-arrow {
    color: var(--mp-accent-gold);
    font-size: 0.7rem;
    animation: mp-pulse 1.5s ease-in-out infinite;
}

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

/* ── Improved Combat Log ── */
.mp-combat-log {
    margin-top: 10px;
    border-top: 1px solid var(--mp-border-color);
    padding-top: 8px;
}

.mp-combat-log h5 {
    color: var(--mp-accent-red-bright);
    font-size: 0.85rem;
    margin: 0 0 6px 0;
    font-family: var(--mp-font-display);
}

.mp-combat-log-entry {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 0;
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
    border-bottom: 1px solid rgba(42, 42, 62, 0.3);
    flex-wrap: wrap;
}

.mp-combat-log-entry .mp-log-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.mp-combat-log-entry .mp-log-round {
    color: var(--mp-text-muted);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.mp-combat-log-entry .mp-log-actor {
    color: var(--mp-text-primary);
    font-weight: 600;
}

.mp-combat-log-entry .mp-log-target {
    color: var(--mp-accent-red-bright);
    font-weight: 500;
}

.mp-combat-log-entry .mp-log-action {
    color: var(--mp-text-muted);
    font-size: 0.7rem;
}

.mp-combat-log-entry .mp-log-result {
    color: var(--mp-accent-gold);
    font-weight: 500;
    font-size: 0.7rem;
}

.mp-combat-log-empty {
    color: var(--mp-text-muted);
    font-style: italic;
    font-size: 0.8rem;
    padding: 4px 0;
}

.combat-log-entries {
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
    border-top: 1px solid var(--mp-border-color);
    margin-top: 6px;
    padding-top: 6px;
}

.combat-log-entry {
    padding: 2px 0;
    border-bottom: 1px solid rgba(42, 42, 62, 0.3);
}

/* ============ GM DASHBOARD ============ */

.gm-dashboard {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: var(--mp-bg-dark);
    border-left: 1px solid var(--mp-accent-gold-dim);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
    font-family: var(--mp-font-body);
    animation: mp-slide-in-right 0.3s ease;
}

.gm-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mp-border-color);
    background: var(--mp-bg-card);
    position: sticky;
    top: 0;
    z-index: 2;
}

.gm-dashboard-header h3 {
    font-family: var(--mp-font-display);
    font-size: 1.1rem;
    color: var(--mp-accent-gold);
    margin: 0;
}

.gm-dashboard-content {
    padding: 16px;
}

.gm-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.gm-quick-actions .btn-sm {
    font-size: 0.72rem;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
}

.gm-panels {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gm-panel {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 8px;
    padding: 14px;
}

.gm-panel h4 {
    font-family: var(--mp-font-display);
    font-size: 0.85rem;
    color: var(--mp-accent-gold);
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mp-border-color);
}

#session-view .npc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.npc-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 8px 10px;
    transition: var(--mp-transition);
}

.npc-entry:hover {
    border-color: var(--mp-border-light);
}

.npc-entry-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.npc-entry-name {
    font-size: 0.82rem;
    color: var(--mp-text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.npc-type-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.npc-type-badge.hostile {
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.npc-type-badge.neutral {
    background: rgba(52, 152, 219, 0.15);
    color: var(--mp-accent-blue);
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.npc-type-badge.friendly {
    background: rgba(46, 204, 113, 0.15);
    color: var(--mp-accent-green);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.npc-type-badge.mythos {
    background: rgba(155, 89, 182, 0.15);
    color: var(--mp-accent-purple);
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.npc-entry-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.npc-entry-actions .btn-sm {
    font-size: 0.65rem;
    padding: 3px 6px;
}

/* ============ HORROR OVERLAY ============ */

/* .mp-horror-overlay moved to Overlays section below */

/* .mp-horror-text moved to Overlays section below */

.mp-horror-image {
    max-width: 80vw;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--mp-shadow-glow-red);
    margin-top: 20px;
}

/* ============ HANDOUT OVERLAY ============ */

.mp-handout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: mp-fade-in 0.3s ease;
    font-family: var(--mp-font-body);
}

/* .mp-handout-image moved to Overlays section below */

.mp-handout-overlay.zoomed .mp-handout-image {
    transform: scale(1.5);
    cursor: grab;
}

.mp-handout-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--mp-text-secondary);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--mp-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--mp-transition);
}

.mp-handout-close:hover {
    color: var(--mp-text-primary);
    border-color: var(--mp-border-light);
}

/* ============ SCENE PANEL ============ */

.mp-scene-panel {
    display: none;
    position: fixed;
    top: var(--mp-topbar-height);
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: 90vw;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 8px;
    box-shadow: var(--mp-shadow-dark);
    z-index: 1050;
    animation: mp-fade-in 0.3s ease;
    font-family: var(--mp-font-body);
}

.mp-scene-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-scene-panel-header h4 {
    font-family: var(--mp-font-display);
    font-size: 0.9rem;
    color: var(--mp-accent-gold);
    margin: 0;
}

.mp-scene-panel-body {
    padding: 16px;
}

.mp-scene-description {
    color: var(--mp-text-primary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.mp-scene-atmosphere {
    margin-top: 10px;
    padding: 8px;
    background: var(--mp-bg-input);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--mp-text-secondary);
    font-style: italic;
}

/* ============ WHISPER / CHAT ============ */

/* .mp-whisper-notification moved to Whisper section below */

.mp-whisper-sender {
    font-size: 0.72rem;
    color: var(--mp-accent-purple);
    font-weight: 700;
    margin-bottom: 4px;
}

.mp-whisper-text {
    font-size: 0.82rem;
    color: var(--mp-text-primary);
    line-height: 1.4;
}

/* ============ PAUSE OVERLAY ============ */

.mp-pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9996;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--mp-font-body);
    animation: mp-fade-in 0.5s ease;
}

.mp-pause-text {
    font-family: var(--mp-font-display);
    font-size: 2.5rem;
    color: var(--mp-accent-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 4px;
}

.mp-pause-subtitle {
    font-size: 0.9rem;
    color: var(--mp-text-muted);
    margin-top: 12px;
}

/* ============ BUTTONS (multiplayer specific) ============ */

#session-view .btn-gold {
    background: linear-gradient(135deg, var(--mp-accent-gold-dim), var(--mp-accent-gold));
    color: #0a0a0f;
    border: none;
    font-weight: 600;
}

#session-view .btn-gold:hover {
    background: linear-gradient(135deg, var(--mp-accent-gold), var(--mp-accent-gold-bright));
    box-shadow: var(--mp-shadow-glow-gold);
}

#session-view .btn-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

#session-view .btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: var(--mp-accent-red);
}

#session-view .btn-success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--mp-accent-green);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

#session-view .btn-success:hover {
    background: rgba(46, 204, 113, 0.25);
    border-color: var(--mp-accent-green);
}

#session-view .btn-primary {
    background: rgba(52, 152, 219, 0.15);
    color: var(--mp-accent-blue);
    border: 1px solid rgba(52, 152, 219, 0.3);
}

#session-view .btn-primary:hover {
    background: rgba(52, 152, 219, 0.25);
    border-color: var(--mp-accent-blue);
}

#session-view .btn {
    font-family: var(--mp-font-body);
    cursor: pointer;
    border-radius: 4px;
    transition: var(--mp-transition);
}

#session-view .btn-sm {
    font-size: 0.78rem;
    padding: 4px 10px;
}

#session-view .btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.mp-topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    color: var(--mp-text-secondary);
    cursor: pointer;
    font-family: var(--mp-font-body);
    font-size: 0.85rem;
    line-height: 1;
    transition: var(--mp-transition);
}

.mp-topbar-btn:hover {
    background: var(--mp-bg-hover);
    color: var(--mp-text-primary);
    border-color: var(--mp-border-light);
}

.mp-topbar-btn:active {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--mp-accent-gold-dim);
}

.gm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    color: var(--mp-text-primary);
    cursor: pointer;
    font-family: var(--mp-font-body);
    font-size: 0.78rem;
    line-height: 1.2;
    transition: var(--mp-transition);
    white-space: nowrap;
}

.gm-action-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--mp-accent-gold-dim);
    color: var(--mp-accent-gold-bright);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}

.gm-action-btn:active {
    background: rgba(212, 175, 55, 0.25);
    border-color: var(--mp-accent-gold);
    transform: scale(0.97);
}

/* ============ SCROLLBAR STYLING ============ */

.session-sidebar::-webkit-scrollbar,
.dice-feed-list::-webkit-scrollbar,
.gm-dashboard::-webkit-scrollbar {
    width: 5px;
}

.session-sidebar::-webkit-scrollbar-track,
.dice-feed-list::-webkit-scrollbar-track,
.gm-dashboard::-webkit-scrollbar-track {
    background: transparent;
}

.session-sidebar::-webkit-scrollbar-thumb,
.dice-feed-list::-webkit-scrollbar-thumb,
.gm-dashboard::-webkit-scrollbar-thumb {
    background: var(--mp-border-color);
    border-radius: 3px;
}

.session-sidebar::-webkit-scrollbar-thumb:hover,
.dice-feed-list::-webkit-scrollbar-thumb:hover,
.gm-dashboard::-webkit-scrollbar-thumb:hover {
    background: var(--mp-border-light);
}

/* ============ RESPONSIVE DESIGN ============ */

@media (max-width: 1024px) {
    .session-sidebar {
        position: fixed;
        top: var(--mp-topbar-height);
        height: calc(100vh - var(--mp-topbar-height));
        z-index: 900;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .session-sidebar.session-sidebar-right {
        right: 0;
        left: auto;
        transform: translateX(100%);
    }

    .session-sidebar.open {
        transform: translateX(0);
    }

    .session-sidebar.session-sidebar-right.open {
        transform: translateX(0);
    }

    .session-sidebar-left.open {
        animation: mp-slide-in-left 0.3s ease;
    }

    .session-sidebar-right.open {
        animation: mp-slide-in-right 0.3s ease;
    }

    .gm-dashboard {
        width: 100vw;
    }

    .combat-tracker-bar {
        max-height: 50vh;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .lobby-actions {
        grid-template-columns: 1fr;
    }

    .lobby-container {
        padding: 24px 16px;
    }

    .lobby-header h1 {
        font-size: 1.6rem;
    }

    .lobby-card {
        padding: 20px;
    }

    .lobby-card .form-row {
        grid-template-columns: 1fr;
    }

    .session-top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 6px;
    }

    .session-info {
        flex-wrap: wrap;
        gap: 8px;
    }

    .session-actions {
        flex-wrap: wrap;
        gap: 4px;
    }

    .session-sidebar {
        width: 100vw;
        min-width: 100vw;
    }

    .gm-dashboard {
        width: 100vw;
    }

    .gm-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .combat-initiative-list {
        flex-wrap: nowrap;
    }

    .mp-horror-text {
        font-size: 2rem;
    }

    .room-code-badge {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .lobby-header h1 {
        font-size: 1.3rem;
    }

    .lobby-header .tentacle-icon {
        font-size: 2.2rem;
    }

    .gm-quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .mp-horror-text {
        font-size: 1.5rem;
    }

    .mp-handout-image {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* ============ UTILITY CLASSES ============ */

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

.mp-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 899;
    animation: mp-fade-in 0.2s ease;
}

.mp-text-gold {
    color: var(--mp-accent-gold);
}

.mp-text-red {
    color: var(--mp-accent-red);
}

.mp-text-green {
    color: var(--mp-accent-green);
}

.mp-text-blue {
    color: var(--mp-accent-blue);
}

.mp-text-muted {
    color: var(--mp-text-muted);
}

.mp-divider {
    border: none;
    border-top: 1px solid var(--mp-border-color);
    margin: 12px 0;
}

.mp-empty-state {
    text-align: center;
    padding: 24px 16px;
    color: var(--mp-text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* ===== Timer Overlay ===== */
.mp-timer-overlay {
    position: fixed;
    top: var(--mp-topbar-height);
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.85) 100%);
    border-bottom: 2px solid var(--mp-accent-red);
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    animation: mp-slide-down 0.3s ease;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
}

.mp-timer-overlay.mp-hidden {
    display: none;
}

.mp-timer-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mp-timer-label {
    color: var(--mp-text-secondary);
    font-family: var(--mp-font-body);
    font-size: 0.9rem;
}

.mp-timer-display {
    color: var(--mp-accent-red);
    font-family: var(--mp-font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.mp-timer-overlay.mp-timer-expired .mp-timer-display {
    color: #ff0000;
    animation: mp-timer-flash 0.5s ease infinite alternate;
}

@keyframes mp-slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes mp-timer-flash {
    from { opacity: 1; text-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    to { opacity: 0.6; text-shadow: 0 0 30px rgba(255, 0, 0, 0.8); }
}

/* ===== Madness Overlay ===== */
.mp-madness-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: mp-madness-appear 0.5s ease;
}

.mp-madness-overlay.mp-hidden {
    display: none;
}

.mp-madness-content {
    max-width: 500px;
    padding: 40px;
    text-align: center;
    border: 2px solid var(--mp-accent-red);
    border-radius: 8px;
    background: var(--mp-bg-dark);
    box-shadow: var(--mp-shadow-glow-red), 0 0 60px rgba(0, 0, 0, 0.8);
    animation: mp-madness-pulse 2s ease infinite;
}

.mp-madness-type-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--mp-accent-red);
    color: #fff;
    font-family: var(--mp-font-display);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 20px;
}

.mp-madness-name {
    color: var(--mp-accent-gold-bright);
    font-family: var(--mp-font-display);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.mp-madness-description {
    color: var(--mp-text-primary);
    font-family: var(--mp-font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.mp-madness-duration {
    color: var(--mp-text-secondary);
    font-family: var(--mp-font-body);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 16px;
}

.mp-madness-delusion {
    color: var(--mp-accent-purple);
    font-family: var(--mp-font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 12px;
    background: rgba(155, 89, 182, 0.1);
    border-left: 3px solid var(--mp-accent-purple);
    text-align: left;
    margin-bottom: 16px;
}

.mp-madness-dismiss {
    color: var(--mp-text-muted);
    font-size: 0.75rem;
    margin-top: 16px;
}

@keyframes mp-madness-appear {
    from { opacity: 0; }
    50% { opacity: 0; background: rgba(231, 76, 60, 0.3); }
    to { opacity: 1; background: rgba(0, 0, 0, 0.95); }
}

.mp-madness-fade-out {
    animation: mp-madness-fade-out 0.5s ease forwards;
}

@keyframes mp-madness-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes mp-madness-pulse {
    0%, 100% { border-color: var(--mp-accent-red); box-shadow: var(--mp-shadow-glow-red); }
    50% { border-color: var(--mp-accent-purple); box-shadow: 0 0 20px rgba(155, 89, 182, 0.4); }
}

/* ===== Journal Panel ===== */
.mp-journal-panel {
    z-index: 900;
    display: none;
}

.mp-journal-panel.open {
    display: flex;
}

.mp-journal-toolbar {
    padding: 8px 12px;
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-journal-entries {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.mp-journal-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-tag-filter-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--mp-bg-input);
    color: var(--mp-text-secondary);
    font-size: 0.7rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--mp-transition);
    border: 1px solid transparent;
}

.mp-tag-filter-badge:hover {
    background: var(--mp-bg-hover);
    color: var(--mp-text-primary);
}

.mp-tag-filter-badge.active {
    background: var(--mp-accent-gold-dim);
    color: var(--mp-accent-gold-bright);
    border-color: var(--mp-accent-gold);
}

.mp-journal-entry {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    transition: var(--mp-transition);
}

.mp-journal-entry:hover {
    border-color: var(--mp-border-light);
}

.mp-journal-entry.mp-journal-pinned {
    border-left: 3px solid var(--mp-accent-gold);
    background: rgba(212, 175, 55, 0.05);
}

.mp-journal-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.mp-journal-author {
    color: var(--mp-accent-gold);
    font-size: 0.8rem;
    font-weight: 600;
}

.mp-journal-date {
    color: var(--mp-text-muted);
    font-size: 0.7rem;
    margin-left: auto;
}

.mp-journal-entry-header .mp-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    opacity: 0.6;
    transition: var(--mp-transition);
}

.mp-journal-entry-header .mp-btn-icon:hover {
    opacity: 1;
}

.mp-journal-content {
    color: var(--mp-text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 8px;
}

.mp-journal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mp-tag-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--mp-bg-input);
    color: var(--mp-accent-blue);
    font-size: 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--mp-border-color);
}

.mp-tag-badge.tag-hinweis { color: var(--mp-accent-gold); border-color: var(--mp-accent-gold-dim); }
.mp-tag-badge.tag-verdaechtig { color: var(--mp-accent-red); border-color: var(--mp-accent-red); }
.mp-tag-badge.tag-ort { color: var(--mp-accent-green); border-color: var(--mp-accent-green); }
.mp-tag-badge.tag-npc { color: var(--mp-accent-purple); border-color: var(--mp-accent-purple); }
.mp-tag-badge.tag-wichtig { color: var(--mp-accent-gold-bright); border-color: var(--mp-accent-gold); background: rgba(212, 175, 55, 0.1); }

/* ===== Voting Panel ===== */
.mp-voting-panel {
    z-index: 900;
    display: none;
}

.mp-voting-panel.open {
    display: flex;
}

.mp-voting-toolbar {
    padding: 8px 12px;
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-voting-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.mp-vote-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: var(--mp-transition);
}

.mp-vote-card.mp-vote-active {
    border-color: var(--mp-accent-gold-dim);
}

.mp-vote-card.mp-vote-closed {
    opacity: 0.65;
}

.mp-vote-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.mp-vote-question {
    color: var(--mp-text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.mp-vote-status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mp-vote-status-badge.mp-vote-active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--mp-accent-green);
}

.mp-vote-status-badge.mp-vote-closed {
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red);
}

.mp-vote-header .mp-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mp-accent-red);
    font-size: 0.85rem;
    opacity: 0.7;
    transition: var(--mp-transition);
}

.mp-vote-header .mp-btn-icon:hover {
    opacity: 1;
}

.mp-vote-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.mp-vote-option {
    position: relative;
    padding: 8px 12px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    cursor: default;
    transition: var(--mp-transition);
    overflow: hidden;
}

.mp-vote-option.mp-vote-clickable {
    cursor: pointer;
}

.mp-vote-option.mp-vote-clickable:hover {
    border-color: var(--mp-accent-gold-dim);
    background: var(--mp-bg-hover);
}

.mp-vote-option.mp-vote-option-voted {
    border-color: var(--mp-accent-gold);
}

.mp-vote-option-text {
    position: relative;
    z-index: 1;
    color: var(--mp-text-primary);
    font-size: 0.85rem;
}

.mp-vote-result-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(212, 175, 55, 0.1);
    transition: width 0.5s ease;
    pointer-events: none;
}

.mp-vote-result-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
}

.mp-vote-count {
    display: block;
    margin-top: 4px;
    position: relative;
    z-index: 1;
    color: var(--mp-text-muted);
    font-size: 0.7rem;
}

.mp-vote-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mp-vote-total {
    color: var(--mp-text-secondary);
    font-size: 0.75rem;
}

.mp-vote-date {
    color: var(--mp-text-muted);
    font-size: 0.7rem;
}

/* ===== Sound Board ===== */
.mp-sound-board-modal .mp-modal-content {
    max-width: 600px;
}

.mp-sound-categories {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mp-sound-cat-btn {
    padding: 6px 12px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--mp-transition);
}

.mp-sound-cat-btn:hover {
    background: var(--mp-bg-hover);
    color: var(--mp-text-primary);
}

.mp-sound-cat-btn.active {
    background: var(--mp-accent-gold-dim);
    color: var(--mp-accent-gold-bright);
    border-color: var(--mp-accent-gold);
}

.mp-sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.mp-sound-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--mp-transition);
}

.mp-sound-card:hover {
    border-color: var(--mp-accent-gold-dim);
    background: var(--mp-bg-hover);
    transform: translateY(-1px);
}

.mp-sound-card-icon {
    font-size: 1.5rem;
}

.mp-sound-card-name {
    color: var(--mp-text-primary);
    font-size: 0.75rem;
    text-align: center;
}

.mp-sound-card-duration {
    color: var(--mp-text-muted);
    font-size: 0.65rem;
}

.mp-sound-indicator {
    position: fixed;
    top: calc(var(--mp-topbar-height) + 8px);
    right: 16px;
    z-index: 999;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-accent-gold-dim);
    border-radius: 20px;
    padding: 6px 14px;
    color: var(--mp-accent-gold);
    font-size: 0.8rem;
    animation: mp-fade-in 0.3s ease;
    box-shadow: var(--mp-shadow-glow-gold);
}

/* ===== Token Notification ===== */
.mp-token-float {
    position: fixed;
    z-index: 9000;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mp-accent-gold-bright);
    font-family: var(--mp-font-display);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    pointer-events: none;
    animation: mp-token-rise 2s ease forwards;
}

@keyframes mp-token-rise {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    50% { opacity: 1; transform: translateY(-40px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* ===== Bookmarks ===== */
.mp-bookmark-entry {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-bookmark-entry:last-child {
    border-bottom: none;
}

.mp-bookmark-time {
    color: var(--mp-accent-gold);
    font-size: 0.75rem;
    font-family: var(--mp-font-display);
    min-width: 50px;
    white-space: nowrap;
}

.mp-bookmark-desc {
    color: var(--mp-text-primary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ===== Pregen Characters ===== */
.mp-pregen-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 8px;
}

.mp-pregen-section h3 {
    color: var(--mp-accent-gold);
    font-family: var(--mp-font-display);
    margin-bottom: 12px;
    font-size: 1rem;
}

.mp-pregen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.mp-pregen-card {
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--mp-transition);
}

.mp-pregen-card:hover {
    border-color: var(--mp-border-light);
}

.mp-pregen-name {
    color: var(--mp-text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.mp-pregen-claim-btn {
    padding: 4px 10px;
    background: var(--mp-accent-gold-dim);
    color: var(--mp-accent-gold-bright);
    border: 1px solid var(--mp-accent-gold);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--mp-transition);
}

.mp-pregen-claim-btn:hover {
    background: var(--mp-accent-gold);
    color: var(--mp-bg-dark);
}

.mp-pregen-claimed {
    color: var(--mp-text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* ===== Session Summary ===== */
.mp-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.mp-summary-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.mp-summary-value {
    color: var(--mp-accent-gold-bright);
    font-family: var(--mp-font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.mp-summary-label {
    color: var(--mp-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .mp-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .mp-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Combat: New Actions & Surprise ===== */
.mp-combat-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.mp-combat-action-btn {
    padding: 6px 12px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--mp-transition);
}

.mp-combat-action-btn:hover {
    background: var(--mp-bg-hover);
    color: var(--mp-text-primary);
    border-color: var(--mp-accent-gold-dim);
}

.mp-combat-action-btn.mp-action-attack { border-color: var(--mp-accent-red); }
.mp-combat-action-btn.mp-action-maneuver { border-color: var(--mp-accent-blue); }
.mp-combat-action-btn.mp-action-flee { border-color: var(--mp-accent-green); }
.mp-combat-action-btn.mp-action-spell { border-color: var(--mp-accent-purple); }
.mp-combat-action-btn.mp-action-item { border-color: var(--mp-accent-gold); }

.mp-surprise-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red);
    border: 1px solid var(--mp-accent-red);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: mp-pulse-gold 1.5s ease infinite;
}

/* ===== Character Approval ===== */
.mp-approval-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.mp-approval-btn {
    padding: 4px 10px;
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--mp-transition);
}

.mp-approval-btn.mp-approve {
    background: rgba(46, 204, 113, 0.15);
    color: var(--mp-accent-green);
    border-color: var(--mp-accent-green);
}

.mp-approval-btn.mp-approve:hover {
    background: var(--mp-accent-green);
    color: #fff;
}

.mp-approval-btn.mp-reject {
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red);
    border-color: var(--mp-accent-red);
}

.mp-approval-btn.mp-reject:hover {
    background: var(--mp-accent-red);
    color: #fff;
}

/* ===== GM-only Elements ===== */
.gm-only {
    display: none;
}

body.mp-role-gm .gm-only {
    display: inline-block;
}

body.mp-role-gm .gm-only.flex {
    display: flex;
}

body.mp-role-gm .gm-only.grid {
    display: grid;
}

/* ===== Floating Notifications ===== */
.mp-float-notification {
    position: fixed;
    top: calc(var(--mp-topbar-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--mp-font-body);
    font-size: 0.9rem;
    animation: mp-fade-in 0.3s ease;
    pointer-events: none;
    text-align: center;
    max-width: 400px;
    font-family: var(--mp-font-body);
}

.mp-float-notification.mp-notification-mythos {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid var(--mp-accent-purple);
    color: #d4a0e8;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.3);
}

.mp-float-notification.mp-notification-luck {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--mp-accent-gold);
    color: var(--mp-accent-gold-bright);
    box-shadow: var(--mp-shadow-glow-gold);
}

.mp-float-notification.mp-notification-luck-fail {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid var(--mp-accent-red);
    color: var(--mp-accent-red);
}

.mp-float-notification.mp-notification-token {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--mp-accent-gold);
    color: var(--mp-accent-gold-bright);
    box-shadow: var(--mp-shadow-glow-gold);
}

/* ===== Clue / Investigation System ===== */
.mp-clue-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.mp-clue-empty {
    text-align: center;
    color: var(--mp-text-muted);
    font-size: 0.8rem;
    padding: 16px;
}

.mp-clue-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 6px;
    transition: var(--mp-transition);
}

.mp-clue-card:hover {
    border-color: var(--mp-border-light);
}

.mp-clue-card.mp-clue-discovered {
    border-left: 3px solid var(--mp-accent-green);
    background: rgba(46, 204, 113, 0.03);
}

.mp-clue-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.mp-clue-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--mp-accent-gold-bright);
    white-space: nowrap;
}

.mp-clue-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--mp-text-primary);
}

.mp-clue-meta {
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--mp-text-muted);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.mp-clue-difficulty {
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(52, 152, 219, 0.15);
    color: #5dade2;
}

.mp-clue-skill {
    color: var(--mp-accent-gold);
}

.mp-clue-found {
    color: var(--mp-accent-green);
    font-weight: 600;
}

.mp-clue-desc {
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--mp-border-color);
}

.mp-clue-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

/* ===== Initiative Drag-to-Reorder ===== */
.mp-combat-turn-draggable {
    cursor: grab;
}

.mp-combat-turn-draggable:active {
    cursor: grabbing;
}

.mp-combat-turn-dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 2px dashed var(--mp-accent-gold) !important;
}

.mp-combat-turn-drag-over {
    border: 2px solid var(--mp-accent-gold) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transform: scale(1.03);
}

.mp-combat-turn-dead {
    opacity: 0.4;
    background: rgba(231, 76, 60, 0.08);
    text-decoration: line-through;
}

.mp-turn-dead-badge {
    font-size: 0.8rem;
    margin-left: 4px;
}

/* ===== Death Animation ===== */
.mp-death-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mp-death-appear 0.5s ease;
    pointer-events: none;
}

.mp-death-content {
    text-align: center;
    animation: mp-death-pulse 1.5s ease-in-out infinite;
}

.mp-death-skull {
    font-size: 6rem;
    animation: mp-death-skull-shake 0.5s ease-in-out;
}

.mp-death-text {
    font-family: var(--mp-font-display);
    font-size: 2rem;
    color: #c0392b;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    margin-top: 16px;
}

.mp-blood-drips {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.mp-blood-drip {
    display: inline-block;
    width: 4px;
    height: 0;
    background: #8b0000;
    border-radius: 0 0 4px 4px;
    animation: mp-blood-drip-anim 2s ease-in forwards;
}

.mp-blood-drip:nth-child(2) {
    animation-delay: 0.3s;
}

.mp-blood-drip:nth-child(3) {
    animation-delay: 0.6s;
}

.mp-death-fade-out {
    animation: mp-death-fade-out 2s ease forwards;
}

@keyframes mp-death-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mp-death-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes mp-death-skull-shake {
    0% { transform: rotate(0); }
    20% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-5deg); }
    80% { transform: rotate(5deg); }
    100% { transform: rotate(0); }
}

@keyframes mp-blood-drip-anim {
    0% { height: 0; }
    100% { height: 80px; }
}

@keyframes mp-death-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.mp-player-dead {
    opacity: 0.5;
    border-color: #8b0000 !important;
    position: relative;
}

.mp-player-dead::after {
    content: '💀';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 1.2rem;
}

/* ===== Scenario Packs ===== */
.mp-scenario-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--mp-border-color);
    padding-bottom: 4px;
}

.mp-scenario-tab {
    padding: 6px 14px;
    border: 1px solid var(--mp-border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: transparent;
    color: var(--mp-text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--mp-transition);
}

.mp-scenario-tab.mp-active {
    background: var(--mp-bg-card);
    color: var(--mp-accent-gold-bright);
    border-color: var(--mp-accent-gold);
    border-bottom: 1px solid var(--mp-bg-card);
    margin-bottom: -1px;
}

.mp-scenario-panel {
    min-height: 150px;
}

.mp-scenario-list {
    max-height: 400px;
    overflow-y: auto;
}

.mp-scenario-loading,
.mp-scenario-empty {
    text-align: center;
    color: var(--mp-text-muted);
    padding: 24px;
    font-size: 0.85rem;
}

.mp-scenario-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    transition: var(--mp-transition);
}

.mp-scenario-card:hover {
    border-color: var(--mp-border-light);
}

.mp-scenario-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.mp-scenario-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--mp-text-primary);
}

.mp-scenario-era {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(155, 89, 182, 0.15);
    color: #bb8fce;
}

.mp-scenario-card-desc {
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    margin-bottom: 6px;
}

.mp-scenario-card-meta {
    display: flex;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--mp-text-muted);
    margin-bottom: 8px;
}

.mp-scenario-import-btn {
    width: 100%;
}

@keyframes mp-pulse-gold {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4);
    }
    50% {
        box-shadow: 0 0 8px 2px rgba(201, 168, 76, 0.7);
    }
}

/* ===== Multiplayer UI (migrated from style.css - M9) ===== */

.mp-player-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.mp-player-card:hover {
    border-color: var(--mp-accent-gold);
}

.mp-player-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.mp-player-icon {
    font-size: 1.1rem;
}

.mp-player-name {
    font-weight: 600;
    color: var(--mp-text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.mp-status-dot.mp-online {
    background: var(--mp-accent-green);
    box-shadow: 0 0 6px rgba(74, 124, 89, 0.6);
}

.mp-status-dot.mp-offline {
    background: var(--mp-accent-red);
    box-shadow: 0 0 6px rgba(139, 58, 58, 0.6);
}

.mp-stat-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.mp-stat-label {
    color: var(--mp-text-secondary);
    width: 28px;
    text-align: right;
}

.mp-bar-track {
    flex: 1;
    height: 6px;
    background: var(--mp-bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.mp-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.mp-hp-fill {
    background: linear-gradient(90deg, var(--mp-accent-green), var(--mp-accent-red));
}

.mp-san-fill {
    background: linear-gradient(90deg, var(--mp-accent-purple), var(--mp-accent-blue-bright));
}

.mp-stat-value {
    color: var(--mp-text-secondary);
    font-size: 0.75rem;
    width: 44px;
    text-align: left;
}

.mp-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.mp-condition-tag {
    background: rgba(139, 58, 58, 0.3);
    color: var(--mp-accent-red-bright);
    border: 1px solid var(--mp-accent-red);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.7rem;
}

/* Dice Feed */
.mp-dice-entry {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.mp-dice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.mp-dice-player {
    color: var(--mp-accent-gold);
    font-weight: 500;
}

.mp-dice-time {
    color: var(--mp-text-secondary);
    font-size: 0.7rem;
}

.mp-dice-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mp-dice-skill {
    color: var(--mp-text-primary);
}

.mp-dice-result {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Cinzel', Georgia, serif;
}

.mp-roll-critical, .mp-float-critical { color: var(--mp-accent-gold-bright); text-shadow: 0 0 8px rgba(212, 176, 80, 0.5); }
.mp-roll-hard, .mp-roll-extreme { color: var(--mp-accent-blue-bright); }
.mp-roll-regular { color: var(--mp-accent-green-bright); }
.mp-roll-fail, .mp-float-fail { color: var(--mp-accent-red-bright); }
.mp-roll-fumble, .mp-float-fumble { color: #ff4444; text-shadow: 0 0 8px rgba(255, 0, 0, 0.4); }
.mp-float-success { color: var(--mp-accent-green-bright); }

.mp-dice-label {
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Floating Dice Result */
.mp-dice-float {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--mp-bg-card);
    border: 2px solid var(--mp-accent-gold);
    border-radius: 8px;
    padding: 12px 18px;
    z-index: 10000;
    text-align: center;
    box-shadow: 0 4px 20px var(--mp-shadow-dark);
    animation: mp-slide-in 0.3s ease;
    transition: opacity 0.5s;
}

.mp-float-name {
    color: var(--mp-accent-gold);
    font-size: 0.8rem;
}

.mp-float-roll {
    font-size: 2rem;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
}

.mp-float-label {
    font-size: 0.85rem;
}

.mp-float-fade {
    opacity: 0;
}

@keyframes mp-slide-in {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Combat Tracker */
.mp-combat-header h4 {
    color: var(--mp-accent-red-bright);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.mp-combat-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-combat-header-row h4 {
    margin: 0;
}

.mp-btn-minimize-combat {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
    line-height: 1;
}

.mp-combat-empty, .mp-scene-empty, .mp-npc-empty {
    color: var(--mp-text-secondary);
    font-style: italic;
    padding: 12px;
    text-align: center;
}

.mp-combat-turn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 3px;
    background: var(--mp-bg-card);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.mp-combat-turn.mp-active-turn {
    background: rgba(184, 150, 62, 0.15);
    border-color: var(--mp-accent-gold);
}

.mp-turn-icon { font-size: 0.9rem; }
.mp-turn-name { flex: 1; color: var(--mp-text-primary); }
.mp-turn-init { color: var(--mp-text-secondary); font-size: 0.85rem; }
.mp-turn-active-indicator { color: var(--mp-accent-gold); font-weight: 700; }

.mp-combat-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mp-combat-log {
    margin-top: 12px;
    border-top: 1px solid var(--mp-border-color);
    padding-top: 8px;
}

.mp-combat-log h5 {
    font-size: 0.85rem;
    color: var(--mp-text-secondary);
    margin-bottom: 6px;
}

.mp-combat-log-entry {
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    padding: 2px 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.3);
}

/* Scene */
.mp-scene-canvas {
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    cursor: grab;
    display: block;
    max-width: 100%;
}

.mp-scene-canvas:active {
    cursor: grabbing;
}

/* Scene Map Overlay — full main area */
.mp-scene-map-overlay {
    position: fixed;
    top: var(--mp-topbar-height, 48px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--mp-bg-dark, #0f0f23);
    display: flex;
    flex-direction: column;
}

.mp-scene-map-overlay.hidden {
    display: none !important;
}

.mp-scene-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--mp-bg-card, #16213e);
    border-bottom: 1px solid var(--mp-border-color, #2a2a4a);
    flex-shrink: 0;
}

.mp-scene-map-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mp-accent-gold, #d4a843);
}

.mp-scene-map-header-actions {
    display: flex;
    gap: 6px;
}

.mp-scene-map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.mp-scene-map-container .mp-scene-canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Scene sidebar overview list */
.mp-scene-sidebar-list {
    padding: 0;
}

.mp-scene-sidebar-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    gap: 8px;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(42, 42, 74, 0.3);
}

.mp-scene-sidebar-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.mp-scene-sidebar-item.active {
    background: rgba(59, 130, 246, 0.18);
    border-right: 3px solid #3B82F6;
}

.mp-scene-sidebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mp-scene-sidebar-dot.active {
    background: #10B981;
}

.mp-scene-sidebar-dot.inactive {
    background: #444;
}

.mp-scene-sidebar-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--mp-text-primary, #e0e0e0);
}

.mp-scene-sidebar-tokens {
    font-size: 11px;
    color: var(--mp-text-muted, #8888aa);
    flex-shrink: 0;
}

/* NPC List */
.mp-npc-card {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 6px;
}

.mp-npc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mp-npc-name {
    font-weight: 600;
    color: var(--mp-text-primary);
}

.mp-npc-type {
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
    background: var(--mp-bg-dark);
    padding: 1px 8px;
    border-radius: 3px;
}

.mp-npc-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
}

.mp-npc-revealed-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--mp-accent-green-bright);
    background: rgba(74, 124, 89, 0.2);
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 4px;
}

.mp-npc-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

/* NPC Details (collapsible skills/weapons/equipment/notes) */
.mp-npc-details {
    border-top: 1px solid var(--mp-border-color, #2a2a3e);
    padding-top: 4px;
}

.mp-npc-details summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mp-npc-details summary::-webkit-details-marker {
    display: none;
}

.mp-npc-details summary::before {
    content: '▸';
    font-size: 0.7rem;
    transition: transform 0.15s;
}

.mp-npc-details[open] summary::before {
    transform: rotate(90deg);
}

.mp-npc-details[open] {
    padding-bottom: 4px;
}

/* NPC Edit Sections */
.mp-npc-edit-section {
    border-top: 1px solid var(--mp-border-color, #2a2a3e);
    padding-top: 6px;
}

/* Buttons */
.mp-btn {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-primary);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.mp-btn:hover {
    border-color: var(--mp-accent-gold);
    color: var(--mp-text-primary);
}

.mp-btn-primary {
    background: rgba(184, 150, 62, 0.2);
    border-color: var(--mp-accent-gold);
    color: var(--mp-accent-gold-bright);
}

.mp-btn-primary:hover {
    background: rgba(184, 150, 62, 0.35);
}

.mp-btn-danger {
    border-color: var(--mp-accent-red);
    color: var(--mp-accent-red-bright);
}

.mp-btn-danger:hover {
    background: rgba(139, 58, 58, 0.25);
}

.mp-btn-sm {
    padding: 3px 10px;
    font-size: 0.78rem;
}

/* Overlays */
.mp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.mp-overlay.mp-overlay-visible {
    opacity: 1;
    pointer-events: all;
}

.mp-horror-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 0, 0, 0.97);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: mp-horror-flash 2s ease-out;
    pointer-events: none;
    font-family: var(--mp-font-body);
}

.mp-horror-image {
    max-width: 80vw;
    max-height: 60vh;
    object-fit: contain;
    border: 2px solid var(--mp-accent-red);
    box-shadow: 0 0 40px rgba(139, 58, 58, 0.4);
    margin-bottom: 20px;
}

.mp-horror-text {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.6rem;
    color: var(--mp-accent-red-bright);
    text-shadow: 0 0 20px rgba(196, 80, 80, 0.6);
    text-align: center;
    max-width: 80vw;
    line-height: 1.5;
    padding: 0 20px;
    animation: mp-horror-pulse 3s ease-in-out infinite;
}

@keyframes mp-horror-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; text-shadow: 0 0 30px rgba(196, 80, 80, 0.8); }
}

.mp-handout-overlay {
    background: rgba(0, 0, 0, 0.92);
}

.mp-handout-content {
    background: var(--mp-bg-card);
    border: 2px solid var(--mp-accent-gold);
    border-radius: 8px;
    padding: 20px;
    max-width: 85vw;
    max-height: 85vh;
    overflow: auto;
    text-align: center;
}

.mp-handout-title {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--mp-accent-gold);
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.mp-handout-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 12px;
    box-shadow: var(--mp-shadow-dark);
    transition: transform 0.3s ease;
}

.mp-handout-text {
    color: var(--mp-text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    text-align: left;
}

.mp-overlay-close {
    position: absolute;
    bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-primary);
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.mp-overlay-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--mp-accent-gold);
}

/* SAN Flash */
.mp-san-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(139, 0, 0, calc(var(--mp-flash-intensity, 0.5) * 0.7)), rgba(80, 0, 0, calc(var(--mp-flash-intensity, 0.5) * 0.9)));
    z-index: 99999;
    pointer-events: none;
    animation: mp-san-shake 0.3s ease;
}

.mp-san-flash-fade {
    opacity: 0;
    transition: opacity 1s ease;
}

@keyframes mp-san-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Whisper */
.mp-whisper-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--mp-bg-card), rgba(107, 74, 143, 0.3));
    border: 2px solid var(--mp-accent-purple);
    border-radius: 8px;
    padding: 16px 24px;
    z-index: 50000;
    text-align: center;
    box-shadow: 0 0 30px rgba(107, 74, 143, 0.4);
    animation: mp-slide-in 0.3s ease;
    max-width: 400px;
}

.mp-whisper-header {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--mp-accent-purple);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.mp-whisper-body {
    color: var(--mp-text-primary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.mp-whisper-fade {
    opacity: 0;
    transition: opacity 0.5s;
}

/* Group Roll Modal */
.mp-group-roll-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.mp-group-roll-modal {
    background: var(--mp-bg-card);
    border: 2px solid var(--mp-accent-gold);
    border-radius: 8px;
    padding: 24px 32px;
    text-align: center;
    max-width: 400px;
}

.mp-group-roll-modal h3 {
    color: var(--mp-accent-gold);
    margin-bottom: 12px;
}

.mp-group-roll-skill {
    font-size: 1.3rem;
    color: var(--mp-text-primary);
    font-family: 'Cinzel', Georgia, serif;
    margin-bottom: 8px;
}

.mp-group-roll-msg {
    color: var(--mp-text-secondary);
    margin-bottom: 16px;
}

.mp-group-roll-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* NPC Edit Modal */
.mp-modal {
    background: var(--mp-bg-card);
    border: 2px solid var(--mp-border-light);
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.mp-modal h3 {
    color: var(--mp-accent-gold);
    margin-bottom: 16px;
}

.mp-form-group {
    margin-bottom: 12px;
}

.mp-form-group label {
    display: block;
    color: var(--mp-text-secondary);
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.mp-form-group input,
.mp-form-group textarea {
    width: 100%;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-primary);
    padding: 8px 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
}

.mp-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.mp-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* NPC Reveal Notification */
.mp-npc-reveal-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mp-bg-card);
    border: 2px solid var(--mp-accent-gold);
    border-radius: 8px;
    padding: 12px 24px;
    z-index: 50000;
    text-align: center;
    animation: mp-slide-in 0.5s ease;
    box-shadow: 0 4px 20px var(--mp-shadow-dark);
}

.mp-npc-reveal-label {
    color: var(--mp-text-secondary);
    font-size: 0.8rem;
}

.mp-npc-reveal-name {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--mp-accent-gold);
    font-size: 1.1rem;
}

.mp-npc-reveal-fade {
    opacity: 0;
    transition: opacity 1s;
}

/* ─── Random NPC Generator ─────────────────────────────── */

.mp-rng-preview-card {
    padding: 8px;
    background: var(--mp-bg-input);
    border-radius: 4px;
    border-left: 3px solid var(--mp-accent-gold);
    margin-bottom: 8px;
}

.mp-rng-preview-card:last-child {
    margin-bottom: 0;
}

.mp-rng-preview-name {
    color: var(--mp-accent-gold);
    font-weight: 600;
}

.mp-rng-preview-category {
    color: var(--mp-text-secondary);
    font-size: 0.8rem;
    margin-left: 6px;
}

.mp-rng-preview-stats {
    margin-top: 4px;
    font-size: 0.85rem;
}

.mp-rng-preview-details {
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    margin-top: 2px;
}

/* Quick-spawn row in NPC panel header */
.mp-quick-spawn-row {
    display: inline-flex;
    gap: 3px;
    margin-left: auto;
}

.mp-quick-spawn-row .mp-btn-sm {
    padding: 2px 6px;
    font-size: 0.85rem;
    line-height: 1;
    min-width: 28px;
    text-align: center;
}

/* Range slider styling (consistent with dark theme) */
input[type="range"]#mp-rng-power,
input[type="range"]#mp-rng-variance {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--mp-border-color);
    border-radius: 3px;
    outline: none;
}

input[type="range"]#mp-rng-power::-webkit-slider-thumb,
input[type="range"]#mp-rng-variance::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--mp-accent-gold);
    cursor: pointer;
}

/* Quantity radio buttons */
#mp-rng-qty label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.85rem;
    color: var(--mp-text-secondary);
    cursor: pointer;
    padding: 2px 8px;
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    transition: all 0.2s;
}

#mp-rng-qty label:hover {
    border-color: var(--mp-accent-gold);
}

#mp-rng-qty label:has(input:checked) {
    background: rgba(184, 150, 62, 0.2);
    border-color: var(--mp-accent-gold);
    color: var(--mp-accent-gold-bright, var(--mp-accent-gold));
}

/* ===== Combat: Roll Mode Header (Idee 3) ===== */
.mp-combat-roll-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--mp-text-secondary);
}

.mp-roll-mode-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mp-roll-mode-badge.auto {
    background: rgba(46, 204, 113, 0.15);
    color: var(--mp-accent-green);
    border: 1px solid var(--mp-accent-green);
}

.mp-roll-mode-badge.manual {
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red);
    border: 1px solid var(--mp-accent-red);
}

.mp-btn-toggle-roll-mode {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* ===== Combat: Action Panel (Idee 3) ===== */
.mp-combat-panels {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.mp-action-panel {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.mp-action-panel.mp-active-turn {
    border-color: var(--mp-accent-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.mp-action-panel.mp-panel-dead {
    opacity: 0.4;
}

.mp-action-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.mp-action-panel-header:hover {
    background: rgba(0, 0, 0, 0.35);
}

.mp-panel-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.mp-panel-toggle {
    font-size: 0.7rem;
    color: var(--mp-text-secondary);
    width: 14px;
}

.mp-panel-icon {
    font-size: 0.9rem;
}

.mp-panel-name {
    font-size: 0.9rem;
    color: var(--mp-text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-panel-init {
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
    background: rgba(212, 175, 55, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
}

.mp-panel-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* HP Bar in Panel */
.mp-hp-bar {
    position: relative;
    width: 80px;
    height: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--mp-border-color);
}

.mp-hp-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

.mp-hp-bar-fill.mp-hp-ok {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.mp-hp-bar-fill.mp-hp-wounded {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.mp-hp-bar-fill.mp-hp-critical {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.mp-hp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* Condition Badges */
.mp-condition-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(231, 76, 60, 0.2);
    color: var(--mp-accent-red-bright);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Panel Body */
.mp-action-panel-body {
    padding: 10px 12px;
    border-top: 1px solid var(--mp-border-color);
}

.mp-action-panel-body.mp-panel-collapsed {
    display: none;
}

.mp-panel-info {
    text-align: center;
    color: var(--mp-text-secondary);
    font-style: italic;
    font-size: 0.85rem;
    padding: 8px;
}

/* Weapon Selector */
.mp-weapon-selector {
    margin-bottom: 10px;
}

.mp-weapon-select {
    width: 100%;
    padding: 6px 8px;
    background: var(--mp-bg-input);
    color: var(--mp-text-primary);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.mp-weapon-select:focus {
    border-color: var(--mp-accent-gold-dim);
    outline: none;
}

.mp-weapon-info {
    margin-top: 4px;
}

.mp-weapon-info-text {
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
}

/* Target Selector */
.mp-target-selector {
    margin-bottom: 10px;
}

.mp-target-select {
    width: 100%;
    padding: 6px 8px;
    background: var(--mp-bg-input);
    color: var(--mp-text-primary);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.mp-target-select:focus {
    border-color: var(--mp-accent-gold-dim);
    outline: none;
}

.mp-target-info {
    margin-top: 4px;
}

.mp-target-info-text {
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
}

/* Range & Cover Selectors */
.mp-modifier-select {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
}

.mp-modifier-select label {
    font-size: 0.75rem;
    min-width: 55px;
}

.mp-modifier-select select {
    flex: 1;
    padding: 3px 6px;
    background: var(--mp-bg-input);
    color: var(--mp-text-primary);
    border: 1px solid var(--mp-border-color);
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Action Buttons */
.mp-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.mp-action-btn {
    padding: 4px 10px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    color: var(--mp-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.mp-action-btn:hover:not(:disabled) {
    background: var(--mp-bg-hover);
    color: var(--mp-text-primary);
}

.mp-action-btn.mp-action-selected {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--mp-accent-gold);
    color: var(--mp-accent-gold-bright);
}

.mp-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.mp-action-btn.mp-action-attack {
    border-color: var(--mp-accent-red);
}

.mp-action-btn.mp-action-attack:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.15);
    color: var(--mp-accent-red-bright);
}

.mp-action-btn.mp-action-reaction {
    border-color: var(--mp-accent-blue);
}

.mp-action-btn.mp-action-reaction:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.15);
    color: var(--mp-accent-blue-bright);
}

.mp-action-btn.mp-action-movement {
    border-color: var(--mp-accent-green);
}

.mp-action-btn.mp-action-standard {
    border-color: var(--mp-accent-gold-dim);
}

.mp-action-btn.mp-action-full_round {
    border-color: var(--mp-accent-purple);
}

.mp-action-btn.mp-action-free {
    border-color: var(--mp-border-color);
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Dice Module */
.mp-dice-module {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid var(--mp-border-color);
}

.mp-dice-mode-display {
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    margin-bottom: 6px;
}

.mp-dice-manual-input {
    margin-bottom: 8px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.mp-dice-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
}

.mp-dice-input-row label {
    min-width: 130px;
    font-size: 0.75rem;
}

.mp-dice-input-row input {
    width: 80px;
    padding: 4px 6px;
    background: var(--mp-bg-input);
    color: var(--mp-text-primary);
    border: 1px solid var(--mp-border-color);
    border-radius: 3px;
    font-size: 0.85rem;
    text-align: center;
}

.mp-dice-input-row input:focus {
    border-color: var(--mp-accent-gold-dim);
    outline: none;
}

.mp-dice-modifiers {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
}

.mp-dice-modifiers label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.mp-dice-modifiers select {
    padding: 2px 4px;
    background: var(--mp-bg-input);
    color: var(--mp-text-primary);
    border: 1px solid var(--mp-border-color);
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Execute Button Row */
.mp-action-execute-row {
    text-align: center;
    margin-top: 8px;
}

.mp-btn-execute-action {
    padding: 8px 24px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Action Result */
.mp-action-result {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    border-left: 3px solid transparent;
}

.mp-action-result.mp-result-success {
    background: rgba(46, 204, 113, 0.1);
    border-left-color: var(--mp-accent-green);
}

.mp-action-result.mp-result-failure {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: var(--mp-accent-red);
}

.mp-action-result.mp-result-fumble {
    background: rgba(231, 76, 60, 0.2);
    border-left-color: #ff0000;
    animation: mp-fumble-pulse 1.5s ease infinite;
}

.mp-action-result.mp-result-critical {
    background: rgba(212, 175, 55, 0.15);
    border-left-color: var(--mp-accent-gold);
    animation: mp-critical-shine 1.5s ease infinite;
}

.mp-action-result.mp-result-impale {
    background: rgba(155, 89, 182, 0.15);
    border-left-color: var(--mp-accent-purple);
}

.mp-result-header {
    font-weight: 600;
    margin-bottom: 4px;
}

.mp-result-roll {
    color: var(--mp-accent-gold-bright);
}

.mp-result-skill {
    color: var(--mp-text-secondary);
}

.mp-result-level {
    margin-left: 8px;
}

.mp-result-damage {
    color: var(--mp-accent-red-bright);
    margin-top: 4px;
}

.mp-result-damage strong {
    color: var(--mp-text-primary);
}

.mp-result-hp {
    color: var(--mp-text-secondary);
    margin-top: 2px;
}

.mp-result-fumble-detail {
    color: #ff4444;
    font-weight: 600;
    margin-top: 4px;
}

/* ===== Debug Panel (Idee 4) ===== */
#mp-debug-panel {
    margin-top: 12px;
    border-top: 2px solid var(--mp-border-color);
    padding-top: 8px;
}

.mp-debug-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mp-debug-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    cursor: pointer;
}

.mp-debug-toggle input[type="checkbox"] {
    cursor: pointer;
}

.mp-debug-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.mp-debug-filter select,
.mp-debug-filter input {
    padding: 4px 8px;
    background: var(--mp-bg-input);
    color: var(--mp-text-primary);
    border: 1px solid var(--mp-border-color);
    border-radius: 3px;
    font-size: 0.8rem;
}

.mp-debug-filter select {
    min-width: 100px;
}

.mp-debug-filter input {
    flex: 1;
    min-width: 80px;
}

.mp-debug-filter select:focus,
.mp-debug-filter input:focus {
    border-color: var(--mp-accent-gold-dim);
    outline: none;
}

.mp-debug-log-entries {
    max-height: 400px;
    overflow-y: auto;
}

.mp-debug-empty {
    text-align: center;
    color: var(--mp-text-secondary);
    font-style: italic;
    padding: 12px;
    font-size: 0.85rem;
}

/* Debug Entry */
.mp-debug-entry {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}

.mp-debug-entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.mp-debug-entry-header:hover {
    background: rgba(0, 0, 0, 0.35);
}

.mp-debug-entry-id {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--mp-text-muted);
}

.mp-debug-entry-round {
    font-size: 0.7rem;
    color: var(--mp-accent-gold);
    background: rgba(212, 175, 55, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
}

.mp-debug-entry-actor {
    color: var(--mp-text-primary);
    font-weight: 500;
}

.mp-debug-entry-action {
    color: var(--mp-text-secondary);
    font-size: 0.75rem;
}

.mp-debug-entry-target {
    color: var(--mp-accent-red-bright);
    font-size: 0.75rem;
}

.mp-debug-entry-result {
    margin-left: auto;
    font-size: 0.75rem;
}

/* Debug Steps */
.mp-debug-entry-steps {
    padding: 8px 10px;
    border-top: 1px solid var(--mp-border-color);
}

.mp-debug-entry-steps.mp-debug-collapsed {
    display: none;
}

.mp-debug-step {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.75rem;
    color: var(--mp-text-secondary);
    border-bottom: 1px solid rgba(42, 42, 74, 0.2);
}

.mp-debug-step:last-child {
    border-bottom: none;
}

.mp-debug-step-highlight {
    font-weight: 600;
    color: var(--mp-text-primary);
}

.mp-debug-step-number {
    color: var(--mp-text-muted);
    min-width: 18px;
    font-family: monospace;
}

.mp-debug-step-label {
    color: var(--mp-accent-gold);
    font-weight: 500;
    min-width: 120px;
}

.mp-debug-step-desc {
    flex: 1;
}

.mp-debug-step-formula {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--mp-accent-blue-bright);
    font-size: 0.7rem;
}

.mp-debug-count {
    text-align: center;
    font-size: 0.75rem;
    color: var(--mp-text-muted);
    padding: 6px;
    border-top: 1px solid var(--mp-border-color);
    margin-top: 6px;
}

/* Debug Success Level Colors */
.mp-debug-success { color: #44ff44; }
.mp-debug-failure { color: #ff4444; }
.mp-debug-fumble { color: #ff0000; font-weight: bold; }
.mp-debug-critical { color: #ffaa00; font-weight: bold; }
.mp-debug-extreme { color: #aa44ff; }
.mp-debug-hard { color: #44aaff; }

/* ═══════════════════════════════════════════════════════════════════
   Opposed Roll Overlay (Idee 3 §5.4)
   ═══════════════════════════════════════════════════════════════════ */

.mp-opposed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: mp-fade-in 0.3s ease;
}

@keyframes mp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mp-opposed-card {
    background: var(--mp-bg-card);
    border: 2px solid var(--mp-accent-gold);
    border-radius: 8px;
    padding: 20px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.mp-opposed-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mp-accent-gold);
    text-align: center;
    margin-bottom: 6px;
}

.mp-opposed-context {
    text-align: center;
    color: var(--mp-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.mp-opposed-side {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.mp-opposed-label {
    font-weight: 600;
    color: var(--mp-text-primary);
    margin-bottom: 4px;
}

.mp-opposed-skill {
    color: var(--mp-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.mp-opposed-roll {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mp-accent-gold);
}

.mp-opposed-waiting {
    color: var(--mp-text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.mp-opposed-initiator {
    border-left: 3px solid var(--mp-accent-red-bright);
}

.mp-opposed-defender {
    border-left: 3px solid var(--mp-accent-blue-bright);
}

.mp-opposed-vs {
    text-align: center;
    font-weight: 700;
    color: var(--mp-text-muted);
    font-size: 0.9rem;
    margin: 4px 0;
}

.mp-opposed-outcome {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

.mp-opposed-win-attacker {
    color: var(--mp-accent-red-bright);
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.mp-opposed-win-defender {
    color: var(--mp-accent-blue-bright);
    background: rgba(68, 170, 255, 0.1);
    border: 1px solid rgba(68, 170, 255, 0.3);
}

.mp-opposed-tie {
    color: var(--mp-accent-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.mp-opposed-margin {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--mp-text-secondary);
    margin-top: 4px;
}

.mp-opposed-gm-override {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
}

.mp-opposed-gm-override .mp-btn {
    font-size: 0.75rem;
}

/* Prompt Card */
.mp-opposed-prompt-card {
    border-color: var(--mp-accent-blue-bright);
}

.mp-opposed-prompt-skill {
    text-align: center;
    font-size: 0.95rem;
    color: var(--mp-text-primary);
    margin-bottom: 14px;
}

.mp-opposed-prompt-input {
    margin-bottom: 14px;
}

.mp-opposed-prompt-input label {
    display: block;
    color: var(--mp-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.mp-opposed-prompt-input input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    color: var(--mp-text-primary);
    font-size: 1.2rem;
    text-align: center;
}

.mp-opposed-prompt-input input[type="number"]:focus {
    border-color: var(--mp-accent-gold);
    outline: none;
}

.mp-opposed-auto-hint {
    text-align: center;
    color: var(--mp-accent-gold);
    font-size: 0.95rem;
    padding: 10px;
}

.mp-opposed-prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Result Card */
.mp-opposed-result-card {
    border-color: var(--mp-accent-gold);
}

/* ═══════════════════════════════════════════════════════════════════
   Combat Simulation UI (Idee 4 §6)
   ═══════════════════════════════════════════════════════════════════ */

.mp-simulation-section {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.mp-simulation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mp-simulation-header h5 {
    margin: 0;
    color: var(--mp-accent-gold);
    font-size: 0.9rem;
}

.mp-simulation-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.mp-simulation-controls label {
    color: var(--mp-text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mp-simulation-controls select,
.mp-simulation-controls input[type="number"] {
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--mp-border-color);
    border-radius: 3px;
    color: var(--mp-text-primary);
    font-size: 0.8rem;
}

.mp-simulation-controls select:focus,
.mp-simulation-controls input[type="number"]:focus {
    border-color: var(--mp-accent-gold-dim);
    outline: none;
}

.mp-simulation-result {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
}

.mp-simulation-result h6 {
    margin: 0 0 6px 0;
    color: var(--mp-accent-gold);
    font-size: 0.85rem;
}

.mp-simulation-survivors {
    color: #44ff44;
}

.mp-simulation-dead {
    color: var(--mp-accent-red-bright);
}

.mp-simulation-rounds {
    color: var(--mp-text-primary);
    font-weight: 600;
}

/* ── Combat Ended Banner ──────────────────────────────────────────── */

.mp-combat-ended-banner {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 4px;
    padding: 8px 12px;
    margin: 6px 0;
    color: var(--mp-accent-red-bright, #e74c3c);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.mp-combat-header-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mp-btn-close-combat {
    background: rgba(231, 76, 60, 0.2) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
    color: var(--mp-accent-red-bright, #e74c3c) !important;
}

.mp-btn-close-combat:hover {
    background: rgba(231, 76, 60, 0.35) !important;
}

/* ── Ended Combat Panel ───────────────────────────────────────────── */

.mp-ended-panel {
    opacity: 0.85;
    border-left: 3px solid var(--mp-accent-red, #c0392b);
}

.mp-ended-panel.mp-panel-dead {
    opacity: 0.5;
    border-left-color: #666;
}

.mp-panel-status {
    font-size: 0.85rem;
    margin-left: 4px;
}

/* ── Extra-Small Button ───────────────────────────────────────────── */

.mp-btn-xs {
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 3px;
    border: 1px solid var(--mp-border-color);
    background: rgba(0, 0, 0, 0.2);
    color: var(--mp-text-secondary);
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}

.mp-btn-xs:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--mp-text-primary);
    border-color: var(--mp-accent-gold-dim);
}

.mp-btn-view-stats,
.mp-btn-view-stats-active,
.mp-btn-view-stats-ended {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.4);
    color: var(--mp-accent-blue-bright, #3498db);
}

.mp-btn-view-stats:hover,
.mp-btn-view-stats-active:hover,
.mp-btn-view-stats-ended:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: var(--mp-accent-blue);
}

/* ── Stats Modal ──────────────────────────────────────────────────── */

.mp-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-stats-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.mp-stats-modal-content {
    position: relative;
    width: 420px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--mp-bg-secondary, #1a1a2e);
    border: 1px solid var(--mp-border-color, #333);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.mp-stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--mp-border-color, #333);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px 8px 0 0;
}

.mp-stats-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--mp-accent-gold, #d4a843);
}

.mp-stats-modal-close {
    background: rgba(231, 76, 60, 0.2) !important;
    border-color: rgba(231, 76, 60, 0.4) !important;
    color: var(--mp-accent-red-bright, #e74c3c) !important;
}

.mp-stats-modal-body {
    padding: 16px 18px;
}

.mp-stats-section {
    margin-bottom: 14px;
}

.mp-stats-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: var(--mp-accent-gold-dim, #b8941f);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 4px;
}

.mp-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.85rem;
    color: var(--mp-text-primary);
}

.mp-stats-label {
    color: var(--mp-text-secondary);
    min-width: 80px;
}

.mp-stats-hp-bar {
    margin-top: 4px;
}

.mp-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mp-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-stat-abbr {
    font-size: 0.7rem;
    color: var(--mp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mp-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mp-text-primary);
    margin-top: 2px;
}

.mp-stat-condition {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--mp-accent-red-bright, #e74c3c);
}

.mp-stat-weapon {
    padding: 4px 8px;
    margin: 3px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--mp-text-primary);
    border-left: 2px solid var(--mp-accent-red, #c0392b);
}

.mp-stat-skill {
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    font-size: 0.8rem;
    color: var(--mp-text-primary);
}

.mp-stat-skill-val {
    color: var(--mp-accent-blue-bright, #3498db);
    font-weight: 600;
}

/* ── Turn chip stats button ───────────────────────────────────────── */

.mp-turn-chip .mp-btn-view-stats {
    margin-left: 4px;
    padding: 1px 4px;
    font-size: 0.65rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.mp-turn-chip:hover .mp-btn-view-stats {
    opacity: 1;
}

/* ============ MAP EDITOR ============ */

.mp-map-editor {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    font-family: var(--mp-font-body);
}

/* ---- Step 1: Toolbar Overhaul ---- */

.mp-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #16162a 0%, #111122 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    flex-wrap: wrap;
}

.mp-editor-tool-group {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    background: rgba(10, 10, 15, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(42, 42, 58, 0.3);
}

.mp-editor-tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 32, 0.6);
    border: 1px solid rgba(42, 42, 58, 0.5);
    border-radius: 6px;
    color: var(--mp-text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    padding: 0;
    position: relative;
}

.mp-editor-tool-btn:hover {
    background: rgba(30, 30, 50, 0.8);
    color: var(--mp-text-primary);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mp-editor-tool-btn.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-color: var(--mp-accent-gold);
    color: var(--mp-accent-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3), inset 0 0 8px rgba(212, 175, 55, 0.1);
}

.mp-editor-tool-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 18, 0.95);
    color: #d0d0d0;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.mp-editor-toolbar-sep {
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    margin: 0 4px;
}

.mp-editor-rotation-label {
    color: var(--mp-accent-gold);
    font-size: 0.75rem;
    min-width: 32px;
    text-align: center;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 600;
}

/* ---- Step 3: Canvas Container & Status Bar ---- */

.mp-editor-canvas-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #050508;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
}

.mp-editor-canvas-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.mp-editor-canvas {
    cursor: crosshair;
}

.mp-editor-status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: rgba(10, 10, 15, 0.92);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    gap: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #8a8a9a;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.mp-editor-status-bar .mp-status-segment {
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(42, 42, 58, 0.4);
}

.mp-editor-status-bar .mp-status-segment:last-child {
    border-right: none;
}

.mp-editor-status-bar .mp-status-label {
    color: rgba(212, 175, 55, 0.6);
    margin-right: 4px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mp-editor-status-bar .mp-status-value {
    color: #c0c0d0;
}

.mp-editor-status-bar .mp-status-btn {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    padding: 1px 8px;
    cursor: pointer;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.15s;
}

.mp-editor-status-bar .mp-status-btn:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* ---- Step 2: Palette Overhaul ---- */

.mp-editor-palette {
    background: linear-gradient(180deg, #12121c, #0d0d16);
    border-top: 1px solid rgba(212, 175, 55, 0.12);
    padding: 10px 10px 8px;
    max-height: 220px;
    overflow-y: auto;
    transition: opacity 0.2s, max-height 0.3s;
}

.mp-editor-properties {
    background: linear-gradient(180deg, #10101c, #0c0c16);
    border-top: 1px solid rgba(212, 175, 55, 0.12);
    padding: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.mp-palette-header {
    font-family: var(--mp-font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mp-accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    position: relative;
    padding-left: 12px;
}

.mp-palette-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: var(--mp-accent-gold);
    border-radius: 50%;
}

.mp-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.mp-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border: 1px solid rgba(42, 42, 58, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(18, 18, 30, 0.3);
}

.mp-palette-item:hover {
    background: rgba(30, 30, 50, 0.5);
    border-color: rgba(212, 175, 55, 0.3);
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.mp-palette-item.selected {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--mp-accent-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
    position: relative;
}

.mp-palette-item.selected::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    color: var(--mp-accent-gold);
    text-shadow: 0 0 4px rgba(212, 175, 55, 0.5);
}

.mp-palette-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(42, 42, 58, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
}

.mp-palette-swatch canvas {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    image-rendering: pixelated;
}

.mp-palette-swatch-line {
    height: 6px;
    border-radius: 3px;
    margin-top: 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.mp-palette-label {
    font-size: 0.7rem;
    color: var(--mp-text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
    line-height: 1.2;
}

.mp-palette-cat {
    font-family: var(--mp-font-display);
    font-size: 0.65rem;
    color: rgba(212, 175, 55, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px;
    padding-left: 2px;
}

.mp-palette-hint {
    color: rgba(212, 175, 55, 0.4);
    font-size: 0.75rem;
    font-style: italic;
    text-align: center;
    padding: 10px 12px;
    position: relative;
}

.mp-palette-hint::before,
.mp-palette-hint::after {
    content: '"';
    color: rgba(212, 175, 55, 0.25);
    font-size: 1rem;
    vertical-align: sub;
}

.mp-palette-hint::after {
    content: '"';
}

.mp-palette-brush-sizes {
    display: flex;
    gap: 6px;
}

.mp-brush-btn {
    padding: 4px 14px;
    font-size: 0.7rem;
    background: rgba(18, 18, 32, 0.6);
    border: 1px solid rgba(42, 42, 58, 0.5);
    border-radius: 12px;
    color: var(--mp-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-brush-btn:hover {
    background: rgba(30, 30, 50, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
}

.mp-brush-btn.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-color: var(--mp-accent-gold);
    color: var(--mp-accent-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.mp-palette-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: rgba(18, 18, 32, 0.4);
    border: 1px solid rgba(42, 42, 58, 0.3);
    border-left: 3px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: var(--mp-text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.mp-palette-action-btn:hover {
    background: rgba(30, 30, 50, 0.6);
    border-left-color: var(--mp-accent-gold);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

/* ============ SCENE CREATE WIZARD ============ */

.mp-wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mp-fade-in 0.2s ease;
}

.mp-wizard {
    background: var(--mp-bg-card);
    border: 1px solid var(--mp-border-color);
    border-radius: 12px;
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--mp-shadow-dark);
    font-family: var(--mp-font-body);
}

.mp-wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-wizard-header h3 {
    font-family: var(--mp-font-display);
    font-size: 1.1rem;
    color: var(--mp-accent-gold);
    margin: 0;
}

.mp-wizard-close {
    background: none;
    border: none;
    color: var(--mp-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.mp-wizard-close:hover {
    color: var(--mp-text-primary);
}

.mp-wizard-body {
    padding: 20px;
}

.mp-wizard-step {
    margin-bottom: 20px;
}

.mp-wizard-step-title {
    font-family: var(--mp-font-display);
    font-size: 0.85rem;
    color: var(--mp-accent-gold);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.mp-wizard-field {
    margin-bottom: 12px;
}

.mp-wizard-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--mp-text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.mp-wizard-field input[type="text"],
.mp-wizard-field input[type="number"],
.mp-wizard-field textarea,
.mp-wizard-field select {
    width: 100%;
    padding: 8px 10px;
    background: var(--mp-bg-input);
    border: 1px solid var(--mp-border-color);
    border-radius: 4px;
    color: var(--mp-text-primary);
    font-size: 0.85rem;
    font-family: var(--mp-font-body);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.mp-wizard-field input:focus,
.mp-wizard-field textarea:focus,
.mp-wizard-field select:focus {
    outline: none;
    border-color: var(--mp-accent-gold);
}

.mp-wizard-field textarea {
    resize: vertical;
    min-height: 40px;
}

.mp-wizard-row {
    display: flex;
    gap: 12px;
}

.mp-wizard-row .mp-wizard-field {
    flex: 1;
}

.mp-wizard-color-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mp-wizard-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.mp-wizard-color-swatch:hover {
    transform: scale(1.1);
}

.mp-wizard-color-swatch.selected {
    border-color: var(--mp-accent-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.mp-wizard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--mp-border-color);
}

.mp-btn-gold {
    background: linear-gradient(135deg, var(--mp-accent-gold-dim), var(--mp-accent-gold));
    color: #0a0a0f;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--mp-font-body);
}

.mp-btn-gold:hover {
    background: linear-gradient(135deg, var(--mp-accent-gold), var(--mp-accent-gold-bright));
    box-shadow: var(--mp-shadow-glow-gold);
}

.mp-btn-secondary {
    background: var(--mp-bg-input);
    color: var(--mp-text-secondary);
    border: 1px solid var(--mp-border-color);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--mp-font-body);
}

.mp-btn-secondary:hover {
    background: var(--mp-bg-hover);
    color: var(--mp-text-primary);
}

.mp-input-error {
    border-color: var(--mp-accent-red) !important;
    box-shadow: 0 0 4px rgba(231, 76, 60, 0.3);
}

.mp-scene-gm-bar {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    background: var(--mp-bg-card);
    border-bottom: 1px solid var(--mp-border-color);
}

.mp-btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* ============ EDITOR LAYER & HISTORY PANELS ============ */

.mp-editor-main-area {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.mp-editor-left-sidebar {
    width: 190px;
    min-width: 170px;
    background: linear-gradient(180deg, #14142a, #0f0f1c);
    border-right: 1px solid rgba(42, 42, 58, 0.4);
    overflow-y: auto;
    flex-shrink: 0;
    position: relative;
}

.mp-editor-left-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), transparent 30%, transparent 70%, rgba(212, 175, 55, 0.1));
    pointer-events: none;
}

.mp-editor-right-sidebar {
    width: 210px;
    min-width: 190px;
    background: linear-gradient(180deg, #14142a, #0f0f1c);
    border-left: 1px solid rgba(42, 42, 58, 0.4);
    overflow-y: auto;
    flex-shrink: 0;
    position: relative;
}

.mp-editor-right-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), transparent 30%, transparent 70%, rgba(212, 175, 55, 0.1));
    pointer-events: none;
}

.mp-editor-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Step 4: Layer Panel ---- */

.mp-editor-layer-panel {
    padding: 10px 8px;
}

.mp-editor-panel-header {
    font-family: var(--mp-font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
}

.mp-editor-panel-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--mp-accent-gold), transparent);
}

.mp-editor-layer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    border-bottom: 1px solid rgba(42, 42, 58, 0.2);
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.mp-editor-layer-row:nth-child(even) {
    background: rgba(18, 18, 30, 0.3);
}

.mp-editor-layer-row:last-child {
    border-bottom: none;
}

.mp-editor-layer-row:hover {
    background: rgba(212, 175, 55, 0.04);
    border-left-color: rgba(212, 175, 55, 0.4);
}

.mp-editor-layer-icon {
    font-size: 0.75rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.mp-editor-layer-vis,
.mp-editor-layer-lock {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.5;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.mp-editor-layer-vis:hover,
.mp-editor-layer-lock:hover {
    opacity: 1;
    background: rgba(42, 42, 58, 0.4);
}

.mp-editor-layer-vis.visible {
    opacity: 1;
}

.mp-editor-layer-lock.locked {
    opacity: 1;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.mp-editor-layer-name {
    font-size: 0.7rem;
    color: #d0d0e0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mp-editor-layer-opacity-wrap {
    width: 52px;
    flex-shrink: 0;
}

.mp-editor-layer-opacity {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(42, 42, 58, 0.6);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.mp-editor-layer-opacity::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #c49b30);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.4);
}

.mp-editor-layer-opacity::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #c49b30);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.4);
}

/* ---- Step 4: History Panel ---- */

.mp-editor-history-panel {
    padding: 10px 8px;
    position: relative;
}

.mp-editor-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-editor-history-clear-btn {
    background: none;
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: rgba(231, 76, 60, 0.7);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.mp-editor-history-clear-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    color: #e74c3c;
}

.mp-editor-history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-left: 10px;
    border-left: 2px solid rgba(212, 175, 55, 0.15);
    margin-top: 8px;
}

.mp-editor-history-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    position: relative;
    border-left: 2px solid transparent;
    margin-left: -11px;
    padding-left: 18px;
}

.mp-editor-history-entry::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a1a2e;
    border: 2px solid rgba(212, 175, 55, 0.3);
    z-index: 1;
}

.mp-editor-history-entry:first-child::before {
    border-color: var(--mp-accent-gold);
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.3);
}

.mp-editor-history-entry:hover {
    background: rgba(212, 175, 55, 0.06);
    border-left-color: rgba(212, 175, 55, 0.3);
}

.mp-editor-history-entry.undone {
    opacity: 0.35;
}

.mp-editor-history-entry.undone .mp-editor-history-label {
    text-decoration: line-through;
}

.mp-editor-history-entry.undone::before {
    border-color: rgba(100, 100, 120, 0.3);
    box-shadow: none;
}

.mp-editor-history-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 30, 0.6);
    border-radius: 50%;
    border: 1px solid rgba(42, 42, 58, 0.4);
}

.mp-editor-history-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 2px;
}

.mp-editor-history-label {
    font-size: 0.68rem;
    color: #d0d0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.mp-editor-history-time {
    font-size: 0.55rem;
    color: #5a5a6a;
}

.mp-editor-undo-btn:disabled,
.mp-editor-redo-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

/* ---- Step 5: Properties Panel Rows ---- */

.mp-prop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(42, 42, 58, 0.2);
}

.mp-prop-row:last-child {
    border-bottom: none;
}

.mp-prop-label {
    font-size: 0.75rem;
    color: rgba(212, 175, 55, 0.6);
    min-width: 70px;
    flex-shrink: 0;
}

.mp-prop-row input[type="text"] {
    flex: 1;
    padding: 5px 8px;
    background: rgba(18, 18, 32, 0.6);
    border: 1px solid rgba(42, 42, 58, 0.5);
    border-radius: 4px;
    color: #d0d0e0;
    font-size: 0.75rem;
    font-family: var(--mp-font-body);
    transition: border-color 0.2s;
}

.mp-prop-row input[type="text"]:focus {
    outline: none;
    border-color: var(--mp-accent-gold);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.15);
}

/* Toggle switch for checkboxes */
.mp-prop-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
}

.mp-prop-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mp-prop-toggle-track {
    width: 32px;
    height: 18px;
    background: rgba(42, 42, 58, 0.6);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s ease;
    border: 1px solid rgba(42, 42, 58, 0.5);
}

.mp-prop-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #6a6a7a;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mp-prop-toggle input:checked + .mp-prop-toggle-track {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.5);
}

.mp-prop-toggle input:checked + .mp-prop-toggle-track::after {
    transform: translateX(14px);
    background: linear-gradient(135deg, #d4af37, #c49b30);
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.4);
}

.mp-prop-section-title {
    font-family: var(--mp-font-display);
    font-size: 0.65rem;
    color: rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(42, 42, 58, 0.2);
}

.mp-prop-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: #6a6a7a;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
}

.mp-prop-close-btn:hover {
    color: #e0e0e0;
}

/* ---- Step 6: Context Menu (NEW) ---- */

.mp-context-menu {
    position: fixed;
    background: rgba(18, 18, 28, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 160px;
    z-index: 10001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 1px rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(8px);
    animation: mp-context-fade-in 0.15s ease;
    font-family: var(--mp-font-body);
}

@keyframes mp-context-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mp-context-menu-header {
    padding: 8px 14px 6px;
    font-size: 0.65rem;
    color: rgba(212, 175, 55, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(42, 42, 58, 0.3);
    margin-bottom: 2px;
}

.mp-context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    height: 36px;
    box-sizing: border-box;
    cursor: pointer;
    color: #c0c0d0;
    font-size: 0.78rem;
    transition: all 0.1s ease;
    border-left: 3px solid transparent;
}

.mp-context-menu-item:hover {
    background: rgba(212, 175, 55, 0.08);
    border-left-color: rgba(212, 175, 55, 0.5);
    color: #e0e0f0;
}

.mp-context-menu-item .mp-ctx-icon {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.mp-context-menu-divider {
    height: 1px;
    background: rgba(42, 42, 58, 0.4);
    margin: 4px 8px;
}

.mp-context-menu-item.mp-ctx-destructive {
    color: rgba(231, 76, 60, 0.8);
}

.mp-context-menu-item.mp-ctx-destructive:hover {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}

/* ---- Step 7: Atmospheric Polish ---- */

/* Custom scrollbars */
.mp-editor-palette::-webkit-scrollbar,
.mp-editor-history-list::-webkit-scrollbar,
.mp-editor-left-sidebar::-webkit-scrollbar,
.mp-editor-right-sidebar::-webkit-scrollbar,
.mp-editor-properties::-webkit-scrollbar {
    width: 5px;
}

.mp-editor-palette::-webkit-scrollbar-track,
.mp-editor-history-list::-webkit-scrollbar-track,
.mp-editor-left-sidebar::-webkit-scrollbar-track,
.mp-editor-right-sidebar::-webkit-scrollbar-track,
.mp-editor-properties::-webkit-scrollbar-track {
    background: transparent;
}

.mp-editor-palette::-webkit-scrollbar-thumb,
.mp-editor-history-list::-webkit-scrollbar-thumb,
.mp-editor-left-sidebar::-webkit-scrollbar-thumb,
.mp-editor-right-sidebar::-webkit-scrollbar-thumb,
.mp-editor-properties::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 3px;
}

.mp-editor-palette::-webkit-scrollbar-thumb:hover,
.mp-editor-history-list::-webkit-scrollbar-thumb:hover,
.mp-editor-left-sidebar::-webkit-scrollbar-thumb:hover,
.mp-editor-right-sidebar::-webkit-scrollbar-thumb:hover,
.mp-editor-properties::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.35);
}

/* Toast enhancement */
.mp-editor-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(18, 18, 30, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #e0e0e0;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: Raleway, sans-serif;
    z-index: 10000;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 1px rgba(212, 175, 55, 0.2);
}

.mp-editor-toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Canvas loading overlay */
.mp-editor-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 8, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: mp-loading-fade 0.4s ease forwards;
}

.mp-editor-loading-overlay.mp-editor-loading-done {
    animation: mp-loading-fade-out 0.3s ease forwards;
}

@keyframes mp-loading-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mp-loading-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.mp-editor-loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(42, 42, 58, 0.5);
    border-top-color: var(--mp-accent-gold);
    border-radius: 50%;
    animation: mp-spin 0.8s linear infinite;
}

@keyframes mp-spin {
    to { transform: rotate(360deg); }
}

@keyframes encounterPulse {
    0%   { background: radial-gradient(ellipse, rgba(180,0,0,0.4), rgba(0,0,0,0.9)); }
    50%  { background: radial-gradient(ellipse, rgba(180,0,0,0.8), rgba(0,0,0,0.98)); }
    100% { background: radial-gradient(ellipse, rgba(180,0,0,0.4), rgba(0,0,0,0.9)); }
}

@keyframes encounterShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(-4px, 3px) rotate(-2deg); }
    50%  { transform: translate(2px, -4px) rotate(1deg); }
    75%  { transform: translate(4px, 2px) rotate(-1deg); }
}
