* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --dark-bg: #1a1a2e;
    --light-bg: #16213e;
    --text-color: #eaeaea;
    --accent-color: #ffd93d;
    /* Höhe des fixierten Fußzeilen-Balkens. Der Inhalt hält diesen Streifen
       frei, sonst rendert die Fußzeile über Karte und Mitteilungen. */
    --footer-h: 34px;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
    color: var(--text-color);
    min-height: 100vh;
}

.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 8px 20px;
    background: rgba(10, 10, 20, 0.85);
    color: var(--text-color);
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.8;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.donation-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    margin-left: 4px;
    transition: color 0.2s;
}

.donation-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.bug-report-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 12px;
    padding: 0;
    transition: color 0.2s;
}
.bug-report-btn:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Bug Report Modal */
.bug-modal-content {
    max-width: 620px;
    width: 90%;
    background: var(--light-bg);
    padding: 0;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.bug-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bug-modal-content .modal-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0;
}
.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
}
.modal-close-btn:hover { opacity: 1; }
.bug-modal-content .modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group input,
.form-group textarea,
.form-group select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}
.form-group select option { background: var(--light-bg); }
.bug-submit-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.bug-submit-btn:hover:not(:disabled) { opacity: 0.85; }
.bug-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bug-status {
    font-size: 13px;
    padding: 6px 0;
}
.bug-status.error { color: var(--primary-color); }
.bug-status.success { color: #4ecdc4; }
.bug-status.info { color: var(--accent-color); }

.bug-reporter-info {
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    color: var(--secondary-color);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.category-chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: var(--text-color);
    font-size: 12px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.category-chip:hover {
    background: rgba(255,255,255,0.12);
}
.category-chip.active {
    background: rgba(255, 107, 107, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 40px;
    border-radius: 10px;
    border: 2px solid #FFD700;
}

.spinner {
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h2 {
    color: #FFD700;
    margin: 20px 0 10px;
}

.loading-content p {
    color: #ccc;
    font-size: 14px;
}

/* Auth Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--light-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    border: 2px solid var(--primary-color);
}

.modal-content h1 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 32px;
}

.modal-content p {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

/* Tabs */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 10px;
    background: var(--dark-bg);
    border: 2px solid transparent;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.tab-button.active {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.1);
}

.tab-button:hover {
    border-color: var(--secondary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: var(--dark-bg);
    border: 2px solid var(--secondary-color);
    color: var(--text-color);
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* Buttons */
.btn {
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff4757 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff4757 100%);
}

.btn-small {
    padding: 8px 15px;
    background: var(--primary-color);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.btn-small:hover {
    background: #ff4757;
}

.error {
    color: #ff6b6b;
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
}

/* Game Container */
.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Am Desktop exakt der Viewport: Der Inhalt teilt sich den Rest unter dem
       Header selbst auf, statt sich auf eine geratene Headerhöhe zu verlassen.
       Die Mobil-Media-Query hebt das wieder auf, dort scrollt die Seite. */
    height: 100vh;
}

/* Header */
.header {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-color);
    display: flex;
    align-items: center;
}
.logo img {
    height: 50px;
    width: auto;
    display: block;
}

/* Ingame Time Display */
.game-time-display {
    font-size: 11px;
    font-weight: bold;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info span {
    color: var(--secondary-color);
}

/* Player Profile Header */
.player-profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: rgba(255,215,0,0.05);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 20px;
}

.player-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,215,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.player-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.player-avatar-small.frame-glow {
    box-shadow:
        0 0 10px #00ff00,
        0 0 20px #00ff00,
        0 0 30px rgba(0,255,0,0.6),
        0 0 40px rgba(0,255,0,0.4),
        0 0 50px rgba(0,255,0,0.2),
        inset 0 0 15px rgba(0,255,0,0.3);
    border-color: #00ff00;
    border-width: 3px;
    animation: glowPulseIntense 1.5s ease-in-out infinite;
}

.player-avatar-small.frame-gold {
    box-shadow: inset 0 0 10px rgba(255,215,0,0.2) !important;
    border: none !important;
    position: relative !important;
    overflow: visible !important;
}

.player-avatar-small.frame-gold::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 1.5px solid #FFD700;
    animation: goldRingRotateWithGlow 2s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.player-avatar-small.frame-gold::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top: 1.5px solid #FFD700;
    border-right: 1.5px solid #FFD700;
    animation: goldRingRotateWithGlow 2.5s linear infinite reverse;
    z-index: 0;
    pointer-events: none;
}

.player-avatar-small.frame-fire {
    box-shadow:
        0 0 15px #ff4500,
        0 0 30px #ff4500,
        0 0 45px rgba(255,69,0,0.6),
        0 0 60px rgba(255,69,0,0.3),
        inset 0 0 20px rgba(255,69,0,0.2);
    border-color: #ff4500;
    border-width: 3px;
    animation: fireFlickerIntense 0.1s infinite;
}

.player-avatar-small.frame-sparkle {
    box-shadow:
        0 0 10px #FFD700,
        0 0 20px #FFD700,
        0 0 30px rgba(255,215,0,0.5),
        0 0 40px rgba(255,215,0,0.3);
    border-color: #FFD700;
    border-width: 3px;
    animation: sparkleEffectIntense 1s ease-in-out infinite;
}

.player-avatar-small.frame-pulse {
    border-color: #FFD700;
    border-width: 3px;
    animation: pulseFrameIntense 1.2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255,215,0,0.6);
}

.player-header-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.avatar-icon-btn {
    background: rgba(255,215,0,0.2);
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    color: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.avatar-icon-btn:hover:not(:disabled) {
    background: rgba(255,215,0,0.4);
    border-color: #FFD700;
    transform: scale(1.1);
}

.avatar-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.player-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 100px;
    margin-left: 10px;
}

.player-name-header {
    font-weight: bold;
    color: #FFD700;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name-display {
    color: #aaa;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Resource Header */
.resource-header {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    flex-wrap: wrap;
}

.resource-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.1);
    white-space: nowrap;
}

.resource-item > span:first-child {
    font-size: 13px;
    color: #aaa;
    font-weight: bold;
}

.resource-gains {
    display: flex;
    gap: 6px;
    font-size: 11px;
    font-weight: bold;
}

.gain {
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.gain-player {
    color: #00FF00;
    background: rgba(0, 255, 0, 0.15);
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.gain-company {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.resource-gains-inline {
    margin-left: 6px;
    font-size: 12px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.resource-gains-inline.gain-player {
    color: #90EE90;
    background: rgba(0, 255, 0, 0.1);
}

.resource-gains-inline.gain-company {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

/* Fallback for old resource-item structure */
.resource-item-old {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
}

.resource-label {
    color: var(--secondary-color);
}

.resource-value {
    color: var(--accent-color);
}

.resource-icon {
    font-size: 16px;
}

/* Game Content Layout */
.game-content {
    flex: 1;
    /* min-height: 0 lässt den Bereich unter seine Inhaltshöhe schrumpfen —
       ohne das wächst er mit jeder Chat-Zeile und schiebt die ganze
       Oberfläche nach unten, statt die Liste scrollen zu lassen. */
    min-height: 0;
    width: 100%;
    display: flex;
    overflow: hidden;
    padding: 10px;
    padding-bottom: calc(var(--footer-h) + 6px);
    gap: 15px;
}

.left-panel, .right-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    /* Gleiches Spiel eine Ebene tiefer: erst damit kann die Nachrichtenliste
       kleiner als ihr Inhalt werden und bekommt eine eigene Scrollleiste. */
    min-height: 0;
    gap: 15px;
    z-index: 10;
}

.center-panel {
    flex: 1;
    min-height: 0;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px solid rgba(255, 107, 107, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Canvas */
#mapCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Panel Styling (replacement for .terrain-modal) */
.terrain-panel, .right-panel > div {
    background: var(--light-bg);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.terrain-panel-content, .mitteilungen {
    padding: 20px;
}

.panel-header {
    background: rgba(255, 107, 107, 0.1);
    padding: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.panel-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 18px;
}

.mitteilungen {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Global event announcement (rendered as a normal Mitteilung) ───────────── */
.ge-countdown {
    margin-top: 6px;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    color: var(--accent-color, #ffd700);
    font-weight: 600;
}
/* Effect/strength footnote shown beneath a custom roleplay message. */
.ge-note {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-dim, #9aa0a6);
}

.report-item {
    padding: 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #888;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.report-item.priority-high {
    border-left: 4px solid #FFD700;
    background: rgba(255, 217, 0, 0.15);
    font-weight: 500;
}

.report-close {
    position: absolute;
    top: 5px;
    right: 8px;
    color: #4ecdc4;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
}

.report-close:hover {
    opacity: 1;
}

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

@keyframes slideInTop {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.report-item.priority-high {
    animation: slideInTop 0.3s ease-out;
}

.report-item.info { border-left-color: var(--secondary-color); }
.report-item.success { border-left-color: #4CAF50; }
.report-item.warning { border-left-color: #FFC107; }
.report-item.error { border-left-color: var(--primary-color); }
.report-item.travel { border-left-color: var(--accent-color); background: rgba(255, 217, 61, 0.1); }

.report-item .report-time {
    font-size: 10px;
    color: #888;
    margin-bottom: 5px;
    display: block;
}

.report-item .report-title {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.report-item .report-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.report-item .report-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.report-btn.primary { background: var(--accent-color); color: #000; }
.report-btn.secondary { background: #444; color: #fff; }
.report-btn:hover { filter: brightness(1.2); }

.no-reports {
    color: #888;
    text-align: center;
    margin-top: 20px;
}

/* Removal of old styles or updates */
.terrain-header h3 {
    color: var(--accent-color);
    margin: 0 0 15px 0;
    font-size: 18px;
    word-break: break-word;
}

.terrain-development {
    color: var(--secondary-color);
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(78, 205, 196, 0.1);
    border-left: 3px solid var(--secondary-color);
    border-radius: 4px;
}

.dev-level-text {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.dev-progress-container {
    position: relative;
    height: 18px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.dev-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary-color), #45b7b0);
    transition: width 0.5s ease-out;
}

.dev-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    pointer-events: none;
}

.player-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
    color: white;
}

.jobben-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #45b7b0 100%);
}

.jobben-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.travel-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff4757 100%);
}

.travel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.travel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.travel-confirm-panel {
    margin-top: 10px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 16px;
}

.travel-confirm-header {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
}

.travel-confirm-info {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 14px;
    line-height: 1.6;
}

.travel-confirm-actions {
    display: flex;
    gap: 10px;
}

.travel-confirm-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44b5ab 100%);
    color: #000;
}

.travel-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.travel-cancel-btn {
    background: #444;
    color: #fff;
}

.travel-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.travel-info {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 217, 61, 0.1);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    font-size: 14px;
}

.travel-info p {
    margin: 5px 0;
    color: var(--text-color);
}

.travel-actions {
    display: flex;
    gap: 10px;
}

.cancel-btn {
    background: #444;
}

.cancel-btn:hover {
    background: #555;
    transform: translateY(-2px);
}

/* Position Map Canvas */
#positionMapCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ── Center Panel Tabs (Map / Market) ── */
.center-panel {
    display: flex;
    flex-direction: column;
}

.center-tabs {
    display: flex;
    gap: 0;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,107,107,0.3);
    flex-shrink: 0;
    z-index: 5;
}

.center-tab {
    padding: 7px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #aaa;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.center-tab:hover { color: var(--text-color); }

.center-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(255,217,61,0.05);
}

/* ── Certificates modal tabs (Ressourcen / Raub / Unternehmen) ── */
.cert-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #444;
    margin-bottom: 12px;
}

.cert-tab {
    padding: 7px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #aaa;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.cert-tab:hover { color: var(--text-color); }

.cert-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(255,217,61,0.05);
}

.center-tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.center-tab-content.active {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Map canvas fills its tab */
.center-tab-content canvas#mapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Market Panel ── */
.market-panel {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding: 12px;
}

.market-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.market-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.market-table-wrapper {
    overflow-y: auto;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.market-table th {
    background: rgba(255,107,107,0.15);
    color: var(--accent-color);
    padding: 6px 12px;
    text-align: left;
    position: sticky;
    top: 0;
    border-bottom: 1px solid rgba(255,107,107,0.3);
}

.market-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.market-table th.sortable:hover {
    background: rgba(255,107,107,0.28);
}
.market-table th.sort-active { color: #fff; }
.market-table th.sort-asc::after  { content: ' ▲'; font-size: 10px; }
.market-table th.sort-desc::after { content: ' ▼'; font-size: 10px; }

.market-dist-cell {
    text-align: right;
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}

.market-table td {
    padding: 5px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-color);
}

.market-table tr[data-city] { cursor: pointer; }
.market-table tr:hover td { background: rgba(255,255,255,0.03); }
.market-row-selected td { background: rgba(255,107,107,0.12) !important; }

.price-low    { color: #ff6b6b; }
.price-mid    { color: var(--accent-color); }
.price-high   { color: #4ecdc4; }

.demand-bar {
    display: inline-block;
    width: 40px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
    overflow: hidden;
}

.demand-bar-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--secondary-color);
    transition: width 0.3s;
}

/* ── Market Pagination ── */
.market-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0 4px;
    flex-shrink: 0;
}

.page-btn {
    background: rgba(255,107,107,0.15);
    border: 1px solid rgba(255,107,107,0.3);
    color: var(--text-color);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.page-btn:hover:not([disabled]) { background: rgba(255,107,107,0.3); }
.page-btn[disabled] { opacity: 0.35; cursor: default; }

.page-info {
    font-size: 12px;
    color: #aaa;
}

/* ── Price History Chart ── */
.market-chart-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.market-chart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #aaa;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.market-filter-select {
    background: var(--dark-bg);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.price-chart {
    width: 100%;
    display: block;
    min-height: 0;
}

/* ── Sell Modal ── */
.sell-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}

.sell-modal.active {
    display: flex;
}

.sell-modal-content {
    background: var(--light-bg);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 0;
    width: 420px;
    max-width: 95vw;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.sell-modal-header {
    background: rgba(255,217,61,0.1);
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,217,61,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sell-modal-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 16px;
}

.sell-modal-body {
    padding: 20px;
}

.sell-city-name {
    color: var(--secondary-color);
    font-size: 13px;
    margin-bottom: 14px;
}

.sell-resource-selector label,
.sell-quantity-row label {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-bottom: 6px;
}

.sell-resource-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.sell-resource-btn {
    flex: 1;
    padding: 8px 4px;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-align: center;
}

.sell-resource-btn:hover { border-color: rgba(255,255,255,0.3); }

.sell-resource-btn.active {
    border-color: var(--accent-color);
    background: rgba(255,217,61,0.1);
    color: var(--accent-color);
}

.sell-resource-btn .qty-badge {
    display: block;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.sell-resource-btn.active .qty-badge { color: #aaa; }

/* ── Quantity block: input → buttons → slider stacked ── */
.sell-quantity-block {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
}

.sell-qty-label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sell-qty-input {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1;
    transition: font-size 0.1s;
}
.sell-qty-input::-webkit-inner-spin-button,
.sell-qty-input::-webkit-outer-spin-button { display: none; }
.sell-qty-input { -moz-appearance: textfield; }
/* shrink font as digit count grows */
.sell-qty-input.digits-6  { font-size: 26px; }
.sell-qty-input.digits-7  { font-size: 22px; }
.sell-qty-input.digits-8  { font-size: 18px; }
.sell-qty-input.digits-9p { font-size: 15px; }

.sell-qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.qty-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 4px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
    white-space: nowrap;
}
.qty-btn:hover { background: rgba(255,255,255,0.15); }
.qty-max { color: var(--accent-color); border-color: var(--accent-color); flex: 0 0 auto; padding: 6px 10px; }
.qty-reset { color: #aaa; flex: 0 0 auto; padding: 6px 10px; }

.qty-arrow { font-family: monospace; letter-spacing: -1px; }
.qty-minus { color: #ff8888; border-color: rgba(255,100,100,0.35); }
.qty-minus:hover { background: rgba(255,80,80,0.15); }
.qty-plus  { color: #88ddaa; border-color: rgba(80,200,120,0.35); }
.qty-plus:hover  { background: rgba(80,200,120,0.15); }

.sell-qty-slider {
    width: 100%;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.demand-delta { font-size: 12px; }
.demand-delta-neg { color: #ff8888; }
.demand-delta-pos { color: #88ddaa; }

.sell-preview {
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 4px;
}

.sell-preview-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #ccc;
}

.sell-total-row {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 8px;
    margin-top: 4px;
    font-weight: bold;
}

.sell-value { color: var(--text-color); }
.sell-total { color: var(--accent-color); font-size: 15px; }

/* collect button */
.collect-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #45b7b0 100%);
}

.collect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.sell-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000 !important;
}

.sell-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,215,0,0.4);
}

/* ── Order Points Badge ── */
.order-points-badge {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid #FFD700;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    color: #FFD700;
    font-weight: bold;
    margin-right: 6px;
}

/* ── Honorary Citizen Header (under city name) ── */
.city-honorary-header {
    font-size: 12px;
    color: #FFD700;
    padding: 4px 0 6px 0;
    border-bottom: 1px solid rgba(255,215,0,0.2);
    margin-bottom: 4px;
}

/* ── City Order Section (in terrain panel) ── */
.city-order-loading {
    color: #888;
    font-size: 12px;
    padding: 8px 0;
}
.city-order-section {
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}
.city-order-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
    color: #FFD700;
}
.city-order-pct {
    background: rgba(255,215,0,0.15);
    border-radius: 8px;
    padding: 1px 7px;
    font-size: 12px;
    margin-left: 6px;
}
.city-order-honorary {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 6px;
}
.city-order-resources { margin-bottom: 8px; }
.city-order-res-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}
.city-order-res-label { width: 90px; flex-shrink: 0; }
.city-order-res-bar-wrap {
    flex: 1;
    height: 18px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.city-order-res-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #FFD700);
    border-radius: 4px;
    transition: width 0.3s;
}
.city-order-res-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    pointer-events: none;
    white-space: nowrap;
}
.city-order-lb-title {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.city-order-leaderboard { margin-bottom: 8px; }
.city-order-lb-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #ccc;
    padding: 2px 0;
}

.deliver-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: #fff !important;
}
.deliver-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78,205,196,0.4);
}

/* ── Deliver Modal ── */
.deliver-sliders { margin: 10px 0; }
.deliver-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}
.deliver-slider-label { width: 110px; flex-shrink: 0; }
.deliver-slider {
    flex: 1;
    accent-color: #4ecdc4;
}
.deliver-slider-val {
    width: 36px;
    text-align: right;
    color: #FFD700;
    font-weight: bold;
}
.deliver-slider-max { color: #888; font-size: 11px; }
.deliver-slider-maxbtn {
    flex-shrink: 0;
    background: rgba(78, 205, 196, 0.15);
    border: 1px solid #4ecdc4;
    color: #4ecdc4;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.deliver-slider-maxbtn:hover {
    background: #4ecdc4;
    color: #14202a;
}
.deliver-summary { color: #ff6b6b; font-size: 12px; min-height: 16px; }

/* ── Leaderboard Tab ── */
.leaderboard-panel {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}
.leaderboard-tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.leaderboard-tab-btn:hover {
    color: #FFD700;
}
.leaderboard-tab-btn.active {
    color: #FFD700;
    border-bottom-color: #FFD700;
}
.leaderboard-title {
    color: #FFD700;
    margin-bottom: 8px;
}
.leaderboard-refresh-timer {
    font-size: 12px;
    color: #9aa;
    text-align: center;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    margin-bottom: 16px;
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.leaderboard-table th {
    text-align: left;
    padding: 8px 12px;
    background: rgba(255,215,0,0.1);
    border-bottom: 1px solid rgba(255,215,0,0.3);
    color: #FFD700;
}
.leaderboard-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: #eee;
}
.leaderboard-table tr:hover td {
    background: rgba(255,255,255,0.04);
}

/* Companies Panel */
.companies-panel {
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.companies-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FFD700;
}

.companies-header h3 {
    color: #FFD700;
    margin: 0;
}

.companies-table-wrapper {
    width: 100%;
    flex: 1;
    min-height: 0;
    max-height: 55vh;
    overflow: auto;
    border-radius: 0;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0,0,0,0.4);
    font-size: 14px;
}

.companies-table thead {
    background: rgba(0,0,0,0.6);
    border-bottom: 2px solid #FFD700;
}

.companies-table th {
    padding: 12px;
    text-align: left;
    color: #FFD700;
    font-weight: bold;
    white-space: nowrap;
}

.companies-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #eaeaea;
}

.companies-table tr:hover td {
    background: rgba(255,255,255,0.04);
}

.companies-actions {
    white-space: nowrap;
}

.companies-table .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 6px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #FFD700;
    background: transparent;
    color: #FFD700;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: #FFD700;
    color: #1a1a2e;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #FFD700;
    font-weight: bold;
}

.form-group .input-field {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #555;
    color: #eaeaea;
    border-radius: 3px;
    font-size: 14px;
}

.form-group .input-field:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(0,0,0,0.7);
}

/* ─ Certificates Modal ─ */

.modal.certificates-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}

.modal.certificates-modal.active {
    display: flex;
}

.certificates-modal-content {
    width: 880px;
    max-width: 95vw;
    max-height: 85vh;
    border: 2px solid #FFD700;
    background: var(--light-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.modal-header {
    background: rgba(255,217,61,0.1);
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,217,61,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

.upgrades-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
    align-items: start;
}

.upgrade-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 1px solid #FFD700;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upgrade-info {
    flex: 1;
}

.upgrade-info h4 {
    color: #FFD700;
    margin: 0 0 4px 0;
    font-size: 14px;
}

.upgrade-info p {
    color: #bdc3c7;
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.upgrade-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    margin-left: 12px;
}

.upgrade-actions div {
    color: #FFD700;
    font-size: 12px;
    font-weight: bold;
}

.upgrade-actions button {
    padding: 6px 12px;
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.upgrade-actions button:hover:not(:disabled) {
    background: #44a08d;
}

.upgrade-actions button:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* City Action Section (Deliver & Certificates) */

.city-action-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,217,61,0.2);
}

.action-btn.deliver-btn,
.action-btn.certificates-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn.deliver-btn:hover,
.action-btn.certificates-btn:hover {
    background: linear-gradient(135deg, #44a08d 0%, #3a8f7d 100%);
    transform: translateY(-2px);
}

/* Company Profile View */
.company-profile-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.company-profile-header {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 217, 61, 0.2);
}

.company-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.company-profile-left {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid rgba(255, 217, 61, 0.15);
}

.company-profile-right {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid rgba(255, 217, 61, 0.15);
    overflow-y: auto;
}

.company-info-item {
    margin: 12px 0;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 217, 61, 0.1);
}

.company-info-label {
    font-size: 12px;
    color: #FFD700;
    font-weight: bold;
    text-transform: uppercase;
}

.company-info-value {
    font-size: 14px;
    color: #eaeaea;
    margin-top: 4px;
}

.company-section-title {
    font-size: 14px;
    color: #FFD700;
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.company-info-table {
    width: 100%;
    border-collapse: collapse;
}

.company-info-table tr {
    border-bottom: 1px solid rgba(255, 217, 61, 0.1);
}

.company-info-table td {
    padding: 8px;
    vertical-align: middle;
}

.company-info-table td.company-info-label {
    white-space: nowrap;
    padding-right: 12px;
}

.company-info-table td.company-info-value {
    margin-top: 0;
    width: 100%;
    text-align: right;
}

.upgrades-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.upgrades-header h4 {
    color: #FFD700;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Globaler Kaufmodus-Schalter (+1 / +10 / +100 / Max) */
.purchase-mode-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.purchase-mode-hint {
    font-size: 11px;
    color: #888;
}

.cert-money-display {
    margin-left: auto;
    font-size: 14px;
    font-weight: bold;
    color: #FFD700;
    white-space: nowrap;
}

.purchase-mode-btn {
    background: rgba(255, 217, 61, 0.12);
    border: 1px solid rgba(255, 217, 61, 0.45);
    color: #FFD700;
    font-weight: bold;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.purchase-mode-btn:hover {
    background: rgba(255, 217, 61, 0.25);
    border-color: rgba(255, 217, 61, 0.7);
}

.upgrade-card {
    background: rgba(255, 217, 61, 0.05);
    border: 1px solid rgba(255, 217, 61, 0.2);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.upgrade-card:hover {
    background: rgba(255, 217, 61, 0.1);
    border-color: rgba(255, 217, 61, 0.4);
}

.upgrade-card-name {
    font-weight: bold;
    color: #FFD700;
    font-size: 13px;
    margin-bottom: 4px;
}

.upgrade-card-description {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}

.upgrade-card-level {
    font-size: 12px;
    color: #4ecdc4;
    margin-bottom: 8px;
}

.upgrade-card-cost {
    font-size: 13px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 8px;
}

.upgrade-card-buttons {
    display: flex;
    gap: 8px;
}

.upgrade-buy-btn {
    flex: 1;
    background: #4ecdc4;
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.upgrade-buy-btn:hover:not(:disabled) {
    background: #44a08d;
    transform: translateY(-1px);
}

.upgrade-buy-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Icon Buttons (Settings, Inventory) */
.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    color: #FFD700;
    transition: transform 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover:not(:disabled) {
    transform: scale(1.15);
    color: #FFC700;
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Intense Frame Effect Animations for Header */
@keyframes glowPulseIntense {
    0%, 100% {
        box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 30px rgba(0,255,0,0.6), 0 0 40px rgba(0,255,0,0.4), 0 0 50px rgba(0,255,0,0.2), inset 0 0 15px rgba(0,255,0,0.3);
    }
    50% {
        box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00, 0 0 60px rgba(0,255,0,0.8), 0 0 80px rgba(0,255,0,0.5), 0 0 100px rgba(0,255,0,0.3), inset 0 0 25px rgba(0,255,0,0.5);
    }
}

@keyframes goldShimmer {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255,215,0,0.8), 0 0 25px rgba(255,215,0,0.5), inset 0 0 20px rgba(255,215,0,0.4), inset 0 0 10px rgba(255,215,0,0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(255,215,0,1), 0 0 40px rgba(255,215,0,0.7), inset 0 0 30px rgba(255,215,0,0.6), inset 0 0 15px rgba(255,215,0,0.8);
    }
}

@keyframes fireFlickerIntense {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        box-shadow: 0 0 15px #ff4500, 0 0 30px #ff4500, 0 0 45px rgba(255,69,0,0.6), 0 0 60px rgba(255,69,0,0.3), inset 0 0 20px rgba(255,69,0,0.2);
    }
    20%, 24%, 55% {
        box-shadow: 0 0 20px #ff2500, 0 0 35px #ff2500, 0 0 50px rgba(255,37,0,0.7), 0 0 70px rgba(255,37,0,0.4), inset 0 0 25px rgba(255,37,0,0.3);
    }
}

@keyframes sparkleEffectIntense {
    0%, 100% {
        box-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700, 0 0 30px rgba(255,215,0,0.5), 0 0 40px rgba(255,215,0,0.3);
    }
    50% {
        box-shadow: 0 0 20px #FFD700, 0 0 40px #FFD700, 0 0 60px rgba(255,215,0,0.7), 0 0 80px rgba(255,215,0,0.5);
    }
}

@keyframes pulseFrameIntense {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255,215,0,0.4), inset 0 0 10px rgba(255,215,0,0.2);
        border-color: #FFD700;
    }
    50% {
        box-shadow: 0 0 30px rgba(255,215,0,0.8), inset 0 0 20px rgba(255,215,0,0.5);
        border-color: #ffff00;
    }
}

@keyframes goldRingRotateWithGlow {
    0% {
        transform: rotate(0deg);
        box-shadow: 0 0 8px #FFD700, 0 0 15px rgba(255,215,0,0.6);
    }
    50% {
        box-shadow: 0 0 15px #FFD700, 0 0 30px rgba(255,215,0,0.8);
    }
    100% {
        transform: rotate(360deg);
        box-shadow: 0 0 8px #FFD700, 0 0 15px rgba(255,215,0,0.6);
    }
}

/* Messages/Inbox Styles */
.message-item {
    padding: 12px;
    border-bottom: 1px solid #444;
    cursor: pointer;
    background: rgba(0,0,0,0.2);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.message-item:hover {
    background: rgba(255,215,0,0.05);
    border-left: 3px solid #FFD700;
}

.message-item.selected {
    background: rgba(255,215,0,0.1);
    border-left: 3px solid #FFD700;
}

.message-item.unread {
    background: rgba(0,100,200,0.1);
    border-left: 3px solid #4ecdc4;
}

.btn-secondary {
    background: rgba(100,100,150,0.3);
    border: 1px solid #666;
    color: #ccc;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(100,100,200,0.5);
    color: #fff;
}

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

.btn-danger {
    background: rgba(255,100,100,0.2);
    border: 1px solid #ff6b6b;
    color: #ff9999;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255,100,100,0.4);
    color: #ffbbbb;
}

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

/* Current Leaderboard Event Widget */
.current-leaderboard-event {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 100, 100, 0.1) 100%);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.current-leaderboard-event h4 {
    color: #FFD700;
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-event-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.leaderboard-event-info > div {
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.leaderboard-event-info strong {
    color: #FFD700;
}

.leaderboard-event-rewards {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 10px;
    font-size: 13px;
    margin-top: 8px;
}

.leaderboard-event-rewards > div {
    padding: 4px 0;
    color: #eaeaea;
}

.leaderboard-event-countdown {
    font-size: 14px;
    font-weight: bold;
    color: #FF6B6B;
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content { padding: 20px; }
    .market-chart-section { display: none; }
    .company-profile-grid {
        grid-template-columns: 1fr;
    }

    /* ── Mobile layout heights ─────────────────────────────── */
    :root { --mobnav-h: 58px; --footer-h: 34px; }

    /* height: auto hebt die Desktop-Fixierung auf — auf Mobil scrollt die
       Seite als Ganzes, der Platz für Navigation und Fußzeile kommt über das
       padding-bottom von .game-content. */
    .game-container { min-height: 100vh; min-height: 100dvh; height: auto; }

    /* ── Compact header ── */
    .header {
        padding: 8px 10px;
        gap: 8px 10px;
        flex-wrap: wrap;
    }
    .header-left { gap: 8px; }
    .logo { font-size: 15px; }
    .logo img { height: 36px; }
    .game-time-display { font-size: 10px; padding: 3px 6px; }
    .user-info { gap: 8px; }
    .player-profile-header { padding: 3px 6px; gap: 6px; }
    /* Resources go full-width on their own row and scroll horizontally */
    .resource-header {
        order: 3;
        flex: 1 1 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding: 6px 8px;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Single-column content; leave room for fixed nav + footer ── */
    .game-content {
        flex-direction: column;
        height: auto;
        min-height: 0;
        flex: 1;
        gap: 6px;
        padding: 6px;
        padding-bottom: calc(var(--mobnav-h) + var(--footer-h) + 8px);
        overflow: visible;
        position: relative; /* anchor for the terrain overlay pinned to the top */
    }

    .center-panel {
        order: 1;
        flex: 1;
        width: 100%;
        min-height: 0;
    }

    /* ── Tabs become a fixed bottom navigation bar above the footer ── */
    .center-tabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--footer-h);
        height: var(--mobnav-h);
        align-items: stretch;
        border-top: 1px solid rgba(255, 107, 107, 0.4);
        border-bottom: none;
        background: rgba(10, 10, 20, 0.97);
        box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.45);
        z-index: 1001;
    }
    .center-tab {
        flex: 1;
        padding: 0 2px;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-bottom: none;
        border-top: 3px solid transparent;
    }
    .center-tab.active {
        border-bottom-color: transparent;
        border-top-color: var(--accent-color);
        background: rgba(255, 217, 61, 0.10);
    }

    /* ── Compact footer: shrink type/padding so it no longer overlaps the nav.
       --footer-h is tuned to the wrapped height below. ── */
    .page-footer {
        padding: 3px 6px;
        font-size: 9px;
        line-height: 1.25;
    }
    .page-footer .donation-link { margin-left: 4px; }
    .page-footer .bug-report-btn { font-size: 9px; margin-left: 6px; }
    /* Version link is hidden on mobile (JS shows it via inline style, so !important). */
    .footer-version { display: none !important; }

    /* ── Left panel becomes a bottom-sheet overlay, only on the Map tab ── */
    .left-panel { display: none; }

    /* ── Mitteilungen → overlapping toast stack over the header ───────────
       No dedicated panel on mobile; instead messages slide in over the header
       as toasts. Newest sits fully on top, older ones peek out underneath and
       auto-dismiss as usual. Pinned global-event cards are not shown. */
    .right-panel {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: auto;
        max-height: none;
        padding: 0;
        margin: 0;
        background: none;
        border: none;
        overflow: visible;
        z-index: 2000;
        pointer-events: none; /* let header taps through where no toast covers it */
    }
    .right-panel .panel-header { display: none; }
    /* Auf Mobil ist das rechte Panel ein Toast-Overlay, kein Panel: Tab-Leiste
       und Chat werden ausgeblendet, damit die Mitteilungen weiter wie gewohnt
       über dem Header einfliegen. Der Chat ist derzeit Desktop-only. */
    .right-panel .panel-tabs,
    .right-panel #panelChat { display: none !important; }
    .right-panel .panel-card {
        display: block;
        background: none;
        border: none;
        box-shadow: none;
    }
    /* Muss auch dann gewinnen, wenn der Spieler zuvor auf den Chat-Tab
       umgeschaltet hatte — sonst blieben die Toasts auf Mobil verborgen. */
    .right-panel #panelMitteilungen { display: block !important; }
    .right-panel .mitteilungen {
        position: relative;
        padding: 0;
        overflow: visible;
    }
    .right-panel .mitteilungen .no-reports { display: none; }
    /* Pinned global events (e.g. running summer event) are not toasted on mobile */
    .right-panel .report-global-event { display: none !important; }

    .right-panel .report-item {
        position: absolute;
        top: 6px;
        left: 6px;
        right: 6px;
        margin: 0;
        pointer-events: auto;
        transform-origin: top center;
        /* --stack-i (0 = newest) is set by reportManager.layoutMobileStack() */
        transform: translateY(calc(var(--stack-i, 0) * 12px))
                   scale(calc(1 - var(--stack-i, 0) * 0.05));
        opacity: calc(1 - var(--stack-i, 0) * 0.22);
        z-index: calc(100 - var(--stack-i, 0));
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
        background: rgba(18, 18, 30, 0.97);
        transition: transform 0.25s ease, opacity 0.25s ease;
    }
    .right-panel .report-item.stack-hidden { display: none; }

    /* ── Terrain info / actions: overlay pinned to the TOP of the map ──
       Floats over the map (map canvas keeps its full size and is pannable
       around it); anchored inside .game-content so it sits below the header. */
    body[data-active-tab="map"] .left-panel {
        display: flex;
        position: absolute;
        top: 6px;
        left: 6px;
        right: 6px;
        width: auto;
        /* Fill down to just above the bottom nav; long content scrolls inside. */
        max-height: calc(100dvh - 260px);
        overflow-y: auto;
        gap: 8px;
        z-index: 900;
        pointer-events: none;
    }
    /* Keep children at their natural height so .left-panel (not the inner
       .terrain-panel, which clips via overflow:hidden) is the scroll container.
       Without this the panel shrinks to fit and the overflow is cut off. */
    body[data-active-tab="map"] .left-panel > * {
        pointer-events: auto;
        flex-shrink: 0;
    }

    /* ── Market overview: turn the wide table into a compact card list ── */
    .market-panel { flex-direction: column; padding: 8px; gap: 8px; }
    .market-left { flex: 1; }
    .market-table-wrapper { overflow-x: hidden; }

    .market-table,
    .market-table tbody { display: block; width: 100%; }
    .market-table thead { display: none; }

    .market-table tr[data-city] {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px 8px;
        padding: 10px 12px;
        margin-bottom: 8px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 107, 107, 0.22);
        border-radius: 10px;
    }
    .market-table tr[data-city].market-row-selected {
        border-color: var(--accent-color);
        background: rgba(255, 217, 61, 0.10) !important;
    }
    .market-table tr[data-city] td {
        display: block;
        padding: 0;
        border: none;
        font-size: 14px;
    }
    /* City name as the card title, distance as a small badge next to it */
    .market-table tr[data-city] td:first-child {
        grid-column: 1 / 3;
        font-size: 15px;
    }
    .market-table .market-dist-cell {
        grid-column: 3;
        align-self: center;
        text-align: right;
        font-size: 12px;
    }
    .market-table .market-dist-cell::before { content: '📍 '; }
    /* Resource cells: stack the type label above the price + demand bar */
    .market-table tr[data-city] td[data-res] {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 6px;
        padding: 5px 6px;
        font-size: 13px;
        text-align: center;
    }
    .market-table td[data-res]::before {
        content: attr(data-res);
        display: block;
        font-size: 15px;
        margin-bottom: 2px;
    }
    .market-table .demand-bar {
        display: block;
        width: 100%;
        margin: 3px 0 0;
    }
}

/* ── Login page ──────────────────────────────────────────────────────────
   The login box is ALWAYS horizontally centered. By default the news panel
   stacks below it (so it can never push the login off-centre). On wide screens
   the news docks to the right, taken out of flow, so the login stays at the
   true viewport centre regardless of how large the news panel is. ── */
#authModal.modal.active {
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 0;
}

#newsPanel {
    width: 92%;
    max-width: 460px;
    margin: 20px auto 0;
    background: var(--light-bg);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}
#newsPanel > h2 {
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 14px;
    font-size: 22px;
    flex-shrink: 0;
}
#newsContent { overflow-y: auto; }
.news-empty { color: var(--secondary-color); text-align: center; font-size: 14px; }

#aboutPanel {
    width: 92%;
    max-width: 460px;
    margin: 20px auto 0;
    background: var(--light-bg);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#aboutPanel h2 {
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 14px;
    font-size: 22px;
}
#aboutPanel p {
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}
#aboutPanel ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 12px;
}
#aboutPanel li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-color);
}
#aboutPanel li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* ── News accordion ── */
.news-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}
.news-item-head {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
    align-items: start;
}
.news-item-heading { grid-column: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.news-item-title { font-weight: bold; color: var(--accent-color); font-size: 15px; }
.news-item-subtitle {
    font-size: 11px;
    color: var(--secondary-color);
    background: rgba(78, 205, 196, 0.12);
    padding: 1px 7px;
    border-radius: 10px;
}
.news-item-summary { grid-column: 1; font-size: 13px; color: #cfcfcf; line-height: 1.4; }
.news-item-caret {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--accent-color);
    transition: transform 0.2s;
}
.news-item-head[aria-expanded="true"] .news-item-caret { transform: rotate(180deg); }
.news-item-body { padding: 0 14px 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.news-item-content { font-size: 13px; line-height: 1.6; color: var(--text-color); padding-top: 10px; }
.news-item-content p { margin-bottom: 8px; }
/* Effect/time facts as a small muted footnote under the announcement text. */
.news-item-content .news-event-meta {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11.5px;
    color: var(--text-dim, #9aa0a6);
}
.news-item-content ul, .news-item-content ol { margin: 8px 0 8px 18px; }
.news-item-content a { color: var(--secondary-color); }
.news-item-content h1, .news-item-content h2, .news-item-content h3 {
    color: var(--accent-color);
    margin: 8px 0 6px;
    font-size: 15px;
}
.news-changelog-link {
    margin-top: 10px;
    background: rgba(255, 217, 61, 0.12);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.news-changelog-link:hover { background: rgba(255, 217, 61, 0.22); }

/* ── Changelog modal ── */
.changelog-modal-content {
    max-width: 560px;
    width: 90%;
    background: var(--light-bg);
    padding: 0;
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.changelog-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.changelog-modal-content .modal-header h3 { color: var(--accent-color); font-size: 18px; margin: 0; }
.changelog-modal-content .modal-body { padding: 20px; overflow-y: auto; }
.cl-highlight { animation: cl-flash 1.6s ease; border-radius: 6px; }
@keyframes cl-flash {
    0%, 100% { background: transparent; }
    20% { background: rgba(255, 217, 61, 0.18); }
}

/* ── Footer version link (changelog) ── */
.footer-version {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.footer-version:hover { opacity: 1; text-decoration: underline; }

.cl-empty { color: var(--secondary-color); text-align: center; }
.cl-version { margin-bottom: 22px; }
.cl-version:last-child { margin-bottom: 0; }
.cl-version-header {
    color: var(--accent-color);
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 217, 61, 0.3);
    padding-bottom: 6px;
    margin-bottom: 12px;
}
.cl-date {
    color: var(--secondary-color);
    font-size: 12px;
    font-weight: normal;
    margin-left: 8px;
}
.cl-section { margin-bottom: 12px; }
.cl-section:last-child { margin-bottom: 0; }
.cl-section-title { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.cl-neues .cl-section-title { color: #6bd968; }
.cl-balancing .cl-section-title { color: var(--secondary-color); }
.cl-bugfix .cl-section-title { color: var(--primary-color); }
.cl-list { list-style: none; padding-left: 0; }
.cl-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-color);
}
.cl-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Wide screens only: dock the news panel to the right edge, out of flow, so the
   login stays at the true viewport centre. The breakpoint (1380px) is the point
   below which a centred login + right-docked news would start to overlap. */
@media (min-width: 1380px) {
    #authModal.modal.active {
        flex-direction: row;
        overflow: visible;
        padding: 0;
    }
    #newsPanel {
        position: absolute;
        top: 24px;
        right: 24px;
        bottom: 24px;
        width: 460px;
        max-width: 42vw;
        margin: 0;
    }
    #aboutPanel {
        position: absolute;
        top: 24px;
        left: 24px;
        bottom: 24px;
        width: 380px;
        max-width: 36vw;
        margin: 0;
        overflow-y: auto;
    }
}

/* ── Maintenance overlay (backend unreachable) ── */
.maintenance-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}
.maintenance-overlay.active { display: flex; }
.maintenance-box { max-width: 440px; }
.maintenance-box h1 { color: var(--accent-color); font-size: 28px; margin: 18px 0 10px; }
.maintenance-box p { color: var(--text-color); line-height: 1.6; margin-bottom: 8px; }
.maintenance-box .maintenance-retry { color: var(--secondary-color); font-size: 14px; }
.maintenance-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.maintenance-box button {
    margin-top: 18px;
    padding: 10px 18px;
    background: var(--accent-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.maintenance-box button:hover { opacity: 0.85; }

/* ── Rechtes Panel: Mitteilungen / Chat ─────────────────────────────────── */
.panel-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.panel-tabs {
    display: flex;
    background: rgba(255, 107, 107, 0.1);
    border-bottom: 2px solid var(--primary-color);
    flex-shrink: 0;
}
.panel-tab {
    flex: 1;
    padding: 12px 10px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-color, #ddd);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}
.panel-tab:hover { color: var(--accent-color); }
.panel-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}
/* Punkt am Chat-Tab, wenn Nachrichten eintreffen, während die Mitteilungen offen sind */
.panel-tab.has-unread::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
}

.panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.panel-body.panel-hidden { display: none; }

/* ── Chat ───────────────────────────────────────────────────────────────── */
.chat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 8px 0;
    flex-shrink: 0;
}
.chat-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    max-width: 100%;
}
.chat-tab:hover { border-color: var(--accent-color); }
.chat-tab.active {
    background: rgba(255, 107, 107, 0.18);
    border-color: var(--primary-color);
    color: #fff;
}
.chat-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
}
.chat-tab-badge {
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 16px;
    min-width: 16px;
    text-align: center;
}
.chat-tab-close { opacity: 0.6; padding-left: 2px; }
.chat-tab-close:hover { opacity: 1; color: var(--primary-color); }

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-empty { color: #888; text-align: center; padding: 20px 0; }

.chat-line { word-wrap: break-word; overflow-wrap: anywhere; }
.chat-line-own .chat-author { color: var(--accent-color); }
.chat-time { color: #777; font-size: 11px; margin-right: 5px; }
.chat-author {
    color: #7fb2ff;
    font-weight: 600;
    cursor: pointer;
    margin-right: 5px;
}
.chat-author:hover { text-decoration: underline; }
.chat-text { color: #e6e6e6; }

.chat-error {
    color: var(--primary-color);
    font-size: 12px;
    padding: 0 12px;
    min-height: 0;
}

.chat-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px 10px;
    flex-shrink: 0;
}
.chat-input-row input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent-color); }
.chat-send {
    padding: 8px 12px;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
.chat-send:hover { filter: brightness(1.1); }

/* ── Aktionsmenü auf einen anderen Spieler ─────────────────────────────── */
.player-actions { position: relative; margin-top: 10px; }
.player-actions-toggle { width: 100%; }
.player-actions-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--light-bg);
    border: 1px solid rgba(68, 136, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 60;
}
.player-action-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.player-action-item:hover { background: rgba(68, 136, 255, 0.18); }
.player-action-item:disabled { opacity: 0.45; cursor: default; }
