/* === Castle Interior View — Top-Down Burgansicht === */

#castle-view {
    position: fixed;
    top: var(--top-bar-h, 80px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: linear-gradient(160deg, #c4b080 0%, #a89060 50%, #8a7448 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#castle-view.hidden {
    display: none;
}

/* ============================================
   BURGHOF LAYOUT (AI-generated building images)
   ============================================ */

/* Gesamt-Burggrund */
#castle-ground {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #c4b080 0%, #a89060 50%, #8a7448 100%);
    container-type: size;
}

/* === Burghof (Hintergrundbild mit positionierten Gebäuden) === */
#burghof {
    position: relative;
    width: min(100cqw, calc(100cqh * 1.5));
    aspect-ratio: 3 / 2;
    max-height: 100cqh;
    background: url('../assets/burghof.jpg') center / cover no-repeat;
    overflow: hidden;
}

/* === Building Slot (absolut positioniert per JS) === */
.bld-slot {
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.15s ease;
}

.bld-slot:hover {
    filter: drop-shadow(0 0 8px rgba(218, 165, 32, 0.7));
    transform: scale(1.04);
}

.bld-slot:active {
    transform: scale(1.01);
}

.bld-slot img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.bld-slot svg {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    filter: drop-shadow(1px 2px 3px rgba(20, 10, 0, 0.45));
}

/* === Building Name Label (below image) === */
.bld-name {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #2a1a0a;
    text-align: center;
    text-shadow:
        0 0 3px rgba(220, 210, 170, 0.95),
        0 0 6px rgba(220, 210, 170, 0.7);
    white-space: nowrap;
    pointer-events: none;
}

/* === Building Info Panel === */
#building-info {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1600;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 24px 28px;
    min-width: 260px;
    max-width: 320px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow:
        0 4px 16px rgba(59, 42, 26, 0.4),
        inset 0 0 30px rgba(139, 105, 20, 0.1),
        inset 0 0 0 4px rgba(139, 105, 20, 0.15);
    transition: opacity 0.3s, transform 0.3s;
}

#building-info.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#building-info-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: #6b4226;
    font-size: 1.3rem;
    cursor: pointer;
    font-family: serif;
}

#building-info-close:hover {
    color: #3b2a1a;
}

#building-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #3b2a1a;
    text-align: center;
    margin: 0;
}

#building-description {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.9rem;
    color: #5a3d24;
    text-align: center;
    margin: 8px 0;
    line-height: 1.4;
}

/* Resource bar styles are now in style.css (shared) */

/* === Building Level Badge === */
.bld-level {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: #fff;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 28px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #8b6914;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 5;
    white-space: nowrap;
    pointer-events: none;
}

.bld-level.unbuilt {
    background: #7a6e5a;
    border-color: #5a4e40;
}

.bld-tent-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 0 0 4px 0;
    border: 1px solid #4caf50;
    line-height: 1.2;
}

/* === Building under construction overlay === */
.bld-construction {
    position: absolute;
    inset: 0;
    background: rgba(218, 165, 32, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    pointer-events: none;
}

.bld-construction .construction-text,
.bld-construction .build-timer {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    color: #3b2a1a;
    background: rgba(212, 190, 146, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #8b6914;
}

/* === Extended Building Info Panel === */
#building-level {
    display: block;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #8b6914;
    text-align: center;
    margin-top: 2px;
}

#building-icon-preview {
    text-align: center;
    margin-bottom: 4px;
}

#building-icon-preview svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(1px 2px 3px rgba(20, 10, 0, 0.35));
}

#building-icon-preview img {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(1px 2px 3px rgba(20, 10, 0, 0.35));
}

#building-production {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
    text-align: center;
    margin: 4px 0;
}

#building-upgrade-cost {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #3b2a1a;
    text-align: center;
    margin: 4px 0;
}

#building-upgrade-cost .cost-item { display: inline-block; margin: 0 6px; }
#building-upgrade-cost .cost-item.insufficient { color: #8b1a1a; font-weight: bold; }

#building-upgrade-time {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #6b4226;
    text-align: center;
}

#building-dependency {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #8b1a1a;
    text-align: center;
    margin-top: 4px;
}

/* Build progress bar */
#build-progress-section {
    margin: 8px 0;
    text-align: center;
}

#build-progress-section.hidden { display: none; }

#build-progress-bar-container {
    width: 100%;
    height: 10px;
    background: #5a4e40;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #3b2a1a;
}

#build-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #daa520, #f0c030);
    border-radius: 5px;
    transition: width 1s linear;
    width: 0%;
}

#build-countdown {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #3b2a1a;
    margin-top: 4px;
    display: inline-block;
}

/* Action Buttons */
#building-actions {
    text-align: center;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#building-actions button {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.9rem;
    color: #3b2a1a;
    background: linear-gradient(180deg, #d4be92, #c4a870);
    border: 1px solid #8b6914;
    border-radius: 4px;
    padding: 6px 16px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

#building-actions button:hover {
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    box-shadow: 0 2px 6px rgba(139, 105, 20, 0.3);
}

#building-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#building-actions button.hidden { display: none; }

#btn-upgrade { background: linear-gradient(180deg, #daa520, #b8860b); color: #fff; border-color: #8b6914; }
#btn-upgrade:hover:not(:disabled) { background: linear-gradient(180deg, #f0c030, #daa520); }
#btn-upgrade:disabled { background: linear-gradient(180deg, #8a7a50, #6b6040); color: #b0a080; border-color: #6b6040; opacity: 0.7; cursor: not-allowed; }

#upgrade-reqs {
    font-size: 11px;
    color: #c44;
    padding: 4px 8px;
    line-height: 1.5;
}
#upgrade-reqs.hidden { display: none; }
#upgrade-reqs strong {
    display: block;
    color: #a33;
    margin-bottom: 2px;
    font-size: 11px;
}
#upgrade-reqs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#upgrade-reqs ul li::before {
    content: '\2022 ';
    color: #a33;
}

/* === Registration Overlay === */
#registration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.7);
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#registration-overlay.hidden { display: none; }

#registration-panel {
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 2px solid #8b6914;
    border-radius: 6px;
    padding: 28px 32px;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 8px 30px rgba(30, 20, 10, 0.6);
}

#registration-panel h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #3b2a1a;
    margin: 0 0 8px 0;
}

#registration-panel p {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.9rem;
    color: #5a3d24;
    margin: 0 0 16px 0;
}

#reg-name-row {
    margin-bottom: 14px;
}

#reg-name-row label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #5a3d24;
    margin-bottom: 4px;
}

#reg-name-input {
    width: 100%;
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: #3b2a1a;
    background: rgba(255, 245, 220, 0.8);
    border: 1px solid #8b6914;
    border-radius: 4px;
    padding: 6px 12px;
    text-align: center;
    outline: none;
}

#reg-name-input:focus {
    border-color: #daa520;
    box-shadow: 0 0 6px rgba(218, 165, 32, 0.3);
}

#reg-city {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    color: #5a3d24;
    margin-bottom: 12px;
    font-weight: 700;
}

#wappen-preview {
    margin: 12px 0;
}

#reg-cost {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #8b6914;
    margin-bottom: 16px;
}

#btn-register {
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(180deg, #daa520, #b8860b);
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 8px 24px;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-register:hover {
    background: linear-gradient(180deg, #f0c030, #daa520);
}

/* === KLV Deposit Dialog === */
#deposit-dialog {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.6);
    z-index: 1800;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#deposit-dialog.hidden { display: none; }

#deposit-panel {
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 2px solid #8b6914;
    border-radius: 6px;
    padding: 24px 28px;
    max-width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 6px 24px rgba(30, 20, 10, 0.5);
    position: relative;
}

#deposit-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: #6b4226;
    font-size: 1.3rem;
    cursor: pointer;
    font-family: serif;
}

#deposit-panel h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #3b2a1a;
    margin: 0 0 6px 0;
}

#deposit-panel p {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
    margin: 0 0 12px 0;
}

#deposit-rate {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: #8b6914;
    margin-bottom: 10px;
}

.deposit-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

#deposit-amount {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    width: 100px;
    padding: 5px 8px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    background: #f0e6c8;
    color: #3b2a1a;
    text-align: center;
}

#deposit-preview {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
}

#btn-deposit {
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(180deg, #daa520, #b8860b);
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 6px 20px;
    cursor: pointer;
}

#btn-deposit:hover {
    background: linear-gradient(180deg, #f0c030, #daa520);
}

/* === Gold Withdraw Dialog === */
#withdraw-dialog {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.6);
    z-index: 1800;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#withdraw-dialog.hidden { display: none; }

#withdraw-panel {
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 2px solid #8b6914;
    border-radius: 6px;
    padding: 24px 28px;
    max-width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 6px 24px rgba(30, 20, 10, 0.5);
    position: relative;
}

#withdraw-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: #6b4226;
    font-size: 1.3rem;
    cursor: pointer;
    font-family: serif;
}

#withdraw-panel h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #3b2a1a;
    margin: 0 0 6px 0;
}

#withdraw-panel p {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
    margin: 0 0 12px 0;
}

#withdraw-rate {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: #8b6914;
    margin-bottom: 4px;
}

#withdraw-available {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
    margin-bottom: 10px;
}

#withdraw-max-btn {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    color: #3b2a1a;
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    border: 1px solid #8b6914;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
}

#withdraw-max-btn:hover {
    background: linear-gradient(180deg, #f0e0c0, #e8d5a8);
}

#withdraw-amount {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    width: 100px;
    padding: 5px 8px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    background: #f0e6c8;
    color: #3b2a1a;
    text-align: center;
}

#withdraw-preview {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
}

#btn-withdraw {
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(180deg, #daa520, #b8860b);
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 6px 20px;
    cursor: pointer;
}

#btn-withdraw:hover {
    background: linear-gradient(180deg, #f0c030, #daa520);
}

/* === Withdraw Button in Resource Bar === */
#withdraw-btn {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #3b2a1a;
    background: linear-gradient(180deg, #d4be92, #c4a870);
    border: 1px solid #8b6914;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.2s;
}

#withdraw-btn:hover {
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
}

/* === Registration Refcode Row === */
#reg-refcode-row {
    margin: 8px 0;
    text-align: left;
}

#reg-refcode-row label {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3d24;
    display: block;
    margin-bottom: 4px;
}

#reg-refcode-input {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    background: #f0e6c8;
    color: #3b2a1a;
    text-align: center;
    letter-spacing: 2px;
    box-sizing: border-box;
}

/* === Military Training Panel (Phase 3) === */

#military-panel {
    margin-top: 8px;
    border-top: 1px solid rgba(139, 105, 20, 0.3);
    padding-top: 8px;
}

#military-panel.hidden { display: none; }

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

.mil-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #3b2a1a;
}

.mil-army-size {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #6b4226;
}

.unit-row {
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    margin: 2px 0;
    background: rgba(139, 105, 20, 0.08);
    border-radius: 3px;
    gap: 2px;
}

.unit-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.unit-row.locked {
    opacity: 0.5;
}

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

.unit-name {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #3b2a1a;
    display: block;
}

.unit-stats {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.65rem;
    color: #5a3d24;
    display: block;
    margin: 1px 0;
}

.unit-stats span {
    margin-right: 4px;
}

.unit-cost {
    font-size: 0.65rem;
    color: #5a3d24;
    display: flex;
    align-items: center;
    gap: 2px;
}

.unit-cost svg {
    width: 10px;
    height: 10px;
    vertical-align: middle;
}

.unit-locked-text {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #8b6914;
    font-style: italic;
}

.unit-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.unit-count {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #3b2a1a;
    min-width: 18px;
    text-align: center;
}

.btn-train, .btn-train5, .btn-dismiss {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    padding: 2px 5px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 700;
}

.btn-train, .btn-train5 {
    background: linear-gradient(180deg, #daa520 0%, #b8860b 100%);
    color: #3b2a1a;
}

.btn-dismiss {
    background: linear-gradient(180deg, #a08050 0%, #806040 100%);
    color: #e8d5a8;
}

.btn-dismiss:hover:not(:disabled) {
    background: linear-gradient(180deg, #b09060 0%, #906050 100%);
}

.btn-train:disabled, .btn-train5:disabled, .btn-dismiss:disabled,
.btn-custom-train:disabled, .btn-custom-dismiss:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-train:hover:not(:disabled), .btn-train5:hover:not(:disabled) {
    background: linear-gradient(180deg, #f0c040 0%, #daa520 100%);
}

/* Unit buttons row: dismiss left, train right */
.unit-buttons-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin: 3px 0 2px;
}

.unit-dismiss-btns, .unit-train-btns {
    display: flex;
    gap: 2px;
}

/* Custom input row */
.unit-custom-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 2px 0;
}

.unit-input {
    width: 50px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    text-align: center;
    padding: 2px 4px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    background: rgba(255, 248, 220, 0.7);
    color: #3b2a1a;
    flex-shrink: 0;
}

.unit-input:focus {
    outline: none;
    border-color: #daa520;
    box-shadow: 0 0 3px rgba(218, 165, 32, 0.4);
}

/* Hide number input spinners */
.unit-input::-webkit-outer-spin-button,
.unit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.unit-input[type=number] {
    -moz-appearance: textfield;
}

.btn-custom-train, .btn-custom-dismiss {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    padding: 2px 6px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    flex: 1;
}

.btn-custom-train {
    background: linear-gradient(180deg, #daa520 0%, #b8860b 100%);
    color: #3b2a1a;
}

.btn-custom-train:hover:not(:disabled) {
    background: linear-gradient(180deg, #f0c040 0%, #daa520 100%);
}

.btn-custom-dismiss {
    background: linear-gradient(180deg, #a08050 0%, #806040 100%);
    color: #e8d5a8;
}

.btn-custom-dismiss:hover:not(:disabled) {
    background: linear-gradient(180deg, #b09060 0%, #906050 100%);
}

/* Max trainable info */
.unit-max-info {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.6rem;
    color: #6b4226;
    text-align: right;
    margin-bottom: 2px;
}

.army-upkeep {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #8b1a1a;
    text-align: right;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed rgba(139, 105, 20, 0.2);
}

/* === Dispatch Army Panel (Phase 4) === */

.btn-dispatch-army {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: linear-gradient(180deg, #8b1a1a, #5a0f0f);
    color: #f5e6c8;
    border: 1px solid #daa520;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-dispatch-army:hover {
    background: linear-gradient(180deg, #a02020, #6a1515);
}

.btn-dispatch-back {
    background: none;
    border: 1px solid #6b4a2a;
    color: #5a3d24;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
}

.btn-dispatch-back:hover {
    background: rgba(139, 105, 20, 0.1);
}

.dispatch-section {
    margin: 8px 0;
}

.dispatch-section label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: #5a3d24;
    margin-bottom: 4px;
}

.dispatch-input {
    width: 100%;
    padding: 6px;
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    border-radius: 3px;
    box-sizing: border-box;
}

select.dispatch-input {
    cursor: pointer;
    outline: none;
}

select.dispatch-input:hover {
    background: linear-gradient(180deg, #f0e0c0, #e8d5a8);
}

select.dispatch-input option {
    font-family: 'MedievalSharp', cursive;
    background: #e8d5a8;
    color: #3b2a1a;
}

.dispatch-unit-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(139, 105, 20, 0.2);
}

.dispatch-unit-name {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #3b2a1a;
}

.dispatch-unit-avail {
    font-size: 0.6rem;
    color: #8b7355;
}

.dispatch-unit-input {
    width: 50px;
    padding: 3px;
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-size: 0.7rem;
    text-align: center;
    border-radius: 3px;
}

.dispatch-all-btn {
    padding: 2px 6px;
    background: linear-gradient(180deg, #d4be92, #c4a870);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-size: 0.6rem;
    border-radius: 3px;
    cursor: pointer;
}

.dispatch-all-btn:hover {
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
}

.dispatch-hint {
    font-size: 0.55rem;
    color: #8b7355;
    margin-top: 2px;
}

.dispatch-preview {
    padding: 6px;
    background: rgba(59, 42, 26, 0.08);
    border: 1px solid rgba(139, 105, 20, 0.2);
    border-radius: 3px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #3b2a1a;
    min-height: 20px;
    margin: 6px 0;
}

.dispatch-no-units {
    font-size: 0.7rem;
    color: #8b7355;
    font-style: italic;
    padding: 8px 0;
}

.btn-dispatch-send {
    width: 100%;
    padding: 8px;
    background: linear-gradient(180deg, #8b1a1a, #5a0f0f);
    color: #f5e6c8;
    border: 1px solid #daa520;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-dispatch-send:hover:not(:disabled) {
    background: linear-gradient(180deg, #a02020, #6a1515);
}

.btn-dispatch-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Reinforcement Slots (Zeltlager) === */

.reinforce-capacity {
    font-size: 0.75rem;
    color: #3b2a1a;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
    margin-bottom: 4px;
}

.reinforce-slot {
    padding: 6px;
    margin: 4px 0;
    border-radius: 4px;
    border: 1px solid rgba(139, 105, 20, 0.2);
    background: rgba(59, 42, 26, 0.06);
}

.reinforce-slot.reinforce-stationed {
    border-left: 3px solid #2e7d32;
}

.reinforce-slot.reinforce-traveling {
    border-left: 3px solid #e68a00;
}

.reinforce-slot.reinforce-returning {
    border-left: 3px solid #8b4513;
    opacity: 0.7;
}

.reinforce-sender {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #3b2a1a;
}

.reinforce-wappen {
    display: inline-flex;
    vertical-align: middle;
}

.reinforce-troops {
    font-size: 0.62rem;
    color: #5a4020;
    margin: 2px 0;
}

.reinforce-status {
    font-size: 0.6rem;
    color: #8b7355;
    font-style: italic;
}

.reinforce-actions {
    display: flex;
    gap: 4px;
    margin-top: 3px;
}

.reinforce-actions button {
    padding: 2px 6px;
    font-size: 0.58rem;
    border-radius: 3px;
    border: 1px solid rgba(139, 105, 20, 0.3);
    cursor: pointer;
    font-family: 'MedievalSharp', cursive;
}

.btn-evict {
    background: linear-gradient(180deg, #cc7700, #995500);
    color: #fff;
}

.btn-evict:hover {
    background: linear-gradient(180deg, #dd8800, #aa6600);
}

.btn-recall {
    background: linear-gradient(180deg, #5a7a5a, #3a5a3a);
    color: #f5e6c8;
}

.btn-recall:hover {
    background: linear-gradient(180deg, #6a8a6a, #4a6a4a);
}

.btn-resolve {
    background: linear-gradient(180deg, #4a6a9a, #2a4a7a);
    color: #f5e6c8;
}

.btn-resolve:hover {
    background: linear-gradient(180deg, #5a7aaa, #3a5a8a);
}

/* === Market Dialog (Central Overlay) === */

#market-dialog {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 20, 10, 0.6);
}
#market-dialog.hidden { display: none; }
#market-tab-market.hidden { display: none; }
#market-tab-transport.hidden { display: none; }
#market-tab-upgrade.hidden { display: none; }

#market-panel {
    position: relative;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 2px solid #8b6914;
    border-radius: 6px;
    padding: 24px 28px;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(59, 42, 26, 0.4), inset 0 0 30px rgba(139, 105, 20, 0.1);
}

#market-panel h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #3b2a1a;
    text-align: center;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 0 rgba(255, 235, 180, 0.5);
}

#market-dialog-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #6b4226;
    cursor: pointer;
    line-height: 1;
}
#market-dialog-close:hover {
    color: #3b2a1a;
}

/* === Market Upgrade Section === */
.market-upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8rem;
}
.market-upgrade-label {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.8rem;
}
.market-upgrade-cost span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 6px;
    font-size: 0.75rem;
}
.market-upgrade-cost svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}
.market-upgrade-info {
    text-align: center;
    font-size: 0.8rem;
    color: #8b6914;
    padding: 4px 0;
}
.btn-market-upgrade {
    width: 100%;
    padding: 7px 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #3b2a1a;
    background: linear-gradient(180deg, #daa520, #b8860b);
    border: 1px solid #8b6914;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-market-upgrade:hover:not(:disabled) {
    background: linear-gradient(180deg, #e8c040, #daa520);
}
.btn-market-upgrade:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.market-upgrade-reqs {
    font-size: 0.75rem;
    color: #8b1a1a;
    margin-top: 4px;
}
.market-upgrade-reqs ul {
    margin: 2px 0 0 16px;
    padding: 0;
}

/* Market build progress */
#market-build-progress {
    margin: 8px 0;
    text-align: center;
}
#market-progress-bar-container {
    width: 100%;
    height: 10px;
    background: #5a4e40;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #3b2a1a;
}
#market-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #daa520, #f0c030);
    border-radius: 5px;
    transition: width 1s linear;
    width: 0%;
}
#market-build-countdown {
    font-size: 0.8rem;
    color: #3b2a1a;
    display: inline-block;
    margin-top: 4px;
}
.market-build-buttons {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.market-build-buttons .btn-market-upgrade {
    flex: 1;
}
.btn-market-cancel {
    flex: 1;
    padding: 7px 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    background: linear-gradient(180deg, #c0392b, #a93226);
    color: #fff;
    border: 1px solid #922b21;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-market-cancel:hover:not(:disabled) {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
}
.btn-market-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#market-panel .market-row {
    gap: 8px;
    margin-bottom: 8px;
}

#market-panel .market-row label {
    font-size: 0.75rem;
    min-width: 65px;
}

#market-panel .market-select {
    font-size: 0.75rem;
    padding: 6px;
}

#market-panel .market-input {
    width: 70px;
    padding: 6px;
    font-size: 0.8rem;
}

#market-panel .market-subtitle {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

#market-panel .btn-market-create {
    font-size: 0.85rem;
    padding: 8px;
    margin-top: 8px;
}

#market-panel .market-fee-info {
    font-size: 0.65rem;
}

#market-panel .market-orders-table {
    font-size: 0.75rem;
}

#market-panel .btn-market-fill {
    padding: 4px 12px;
    font-size: 0.7rem;
}

#market-panel .btn-market-cancel,
.market-order-row .btn-market-cancel {
    padding: 4px 12px;
    background: linear-gradient(180deg, #8b1a1a, #6b1010);
    border: 1px solid #8b6914;
    color: #e8d5a8;
    font-size: 0.7rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}
#market-panel .btn-market-cancel:hover,
.market-order-row .btn-market-cancel:hover {
    background: linear-gradient(180deg, #a52020, #7b1515);
}

.btn-open-market {
    width: 100%;
    padding: 6px;
    margin-top: 6px;
    background: linear-gradient(180deg, #2a6a2a, #1a4a1a);
    color: #f5e6c8;
    border: 1px solid #daa520;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    cursor: pointer;
}
.btn-open-market:hover {
    background: linear-gradient(180deg, #357a35, #255a25);
}

/* Market Dialog Tabs */
.market-tabs {
    display: flex;
    gap: 0;
    margin: 8px 0 4px 0;
    border-bottom: 2px solid #8b6914;
}
.market-tab {
    flex: 1;
    padding: 6px 12px;
    background: linear-gradient(180deg, #c4a870, #b09860);
    border: 1px solid #8b6914;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #6b4226;
    cursor: pointer;
    opacity: 0.7;
}
.market-tab.active {
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    color: #3b2a1a;
    opacity: 1;
    font-weight: bold;
    border-bottom: 2px solid #e8d5a8;
    margin-bottom: -2px;
}
.market-tab:hover:not(.active) {
    opacity: 0.9;
}

/* Transport Tab Content */
.transport-inventory {
    margin-bottom: 6px;
}
.transport-cart-row {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #3b2a1a;
    border-bottom: 1px solid rgba(139, 105, 20, 0.1);
}
.transport-cart-name {
    flex: 1;
}
.transport-cart-info {
    font-size: 0.65rem;
    color: #8b7355;
    margin-right: 12px;
}
.transport-cart-count {
    font-weight: bold;
    color: #6b4226;
    min-width: 24px;
    text-align: right;
}
.transport-build-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.transport-build-row .market-select {
    flex: 1;
}
.transport-build-row .market-input {
    width: 60px;
    flex: 0 0 60px;
}
.transport-build-row .btn-market-create {
    flex: 0 0 auto;
    white-space: nowrap;
    width: auto;
    padding: 6px 12px;
    margin-top: 0;
    font-size: 0.75rem;
}
.convoy-res-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
}
.convoy-res-name {
    min-width: 60px;
    color: #3b2a1a;
}
.convoy-res-avail {
    font-size: 0.7rem;
    color: #8b7355;
    min-width: 55px;
}
.convoy-res-row .market-input {
    width: 70px;
    flex: 0 0 70px;
}
.btn-convoy-max {
    padding: 3px 8px;
    background: linear-gradient(180deg, #d4be92, #c4a870);
    border: 1px solid #8b6914;
    border-radius: 3px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #3b2a1a;
    cursor: pointer;
}
.btn-convoy-max:hover {
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
}
.btn-convoy-send {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: linear-gradient(180deg, #6b5a2a, #4a3d1a);
    color: #f5e6c8;
    border: 1px solid #daa520;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
}
.btn-convoy-send:hover:not(:disabled) {
    background: linear-gradient(180deg, #7d6a35, #5a4a25);
}
.btn-convoy-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.over-capacity {
    color: #8b1a1a !important;
    border-color: #8b1a1a !important;
}

.market-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.market-filter-row label {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    color: #5a3d24;
    white-space: nowrap;
    min-width: 80px;
}
.market-filter-row .market-select {
    flex: 1;
    font-size: 0.65rem;
}

.market-fill-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.market-fill-calc {
    width: 100%;
    font-size: 0.6rem;
    color: #5a3d24;
    padding: 3px 0 1px;
    font-family: 'MedievalSharp', cursive;
    line-height: 1.3;
}
.market-storage-warn {
    width: 100%;
    font-size: 0.6rem;
    color: #c04020;
    padding: 2px 0;
    font-family: 'MedievalSharp', cursive;
    line-height: 1.3;
    font-weight: bold;
}
.market-fill-inline input {
    width: 50px;
    padding: 3px;
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-size: 0.7rem;
    text-align: center;
    border-radius: 3px;
}
.market-fill-inline .btn-market-confirm {
    padding: 3px 8px;
    background: linear-gradient(180deg, #2a6a2a, #1a4a1a);
    border: 1px solid #8b6914;
    color: #e8d5a8;
    font-size: 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}
.market-fill-inline .btn-market-cancel {
    padding: 3px 6px;
    background: linear-gradient(180deg, #8b1a1a, #6b1010);
    border: 1px solid #8b6914;
    color: #e8d5a8;
    font-size: 0.6rem;
    border-radius: 3px;
    cursor: pointer;
}

/* === Market Trading Panel (Phase 5) === */

.market-section {
    margin: 8px 0;
    padding: 6px 0;
    border-top: 1px solid rgba(218, 165, 32, 0.15);
}

.market-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: #5a3d24;
    margin-bottom: 6px;
}

.market-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.market-row label {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.65rem;
    color: #3b2a1a;
    min-width: 55px;
}

.market-select {
    flex: 1;
    padding: 4px;
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.65rem;
    border-radius: 3px;
    cursor: pointer;
}

.market-select:hover {
    background: linear-gradient(180deg, #f0e0c0, #e8d5a8);
}

.market-select option {
    background: #e8d5a8;
    color: #3b2a1a;
}

.market-input {
    width: 55px;
    padding: 4px;
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-size: 0.7rem;
    text-align: center;
    border-radius: 3px;
}

.market-price-label {
    min-width: auto !important;
    font-size: 0.6rem !important;
}

.market-fee-info {
    font-size: 0.55rem;
    color: #8b7355;
    margin: 4px 0;
}

/* === Language Flags (Registration) === */
#reg-lang-row {
    text-align: center;
    margin-bottom: 10px;
}
.lang-flag {
    font-size: 1.5rem;
    background: none;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 6px;
    margin: 0 2px;
    transition: border-color 0.2s;
}
.lang-flag.active {
    border-color: #8b6914;
    background: rgba(139, 105, 20, 0.15);
}
.lang-flag:hover {
    border-color: #daa520;
}

/* === Auto-Connect Checkbox === */
.menu-autoconnect-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #6b4226;
}
.chk-autoconnect {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #8b6914;
    border-radius: 3px;
    background: #f5e6c8;
    cursor: pointer;
    position: relative;
}
.chk-autoconnect:checked {
    background: #daa520;
    border-color: #8b6914;
}
.chk-autoconnect:checked::after {
    content: '\2714';
    position: absolute;
    top: -2px;
    left: 1px;
    font-size: 12px;
    color: #3b2a1a;
}

/* === Tutorial Menu Button === */
.btn-menu-tutorial, .btn-menu-leaderboard, .btn-menu-techtree {
    width: 100%;
    padding: 6px 10px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #3b2a1a;
    background: linear-gradient(180deg, #daa520, #b8860b);
    border: 1px solid #8b6914;
    border-radius: 4px;
    cursor: pointer;
}
.btn-menu-tutorial:hover, .btn-menu-leaderboard:hover, .btn-menu-techtree:hover {
    background: linear-gradient(180deg, #e8c040, #daa520);
}

/* === Tutorial Step Info === */
.scroll-step-info {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    color: #8b6914;
    text-align: center;
    margin-bottom: 12px;
}

.market-preview {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #3b2a1a;
    text-align: center;
    margin: 6px 0;
    padding: 4px 8px;
    background: rgba(139, 105, 20, 0.1);
    border-radius: 3px;
    min-height: 1.2em;
}

.btn-market-create {
    width: 100%;
    padding: 6px;
    margin-top: 4px;
    background: linear-gradient(180deg, #2a6a2a, #1a4a1a);
    color: #f5e6c8;
    border: 1px solid #daa520;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-market-create:hover {
    background: linear-gradient(180deg, #357a35, #255a25);
}
.btn-market-create:disabled {
    background: linear-gradient(180deg, #6a6a6a, #4a4a4a);
    border-color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}
.market-preview-error {
    color: #8b1a1a;
    font-size: 0.6rem;
    font-weight: normal;
    background: rgba(139, 26, 26, 0.08);
}

.market-orders-list {
    max-height: 300px;
    overflow-y: auto;
}

.market-empty {
    font-size: 0.65rem;
    color: #8b7355;
    font-style: italic;
    padding: 6px 0;
}

.market-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.72rem;
}

.market-orders-table th {
    color: #5a3d24;
    font-size: 0.65rem;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 4px 6px 5px;
    border-bottom: 2px solid rgba(139, 105, 20, 0.35);
}

.market-orders-table th:nth-child(2) {
    text-align: right;
}

.market-orders-table th:nth-child(3) {
    text-align: center;
}

.market-orders-table th:last-child {
    text-align: right;
}

.market-orders-table td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
    vertical-align: middle;
}

.market-orders-table td:nth-child(2) {
    text-align: right;
}

.market-orders-table td:nth-child(3) {
    text-align: center;
}

.market-orders-table td:last-child {
    text-align: right;
}

.market-orders-table tbody tr:nth-child(even) td {
    background: rgba(139, 105, 20, 0.06);
}

.market-orders-table tbody tr:hover td {
    background: rgba(139, 105, 20, 0.12);
}

.market-orders-table tr.own-order td {
    background: rgba(139, 90, 20, 0.1);
}

.order-get {
    color: #3b2a1a;
    font-weight: bold;
    white-space: nowrap;
}

.order-pay {
    color: #5a3d24;
    white-space: nowrap;
}

.order-unit {
    color: #8b7355;
    font-size: 0.6rem;
    display: block;
}

.order-delivery {
    color: #6a5a3a;
    font-size: 0.65rem;
    white-space: nowrap;
}

.btn-market-fill {
    padding: 2px 8px;
    background: linear-gradient(180deg, #2a6a2a, #1a4a1a);
    border: 1px solid #8b6914;
    color: #e8d5a8;
    font-size: 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}

.btn-market-fill:hover {
    background: rgba(53, 122, 53, 0.7);
}

/* === Research Panel (Phase 6) === */

.research-active {
    background: rgba(42, 90, 138, 0.15);
    border: 1px solid rgba(42, 90, 138, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
}

.research-active-title {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #5a3d24;
    margin-bottom: 4px;
}

.research-active-name {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #3b2a1a;
    margin-bottom: 6px;
}

.research-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.research-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a5a8a, #4a8acc);
    border-radius: 4px;
    transition: width 1s linear;
}

.research-countdown {
    font-size: 0.75rem;
    color: #5a3d24;
    text-align: center;
    margin-bottom: 6px;
}

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

.btn-research-rush,
.btn-research-cancel {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    padding: 4px 8px;
    border: 1px solid #8b6914;
    border-radius: 3px;
    cursor: pointer;
    background: linear-gradient(180deg, #d4be92, #c4a870);
    color: #3b2a1a;
}

.btn-research-rush:hover { background: linear-gradient(180deg, #e8d5a8, #d4be92); }
.btn-research-cancel:hover { background: linear-gradient(180deg, #c08080, #a06060); color: #3b2a1a; }

.btn-research-finish {
    width: 100%;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    padding: 6px;
    background: linear-gradient(180deg, #2a6a2a, #1a4a1a);
    border: 1px solid #8b6914;
    border-radius: 4px;
    color: #e8d5a8;
    cursor: pointer;
}

.btn-research-finish:hover { background: linear-gradient(180deg, #357a35, #255a25); }

.research-branch {
    margin-bottom: 10px;
    border: 1px solid rgba(139, 113, 85, 0.2);
    border-radius: 4px;
    padding: 6px;
    background: rgba(59, 42, 26, 0.15);
}

.research-branch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(139, 113, 85, 0.2);
}

.research-branch-name {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #5a3d24;
    font-weight: 600;
}

.research-branch-level {
    font-size: 0.7rem;
    color: #6b4a2a;
}

.research-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #8b7355;
}

.research-item.researched {
    color: #2a5a2a;
    background: rgba(42, 90, 58, 0.15);
}

.research-item.next {
    color: #3b2a1a;
    background: rgba(139, 105, 20, 0.12);
    border: 1px solid rgba(139, 105, 20, 0.3);
}

.research-item.locked {
    opacity: 0.4;
}

.research-item-lv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(59, 42, 26, 0.3);
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.research-item.researched .research-item-lv {
    background: rgba(42, 90, 58, 0.4);
}

.research-item.next .research-item-lv {
    background: rgba(218, 165, 32, 0.3);
}

.research-item-name {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
}

.research-item-status {
    color: #4a8a4a;
    font-size: 0.85rem;
}

.research-item-cost {
    font-size: 0.65rem;
    color: #6b4a2a;
    display: flex;
    align-items: center;
    gap: 2px;
}

.research-item-cost svg {
    width: 12px;
    height: 12px;
}

.research-item-locked {
    font-size: 0.6rem;
    color: #8b5a2b;
    font-style: italic;
}

.research-item-effect {
    font-size: 0.6rem;
    color: #7a9a5a;
    padding-left: 28px;
    margin-bottom: 2px;
    font-style: italic;
}

.btn-start-research {
    width: 100%;
    margin-top: 6px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    padding: 5px 8px;
    background: linear-gradient(180deg, #2a5a8a, #1a3a5a);
    border: 1px solid #8b6914;
    border-radius: 4px;
    color: #e8d5a8;
    cursor: pointer;
}

.btn-start-research:hover:not(.disabled) { background: linear-gradient(180deg, #3a6a9a, #2a5a8a); }

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

/* === Diplomacy Panel (Phase 7) === */

.diplomacy-section {
    margin-bottom: 8px;
    padding: 6px;
    border: 1px solid rgba(139, 113, 85, 0.3);
    border-radius: 4px;
    background: rgba(59, 42, 26, 0.08);
}

.diplomacy-section .market-subtitle {
    color: #4a2a0a;
    font-size: 0.8rem;
    font-weight: 600;
}

.diplomacy-no-alliance {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #5a3a1a;
    margin-bottom: 6px;
    font-style: italic;
}

.diplomacy-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.diplomacy-row label {
    font-size: 0.7rem;
    color: #5a3a1a;
    min-width: 30px;
    font-weight: 600;
}

.diplomacy-input {
    flex: 1;
    min-width: 0;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid #8b6914;
    border-radius: 3px;
    color: #3b2a1a;
}

select.diplomacy-input option {
    background: #e8d5a8;
    color: #3b2a1a;
}

.btn-diplomacy {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    padding: 4px 10px;
    background: linear-gradient(180deg, #a0c0e0, #7a9ec0);
    border: 1px solid #5a7a9a;
    border-radius: 3px;
    color: #2a1a0a;
    cursor: pointer;
    white-space: nowrap;
}

.btn-diplomacy:hover { background: linear-gradient(180deg, #b0d0f0, #8aaed0); }

.btn-diplomacy-create {
    width: 100%;
    margin-bottom: 6px;
    background: linear-gradient(180deg, #7ab87a, #5a9a5a);
    border-color: #3a7a3a;
    color: #1a1a0a;
    font-weight: 600;
}

.btn-diplomacy-create:hover { background: linear-gradient(180deg, #8ac88a, #6aaa6a); }

.btn-diplomacy-danger {
    background: linear-gradient(180deg, #c07a7a, #a05a5a);
    border-color: #8a3a3a;
    color: #1a0a0a;
}

.btn-diplomacy-danger:hover { background: linear-gradient(180deg, #d08a8a, #b06a6a); }

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

.diplomacy-actions .btn-diplomacy {
    flex: 1;
}

/* === Rathaus Overlay (Diplomacy Redesign) === */

#rathaus-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 20, 10, 0.6);
}
#rathaus-overlay.hidden { display: none; }

#rathaus-panel {
    position: relative;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 3px solid #8b6914;
    border-radius: 6px;
    padding: 0;
    width: 500px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(20, 10, 0, 0.6), inset 0 0 30px rgba(139, 105, 20, 0.1), inset 0 0 0 4px rgba(139, 105, 20, 0.15);
}

#rathaus-panel h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #3b2a1a;
    text-align: center;
    margin: 0;
    padding: 14px 40px 8px;
    text-shadow: 0 1px 0 rgba(255, 235, 180, 0.5);
}

#rathaus-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b4226;
    cursor: pointer;
    line-height: 1;
    z-index: 1;
}
#rathaus-close:hover { color: #3b2a1a; }

#rathaus-tabs {
    display: flex;
    border-bottom: 2px solid #8b6914;
    background: linear-gradient(180deg, #c4a265 0%, #b8956a 100%);
    padding: 0 8px;
}

.rathaus-tab {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.82rem;
    padding: 8px 6px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #5a3a1a;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s, border-color 0.2s;
}

.rathaus-tab:hover { color: #3b2a1a; }

.rathaus-tab.active {
    color: #2a1a0a;
    font-weight: 700;
    border-bottom-color: #3b2a1a;
}

#rathaus-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 16px;
    min-height: 200px;
}

/* Alliance section inside rathaus */
.rathaus-alliance-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.3);
}

.rathaus-alliance-wappen {
    width: 48px;
    height: 48px;
    border: 2px solid #8b6914;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    font-size: 1.6rem;
}

.rathaus-alliance-info {
    flex: 1;
}

.rathaus-alliance-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #3b2a1a;
}

.rathaus-alliance-meta {
    font-size: 0.72rem;
    color: #6b4a2a;
    margin-top: 2px;
}

.rathaus-owner-section {
    margin-bottom: 8px;
    padding: 6px 8px;
    background: rgba(139, 105, 20, 0.12);
    border: 1px solid rgba(139, 105, 20, 0.25);
    border-radius: 4px;
}

.rathaus-owner-label {
    font-size: 0.68rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.rathaus-owner-name {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b2a1a;
}

.rathaus-section-title {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #4a2a0a;
    font-weight: 600;
    margin: 10px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.2);
}

.rathaus-member-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.rathaus-member-row {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    font-size: 0.78rem;
    color: #3b2a1a;
    border-bottom: 1px solid rgba(139, 105, 20, 0.1);
}

.rathaus-member-row:last-child { border-bottom: none; }

.rathaus-member-row.is-me { font-weight: 600; }

.rathaus-member-wappen {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.rathaus-member-name { flex: 1; }

.rathaus-invite-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

.rathaus-invite-row select {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    padding: 5px 6px;
    background: rgba(255,255,255,0.4);
    border: 1px solid #8b6914;
    border-radius: 3px;
    color: #3b2a1a;
}

.rathaus-name-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.rathaus-name-row input {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    padding: 5px 6px;
    background: rgba(255,255,255,0.4);
    border: 1px solid #8b6914;
    border-radius: 3px;
    color: #3b2a1a;
}

/* Tribute section */
.rathaus-tribute-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.rathaus-tribute-row label {
    font-size: 0.72rem;
    color: #5a3a1a;
    min-width: 50px;
    font-weight: 600;
}

.rathaus-tribute-row select,
.rathaus-tribute-row input {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    padding: 5px 6px;
    background: rgba(255,255,255,0.4);
    border: 1px solid #8b6914;
    border-radius: 3px;
    color: #3b2a1a;
    min-width: 0;
}

/* No-alliance state */
.rathaus-no-alliance {
    text-align: center;
    padding: 20px 0;
}

.rathaus-no-alliance p {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3a1a;
    font-style: italic;
    margin-bottom: 12px;
}

.rathaus-create-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
    margin: 0 auto;
}

.rathaus-create-form label {
    font-size: 0.72rem;
    color: #5a3a1a;
    font-weight: 600;
}

.rathaus-create-form input {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    padding: 6px 8px;
    background: rgba(255,255,255,0.4);
    border: 1px solid #8b6914;
    border-radius: 3px;
    color: #3b2a1a;
}

/* Chronicle (war log) in rathaus */
.rathaus-chronicle-list {
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 600px) {
    #rathaus-panel {
        width: calc(100vw - 24px);
        max-width: 420px;
        max-height: 85vh;
        border-radius: 6px;
    }
    .rathaus-tab { font-size: 0.75rem; padding: 6px 4px; }
}

/* === Leaderboard Overlay === */

#leaderboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 20, 10, 0.6);
}
#leaderboard-overlay.hidden { display: none; }

#leaderboard-panel {
    position: relative;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 3px solid #8b6914;
    border-radius: 6px;
    padding: 0;
    width: 540px;
    max-width: 94vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(20, 10, 0, 0.6), inset 0 0 30px rgba(139, 105, 20, 0.1), inset 0 0 0 4px rgba(139, 105, 20, 0.15);
}

#leaderboard-panel h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #3b2a1a;
    text-align: center;
    margin: 0;
    padding: 14px 40px 8px;
    text-shadow: 0 1px 0 rgba(255, 235, 180, 0.5);
}

#leaderboard-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b4226;
    cursor: pointer;
    z-index: 1;
}
#leaderboard-close:hover { color: #3b2a1a; }

#leaderboard-tabs {
    display: flex;
    border-bottom: 2px solid #8b6914;
    background: linear-gradient(180deg, #c4a265 0%, #b8956a 100%);
    padding: 0 8px;
}

.lb-tab {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.82rem;
    padding: 8px 6px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #5a3a1a;
    cursor: pointer;
    text-align: center;
}
.lb-tab:hover { color: #3b2a1a; }
.lb-tab.active { color: #2a1a0a; font-weight: 700; border-bottom-color: #3b2a1a; }

#leaderboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 12px;
    min-height: 200px;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.lb-table th {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: #4a2a0a;
    text-align: left;
    padding: 4px 6px;
    border-bottom: 2px solid #8b6914;
    white-space: nowrap;
    cursor: pointer;
}

.lb-table th:hover { color: #2a1a0a; }
.lb-table th.sorted { color: #8b0000; }

.lb-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
    color: #3b2a1a;
    vertical-align: middle;
}

.lb-table tr.lb-me { background: rgba(139, 105, 20, 0.15); font-weight: 600; }

.lb-rank {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-align: center;
    min-width: 24px;
}
.lb-rank-1 { color: #daa520; font-size: 0.9rem; }
.lb-rank-2 { color: #a0a0a0; }
.lb-rank-3 { color: #cd7f32; }

.lb-player-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lb-loading {
    text-align: center;
    color: #8b7355;
    padding: 30px 0;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    #leaderboard-panel {
        width: calc(100vw - 24px);
        max-width: 420px;
        max-height: 85vh;
        border-radius: 6px;
    }
    .lb-tab { font-size: 0.75rem; }
    .lb-table { font-size: 0.68rem; }
}

/* === Responsive === */
@media (max-width: 600px) {
    .bld-name {
        font-size: 0.55rem;
    }

    .bld-level {
        min-width: 22px;
        height: 16px;
        font-size: 0.55rem;
    }

    #building-info {
        bottom: 12px;
        left: 12px;
        right: 12px;
        min-width: auto;
        max-width: none;
        width: auto;
        padding: 16px 20px;
    }

    #registration-panel {
        margin: 16px;
        padding: 20px 24px;
    }

    #deposit-panel {
        margin: 16px;
        padding: 20px 24px;
    }
}

/* === Transaction Overlay (Medieval Hourglass) === */

#tx-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(20, 12, 4, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
}

#tx-overlay.hidden { display: none; }

#tx-overlay-content {
    text-align: center;
    max-width: 320px;
    padding: 28px 32px;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 2px solid #8b6914;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(139, 105, 20, 0.5), inset 0 1px 0 rgba(255, 235, 180, 0.5);
}

#tx-hourglass {
    display: inline-block;
    width: 48px;
    margin-bottom: 12px;
    animation: tx-flip 2.5s ease-in-out infinite;
}

@keyframes tx-flip {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(5deg); }
    20% { transform: rotate(-5deg); }
    30% { transform: rotate(0deg); }
}

#tx-hourglass .sand-stream {
    animation: tx-sand 1s linear infinite;
}

@keyframes tx-sand {
    0% { opacity: 0.9; }
    50% { opacity: 0.3; }
    100% { opacity: 0.9; }
}

#tx-logo {
    display: block;
    width: 80px;
    height: auto;
    margin: 0 auto 12px;
    filter: drop-shadow(0 2px 6px rgba(139, 105, 20, 0.5));
}

#tx-status {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #3b2a1a;
    margin: 0 0 14px 0;
}

#tx-progress-container {
    width: 100%;
    height: 12px;
    background: #a08050;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #6b4226;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

#tx-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #daa520, #f0c040, #daa520);
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
    animation: tx-shimmer 1.5s ease-in-out infinite;
}

@keyframes tx-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#tx-detail {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
    color: #6b4226;
    margin: 8px 0 0 0;
    min-height: 1.2em;
}

/* ============================================
   WUSELFAKTOR — Animated Courtyard Figures
   ============================================ */

#wusel-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* z-index: auto so figures share stacking context with buildings */
    overflow: visible;
}

/* --- Figure base --- */
.wusel-fig {
    position: absolute;
    transform-origin: center bottom;
    z-index: 7;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.35));
    will-change: left, top;
    margin-left: -16px;
    margin-top: -40px;
    transition: none;
}

/* Walking bob (subtler now that legs move) */
.wusel-walking {
    animation: wusel-bob 0.35s ease-in-out infinite alternate;
}

@keyframes wusel-bob {
    from { margin-top: -40px; }
    to   { margin-top: -42px; }
}

/* Leg swing animation */
.wusel-walking .wl {
    animation: leg-swing-l 0.35s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 0%;
}
.wusel-walking .wr {
    animation: leg-swing-r 0.35s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 0%;
}
@keyframes leg-swing-l {
    from { transform: rotate(-10deg); }
    to   { transform: rotate(10deg); }
}
@keyframes leg-swing-r {
    from { transform: rotate(10deg); }
    to   { transform: rotate(-10deg); }
}

/* Arm swing animation (opposite to legs, smaller amplitude) */
.wusel-walking .wal {
    animation: arm-swing-l 0.35s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 0%;
}
.wusel-walking .war {
    animation: arm-swing-r 0.35s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 0%;
}
@keyframes arm-swing-l {
    from { transform: rotate(5deg); }
    to   { transform: rotate(-5deg); }
}
@keyframes arm-swing-r {
    from { transform: rotate(-5deg); }
    to   { transform: rotate(5deg); }
}

/* Guard idle: subtle look-around + shift */
.wusel-guard {
    animation: guard-look 7s ease-in-out infinite;
}

@keyframes guard-look {
    0%, 65%  { transform: scaleX(1); }
    70%      { transform: scaleX(1) translateX(2px); }
    75%, 90% { transform: scaleX(-1); }
    95%      { transform: scaleX(-1) translateX(-2px); }
    100%     { transform: scaleX(1); }
}

/* --- Smoke effect --- */
.wusel-smoke {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 170, 150, 0.7), rgba(140, 130, 110, 0.3));
    animation: smoke-rise 4s ease-out infinite;
    pointer-events: none;
    z-index: 8;
}

@keyframes smoke-rise {
    0%   { opacity: 0.7; transform: translateY(0) scale(0.6); }
    30%  { opacity: 0.5; transform: translateY(-18px) scale(1.8); }
    60%  { opacity: 0.3; transform: translateY(-35px) scale(2.5); }
    100% { opacity: 0; transform: translateY(-55px) scale(3.5); }
}

/* --- Ambient: Chickens --- */
.wusel-chicken {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    animation: chicken-peck 1.8s ease-in-out infinite;
}

@keyframes chicken-peck {
    0%, 100% { transform: translateY(0); }
    15%      { transform: translateY(2px) scaleY(0.85); }
    30%      { transform: translateY(0); }
    60%      { transform: translateX(3px); }
    80%      { transform: translateX(-2px); }
}

/* --- Sparkle effect (build/research complete) --- */
.wusel-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 20;
    pointer-events: none;
    animation: sparkle-burst 0.9s ease-out forwards;
    box-shadow: 0 0 6px currentColor;
}

@keyframes sparkle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    60% {
        opacity: 0.8;
        transform: translate(var(--sparkle-dx, 20px), var(--sparkle-dy, -20px)) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(var(--sparkle-dx, 20px), var(--sparkle-dy, -20px)) scale(0.3);
    }
}

/* --- Scholar event animation (runs across courtyard) --- */
.wusel-event-scholar {
    animation: scholar-run 2.8s ease-in-out forwards, wusel-bob 0.25s ease-in-out infinite alternate;
    z-index: 15;
}

@keyframes scholar-run {
    0% {
        left: 83%;
        top: 25%;
        opacity: 1;
    }
    30% {
        left: 60%;
        top: 40%;
    }
    60% {
        left: 40%;
        top: 50%;
    }
    80% {
        left: 50%;
        top: 65%;
    }
    100% {
        left: 50%;
        top: 90%;
        opacity: 0;
    }
}

/* ============================================
   NOTIFICATION TOASTS (Phase 8)
   ============================================ */

#notification-container {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 360px;
}

.notification-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 1px solid #8b6914;
    border-left: 4px solid #daa520;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(30, 20, 10, 0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: auto;
    cursor: default;
}

.notification-visible {
    transform: translateX(0);
    opacity: 1;
}

.notification-out {
    transform: translateX(120%);
    opacity: 0;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.notification-message {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #3b2a1a;
    line-height: 1.3;
}

.notification-close {
    background: none;
    border: none;
    color: #6b4226;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

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

/* === Scroll Notification (Alliance Invitation) === */
.scroll-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 15, 5, 0.6);
    animation: scroll-fade-in 0.4s ease;
}

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

.scroll-container {
    position: relative;
    width: 320px;
    animation: scroll-unroll 0.6s ease-out;
}

@keyframes scroll-unroll {
    from { transform: scaleY(0.1) rotateX(60deg); opacity: 0; }
    to { transform: scaleY(1) rotateX(0); opacity: 1; }
}

.scroll-body {
    background: linear-gradient(180deg, #f0e4c8 0%, #e8d8b0 10%, #f2e6c8 50%, #e8d8b0 90%, #f0e4c8 100%);
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 28px 24px 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(30, 20, 10, 0.5), inset 0 0 20px rgba(139, 105, 20, 0.1);
}

.scroll-roll-top, .scroll-roll-bottom {
    height: 18px;
    background: linear-gradient(180deg, #c4a870, #a08050, #c4a870);
    border: 2px solid #8b6914;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(30, 20, 10, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    margin: 0 -4px;
}

.scroll-roll-top { margin-bottom: -4px; z-index: 1; position: relative; }
.scroll-roll-bottom { margin-top: -4px; z-index: 1; position: relative; }

.scroll-seal {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    background: radial-gradient(circle at 40% 35%, #c0392b, #8b1a1a);
    border-radius: 50%;
    border: 2px solid #6a0a0a;
    box-shadow: 0 2px 8px rgba(139, 26, 26, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #f0d090;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.scroll-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #3b2a1a;
    margin-bottom: 8px;
}

.scroll-text {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.9rem;
    color: #5a3a1a;
    line-height: 1.5;
    margin-bottom: 16px;
}

.scroll-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.scroll-btn {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.9rem;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid;
    transition: background 0.2s;
}

.scroll-btn-accept {
    background: linear-gradient(180deg, #7ab87a, #5a9a5a);
    border-color: #3a7a3a;
    color: #1a1a0a;
    font-weight: 600;
}

.scroll-btn-accept:hover {
    background: linear-gradient(180deg, #8ac88a, #6aaa6a);
}

.scroll-btn-dismiss {
    background: linear-gradient(180deg, #d4be92, #c4a870);
    border-color: #8b6914;
    color: #3b2a1a;
}

.scroll-btn-dismiss:hover {
    background: linear-gradient(180deg, #e8d5a8, #d4be92);
}

/* === Battle Report Scroll (Phase 9) === */
.battle-scroll-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 15, 5, 0.65);
    animation: scroll-fade-in 0.4s ease;
}

.battle-scroll {
    width: 360px;
}

.battle-body-victory {
    background: linear-gradient(180deg, #f5ecd0 0%, #eee0b0 10%, #f5ecd0 50%, #eee0b0 90%, #f5ecd0 100%);
    border-color: #8b6914;
}

.battle-body-defeat {
    background: linear-gradient(180deg, #f0e0d0 0%, #e8d0b8 10%, #f0e0d0 50%, #e8d0b8 90%, #f0e0d0 100%);
    border-color: #6a3a2a;
}

.battle-seal-victory {
    background: radial-gradient(circle at 40% 35%, #daa520, #8b6914) !important;
    border-color: #6b4900 !important;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.6) !important;
}

.battle-seal-defeat {
    background: radial-gradient(circle at 40% 35%, #8b1a1a, #4a0a0a) !important;
    border-color: #3a0505 !important;
    box-shadow: 0 2px 8px rgba(139, 26, 26, 0.6) !important;
}

.battle-power-row {
    display: flex;
    justify-content: space-around;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #5a3a1a;
    margin: 8px 0;
    padding: 6px 8px;
    background: rgba(139, 105, 20, 0.08);
    border-radius: 3px;
}

.battle-losses {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #8b1a1a;
    text-align: center;
    margin: 4px 0;
}

.battle-plunder {
    margin: 10px 0;
    padding: 8px;
    background: rgba(139, 105, 20, 0.1);
    border: 1px solid rgba(139, 105, 20, 0.2);
    border-radius: 4px;
}

.battle-plunder-title {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #5a3a1a;
    margin-bottom: 6px;
    text-align: center;
}

.battle-plunder-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
}

.battle-plunder-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.8rem;
}

.battle-res-name {
    color: #5a3a1a;
}

.battle-res-val {
    font-weight: 700;
    color: #2a6a2a;
}

.battle-body-defeat .battle-res-val {
    color: #8b1a1a;
}

.battle-opponent {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #5a3a1a;
    text-align: center;
    margin: 8px 0 4px;
}

/* === Nachrichten-Center (Message Center) === */
.message-center-list {
    max-height: 250px;
    overflow-y: auto;
}

.message-empty {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    color: #8b7355;
    font-style: italic;
    padding: 8px 0;
    text-align: center;
}

.message-row {
    display: flex;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s;
}

.message-row:hover {
    background: rgba(139, 105, 20, 0.1);
}

.msg-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    padding-top: 2px;
}

.msg-icon-victory { color: #2a6a2a; }
.msg-icon-defeat { color: #8b1a1a; }

.msg-body {
    flex: 1;
    min-width: 0;
}

.msg-title {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #3b2a1a;
}

.msg-role {
    font-weight: 400;
    color: #8b7355;
    font-size: 0.65rem;
}

.msg-text {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.7rem;
    color: #5a3a1a;
    line-height: 1.3;
}

.msg-plunder {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.6rem;
    color: #2a6a2a;
    margin-top: 1px;
}

.msg-losses {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.6rem;
    color: #8b1a1a;
}

.msg-meta {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.55rem;
    color: #8b7355;
    margin-top: 2px;
}

/* ============================================
   PLAYER STATS PANEL (Phase 8)
   ============================================ */

/* Stats Overlay Backdrop */
.stats-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1640;
    transition: opacity 0.3s;
}

.stats-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.stats-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1650;
    width: 340px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 3px solid #8b6914;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(20, 10, 0, 0.6), inset 0 0 0 4px rgba(139, 105, 20, 0.15);
    padding: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.stats-panel.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    pointer-events: none;
}

.stats-panel::before {
    content: none;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 2px solid #8b6914;
    background: linear-gradient(180deg, #c4a265 0%, #b8956a 100%);
}

.stats-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #3b2a1a;
    margin: 0;
}

#stats-close {
    background: none;
    border: none;
    color: #6b4226;
    font-size: 1.3rem;
    cursor: pointer;
}

#stats-close:hover {
    color: #3b2a1a;
}

#stats-content {
    padding: 8px 14px 14px;
}

.stats-empty {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.85rem;
    color: #8b7355;
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

.stats-section {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.2);
}

.stats-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stats-section-title {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #8b6914;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.stats-label {
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    color: #5a3d24;
}

.stats-value {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #3b2a1a;
}

.stats-power {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    margin-top: 8px;
    background: linear-gradient(180deg, rgba(218, 165, 32, 0.15), rgba(184, 134, 11, 0.1));
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 4px;
}

.stats-power-label {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #8b6914;
}

.stats-power-value {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5a3d24;
}

/* ============================================
   SOUND TOGGLE BUTTON (Phase 8)
   ============================================ */

#sound-btn {
    font-size: 1.1rem;
    background: none;
    border: 1px solid #8b6914;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #6b4226;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, color 0.3s;
    line-height: 1;
    padding: 0;
}

#sound-btn:hover { opacity: 0.8; }

#sound-btn.enabled {
    opacity: 1;
    color: #daa520;
    border-color: #daa520;
}


/* ============================================
   ENHANCED MOBILE RESPONSIVE (Phase 8)
   ============================================ */

@media (max-width: 768px) {
    /* Header kompakter */
    #header {
        padding: 6px 12px;
    }

    #header h1 {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    #logo {
        height: 28px;
        margin-right: 8px;
    }

    #city-info {
        display: none;
    }

    /* Stats Panel zentriert auch auf mobile */
    .stats-panel {
        width: 90vw;
        max-height: 70vh;
    }

    .stats-panel.hidden {
        transform: translate(-50%, -50%) scale(0.95);
    }

    /* Notifications smaller on mobile */
    #notification-container {
        max-width: 85%;
        right: 8px;
        top: 8px;
    }

    .notification-toast {
        padding: 8px 10px;
    }

    .notification-message {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* Very small screens */
    #resource-bar {
        gap: 4px;
        padding: 3px 6px;
    }

    .resource-item {
        font-size: 0.7rem;
    }

    .resource-item .res-icon svg {
        width: 12px;
        height: 12px;
    }

    .res-actions button {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    /* Building info panel: compact bottom sheet */
    #building-info {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        min-width: 0;
        border-radius: 12px 12px 0 0;
        padding: 8px 12px;
        max-height: 40vh;
    }

    /* Hide star ornaments on mobile */
    #building-info .panel-ornament { display: none; }

    /* Compact building image on mobile */
    #building-icon-preview img {
        max-width: 60px;
    }
    #building-icon-preview svg {
        width: 32px;
        height: 32px;
    }
    #building-icon-preview { margin-bottom: 0; }

    /* Smaller text on mobile */
    #building-name { font-size: 0.9rem; }
    #building-level { font-size: 0.7rem; }
    #building-description { font-size: 0.75rem; margin: 2px 0; }
    #building-production { font-size: 0.75rem; margin: 2px 0; }
    #building-upgrade-cost { font-size: 0.75rem; }
    #building-upgrade-time { font-size: 0.7rem; }
    .panel-divider { margin: 4px auto; }

    /* Burghof full-width on small screens */
    #burghof {
        width: 100%;
    }

    /* Smaller wusel figures on mobile */
    .wusel-fig {
        margin-left: -10px;
        margin-top: -26px;
    }
    .wusel-fig svg {
        width: 20px;
        height: auto;
    }
    .wusel-walking {
        animation: wusel-bob-mobile 0.35s ease-in-out infinite alternate;
    }
    @keyframes wusel-bob-mobile {
        from { margin-top: -26px; }
        to   { margin-top: -27px; }
    }

    .bld-name {
        font-size: 0.5rem;
    }

    .bld-level {
        min-width: 20px;
        height: 14px;
        font-size: 0.5rem;
        padding: 0 3px;
    }

    /* Registration panel */
    #registration-panel {
        margin: 8px;
        padding: 16px 18px;
    }

    #registration-panel h2 {
        font-size: 1.1rem;
    }

    /* Deposit dialog */
    #deposit-panel {
        margin: 8px;
        padding: 16px 18px;
    }

    /* Wallet section */
    #header-right {
        gap: 4px;
    }

    #wallet-balance {
        font-size: 0.7rem;
    }

    #wallet-address {
        display: none !important;
    }

    #wallet-btn {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
}

/* Header Message Button */
#header-msg-wrapper {
    position: relative;
    display: inline-block;
}

#header-msg-btn {
    background: none;
    border: none;
    color: #d4af37;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    position: relative;
}

#header-msg-btn:hover {
    color: #ffd700;
}

.msg-badge {
    position: absolute;
    top: -2px;
    right: 0;
    background: #cc3333;
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 7px;
    text-align: center;
    padding: 0 3px;
}

.msg-badge.hidden {
    display: none;
}

/* Messages Overlay */
#messages-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#messages-overlay.hidden {
    display: none;
}

#messages-panel {
    position: relative;
    background: linear-gradient(160deg, #e8d5a8 0%, #d4be92 40%, #c4a870 100%);
    border: 3px solid #8b6914;
    border-radius: 6px;
    padding: 0;
    width: 460px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(20, 10, 0, 0.6), inset 0 0 30px rgba(139, 105, 20, 0.1);
}

#messages-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #3b2a1a;
    text-align: center;
    margin: 0;
    padding: 14px 40px 8px;
    text-shadow: 0 1px 0 rgba(255, 235, 180, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#messages-content {
    padding: 8px 16px 16px;
    overflow-y: auto;
    flex: 1;
}

#close-messages {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #8b6914;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
}

#close-messages:hover {
    color: #c49720;
}

/* Messages Content */
.rathaus-msg-send {
    background: rgba(59, 42, 26, 0.08);
    border: 1px solid #a8956b;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 12px;
}

.rathaus-msg-send > div:first-child {
    color: #3b2a1a;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
}

#msg-recipient,
#msg-text {
    background: #f5ecd5 !important;
    color: #3b2a1a !important;
    border: 1px solid #a8956b !important;
    font-size: 0.8rem !important;
}

#msg-recipient option {
    background: #f5ecd5;
    color: #3b2a1a;
}

#msg-char-count {
    color: #7a6840 !important;
}

.rathaus-msg-item {
    background: rgba(59, 42, 26, 0.07);
    border: 1px solid #a8956b;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

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

.rathaus-msg-sender {
    color: #6b4c1e;
    font-weight: bold;
    font-size: 0.85rem;
    font-family: 'Cinzel', serif;
}

.rathaus-msg-time {
    color: #8a7a5a;
    font-size: 0.7rem;
}

.rathaus-msg-text {
    color: #3b2a1a;
    font-size: 0.8rem;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
}

.btn-msg-reply {
    background: rgba(139, 105, 20, 0.12);
    border: 1px solid #a8956b;
    color: #6b4c1e;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 6px;
    float: right;
}

.btn-msg-reply:hover {
    background: rgba(139, 105, 20, 0.25);
    color: #3b2a1a;
}

#messages-content > div[style*="font-weight:bold"] {
    color: #3b2a1a;
    font-family: 'Cinzel', serif;
}

#messages-content > div[style*="color:#8b7355"] {
    color: #7a6840 !important;
}

#btn-send-msg {
    background: linear-gradient(180deg, #c4a55a, #a8893a);
    border: 1px solid #8b6914;
    color: #3b2a1a;
    font-family: 'MedievalSharp', cursive;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 3px;
    cursor: pointer;
}

#btn-send-msg:hover {
    background: linear-gradient(180deg, #d4b56a, #b8994a);
}

#btn-send-msg:disabled {
    opacity: 0.5;
    cursor: default;
}

.msg-inbox-title {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 0.85rem;
    color: #3b2a1a;
    margin: 12px 0 6px;
    border-bottom: 1px solid #a8956b;
    padding-bottom: 4px;
}

.msg-empty {
    color: #7a6840;
    font-size: 0.8rem;
    text-align: center;
    padding: 12px;
    font-style: italic;
}
