/* Fallen Kingdom — DARK / CLASSIC layout layer.
   Loaded ONLY when body uses fk-mode-dark. Do not edit this file for Light/Parchment. */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top center, rgba(78, 32, 10, .55), transparent 420px),
        linear-gradient(180deg, #0c0c0f 0%, var(--bg) 42%, #070606 100%);
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
}

a {
    color: var(--link);
}

.topbar {
    background: var(--header);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 4px solid var(--accent);
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.userbox {
    font-weight: bold;
}

.subtitle {
    text-align: center;
    padding: 8px;
    background: #111111;
    color: #eeeeee;
}

.game-header {
    width: min(1720px, calc(100% - 32px));
    margin: 8px auto 18px;
    padding: 14px 20px 18px;
    background:
        radial-gradient(circle at top center, rgba(155, 79, 19, .24), transparent 520px),
        linear-gradient(180deg, rgba(58, 19, 4, .98), rgba(14, 8, 7, .98));
    border: 1px solid rgba(164, 119, 36, .75);
    border-radius: 22px;
    box-shadow:
        inset 0 0 45px rgba(255, 184, 69, .06),
        0 10px 35px rgba(0, 0, 0, .45);
    overflow: hidden;
}

.game-header-topline {
    position: relative;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    align-items: center;
    gap: 16px;
    min-height: 56px;
}

.header-spacer {
    min-width: 1px;
}

.header-logo {
    text-align: center;
}

.header-logo a {
    display: inline-block;
    color: #f8d887;
    text-decoration: none;
    font-size: clamp(36px, 4vw, 58px);
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
    text-shadow:
        0 2px 0 #4d2608,
        0 0 18px rgba(255, 188, 66, .8),
        0 0 35px rgba(255, 148, 34, .35);
}

.header-user {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    color: #fff5d6;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

.header-user strong {
    font-size: 15px;
    line-height: 1;
    color: #ffffff;
}

.header-user span {
    font-size: 13px;
    line-height: 1;
    color: #d8c8a5;
}


.header-logout-form,
.fk-menu-logout-form {
    margin: 0;
}

.fk-menu-logout-button {
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.logout-btn {
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 201, 92, .75);
    background: linear-gradient(180deg, #d39a28, #9c6414);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.logout-btn:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.header-resources {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    max-width: 1360px;
    margin: 14px auto 12px;
}

.resource-box {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 9px;
    min-height: 58px;
    padding: 8px 12px;
    text-decoration: none;
    color: #fff2c8;
    border: 1px solid rgba(188, 134, 33, .85);
    border-radius: 13px;
    background:
        linear-gradient(180deg, rgba(49, 30, 12, .92), rgba(12, 10, 9, .96));
    box-shadow:
        inset 0 0 18px rgba(255, 172, 41, .04),
        0 4px 12px rgba(0, 0, 0, .25);
}

.resource-box:hover {
    transform: translateY(-1px);
    text-decoration: none;
    filter: brightness(1.08);
}

.resource-icon {
    grid-row: 1 / 3;
    font-size: 22px;
    line-height: 1;
}

.resource-name,
.resource-box span:not(.resource-icon) {
    display: block;
    color: #d9c37d;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.resource-box strong {
    display: block;
    margin-top: 3px;
    color: #fff3c4;
    font-size: 20px;
    line-height: 1;
    text-shadow: 0 2px 0 #000000;
}

.header-alerts {
    max-width: 1320px;
    margin: 0 auto;
    padding: 7px 10px;
    border-radius: 13px;
    border: 1px solid rgba(166, 121, 34, .85);
    background: rgba(5, 4, 4, .72);
    color: #ffd36c;
    overflow: hidden;
    text-align: center;
}

.header-alerts-empty {
    font-size: 13px;
    color: #c4b387;
}

.kingdom-alert-viewport {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.kingdom-alert-track {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    min-width: max-content;
    animation: fkAlertTicker 28s linear infinite;
}

.kingdom-alert-viewport:hover .kingdom-alert-track {
    animation-play-state: paused;
}

.kingdom-alert-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 260px;
    max-width: 390px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(171, 125, 35, .8);
    background: linear-gradient(180deg, rgba(55, 37, 24, .86), rgba(14, 10, 9, .9));
    color: #f9d473;
    text-decoration: none;
    overflow: hidden;
}

.kingdom-alert-item:hover {
    text-decoration: none;
    filter: brightness(1.08);
}

.kingdom-alert-button {
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.fk-kingdom-message-open {
    overflow: hidden;
}

.fk-kingdom-message-layer {
    position: fixed;
    inset: 0;
    z-index: 10050;
}

.fk-kingdom-message-form {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.fk-kingdom-message-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .78);
    cursor: pointer;
}

.fk-kingdom-message-modal {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(78vh, 720px);
    overflow: auto;
    padding: 22px;
    border: 1px solid rgba(194, 143, 45, .9);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(44, 29, 20, .99), rgba(12, 9, 8, .99));
    box-shadow: 0 22px 70px rgba(0, 0, 0, .72);
    color: #efe4d0;
}

.fk-kingdom-message-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 215, 130, .35);
    border-radius: 50%;
    background: rgba(0, 0, 0, .34);
    color: #ffe4a1;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.fk-kingdom-message-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 42px;
}

.fk-kingdom-message-heading > span {
    font-size: 34px;
}

.fk-kingdom-message-heading small {
    display: block;
    color: #c9ad72;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.fk-kingdom-message-heading h2 {
    margin: 2px 0 0;
    color: #ffe08f;
}

.fk-kingdom-message-content {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 218, 135, .2);
    border-radius: 12px;
    background: rgba(0, 0, 0, .22);
    color: #f1e7d7;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.fk-kingdom-message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.fk-kingdom-message-layer[aria-busy="true"] .fk-kingdom-message-modal {
    opacity: .72;
    pointer-events: none;
}

@media (max-width: 600px) {
    .fk-kingdom-message-form {
        padding: 12px;
    }

    .fk-kingdom-message-modal {
        max-height: 88vh;
        padding: 18px;
        border-radius: 13px;
    }

    .fk-kingdom-message-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.kingdom-alert-icon {
    flex: 0 0 auto;
    font-size: 18px;
}

.kingdom-alert-title {
    flex: 0 0 auto;
    font-weight: 800;
    color: #ffe19a;
}

.kingdom-alert-message {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ded2bf;
}

.kingdom-alert-count {
    display: inline-block;
    margin-top: 5px;
    font-weight: 800;
    color: #ffd45e;
}

@keyframes fkAlertTicker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    max-width: 1660px;
    margin: 14px auto;
    padding: 0 16px;
}

.menu-box,
.content-card {
    background:
        linear-gradient(180deg, rgba(35, 22, 17, .96), rgba(18, 11, 9, .97));
    border: 1px solid rgba(114, 72, 31, .95);
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 22px rgba(255,255,255,.025);
}

.content-card {
    padding: 18px;
}

.menu-box h3,
.content-title {
    margin: 0;
    background: linear-gradient(180deg, #a79c48, #7d7b34);
    color: #070503;
    padding: 11px 14px;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 45px;
    letter-spacing: .2px;
}

.content-title {
    margin: -18px -18px 18px -18px;
    border-bottom: 1px solid rgba(114, 72, 31, .95);
}

.menu-box a {
    display: block;
    color: var(--link);
    text-decoration: none;
    padding: 12px 14px;
    border-top: 1px solid rgba(114, 72, 31, .8);
    font-size: 17px;
    font-weight: 700;
}

.menu-box a:hover,
.spellbook-tile:hover,
.family-card:hover {
    background: rgba(255, 199, 83, .12);
    text-decoration: none;
}

.welcome-text,
.page-intro {
    margin: 0 0 14px 0;
    line-height: 1.45;
    text-align: center;
}

.dashboard-grid,
.resource-grid,
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat-card,
.resource-card {
    background: linear-gradient(180deg, rgba(58, 45, 39, .92), rgba(43, 31, 27, .92));
    border: 1px solid rgba(123, 75, 32, .95);
    border-radius: 13px;
    padding: 13px 16px;
    min-height: 75px;
}

.stat-title,
.resource-title {
    display: block;
    font-size: 13px;
    opacity: .85;
    margin-bottom: 5px;
}

.stat-value,
.resource-value {
    display: block;
    font-size: 26px;
    font-weight: bold;
    line-height: 1.15;
    color: #fff3d1;
}

.stat-small {
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 8px 0;
}

.form-row input,
.form-row select,
.form-row textarea {
    max-width: 360px;
    padding: 8px;
    border: 1px solid rgba(123, 75, 32, .95);
    background: #fff9ea;
    color: #000000;
}

.form-row input[type="color"] {
    width: 80px;
    height: 36px;
    padding: 2px;
}

button,
.form-row button,
.button {
    padding: 9px 15px;
    border: 1px solid rgba(255, 201, 92, .75);
    border-radius: 10px;
    background: linear-gradient(180deg, #09666e, #06464c);
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.13);
}

button:hover,
.button:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.alert,
.success,
.error,
.message {
    border: 1px solid rgba(201, 158, 60, .95);
    background: linear-gradient(180deg, rgba(45, 31, 18, .97), rgba(20, 13, 9, .97));
    color: #fff1ba;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 13px;
    box-shadow: inset 0 0 18px rgba(255, 206, 84, .04);
	    text-align: center;
}

.success {
    border-color: rgba(87, 181, 107, .9);
    color: #b8ffc2;
}

.error {
    border-color: rgba(201, 72, 72, .95);
    color: #ffb4b4;
}

.mobile-menu {
    display: none;
    margin: 10px 12px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.mobile-bottom-menu {
    display: none;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.class-card {
    display: block;
    cursor: pointer;
}

.class-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.class-card-inner {
    display: block;
    min-height: 170px;
    padding: 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid var(--border);
    transition: .12s;
}

.class-card:hover .class-card-inner {
    background: rgba(255,255,255,.18);
    transform: translateY(-2px);
}

.class-card input:checked + .class-card-inner {
    border-color: var(--accent);
    outline: 2px solid var(--accent);
    background: rgba(255,255,255,.22);
}

.class-icon,
.spellbook-icon,
.family-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: rgba(255,255,255,.10);
    border: 1px solid var(--border);
    border-radius: 50%;
    margin-bottom: 10px;
}

.class-name {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.class-description {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    opacity: .92;
}

.class-actions {
    margin-top: 14px;
}

.creature-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.creature-card {
    background: rgba(255,255,255,.12);
    border: 1px solid var(--border);
    padding: 10px;
}

.creature-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.creature-name {
    display: block;
    font-weight: bold;
    font-size: 16px;
}

.creature-family {
    display: block;
    font-size: 12px;
    opacity: .8;
    margin-top: 3px;
}

.creature-status {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    opacity: .85;
}

.creature-stats,
.creature-defenses {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.creature-stats div,
.creature-defenses span {
    border: 1px solid var(--border);
    padding: 6px;
    background: rgba(255,255,255,.10);
}

.creature-stats span {
    display: block;
    font-size: 11px;
    opacity: .75;
}

.creature-stats strong {
    display: block;
    font-size: 15px;
}

.creature-defenses span {
    text-align: center;
    font-size: 12px;
}

.creature-status-dead {
    opacity: .65;
}

.spellbook-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}

.spellbook-tile {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: rgba(255,255,255,.12);
    border: 1px solid var(--border);
    padding: 14px;
    min-height: 150px;
    transition: .15s;
}

.spellbook-tile:hover,
.family-card:hover {
    transform: translateY(-2px);
}

.spellbook-name,
.family-name {
    display: block;
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 8px;
}

.spellbook-description,
.family-meta {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    opacity: .9;
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
    margin-top: 12px;
}

.family-card {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: rgba(255,255,255,.12);
    border: 1px solid var(--border);
    padding: 14px;
    min-height: 160px;
    transition: .15s;
}

.spell-creature-list {
    display: grid;
    gap: 10px;
}

.spell-creature-row {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.10);
    padding: 10px;
}

.spell-creature-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.spell-creature-name {
    font-size: 17px;
    font-weight: bold;
}

.spell-creature-meta {
    font-size: 12px;
    opacity: .8;
}

.spell-creature-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 8px;
}

.spell-creature-stats div {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.08);
    padding: 7px;
}

.spell-creature-stats span {
    display: block;
    font-size: 11px;
    opacity: .75;
    margin-bottom: 4px;
}

.spell-creature-stats strong {
    display: block;
    font-size: 13px;
}

.spell-creature-stats small {
    display: block;
    font-size: 11px;
    opacity: .75;
    margin-top: 3px;
}

.inline-summon-form {
    margin-top: 7px;
}

.inline-summon-form button {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
}

.resource-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin-top: 10px;
}

.resource-pill {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.10);
    padding: 7px 8px;
}

.resource-pill span {
    display: block;
    font-size: 11px;
    opacity: .75;
}

.resource-pill strong {
    display: block;
    font-size: 15px;
}

.amulet-list {
    display: grid;
    gap: 10px;
}

.amulet-row {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.10);
    padding: 10px;
}

.amulet-main {
    margin-bottom: 8px;
}

.amulet-name {
    display: block;
    font-size: 17px;
    font-weight: bold;
}

.amulet-meta {
    display: block;
    font-size: 12px;
    opacity: .8;
    margin-top: 3px;
}

.amulet-description {
    display: block;
    font-size: 13px;
    opacity: .9;
    margin-top: 6px;
}

.amulet-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 8px;
}

.amulet-stats div {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.08);
    padding: 7px;
}

.amulet-stats span {
    display: block;
    font-size: 11px;
    opacity: .75;
    margin-bottom: 4px;
}

.amulet-stats strong {
    display: block;
    font-size: 13px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.inline-form select {
    max-width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--border-color, #4d3328);
    background: var(--panel-bg, #1b120f);
    color: var(--text-color, #f4ead7);
}

.btn-small {
    padding: 7px 12px;
    border: 0;
    cursor: pointer;
    background: var(--button-bg, #9a4e1d);
    color: var(--button-text, #fff4df);
    font-weight: 700;
}

.creature-equipment {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--border-color, #4d3328);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.compact-creature-list .creature-card,
.compact-creature-card {
    padding: 8px 10px;
}

.compact-creature-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.94rem;
    line-height: 1.45;
}

.compact-creature-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
}

.muted {
    opacity: 0.65;
}

.button-group,
.action-links,
.realm-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 10px 0 !important;
}

.button-group a,
.action-links a,
.realm-links a,
.button-group .btn-small,
.action-links .btn-small,
.realm-links .btn-small,
.button-group .button,
.action-links .button,
.realm-links .button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 140px !important;
    max-width: 220px !important;
    min-width: 0 !important;
    min-height: 42px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2 !important;
}

.deposit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.deposit-card {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deposit-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text);
}

.deposit-card input[type="number"] {
    width: 100%;
    box-sizing: border-box;
}

.deposit-card button {
    width: 100%;
}

.treasury-deposit-form {
    margin-top: 14px;
}

.treasury-deposit-grid {
    display: grid;
    gap: 10px;
}

.treasury-deposit-row {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    padding: 10px;
}

.treasury-resource-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.treasury-resource-name {
    font-weight: bold;
}

.treasury-resource-owned {
    font-size: 13px;
    opacity: 0.85;
}

.treasury-deposit-row input {
    width: 100%;
    box-sizing: border-box;
}

.treasury-deposit-button {
    margin-top: 12px;
    width: 100%;
    max-width: 240px;
}

.banner {
    width: 90%;
    text-align: center;
    margin: 15px auto;
}

.banner img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.notification-toolbar {
    display: flex;
    justify-content: center;
    margin: 16px 0 18px;
}

.notification-list {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.notification-card {
    padding: 14px;
    border: 1px solid rgba(132, 83, 35, .95);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(55, 39, 32, .92), rgba(28, 18, 15, .95));
    box-shadow:
        inset 0 0 20px rgba(255, 216, 100, .025),
        0 4px 16px rgba(0, 0, 0, .28);
}

.notification-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.notification-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #fff0bd;
    font-size: 20px;
    font-weight: 900;
}

.notification-card-title span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-card-time {
    flex: 0 0 auto;
    color: #c6b28a;
    font-size: 13px;
    white-space: nowrap;
    padding-top: 3px;
}

.notification-card-message {
    margin: 0 0 12px;
    color: #f5ead8;
    line-height: 1.45;
}

.notification-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.notification-actions .button,
.notification-actions button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
}

.notification-empty {
    text-align: center;
    padding: 22px 14px;
    border: 1px solid rgba(132, 83, 35, .95);
    border-radius: 15px;
    background: rgba(255, 255, 255, .04);
}

.fk-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.fk-modal-layer.is-open {
    display: flex;
}

.fk-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(3px);
}

.fk-message-modal {
    position: relative;
    width: min(520px, 100%);
    padding: 32px 24px 24px;
    text-align: center;
    border: 2px solid rgba(217, 166, 57, .9);
    border-radius: 18px;
    background:
        radial-gradient(circle at top center, rgba(158, 99, 25, .23), transparent 360px),
        linear-gradient(180deg, #2e1b14, #0d0908);
    color: #fff1c5;
    box-shadow: 0 0 38px rgba(0, 0, 0, .75), inset 0 0 35px rgba(255, 207, 92, .05);
}

.fk-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    background: rgba(0, 0, 0, .35);
    color: #ffd56d;
    font-size: 24px;
}

.fk-modal-emblem {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(217, 166, 57, .9);
    background: rgba(0, 0, 0, .35);
    font-size: 42px;
    margin-bottom: 12px;
}

.fk-message-modal h2 {
    margin: 0 0 8px;
    font-size: 34px;
    color: #8de99a;
}

.fk-modal-separator {
    color: #d9a638;
    margin-bottom: 12px;
}

.fk-modal-body {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.fk-modal-ok {
    min-width: 150px;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .header-resources {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .game-header-topline {
        grid-template-columns: 160px minmax(0, 1fr) 190px;
    }

    .dashboard-grid,
    .resource-grid,
    .stat-grid,
    .class-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spellbook-grid,
    .family-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 760px) {
    body {
        font-size: 13px;
        padding-bottom: 64px;
    }

    .game-header {
        width: calc(100% - 16px);
        margin: 8px auto 10px;
        padding: 10px 10px 12px;
        border-radius: 16px;
    }

    .game-header-topline {
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: 0;
    }

    .header-spacer {
        display: none;
    }

    .header-logo {
        text-align: left;
    }

    .header-logo a {
        font-size: 34px;
        line-height: 1.05;
    }

    .header-user {
        justify-content: flex-end;
        gap: 8px;
        margin-top: -36px;
        padding-left: 190px;
    }

    .header-user-info {
        gap: 6px;
    }

    .header-user strong,
    .header-user span {
        font-size: 12px;
    }

    .logout-btn {
        min-height: 31px;
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    .header-resources {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        margin: 12px auto 8px;
    }

    .resource-box {
        min-height: 43px;
        padding: 6px 7px;
        border-radius: 9px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        text-align: center;
    }

    .resource-icon {
        display: none;
    }

    .resource-name,
    .resource-box span:not(.resource-icon) {
        font-size: 9px;
    }

    .resource-box strong {
        font-size: 14px;
        margin-top: 3px;
    }

    .header-alerts {
        padding: 5px 6px;
        border-radius: 9px;
        min-height: 35px;
    }

    .kingdom-alert-track {
        gap: 7px;
        animation-duration: 22s;
    }

    .kingdom-alert-item {
        min-width: 210px;
        max-width: 240px;
        padding: 6px 8px;
        gap: 5px;
    }

    .kingdom-alert-title {
        font-size: 12px;
    }

    .kingdom-alert-message {
        display: none;
    }

    .kingdom-alert-count {
        display: none;
    }

    .layout {
        display: block;
        margin: 8px auto;
        padding: 0 8px;
        max-width: 100%;
    }

    .mobile-menu {
        display: inline-flex;
        margin: 8px;
        padding: 9px 13px;
    }

    .sidebar {
        display: none;
        margin-bottom: 8px;
    }

    .menu-open .sidebar {
        display: block;
    }

    .menu-box,
    .content-card {
        margin-bottom: 10px;
        border-radius: 13px;

    }

    .menu-box h3,
    .content-title {
        padding: 8px 10px;
        font-size: 18px;
        min-height: 42px;
    }

    .menu-box a {
        padding: 9px 11px;
        font-size: 15px;
    }

    .content-card {
        padding: 12px;
        text-align: center;
    }

    .content-title {
        margin: -12px -12px 12px -12px;
    }

    .dashboard-grid,
    .resource-grid,
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .stat-card,
    .resource-card {
        padding: 10px 11px;
        min-height: 64px;
        text-align: left;
    }

    .stat-title,
    .resource-title {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .stat-value,
    .resource-value {
        font-size: 20px;
        line-height: 1.15;
        word-break: break-word;
    }

    .stat-small {
        font-size: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 4px;
        margin: 7px 0;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        max-width: 100%;
        width: 100%;
    }

    button,
    .button {
        padding: 8px 10px;
        font-size: 13px;
    }

    .alert,
    .success,
    .error,
    .message {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 13px;
        text-align: center;
		
    }

    .footer {
        padding: 12px;
        font-size: 12px;
    }

    .class-grid {
        gap: 8px;
    }

    .class-card-inner {
        min-height: 135px;
        padding: 10px;
    }

    .class-icon,
    .spellbook-icon,
    .family-icon {
        width: 44px;
        height: 44px;
        font-size: 25px;
        margin-bottom: 7px;
    }

    .class-name,
    .spellbook-name,
    .family-name {
        font-size: 15px;
        margin-bottom: 5px;
    }

    .class-description,
    .spellbook-description,
    .family-meta {
        font-size: 12px;
        line-height: 1.25;
    }

    .spellbook-grid,
    .family-grid {
        gap: 8px;
    }

    .spellbook-tile {
        min-height: 120px;
        padding: 10px;
    }

    .family-card {
        min-height: auto;
        padding: 10px;
    }

    .creature-card {
        padding: 8px;
    }

    .creature-head {
        margin-bottom: 6px;
    }

    .creature-name {
        font-size: 14px;
    }

    .creature-family {
        font-size: 11px;
    }

    .creature-stats,
    .creature-defenses,
    .spell-creature-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spell-creature-main {
        display: block;
    }

    .spell-creature-meta {
        display: block;
        margin-top: 3px;
    }

    .resource-strip {
        grid-template-columns: repeat(3, minmax(0,1fr));
        gap: 6px;
    }

    .amulet-stats {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 6px;
    }

    .amulet-name {
        font-size: 15px;
    }

    .amulet-description {
        font-size: 12px;
    }

    .button-group,
    .action-links,
    .realm-links {
        gap: 6px !important;
    }

    .button-group a,
    .action-links a,
    .realm-links a,
    .button-group .btn-small,
    .action-links .btn-small,
    .realm-links .btn-small,
    .button-group .button,
    .action-links .button,
    .realm-links .button {
        flex: 1 1 calc(50% - 6px) !important;
        max-width: none !important;
        min-height: 48px !important;
        padding: 10px 8px !important;
        font-size: 14px !important;
    }

    .treasury-deposit-row {
        grid-template-columns: 1fr;
    }

    .treasury-deposit-button {
        max-width: none;
    }

    .notification-toolbar {
        margin: 12px 0;
    }

    .notification-toolbar .button {
        width: 100%;
    }

    .notification-list {
        gap: 10px;
    }

    .notification-card {
        padding: 12px;
        text-align: left;
    }

    .notification-card-header {
        align-items: flex-start;
        margin-bottom: 8px;
    }

    .notification-card-title {
        font-size: 16px;
        gap: 6px;
    }

    .notification-card-time {
        font-size: 12px;
    }

    .notification-card-message {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .notification-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .notification-actions .button,
    .notification-actions button {
        min-height: 36px;
        font-size: 12px;
        padding: 7px 6px;
    }

    .mobile-bottom-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: var(--header);
        border-top: 3px solid var(--accent);
        z-index: 9999;
        box-shadow: 0 -3px 12px rgba(0,0,0,.35);
    }

    .mobile-bottom-menu a {
        text-align: center;
        color: #ffffff;
        text-decoration: none;
        padding: 6px 2px 5px;
        font-size: 18px;
        line-height: 1;
        border-left: 1px solid rgba(255,255,255,.12);
    }

    .mobile-bottom-menu a:first-child {
        border-left: 0;
    }

    .mobile-bottom-menu span {
        display: block;
        font-size: 10px;
        margin-top: 3px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 520px) {
    .header-logo a {
        font-size: 30px;
    }

    .header-user {
        margin-top: -33px;
        padding-left: 155px;
    }

    .header-user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }
}

@media (max-width: 420px) {
    .layout {
        padding: 0 6px;
    }

    .class-grid {
        grid-template-columns: 1fr;
    }

    .class-card-inner {
        min-height: auto;
    }

    .mobile-bottom-menu a {
        font-size: 17px;
    }

    .mobile-bottom-menu span {
        font-size: 9px;
    }

    .button-group a,
    .action-links a,
    .realm-links a,
    .button-group .btn-small,
    .action-links .btn-small,
    .realm-links .btn-small,
    .button-group .button,
    .action-links .button,
    .realm-links .button {
        flex: 1 1 100% !important;
        max-width: none !important;
    }
}

/* =========================================================
   FINAL COMPACT UI OVERRIDES - 2026-06-24
   Keeps the fantasy style, but prevents dashboard boxes from
   becoming oversized and aligns the logged-in header correctly.
   ========================================================= */

.game-header {
    width: min(1720px, calc(100% - 32px));
    margin: 8px auto 16px;
    padding: 14px 18px 16px;
}

.game-header-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 52px;
}

.header-spacer {
    display: none !important;
}

.header-logo {
    text-align: left;
    min-width: 0;
}

.header-logo a {
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1;
}

.header-user {
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    width: auto;
    white-space: nowrap;
}

.header-user-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.header-user strong {
    font-size: 15px;
}

.header-user span {
    font-size: 13px;
}

.header-resources {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    max-width: 1560px;
    margin: 12px auto 12px;
}

.resource-box {
    min-height: 54px;
    padding: 7px 11px;
    border-radius: 12px;
}

.resource-icon {
    font-size: 20px;
}

.resource-name,
.resource-box span:not(.resource-icon) {
    font-size: 10px;
}

.resource-box strong {
    font-size: 18px;
}

.header-alerts {
    max-width: 1540px;
    min-height: 54px;
    padding: 7px 10px;
}

.kingdom-alert-track {
    animation: fkAlertTicker 26s linear infinite !important;
}

.kingdom-alert-item {
    min-width: 280px;
    max-width: 390px;
    padding: 7px 11px;
}

.layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    max-width: 1660px;
}

.menu-box,
.content-card {
    border-radius: 12px;
    margin-bottom: 14px;
	    text-align: center;
}

.content-card {
    padding: 14px;
}

.menu-box h3,
.content-title {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 1.15;
    text-align: center;
}

.content-title {
    margin: -14px -14px 14px -14px;
}

.menu-box a {
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.2;
}

.dashboard-grid,
.resource-grid,
.stat-grid {
    gap: 10px;
}

.stat-card,
.resource-card {
    min-height: 58px;
    padding: 9px 12px;
    border-radius: 10px;
}

.stat-title,
.resource-title {
    font-size: 12px;
    margin-bottom: 3px;
}

.stat-value,
.resource-value {
    font-size: 20px;
    line-height: 1.08;
}

.stat-small {
    font-size: 13px;
}

.page-intro,
.welcome-text {
    font-size: 14px;
}

.notification-toolbar {
    justify-content: center;
    margin: 12px 0 16px;
}

.notification-list {
    gap: 11px;
}

.notification-card {
    padding: 12px;
    border-radius: 12px;
}

.notification-card-title {
    font-size: 17px;
}

.notification-card-message {
    margin-bottom: 10px;
}

.notification-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.notification-actions .button,
.notification-actions button {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .game-header-topline {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .header-resources {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .game-header {
        width: calc(100% - 16px);
        margin: 8px auto 10px;
        padding: 10px 10px 11px;
        border-radius: 14px;
    }

    .game-header-topline {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 36px;
    }

    .header-logo {
        text-align: left;
    }

    .header-logo a {
        font-size: clamp(25px, 7vw, 35px);
        line-height: 1;
        letter-spacing: .2px;
    }

    .header-user {
        justify-content: flex-end;
        gap: 7px;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    .header-user-info {
        gap: 5px;
    }

    .header-user strong,
    .header-user span {
        font-size: 11px;
    }

    .logout-btn {
        min-height: 28px;
        padding: 5px 8px;
        font-size: 11px;
        border-radius: 7px;
    }

    .header-resources {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        margin: 9px auto 8px;
    }

    .resource-box {
        min-height: 42px;
        padding: 5px 5px;
        border-radius: 8px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        text-align: center;
    }

    .resource-icon {
        display: none;
    }

    .resource-name,
    .resource-box span:not(.resource-icon) {
        font-size: 8px;
    }

    .resource-box strong {
        font-size: 13px;
        margin-top: 2px;
    }

    .header-alerts {
        min-height: 34px;
        max-height: 42px;
        padding: 5px 6px;
        border-radius: 8px;
    }

    .kingdom-alert-track {
        gap: 7px;
        animation: fkAlertTicker 18s linear infinite !important;
    }

    .kingdom-alert-item {
        min-width: 190px;
        max-width: 230px;
        padding: 6px 8px;
        gap: 5px;
    }

    .kingdom-alert-icon {
        font-size: 14px;
    }

    .kingdom-alert-title {
        font-size: 12px;
    }

    .kingdom-alert-message,
    .kingdom-alert-count {
        display: none;
    }

    .layout {
        display: block;
        margin: 8px auto;
        padding: 0 8px;
    }

    .mobile-menu {
        display: inline-flex;
        margin: 6px 8px 9px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .menu-box,
    .content-card {
        border-radius: 11px;
        margin-bottom: 10px;
    }

    .content-card {
        padding: 10px;
        text-align: center;
    }

    .content-title {
        margin: -10px -10px 10px -10px;
    }

    .menu-box h3,
    .content-title {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 15px;
    }

    .menu-box a {
        padding: 8px 10px;
        font-size: 13px;
    }

    .dashboard-grid,
    .resource-grid,
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .stat-card,
    .resource-card {
        min-height: 52px;
        padding: 8px 9px;
        border-radius: 9px;
        text-align: left;
    }

    .stat-title,
    .resource-title {
        font-size: 10px;
    }

    .stat-value,
    .resource-value {
        font-size: 16px;
        word-break: break-word;
    }

    .notification-card {
        padding: 10px;
    }

    .notification-card-title {
        font-size: 15px;
    }

    .notification-card-message {
        font-size: 13px;
    }

    .notification-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .notification-actions .button,
    .notification-actions button {
        min-height: 34px;
        padding: 6px 5px;
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .header-logo a {
        font-size: 25px;
    }

    .header-user strong,
    .header-user span {
        font-size: 10px;
    }

    .logout-btn {
        padding: 5px 7px;
        font-size: 10px;
    }

    .resource-box strong {
        font-size: 12px;
    }

    .stat-value,
    .resource-value {
        font-size: 15px;
    }
}


.fk-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fk-modal-ok,
.fk-modal-action {
    min-width: 150px;
}

.fk-modal-action {
    background: linear-gradient(180deg, #a8731d, #704711);
    border-color: rgba(255, 213, 109, .95);
    color: #fff4cf;
}

.fk-modal-action:hover {
    filter: brightness(1.12);
}


@media (max-width: 520px) {
    .fk-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .fk-modal-ok,
    .fk-modal-action {
        width: 100%;
    }
}

.fk-hidden-repeat-form {
    display: none !important;
}

/* =========================================
   Amulet actions / empty states
   ========================================= */

.empty-state {
    margin: 10px 0;
    padding: 12px 14px;
    border: 1px solid rgba(216, 169, 74, .45);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    text-align: center;
    opacity: .85;
}

.amulet-actions-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.amulet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.amulet-actions .inline-summon-form {
    margin: 0;
}

.amulet-actions button {
    width: 100%;
}

.button-danger {
    background: linear-gradient(180deg, #7b2323, #4d1515) !important;
    border-color: #b84d4d !important;
    color: #fff4e0 !important;
}

.button-danger:hover {
    filter: brightness(1.12);
}

@media (max-width: 760px) {
    .amulet-actions {
        grid-template-columns: 1fr;
    }
}

/* Kingdom Phase 3 */
.kingdom-message-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 12px;
    margin: 12px 0;
    line-height: 1.5;
    text-align: center;
}

.kingdom-rename-form {
    margin-top: 14px;
}

.kingdom-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kingdom-log-entry {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    padding: 10px;
    display: grid;
    gap: 4px;
}

.kingdom-log-entry small {
    opacity: 0.75;
    font-size: 0.85rem;
}

.treasury-resource-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.treasury-resource-row {
    display: grid;
    grid-template-columns: 1fr minmax(110px, 180px);
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    padding: 10px;
}

.treasury-resource-name {
    display: block;
    font-weight: 700;
}

.treasury-resource-owned {
    display: block;
    opacity: 0.78;
    font-size: 0.9rem;
}

.treasury-deposit-button {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .treasury-resource-row {
        grid-template-columns: 1fr;
    }

    .treasury-resource-row input {
        width: 100%;
    }
}


/* =========================================
   Anti-cheat warning + moderator logs
   ========================================= */

.anti-cheat-popup {
    margin: 0 0 14px 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 90, 90, .85);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(85, 14, 14, .96), rgba(35, 5, 5, .96));
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color: #ffecec;
    text-align: center;
}

.anti-cheat-popup-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.anti-cheat-popup-message {
    opacity: .92;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
}

.filter-form label {
    display: grid;
    gap: 5px;
    min-width: 150px;
}

.severity-badge {
    display: inline-block;
    min-width: 72px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .18);
}

.severity-low {
    background: rgba(75, 140, 70, .35);
    color: #dbffd8;
}

.severity-medium {
    background: rgba(210, 151, 49, .35);
    color: #fff0c9;
}

.severity-high {
    background: rgba(210, 88, 45, .42);
    color: #ffe0d3;
}

.severity-critical {
    background: rgba(178, 26, 26, .58);
    color: #ffe0e0;
}

.anti-cheat-table small {
    opacity: .75;
}

.anti-cheat-table details {
    margin-top: 6px;
}

.anti-cheat-table pre {
    max-width: 420px;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .24);
    border: 1px solid rgba(255, 255, 255, .08);
}

@media (max-width: 760px) {
    .filter-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .filter-form label,
    .filter-form button {
        width: 100%;
    }
}


/* =========================================
   Kingdom Phase 8 Treasure Attacks
   ========================================= */

.kingdom-attack-form {
    display: grid;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
}

.kingdom-attack-form label {
    text-align: center;
    font-weight: 800;
    color: #f7d98b;
}

.kingdom-attack-form select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff9ea;
    color: #000000;
}

.kingdom-attack-list {
    display: grid;
    gap: 14px;
}

.kingdom-attack-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255,255,255,.04);
    text-align: left;
}

.kingdom-attack-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 12px;
}

.kingdom-attack-title span {
    color: #f7d98b;
}

.kingdom-attack-meta {
    display: grid;
    gap: 6px;
}

.kingdom-attack-meta div {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    border-radius: 8px;
}

.kingdom-attack-meta strong {
    color: #f7d98b;
}

.kingdom-attack-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kingdom-attack-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.kingdom-attack-actions form,
.kingdom-attack-actions button,
.kingdom-attack-actions a {
    width: 100%;
}

.kingdom-report-text {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(0,0,0,.22);
    color: #fff4cf;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .kingdom-attack-actions {
        grid-template-columns: 1fr;
    }

    .kingdom-attack-title {
        font-size: 18px;
    }

    .kingdom-attack-meta div {
        grid-template-columns: 1fr;
        gap: 3px;
        text-align: center;
    }
}


/* Phase 6: Kingdom History + Treasury Logs */
.kingdom-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kingdom-history-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.14));
    border-radius: 12px;
    padding: 12px;
}

.kingdom-history-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.82rem;
    opacity: 0.78;
    margin-bottom: 7px;
}

.kingdom-history-text {
    line-height: 1.5;
}

.kingdom-treasury-log-table .game-table td,
.kingdom-treasury-log-table .game-table th {
    vertical-align: middle;
}

@media (max-width: 720px) {
    .kingdom-treasury-log-table .game-table,
    .kingdom-treasury-log-table .game-table thead,
    .kingdom-treasury-log-table .game-table tbody,
    .kingdom-treasury-log-table .game-table th,
    .kingdom-treasury-log-table .game-table td,
    .kingdom-treasury-log-table .game-table tr {
        display: block;
        width: 100%;
    }

    .kingdom-treasury-log-table .game-table thead {
        display: none;
    }

    .kingdom-treasury-log-table .game-table tr {
        border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.14));
        border-radius: 12px;
        padding: 10px;
        margin-bottom: 10px;
        background: rgba(255, 255, 255, 0.03);
    }

    .kingdom-treasury-log-table .game-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        padding: 6px 0;
        text-align: right;
    }

    .kingdom-treasury-log-table .game-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        opacity: 0.8;
    }
}


/* =========================================
   Battle cards / defend button layout
   Keeps incoming battle actions aligned while preserving reference-style creature labels.
   ========================================= */

.battle-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.battle-card-info {
    min-width: 0;
    overflow-wrap: anywhere;
}

.battle-card-action {
    margin-left: auto;
    flex: 0 0 auto;
}

.battle-card-action .btn-small {
    min-width: 92px;
    text-align: center;
}

@media (max-width: 768px) {
    .battle-card-content {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .battle-card-action {
        margin-left: 0;
        width: 100%;
    }

    .battle-card-action .btn-small {
        display: flex;
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* =========================================
   Worker assignment dashboard
   ========================================= */

.worker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.worker-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    padding: 12px;
    display: grid;
    gap: 5px;
    text-align: center;
}

.worker-resource-name {
    font-weight: 900;
    color: #fff0bd;
}

.worker-count {
    font-size: 18px;
    font-weight: 900;
    color: #fff3d1;
}

.worker-income {
    font-size: 12px;
    opacity: .82;
}

.worker-assignment-form {
    margin-top: 14px;
    display: grid;
    gap: 12px;
    justify-items: center;
}

.worker-assignment-form h3 {
    margin: 4px 0 0;
}

.worker-assignment-grid {
    width: min(720px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.worker-assignment-row {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    padding: 10px;
    text-align: left;
    font-weight: 800;
}

.worker-assignment-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(123, 75, 32, .95);
    background: #fff9ea;
    color: #000000;
}

@media (max-width: 900px) {
    .worker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .worker-grid,
    .worker-assignment-grid {
        grid-template-columns: 1fr;
    }

    .worker-assignment-row {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
/* Smaller left menu */
.layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 14px;
}

.menu-box h3 {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 14px;
}

.menu-box a {
    padding: 7px 9px;
    font-size: 13px;
    line-height: 1.15;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}
.auth-alert,
.auth-alert.auth-success {
    text-align: center;
}

/* Worker assignment modal */
.fk-modal-open {
    overflow: hidden;
}

.fk-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.72);
}

.fk-modal-backdrop[hidden] {
    display: none;
}

.fk-modal-card {
    width: min(520px, 100%);
    border: 1px solid var(--border-color, #7b4b18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(44, 32, 25, 0.98), rgba(22, 14, 10, 0.98));
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    color: var(--text-color, #f5ead8);
    padding: 24px;
}

.fk-modal-title {
    margin-bottom: 10px;
    color: var(--link-color, #f2bd55);
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
}

.fk-modal-text {
    margin: 0 0 16px;
    line-height: 1.5;
    text-align: center;
}

.fk-modal-summary {
    border: 1px solid var(--border-color, #7b4b18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    padding: 12px;
    line-height: 1.6;
}

.fk-modal-summary-warning {
    color: #ffd2d2;
}

.fk-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.fk-modal-button {
    min-width: 135px;
    border: 1px solid var(--border-color, #7b4b18);
    border-radius: 999px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 800;
}

.fk-modal-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.fk-modal-button-primary {
    background: var(--button-color, #0b4d55);
    color: #ffffff;
}

.fk-modal-button-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color, #f5ead8);
}

.fk-modal-button:hover:not(:disabled),
.fk-modal-button:focus-visible {
    filter: brightness(1.15);
    outline: 2px solid var(--link-color, #f2bd55);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .fk-modal-card {
        padding: 18px;
    }

    .fk-modal-actions {
        flex-direction: column-reverse;
    }

    .fk-modal-button {
        width: 100%;
    }
}

/* =========================================
   Modern Pub / Forum
   ========================================= */

.pub-hero-card {
    overflow: hidden;
}

.pub-hero-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pub-hero-actions,
.pub-toolbar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pub-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pub-category-card {
    display: grid;
    gap: 6px;
    min-height: 132px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.pub-category-card:hover,
.pub-category-card.is-active {
    transform: translateY(-1px);
    border-color: rgba(255, 214, 120, .8);
    background: rgba(255, 214, 120, .08);
}

.pub-category-icon {
    font-size: 28px;
    line-height: 1;
}

.pub-category-card strong {
    color: #fff0bd;
    font-size: 17px;
}

.pub-category-card span:not(.pub-category-icon) {
    opacity: .84;
    line-height: 1.35;
}

.pub-category-card em {
    margin-top: auto;
    opacity: .7;
    font-style: normal;
    font-size: 12px;
}

.pub-search-form,
.pub-moderation-form,
.pub-form {
    display: grid;
    gap: 10px;
}

.pub-search-form {
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
}

.pub-search-form input,
.pub-form input,
.pub-form select,
.pub-form textarea,
.pub-moderation-form select {
    width: 100%;
    border: 1px solid rgba(123, 75, 32, .95);
    border-radius: 10px;
    background: #fff9ea;
    color: #16100a;
    padding: 10px;
    font: inherit;
}

.pub-form textarea {
    min-height: 140px;
    resize: vertical;
}

.pub-form label {
    display: grid;
    gap: 6px;
    text-align: left;
    font-weight: 800;
}

.pub-topic-list {
    display: grid;
    gap: 10px;
}

.pub-topic-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 14px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    text-decoration: none;
}

.pub-topic-row:hover {
    border-color: rgba(255, 214, 120, .85);
    background: rgba(255, 214, 120, .07);
}

.pub-topic-main,
.pub-topic-stats {
    display: grid;
    gap: 5px;
}

.pub-topic-main strong {
    color: #fff0bd;
    overflow-wrap: anywhere;
}

.pub-topic-main span,
.pub-topic-stats span,
.pub-author-meta,
.pub-post-footer,
.pub-back-link {
    color: rgba(255, 245, 220, .72);
    font-size: 12px;
}

.pub-topic-stats {
    text-align: right;
}

.pub-topic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pub-topic-header h2 {
    margin: 8px 0 4px;
    color: #fff0bd;
    overflow-wrap: anywhere;
}

.pub-back-link {
    text-decoration: none;
}

.pub-post-list {
    display: grid;
    gap: 12px;
}

.pub-post-card {
    display: grid;
    gap: 12px;
}

.pub-post-author {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding-bottom: 10px;
}

.pub-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px;
    color: #241104;
    background: linear-gradient(135deg, #ffd777, #a65b1a);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

.pub-post-author strong {
    display: block;
    color: #fff0bd;
}

.pub-post-number {
    opacity: .55;
    font-weight: 900;
}

.pub-post-body {
    line-height: 1.58;
    overflow-wrap: anywhere;
    white-space: normal;
}

.pub-post-footer {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 8px;
}

.pub-muted-link {
    color: #f6c76b;
    word-break: break-all;
}

.pub-mini-list {
    display: grid;
    gap: 8px;
}

.pub-mini-list a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, .045);
}

.pub-mini-list a:hover {
    border-color: rgba(255, 214, 120, .75);
}

.pub-mini-list span {
    opacity: .7;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .pub-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pub-topic-row {
        grid-template-columns: 1fr;
    }

    .pub-topic-stats {
        text-align: left;
    }
}

@media (max-width: 620px) {
    .pub-hero-layout,
    .pub-topic-header {
        display: grid;
    }

    .pub-category-grid,
    .pub-search-form {
        grid-template-columns: 1fr;
    }

    .pub-post-author {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .pub-post-number {
        display: none;
    }

    .pub-mini-list a {
        display: grid;
    }
}

/* =========================================
   Uploaded Avatar Display
   ========================================= */

.fk-avatar {
    position: relative;
    width: 136px;
    height: 136px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 214, 120, .38);
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 213, 120, .20), transparent 34%),
        radial-gradient(circle at 50% 78%, rgba(70, 144, 96, .18), transparent 38%),
        linear-gradient(180deg, rgba(36, 22, 12, .90), rgba(10, 8, 7, .96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        inset 0 -18px 28px rgba(0, 0, 0, .30),
        0 12px 28px rgba(0, 0, 0, .22);
}

.fk-avatar-large {
    width: 190px;
    height: 190px;
}

.fk-avatar-normal {
    width: 136px;
    height: 136px;
}

.fk-avatar-small {
    width: 82px;
    height: 82px;
    border-radius: 10px;
}

.fk-avatar-tiny {
    width: 48px;
    height: 48px;
    border-radius: 9px;
}

.fk-avatar-fallback {
    position: absolute;
    inset: 18%;
    z-index: 1;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #211204;
    background: linear-gradient(135deg, #ffd777, #a65b1a);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
    font-size: 26px;
    font-weight: 900;
}

.avatar-admin-form {
    display: grid;
    gap: 12px;
}

.avatar-admin-form label:not(.avatar-checkbox-row) {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    text-align: left;
    font-weight: 800;
}

.avatar-admin-form input,
.avatar-admin-form select,
.player-search-form input {
    width: 100%;
    border: 1px solid rgba(123, 75, 32, .95);
    border-radius: 10px;
    background: #fff9ea;
    color: #16100a;
    padding: 10px;
    font: inherit;
}

.avatar-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.player-search-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.player-list-modern {
    display: grid;
    gap: 10px;
}

.player-list-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255,255,255,.045);
}

.player-list-row:hover {
    border-color: rgba(255, 214, 120, .82);
    background: rgba(255, 214, 120, .07);
}

.player-list-main {
    display: grid;
    gap: 5px;
}

.player-list-main strong {
    color: #fff0bd;
}

.player-list-main span,
.player-list-meta {
    opacity: .72;
    font-size: 12px;
}

@media (max-width: 720px) {
    .avatar-admin-form label:not(.avatar-checkbox-row),
    .player-search-form,
    .player-list-row {
        grid-template-columns: 1fr;
    }

    .player-list-row {
        justify-items: start;
    }

    .fk-avatar-large {
        width: min(76vw, 280px);
        height: min(76vw, 280px);
    }

    .fk-avatar-normal {
        width: 150px;
        height: 150px;
    }

    .fk-avatar-small {
        width: 92px;
        height: 92px;
    }
}

/* Battle number selection */
.battle-number-input-row {
    align-items: center;
    margin: 12px 0 16px;
}

.battle-number-input-row input[type="text"] {
    width: min(100%, 360px);
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.10);
    color: var(--text-color, #f4ead7);
    font-weight: 700;
}

.battle-number-input-row input[type="text"]::placeholder {
    color: rgba(244,234,215,.65);
}

.battle-number-card {
    position: relative;
}

.battle-number-badge {
    display: inline-flex;
    min-width: 38px;
    height: 28px;
    padding: 0 9px;
    margin-right: 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(0,0,0,.24);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .battle-number-input-row {
        display: block;
    }

    .battle-number-input-row label {
        display: block;
        margin-bottom: 6px;
    }

    .battle-number-input-row input[type="text"] {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }

    .battle-number-badge {
        min-width: 34px;
        height: 26px;
        margin-right: 6px;
    }
}

/* Battle inline defense assignment + preview */
.battle-assignment-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.battle-assignment-control label {
    font-size: .85rem;
    opacity: .9;
}

.battle-defense-slot {
    width: 54px;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255,255,255,.10);
    color: var(--text-color, #f4ead7);
    font-weight: 800;
    text-align: center;
    box-sizing: border-box;
}

.battle-defense-slot::placeholder {
    color: rgba(244,234,215,.55);
}

.battle-assignment-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.battle-assignment-toolbar .btn-small,
.battle-assignment-toolbar button {
    margin: 0;
}


@media (max-width: 760px) {
    .battle-assignment-control {
        width: 100%;
        justify-content: flex-start;
        margin-top: 6px;
    }

    .battle-defense-slot {
        width: 72px;
        min-height: 36px;
        font-size: 16px;
    }
}

/* Mobile compact creature rows
   Keeps creature rows readable on small screens without wrapping every field onto new lines. */
@media (max-width: 760px) {
    .compact-creature-list {
        gap: 6px;
    }

    .compact-creature-list .creature-card,
    .compact-creature-card {
        padding: 6px 7px;
        overflow: hidden;
    }

    .compact-creature-line {
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, .92fr) 28px 48px minmax(0, .86fr) minmax(0, .76fr) max-content;
        align-items: center;
        column-gap: 5px;
        row-gap: 0;
        flex-wrap: nowrap;
        width: 100%;
        min-width: 0;
        font-size: .76rem;
        line-height: 1.15;
    }

    .compact-creature-col,
    .compact-creature-actions {
        min-width: 0;
    }

    .compact-creature-name-col,
    .compact-creature-meta-col,
    .compact-creature-level-col,
    .compact-creature-stats-col,
    .compact-creature-defense-col,
    .compact-creature-item-col,
    .compact-creature-actions {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .compact-creature-name-col {
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .compact-creature-name-col strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .compact-creature-level-col,
    .compact-creature-stats-col {
        text-align: right;
    }

    .compact-creature-defense-col {
        font-size: .70rem;
    }

    .compact-creature-item-col {
        font-size: .72rem;
    }

    .compact-creature-actions {
        display: inline-flex;
        justify-content: flex-end;
        align-items: center;
        gap: 4px;
        font-size: .72rem;
    }

    .compact-creature-actions .inline-form {
        display: inline;
    }

    .compact-creature-actions .link-button,
    .compact-creature-actions a {
        font-size: inherit;
    }

    .compact-creature-item-effect {
        margin-top: 4px;
        font-size: .72rem;
        line-height: 1.2;
    }

    .battle-number-badge {
        min-width: 28px;
        height: 22px;
        padding: 0 6px;
        margin-right: 2px;
        font-size: .72rem;
    }

    .battle-assignment-control {
        width: auto;
        justify-content: flex-end;
        margin-top: 0;
        gap: 3px;
    }

    .battle-assignment-control label {
        display: none;
    }

    .battle-defense-slot {
        width: 40px;
        min-height: 26px;
        padding: 3px 5px;
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .compact-creature-list .creature-card,
    .compact-creature-card {
        padding: 5px 6px;
    }

    .compact-creature-line {
        grid-template-columns: minmax(0, 1.30fr) minmax(0, .82fr) 24px 43px minmax(0, .78fr) minmax(0, .62fr) max-content;
        column-gap: 4px;
        font-size: .68rem;
    }

    .compact-creature-defense-col,
    .compact-creature-item-col,
    .compact-creature-actions,
    .compact-creature-item-effect {
        font-size: .66rem;
    }

    .battle-number-badge {
        min-width: 24px;
        height: 20px;
        padding: 0 5px;
        font-size: .66rem;
    }

    .battle-defense-slot {
        width: 36px;
        min-height: 24px;
        font-size: 13px;
    }
}

/* Mobile readable creature rows
   Uses stable 2-line summaries instead of shrinking every field into one row. */
.fk-creature-list-stacked {
    display: grid;
    gap: 10px;
}

.fk-creature-stacked-card {
    padding: 10px 12px;
}

.fk-creature-summary {
    display: grid;
    gap: 6px;
}

.fk-creature-summary[role="button"] {
    cursor: pointer;
}

.fk-creature-summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.fk-creature-title,
.fk-creature-meta,
.fk-creature-line-stats span,
.fk-creature-item-name {
    min-width: 0;
}

.fk-creature-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}

.fk-creature-meta {
    text-align: right;
}

.fk-creature-line-stats {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.fk-creature-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fk-creature-action-panel {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(176, 101, 23, .35);
}

.fk-creature-actions-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.fk-creature-item-effect {
    margin-top: 4px;
}

.fk-defense-assignment-panel,
.fk-defense-status-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 760px) {
    .fk-creature-stacked-card {
        padding: 9px 10px;
        overflow: visible;
    }

    .fk-creature-summary-line {
        gap: 10px;
        font-size: inherit;
        line-height: 1.35;
    }

    .fk-creature-line-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
    }

    .fk-creature-line-stats {
        display: grid;
        grid-template-columns: max-content max-content minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        column-gap: 8px;
        row-gap: 2px;
        white-space: nowrap;
    }

    .fk-creature-title strong,
    .fk-creature-meta,
    .fk-creature-item-name,
    .fk-creature-line-stats span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fk-creature-meta {
        text-align: right;
    }

    .fk-creature-action-panel {
        display: none;
    }

    .fk-creature-stacked-card.is-expanded .fk-creature-action-panel,
    .fk-defense-assignment-panel,
    .fk-defense-status-panel {
        display: flex;
    }

    .fk-creature-stacked-card.is-expanded .fk-creature-action-panel {
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
    }

    .fk-creature-actions-row,
    .fk-creature-actions-row .inline-form,
    .fk-creature-actions-row .link-button,
    .fk-creature-actions-row a,
    .fk-creature-item-effect,
    .fk-defense-assignment-panel,
    .fk-defense-status-panel {
        font-size: inherit;
        line-height: 1.35;
    }

    .fk-defense-assignment-panel {
        margin-top: 7px;
        padding-top: 7px;
        border-top: 1px solid rgba(176, 101, 23, .35);
    }

    .fk-defense-assignment-panel .battle-assignment-control {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .fk-defense-assignment-panel .battle-assignment-control label {
        display: inline;
    }

    .fk-defense-assignment-panel .battle-defense-slot {
        width: 54px;
        min-height: 30px;
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .fk-creature-stacked-card {
        padding: 8px 9px;
    }

    .fk-creature-line-main {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    }

    .fk-creature-line-stats {
        grid-template-columns: max-content max-content minmax(0, 1.25fr) minmax(0, .90fr);
        column-gap: 7px;
    }

    .fk-creature-summary-line,
    .fk-creature-actions-row,
    .fk-creature-actions-row .link-button,
    .fk-creature-actions-row a,
    .fk-creature-item-effect,
    .fk-defense-assignment-panel,
    .fk-defense-status-panel {
        font-size: inherit;
    }
}

@media (max-width: 760px) {
    .fk-defense-assignment-panel .compact-creature-actions,
    .fk-defense-status-panel .compact-creature-actions {
        font-size: inherit;
        line-height: 1.35;
    }
}

/* Battle launch available creature rows */
.fk-battle-attack-card .battle-number-badge {
    flex: 0 0 auto;
}

.fk-battle-attack-detail {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .fk-battle-attack-card .fk-creature-title {
        min-width: 0;
    }

    .fk-battle-attack-card .battle-number-badge {
        min-width: 31px;
        height: 24px;
        padding: 0 7px;
        margin-right: 3px;
    }

    .fk-battle-attack-stats {
        grid-template-columns: max-content max-content minmax(0, 1fr) minmax(0, 1fr);
    }

    .fk-battle-attack-detail {
        display: flex;
        margin-top: 7px;
        padding-top: 7px;
        border-top: 1px solid rgba(176, 101, 23, .35);
        font-size: inherit;
        line-height: 1.35;
    }
}

.battles-title-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.battles-title-bar .mobile-menu {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

@media (min-width: 761px) {
    .battles-title-bar .mobile-menu {
        display: none;
    }
}
@media (max-width: 640px) {
    .invite-action-row {
        gap: 12px;
    }

    .invite-action-row .btn,
    .invite-action-row button {
        min-width: 140px;
    }
}


/* ===== Season-style sidebar refresh ===== */
.sidebar {
    position: sticky;
    top: 12px;
    align-self: start;
}

.fk-menu-shell {
    display: grid;
    gap: 12px;
}

.fk-menu-box {
    border-radius: 18px;
    border: 1px solid rgba(135, 104, 43, .95);
    background:
        linear-gradient(180deg, rgba(17, 26, 34, .98), rgba(13, 20, 27, .98) 35%, rgba(8, 12, 18, .98) 100%);
    box-shadow:
        inset 0 0 30px rgba(255, 197, 88, .05),
        0 10px 24px rgba(0, 0, 0, .28);
}

.fk-menu-box h3 {
    justify-content: flex-start;
    padding: 12px 16px;
    min-height: 42px;
    background: linear-gradient(180deg, rgba(25, 34, 43, .98), rgba(13, 19, 27, .98));
    border-bottom: 1px solid rgba(135, 104, 43, .45);
    color: #d9b45c;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.fk-menu-links {
    display: grid;
}

.fk-menu-link {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 11px 14px !important;
    border-top: 1px solid rgba(135, 104, 43, .16) !important;
    color: #f0e3bf !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.15;
    transition: background .12s ease, transform .12s ease, border-color .12s ease;
}

.fk-menu-link:first-child {
    border-top: 0 !important;
}

.fk-menu-link:hover {
    background: rgba(212, 167, 76, .10) !important;
    transform: translateX(2px);
}

.fk-menu-link.is-active {
    background:
        linear-gradient(180deg, rgba(114, 74, 27, .92), rgba(74, 45, 17, .96));
    color: #fff6da !important;
    box-shadow: inset 3px 0 0 #e2bd67;
}

.fk-menu-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 1;
    opacity: .95;
}

.fk-menu-link-label {
    min-width: 0;
}

.fk-menu-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: linear-gradient(180deg, #bd4d38, #7e2316);
    border: 1px solid rgba(255, 213, 128, .38);
    color: #fff4d6;
    font-size: 12px;
    font-weight: 900;
}

.fk-menu-travel-lock {
    padding: 16px;
    text-align: center;
}

.fk-menu-travel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 10px;
    border-radius: 16px;
    border: 1px solid rgba(135, 104, 43, .48);
    background: rgba(255,255,255,.04);
    font-size: 28px;
}

.fk-menu-travel-lock p,
.fk-menu-travel-lock small,
.fk-menu-travel-lock strong {
    display: block;
}

.fk-menu-travel-lock p {
    margin: 0 0 6px;
}

.fk-menu-travel-lock strong {
    margin-bottom: 6px;
    color: #fff0c9;
}

.fk-menu-travel-lock small {
    margin-bottom: 12px;
    color: #d4c090;
}

.fk-menu-travel-lock form {
    margin: 0 0 10px;
}

.fk-menu-travel-lock form button {
    width: 100%;
}

.fk-menu-links-compact {
    gap: 0;
}

@media (min-width: 761px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 760px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 10px;
    }

    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .58);
        z-index: 1190;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1200;
        display: block;
        width: min(320px, calc(100vw - 46px));
        margin: 0;
        padding: 12px 10px 18px;
        overflow-y: auto;
        background: linear-gradient(180deg, rgba(7, 10, 14, .98), rgba(8, 10, 14, .99));
        border-right: 1px solid rgba(135, 104, 43, .55);
        transform: translateX(-108%);
        transition: transform .18s ease;
        box-shadow: 16px 0 38px rgba(0, 0, 0, .45);
    }

    .menu-open .sidebar {
        transform: translateX(0);
    }

    .mobile-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 10px 12px;
    }

    .fk-menu-shell {
        gap: 10px;
        padding-bottom: 70px;
    }

    .fk-menu-box {
        margin-bottom: 0;
        border-radius: 16px;
    }

    .fk-menu-box h3 {
        font-size: 12px;
        padding: 10px 14px;
    }

    .fk-menu-link {
        min-height: 46px;
        padding: 10px 12px !important;
        font-size: 15px !important;
    }

    .mobile-bottom-menu {
        background: linear-gradient(180deg, rgba(20, 15, 12, .98), rgba(10, 8, 7, .99));
        border-top: 1px solid rgba(135, 104, 43, .56);
    }

    .mobile-bottom-menu a {
        color: #f1dfb4;
    }

    .mobile-bottom-menu a .mobile-icon {
        font-size: 19px;
        margin-bottom: 2px;
    }

    .mobile-bottom-menu a .mobile-label {
        font-size: 11px;
    }
}


/* ===== Full website premium season-style refresh ===== */
:root {
    --fk-panel-blue: #111a22;
    --fk-panel-blue-2: #0b1118;
    --fk-panel-brown: #241713;
    --fk-panel-brown-2: #120c0a;
    --fk-gold: #d9b45c;
    --fk-gold-soft: #f4ddb0;
    --fk-bronze: #7f5120;
    --fk-line: rgba(135, 104, 43, .62);
    --fk-line-soft: rgba(135, 104, 43, .22);
}

body {
    background:
        radial-gradient(circle at 50% 0%, rgba(92, 61, 25, .38), transparent 360px),
        radial-gradient(circle at 80% 12%, rgba(30, 52, 67, .28), transparent 440px),
        linear-gradient(180deg, #07090b 0%, #0c0b0c 42%, #050505 100%);
}

.layout {
    gap: 18px;
}

.content {
    min-width: 0;
}

.content-card,
.menu-box,
.stat-card,
.resource-card,
.creature-card,
.spellbook-tile,
.family-card,
.spell-creature-row,
.notification-card,
.battle-card,
.amulet-card,
.item-card,
.kingdom-card,
.market-card,
.log-card {
    border-color: var(--fk-line) !important;
    background:
        linear-gradient(180deg, rgba(19, 27, 34, .96), rgba(12, 16, 21, .98));
    box-shadow:
        inset 0 1px 0 rgba(255, 225, 153, .07),
        inset 0 0 32px rgba(255, 189, 89, .025),
        0 12px 28px rgba(0, 0, 0, .22);
}

.content-card {
    border-radius: 18px;
}

.content-title,
.menu-box h3 {
    background:
        linear-gradient(180deg, rgba(181, 157, 73, .98), rgba(133, 119, 49, .98));
    border-bottom: 1px solid rgba(61, 39, 18, .88);
    color: #080604;
    text-shadow: 0 1px 0 rgba(255, 237, 175, .22);
    letter-spacing: .04em;
}

.content-title {
    position: relative;
    overflow: hidden;
}

.content-title::before,
.content-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 54px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(35, 22, 10, .7), transparent);
}

.content-title::before {
    left: 12px;
}

.content-title::after {
    right: 12px;
}

.page-intro,
.welcome-text,
.muted {
    color: #d8caa8;
}

a {
    color: #e7bd62;
}

a:hover {
    color: #ffe2a0;
}

button,
.form-row button,
.button,
.btn-small,
.action-links a,
.realm-links a,
.button-group a {
    border-color: rgba(255, 215, 128, .64) !important;
    border-radius: 11px;
    background:
        linear-gradient(180deg, rgba(20, 119, 126, .98), rgba(8, 78, 84, .98));
    color: #fffaf0 !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .16),
        0 7px 16px rgba(0, 0, 0, .25);
}

button:hover,
.button:hover,
.btn-small:hover,
.action-links a:hover,
.realm-links a:hover,
.button-group a:hover {
    filter: brightness(1.10);
    transform: translateY(-1px);
}

input,
select,
textarea,
.form-row input,
.form-row select,
.form-row textarea {
    border-color: rgba(168, 129, 55, .76) !important;
    border-radius: 10px;
    background: #fff7e7 !important;
    color: #080605 !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.18);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--fk-line-soft);
    border-radius: 14px;
    background: rgba(0,0,0,.16);
}

th,
td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--fk-line-soft);
}

th {
    color: var(--fk-gold-soft);
    background: rgba(255,214,120,.07);
    font-weight: 900;
}

tr:last-child td {
    border-bottom: 0;
}

.stat-card,
.resource-card {
    border-radius: 14px;
    background:
        radial-gradient(circle at top right, rgba(255,214,120,.08), transparent 55%),
        linear-gradient(180deg, rgba(22, 30, 38, .94), rgba(12, 15, 19, .98));
}

.stat-title,
.resource-title {
    color: #cbb783;
    opacity: 1;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
}

.stat-value,
.resource-value {
    color: #fff2c9;
}

.creature-card,
.spell-creature-row,
.family-card,
.spellbook-tile {
    border-radius: 15px;
    background:
        linear-gradient(180deg, rgba(21, 26, 31, .9), rgba(13, 14, 17, .94));
}

.creature-card:hover,
.spellbook-tile:hover,
.family-card:hover {
    border-color: rgba(217, 180, 92, .82) !important;
    background:
        linear-gradient(180deg, rgba(35, 34, 28, .95), rgba(16, 16, 18, .98));
}

.alert,
.success,
.error,
.message,
.success-box,
.error-box {
    border-radius: 15px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .07),
        0 8px 18px rgba(0,0,0,.2);
}

.resource-strip,
.amulet-stats,
.creature-stats,
.creature-defenses,
.spell-creature-stats {
    gap: 8px;
}

.resource-pill,
.creature-stats div,
.creature-defenses span,
.spell-creature-stats div,
.amulet-stats div {
    border-color: var(--fk-line-soft) !important;
    border-radius: 10px;
    background: rgba(255, 255, 255, .055);
}

.footer-donation-status {
    border-radius: 18px;
    border-color: rgba(135,104,43,.5);
    background:
        radial-gradient(circle at top center, rgba(217,180,92,.12), transparent 45%),
        linear-gradient(180deg, rgba(14, 16, 18, .96), rgba(5, 6, 8, .98));
}

.fk-menu-link-icon {
    width: 26px;
    height: 26px;
}

.fk-menu-link-img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.5));
}

.fk-menu-link-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

@media (max-width: 760px) {
    .content-card {
        border-radius: 15px;
    }

    .content-title::before,
    .content-title::after {
        width: 28px;
    }

    .dashboard-grid,
    .resource-grid,
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 7px 8px;
    }
}

@media (max-width: 420px) {
    .dashboard-grid,
    .resource-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== Mockup-closer correction layer ===== */
@media (min-width: 761px) {
    body:not(.landing-page) .layout {
        grid-template-columns: 238px minmax(0, 1fr) !important;
        gap: 16px !important;
        max-width: 1440px !important;
        align-items: start !important;
    }

    body:not(.landing-page) .sidebar {
        width: 238px !important;
        min-width: 238px !important;
        max-width: 238px !important;
    }
}

body:not(.landing-page) .sidebar {
    z-index: 20 !important;
}

body:not(.landing-page) .sidebar .fk-menu-shell {
    display: grid !important;
    gap: 0 !important;
    padding: 8px !important;
    border: 1px solid rgba(128, 96, 42, .78) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(180deg, rgba(16, 25, 32, .98), rgba(9, 14, 20, .99)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 225, 150, .07),
        0 14px 32px rgba(0, 0, 0, .34) !important;
}

body:not(.landing-page) .sidebar .menu-box,
body:not(.landing-page) .sidebar .fk-menu-box {
    margin: 0 0 12px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
}

body:not(.landing-page) .sidebar .fk-menu-box:last-child {
    margin-bottom: 0 !important;
}

body:not(.landing-page) .sidebar .menu-box h3,
body:not(.landing-page) .sidebar .fk-menu-box h3 {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 34px !important;
    margin: 0 0 5px !important;
    padding: 8px 10px !important;
    border: 1px solid rgba(226, 189, 103, .58) !important;
    border-radius: 8px !important;
    background:
        linear-gradient(180deg, rgba(126, 76, 27, .99), rgba(67, 38, 14, .99)) !important;
    color: #fff0c0 !important;
    text-align: center !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, .62),
        0 0 10px rgba(226, 189, 103, .18) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 171, .12),
        0 3px 8px rgba(0, 0, 0, .28) !important;
}

body:not(.landing-page) .sidebar .menu-box h3::before,
body:not(.landing-page) .sidebar .menu-box h3::after,
body:not(.landing-page) .sidebar .fk-menu-box h3::before,
body:not(.landing-page) .sidebar .fk-menu-box h3::after {
    content: '' !important;
    display: block !important;
    width: 18px !important;
    height: 1px !important;
    margin: 0 8px !important;
    flex: 0 0 18px !important;
    background: linear-gradient(90deg, transparent, rgba(255, 231, 170, .64)) !important;
}

body:not(.landing-page) .sidebar .menu-box h3::after,
body:not(.landing-page) .sidebar .fk-menu-box h3::after {
    background: linear-gradient(90deg, rgba(255, 231, 170, .64), transparent) !important;
}

body:not(.landing-page) .sidebar .fk-menu-links {
    display: grid !important;
    gap: 0 !important;
    border: 1px solid rgba(128, 96, 42, .18) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: rgba(0, 0, 0, .16) !important;
}

body:not(.landing-page) .sidebar .menu-box a,
body:not(.landing-page) .sidebar .fk-menu-link {
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: 41px !important;
    padding: 7px 9px !important;
    border: 0 !important;
    border-top: 1px solid rgba(128, 96, 42, .14) !important;
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(16, 24, 31, .92), rgba(10, 15, 21, .94)) !important;
    color: #f0e3bf !important;
    text-align: left !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    box-shadow: none !important;
}

body:not(.landing-page) .sidebar .fk-menu-link:first-child {
    border-top: 0 !important;
}

body:not(.landing-page) .sidebar .fk-menu-link:hover {
    transform: none !important;
    background:
        linear-gradient(180deg, rgba(42, 39, 30, .96), rgba(18, 22, 24, .98)) !important;
    color: #ffe5a6 !important;
}

body:not(.landing-page) .sidebar .fk-menu-link.is-active {
    background:
        linear-gradient(180deg, rgba(97, 58, 21, .98), rgba(57, 34, 15, .98)) !important;
    color: #fff3cf !important;
    box-shadow:
        inset 3px 0 0 #e2bd67,
        inset 0 1px 0 rgba(255, 231, 160, .09) !important;
}

body:not(.landing-page) .sidebar .fk-menu-link-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
}

body:not(.landing-page) .sidebar .fk-menu-link-img {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    filter:
        drop-shadow(0 1px 0 rgba(255, 224, 145, .18))
        drop-shadow(0 2px 2px rgba(0, 0, 0, .65)) !important;
}

body:not(.landing-page) .sidebar .fk-menu-link-symbol {
    display: inline-flex !important;
    width: 24px !important;
    height: 24px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

body:not(.landing-page) .sidebar .fk-menu-link-label {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body:not(.landing-page) .content-card {
    border: 1px solid rgba(128, 96, 42, .62) !important;
    border-radius: 14px !important;
    background:
        radial-gradient(circle at top right, rgba(36, 61, 72, .13), transparent 45%),
        linear-gradient(180deg, rgba(9, 15, 21, .97), rgba(6, 10, 14, .99)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 231, 160, .06),
        0 14px 34px rgba(0, 0, 0, .25) !important;
}

body:not(.landing-page) .content-title {
    min-height: 50px !important;
    margin-bottom: 16px !important;
    background:
        linear-gradient(180deg, rgba(29, 42, 51, .99), rgba(13, 20, 27, .99)) !important;
    border-bottom: 1px solid rgba(128, 96, 42, .55) !important;
    color: #f1d084 !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    letter-spacing: .055em !important;
    text-transform: none !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .55) !important;
}

body:not(.landing-page) .content-title::before,
body:not(.landing-page) .content-title::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    width: 42px !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, rgba(217, 180, 92, .44), transparent) !important;
}

body:not(.landing-page) .content-title::before {
    left: 18px !important;
}

body:not(.landing-page) .content-title::after {
    right: 18px !important;
}

body:not(.landing-page) .stat-card,
body:not(.landing-page) .resource-card,
body:not(.landing-page) .creature-card,
body:not(.landing-page) .spellbook-tile,
body:not(.landing-page) .family-card,
body:not(.landing-page) .spell-creature-row {
    border: 1px solid rgba(128, 96, 42, .5) !important;
    border-radius: 13px !important;
    background:
        linear-gradient(180deg, rgba(18, 25, 30, .95), rgba(9, 13, 17, .98)) !important;
}

body:not(.landing-page) .stat-title,
body:not(.landing-page) .resource-title {
    color: #d9c078 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: .055em !important;
}

body:not(.landing-page) .stat-value,
body:not(.landing-page) .resource-value {
    color: #fff4cc !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .45) !important;
}

body:not(.landing-page) button,
body:not(.landing-page) .button,
body:not(.landing-page) .btn-small,
body:not(.landing-page) .form-row button {
    background:
        linear-gradient(180deg, rgba(25, 119, 128, .98), rgba(7, 73, 80, .98)) !important;
    border-color: rgba(226, 189, 103, .74) !important;
    border-radius: 10px !important;
    color: #fffaf0 !important;
}

@media (max-width: 760px) {
    body:not(.landing-page) .layout {
        grid-template-columns: 1fr !important;
        padding: 0 10px !important;
    }

    body:not(.landing-page).menu-open::before {
        z-index: 1190 !important;
    }

    body:not(.landing-page) .sidebar {
        position: fixed !important;
        display: block !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(300px, calc(100vw - 48px)) !important;
        max-width: min(300px, calc(100vw - 48px)) !important;
        padding: 9px !important;
        margin: 0 !important;
        background: linear-gradient(180deg, rgba(7, 11, 16, .99), rgba(5, 7, 10, .99)) !important;
        border-right: 1px solid rgba(128, 96, 42, .52) !important;
        transform: translateX(-108%) !important;
        transition: transform .18s ease !important;
        z-index: 1200 !important;
        overflow-y: auto !important;
    }

    body:not(.landing-page).menu-open .sidebar {
        transform: translateX(0) !important;
    }

    body:not(.landing-page) .sidebar .fk-menu-shell {
        padding-bottom: 80px !important;
    }

    body:not(.landing-page) .mobile-menu {
        display: inline-flex !important;
    }

    body:not(.landing-page) .content-title {
        min-height: 44px !important;
        font-size: 18px !important;
    }

    body:not(.landing-page) .content-title::before,
    body:not(.landing-page) .content-title::after {
        width: 24px !important;
    }
}


/* ===== Mobile menu icon size emergency fix =====
   Prevents local SVG menu icons from rendering as huge blocks on mobile or cached mixed CSS states. */
html body:not(.landing-page) aside.sidebar .fk-menu-link,
html body:not(.landing-page) .sidebar .fk-menu-link {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    text-align: left !important;
}

html body:not(.landing-page) aside.sidebar .fk-menu-link-icon,
html body:not(.landing-page) .sidebar .fk-menu-link-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    overflow: visible !important;
    flex: 0 0 32px !important;
}

html body:not(.landing-page) aside.sidebar .fk-menu-link-icon img,
html body:not(.landing-page) aside.sidebar img.fk-menu-link-img,
html body:not(.landing-page) .sidebar .fk-menu-link-icon img,
html body:not(.landing-page) .sidebar img.fk-menu-link-img,
html body:not(.landing-page) img.fk-menu-link-img {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    object-fit: contain !important;
    margin: 0 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .62)) !important;
}

html body:not(.landing-page) aside.sidebar .fk-menu-link-symbol,
html body:not(.landing-page) .sidebar .fk-menu-link-symbol {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

html body:not(.landing-page) aside.sidebar .fk-menu-link-label,
html body:not(.landing-page) .sidebar .fk-menu-link-label {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

@media (max-width: 760px) {
    html body:not(.landing-page) .sidebar {
        width: min(300px, calc(100vw - 48px)) !important;
        max-width: min(300px, calc(100vw - 48px)) !important;
    }

    html body:not(.landing-page) .sidebar .fk-menu-shell {
        padding: 8px 8px 84px !important;
    }

    html body:not(.landing-page) .sidebar .fk-menu-link {
        min-height: 40px !important;
        padding: 7px 9px !important;
        font-size: 14px !important;
    }
}


/* ===== Mobile sidebar scroll fix =====
   The slide-in menu must scroll independently while the page behind it is locked. */
@media (max-width: 760px) {
    html body:not(.landing-page).menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    html body:not(.landing-page) .sidebar {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
        padding-bottom: 96px !important;
    }

    html body:not(.landing-page) .sidebar .fk-menu-shell {
        min-height: auto !important;
        padding-bottom: 110px !important;
    }

    html body:not(.landing-page) .sidebar .fk-menu-box:last-child {
        margin-bottom: 28px !important;
    }

    html body:not(.landing-page).menu-open::before {
        pointer-events: auto !important;
    }

    html body:not(.landing-page).menu-open .sidebar {
        pointer-events: auto !important;
    }
}


/* ===== Bronze content title variation =====
   Makes page/card titles match the active menu bronze style instead of the dark blue header. */
body:not(.landing-page) .content-card > .content-title,
body:not(.landing-page) main.content .content-title {
    background:
        linear-gradient(180deg, rgba(126, 76, 27, .98), rgba(79, 45, 16, .99)) !important;
    border-bottom: 1px solid rgba(226, 189, 103, .52) !important;
    color: #fff0c0 !important;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, .62),
        0 0 12px rgba(226, 189, 103, .28) !important;
}

body:not(.landing-page) .content-card > .content-title::before,
body:not(.landing-page) .content-card > .content-title::after,
body:not(.landing-page) main.content .content-title::before,
body:not(.landing-page) main.content .content-title::after {
    background:
        linear-gradient(90deg, transparent, rgba(255, 224, 145, .55), transparent) !important;
}

body:not(.landing-page) .content-card > .content-title + *,
body:not(.landing-page) main.content .content-title + * {
    margin-top: 0;
}


/* ===== Orb navigation and Shard Pool mobile layout ===== */
.orb-navigation {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.orb-navigation .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}

.shard-pool-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.shard-pool-summary-item {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid rgba(128, 96, 42, .5);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(18, 25, 30, .95), rgba(9, 13, 17, .98));
    text-align: center;
}

.shard-pool-summary-item span,
.shard-pool-summary-item strong {
    display: block;
}

.shard-pool-summary-item span {
    color: #d9c078;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.shard-pool-summary-item strong {
    margin-top: 4px;
    color: #fff4cc;
    font-size: 18px;
    line-height: 1.15;
}

.shard-pool-form {
    margin-top: 14px;
}

.shard-pool-resource-list {
    display: grid;
    gap: 10px;
}

.shard-pool-resource-row {
    display: grid;
    grid-template-columns: minmax(145px, 190px) minmax(160px, 1fr) minmax(120px, auto);
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(128, 96, 42, .5);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(18, 25, 30, .92), rgba(9, 13, 17, .96));
}

.shard-pool-resource-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #fff0c0;
}

.shard-pool-resource-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shard-pool-resource-icon {
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
}

.shard-pool-resource-row input {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.shard-pool-available {
    display: block;
    color: #bfae86;
    font-size: 11px;
    line-height: 1.2;
    text-align: right;
    text-transform: uppercase;
}

.shard-pool-available strong {
    display: block;
    margin-top: 3px;
    color: #fff4cc;
    font-size: 15px;
    letter-spacing: normal;
}

.shard-pool-help {
    margin: 14px 0 0;
    text-align: center;
}

.shard-pool-submit {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.shard-pool-submit button {
    width: auto;
    min-width: 190px;
}

@media (max-width: 760px) {
    .orb-navigation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shard-pool-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px;
    }

    .shard-pool-summary-item {
        padding: 9px 6px;
    }

    .shard-pool-summary-item span {
        font-size: 9px;
    }

    .shard-pool-summary-item strong {
        font-size: 15px;
    }

    .shard-pool-resource-row {
        grid-template-columns: minmax(115px, 145px) minmax(0, 1fr);
        gap: 8px 10px;
    }

    .shard-pool-available {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        text-align: right;
    }

    .shard-pool-available strong {
        display: inline;
        margin-top: 0;
    }
}

@media (max-width: 420px) {
    .orb-navigation {
        grid-template-columns: 1fr;
    }

    .shard-pool-resource-row {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .shard-pool-resource-name strong {
        white-space: normal;
    }

    .shard-pool-available {
        grid-column: auto;
        justify-content: flex-start;
        text-align: left;
    }

    .shard-pool-submit button {
        width: 100%;
        min-width: 0;
    }
}


/* =========================================
   Kingdom treasury: permanent shared funds
   ========================================= */

.kingdom-treasury-overview {
    align-items: stretch;
}

.kingdom-treasury-total-card {
    grid-column: 1 / -1;
    min-height: 118px;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 215, 128, .17), transparent 55%),
        linear-gradient(180deg, rgba(88, 52, 18, .96), rgba(44, 24, 9, .96));
    border-color: rgba(236, 185, 86, .9);
}

.kingdom-treasury-total-card .stat-value {
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    color: #ffe6a4;
}

.kingdom-treasury-card-note {
    display: block;
    margin-top: 6px;
    font-size: .86rem;
    opacity: .78;
    text-align: center;
}

.kingdom-treasury-resource-card {
    min-width: 0;
}

.kingdom-treasury-resource-title,
.treasury-resource-name {
    display: flex;
    align-items: center;
    gap: 7px;
}

.kingdom-treasury-resource-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.45em;
    min-width: 1.45em;
    line-height: 1;
    font-size: 1.12em;
}

.kingdom-treasury-legacy-note {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(236, 185, 86, .45);
    border-radius: 10px;
    background: rgba(236, 185, 86, .07);
}

@media (max-width: 640px) {
    .kingdom-treasury-total-card {
        min-height: 100px;
    }

    .kingdom-treasury-card-note {
        font-size: .8rem;
    }
}

/* =========================================
   Dashboard farmers: compact table + mobile assignment
   ========================================= */

.farmer-grid {
    display: grid;
    width: min(100%, 760px);
    margin: 18px auto 0;
    gap: 6px;
}

.farmer-card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(105px, .85fr) minmax(95px, .75fr);
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(205, 155, 73, .22);
}

.farmer-card:last-child {
    border-bottom: 0;
}

.farmer-card > br {
    display: none;
}

.farmer-resource-name,
.farmer-count,
.farmer-income {
    min-width: 0;
    line-height: 1.35;
}

.farmer-resource-name {
    font-weight: 700;
    text-align: left;
}

.farmer-count {
    text-align: center;
    white-space: nowrap;
}

.farmer-income {
    text-align: right;
    white-space: normal;
}

.farmer-bonus-percent {
    white-space: nowrap;
}

.farmer-assignment-form {
    margin-top: 26px;
    text-align: center;
}

.farmer-assignment-form h3 {
    margin-bottom: 12px;
}

.farmer-assignment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    width: min(100%, 720px);
    margin: 18px auto;
}

.farmer-assignment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid rgba(205, 155, 73, .28);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    text-align: left;
}

.farmer-assignment-row > span {
    min-width: 0;
    font-weight: 700;
}

.farmer-assignment-row input[type="number"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
}

@media (max-width: 640px) {
    .farmer-grid {
        width: 100%;
        margin-top: 14px;
        gap: 2px;
    }

    .farmer-card {
        grid-template-columns: minmax(0, 1.2fr) auto auto;
        gap: 8px;
        padding: 8px 4px;
        font-size: clamp(.82rem, 3.6vw, .96rem);
    }

    .farmer-resource-name {
        overflow-wrap: anywhere;
    }

    .farmer-assignment-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        width: 100%;
        margin: 16px auto;
    }

    .farmer-assignment-row {
        grid-template-columns: minmax(0, 1fr) minmax(92px, 118px);
        gap: 10px;
        padding: 9px 10px;
    }

    .farmer-assignment-form > button {
        width: min(100%, 320px);
    }
}

@media (max-width: 380px) {
    .farmer-card {
        gap: 5px;
        font-size: .78rem;
    }

    .farmer-assignment-row {
        grid-template-columns: minmax(0, 1fr) 92px;
    }
}

/* =========================================
   Magic Skills: mobile spend action alignment
   ========================================= */

@media (max-width: 640px) {
    .magic-skill-spend {
        grid-column: 1 / -1;
        width: 100%;
        box-sizing: border-box;
    }

    .magic-skill-spend-form {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        width: 100%;
        margin-top: 7px;
    }

    .magic-skill-spend-form select {
        flex: 0 0 72px;
        width: 72px;
        min-width: 72px;
        margin: 0;
    }

    .magic-skill-spend-form button {
        flex: 0 1 180px;
        width: min(180px, calc(100% - 82px));
        margin: 0;
    }
}

/* Defense attack overview and quick auto-defense */
.fk-defense-attack-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
    margin: 0 0 18px;
}

.fk-defense-attack-details {
    min-width: 0;
    text-align: left;
    line-height: 1.45;
}

.fk-defense-quick-actions {
    display: grid;
    gap: 8px;
    justify-items: stretch;
}

.fk-defense-auto-defend-form {
    margin: 0;
    text-align: right;
}

.fk-defense-quick-actions .fk-defense-auto-defend-button {
    width: 100%;
}

.fk-defense-auto-defend-button {
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .fk-defense-attack-overview {
        gap: 10px;
    }

    .fk-defense-auto-defend-button {
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
    }
}


/* Creature order controls */
.fk-creature-order-help {
    margin: 0 0 12px;
}

.fk-creature-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 25px;
    padding: 0 7px;
    border: 1px solid rgba(218, 176, 89, 0.72);
    border-radius: 999px;
    background: rgba(55, 36, 21, 0.82);
    color: #f3d28c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.fk-creature-order-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px auto;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(204, 168, 103, 0.22);
}

.fk-creature-order-form label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.fk-creature-order-form input[type="number"] {
    width: 100%;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.fk-creature-order-form button {
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .fk-creature-order-form {
        grid-template-columns: minmax(0, 1fr) 70px;
    }

    .fk-creature-order-form button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* ===== VIP bottom quick menu on tablet and desktop =====
   Mobile keeps the existing full-width bar. Wider screens use a compact,
   centered fixed bar so the same saved five shortcuts remain available. */
@media (min-width: 761px) {
    body.has-mobile-bottom-menu {
        padding-bottom: 96px;
    }

    body.has-mobile-bottom-menu .mobile-bottom-menu {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: 12px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        width: min(760px, calc(100vw - 40px));
        max-width: 760px;
        transform: translateX(-50%);
        overflow: hidden;
        border: 1px solid rgba(135, 104, 43, .72);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(20, 15, 12, .98), rgba(10, 8, 7, .99));
        box-shadow: 0 10px 30px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 224, 154, .08);
        z-index: 9999;
    }

    body.has-mobile-bottom-menu .mobile-bottom-menu a {
        display: flex;
        min-width: 0;
        min-height: 58px;
        padding: 7px 10px 8px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        border-left: 1px solid rgba(255, 255, 255, .10);
        color: #f1dfb4;
        text-align: center;
        text-decoration: none;
        transition: background .15s ease, color .15s ease;
    }

    body.has-mobile-bottom-menu .mobile-bottom-menu a:first-child {
        border-left: 0;
    }

    body.has-mobile-bottom-menu .mobile-bottom-menu a:hover,
    body.has-mobile-bottom-menu .mobile-bottom-menu a:focus-visible {
        background: rgba(166, 108, 42, .24);
        color: #fff2c8;
        outline: none;
    }

    body.has-mobile-bottom-menu .mobile-bottom-menu .mobile-icon {
        display: block;
        font-size: 20px;
        line-height: 1;
    }

    body.has-mobile-bottom-menu .mobile-bottom-menu .mobile-label {
        display: block;
        width: 100%;
        overflow: hidden;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.has-mobile-bottom-menu .pwa-install-wrap {
        bottom: 86px;
    }
}

/* ===== Mining System V1 ===== */
.mining-rule-grid,
.mining-mine-grid,
.mining-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}
.mining-rule,
.mining-mine-card,
.mining-expedition,
.mining-history-card {
    border: 1px solid rgba(117, 78, 30, .35);
    border-radius: 10px;
    padding: 12px;
    background:
        radial-gradient(circle at top right, rgba(36, 61, 72, .12), transparent 50%),
        linear-gradient(180deg, rgba(16, 23, 29, .94), rgba(9, 13, 18, .97));
}
.mining-mine-card h3,
.mining-expedition h3,
.mining-history-card h3 {
    margin: 0 0 7px;
}
.mining-mine-card p,
.mining-expedition p,
.mining-history-card p {
    margin: 5px 0;
}
.mining-unknown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(217, 180, 92, .12);
    border: 1px solid rgba(217, 180, 92, .25);
    font-weight: 700;
}
.mining-creature-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
    margin: 12px 0;
}
.mining-creature-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(117, 78, 30, .28);
    border-radius: 8px;
    cursor: pointer;
}
.mining-creature-option input {
    margin-top: 4px;
}
.mining-creature-option small {
    display: block;
    opacity: .78;
}
.mining-expedition-list {
    display: grid;
    gap: 12px;
}
.mining-expedition-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.mining-countdown {
    font-weight: 800;
    white-space: nowrap;
}
.mining-assigned-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}
.mining-assigned-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid rgba(117, 78, 30, .18);
}
.mining-assigned-row:first-child {
    border-top: 0;
}
.mining-recalled {
    opacity: .6;
}
.mining-reward-list {
    margin: 7px 0 0;
    padding-left: 18px;
}
.mining-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .mining-assigned-row {
        align-items: flex-start;
    }
}

.admin-mining-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}
.admin-mining-field {
    display: grid;
    gap: 5px;
}
.admin-mining-field input[type="number"] {
    width: 100%;
    box-sizing: border-box;
}
.admin-mining-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.admin-mining-table-wrap {
    overflow-x: auto;
}
.admin-mining-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-mining-table th,
.admin-mining-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(117, 78, 30, .24);
    text-align: left;
    vertical-align: top;
}

.creature-status-mining {
    box-shadow: inset 4px 0 0 rgba(120, 87, 35, .7);
}

/* Battle multi-creature checkbox selection */
.battle-creature-select-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(187, 160, 94, 0.42);
    border-radius: 10px;
    background: rgba(20, 23, 28, 0.72);
}

.battle-creature-select-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.battle-creature-select-count {
    color: #d9d9d9;
    font-size: 0.92rem;
}

.battle-creature-select-count strong {
    color: #f0cf78;
}

.battle-selectable-creature-card {
    position: relative;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.battle-selectable-creature-card:hover {
    border-color: rgba(206, 178, 102, 0.7);
}

.battle-selectable-creature-card.is-selected {
    border-color: #d8b85f;
    background: linear-gradient(180deg, rgba(94, 79, 37, 0.34), rgba(27, 30, 36, 0.92));
    box-shadow: inset 0 0 0 1px rgba(240, 207, 120, 0.34), 0 0 12px rgba(216, 184, 95, 0.15);
}

.battle-creature-checkbox {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 22px;
    height: 22px;
    margin: 0;
    transform: translateY(-50%);
    accent-color: #d8b85f;
    cursor: pointer;
    z-index: 2;
}

.battle-selectable-creature-card .fk-creature-summary,
.battle-selectable-creature-card .fk-creature-action-panel {
    padding-right: 42px;
}

@media (max-width: 700px) {
    .battle-creature-select-toolbar {
        align-items: stretch;
    }

    .battle-creature-select-actions {
        width: 100%;
    }

    .battle-creature-select-actions .btn-small {
        flex: 1 1 0;
        text-align: center;
    }

    .battle-creature-select-count {
        width: 100%;
        text-align: center;
    }

    .battle-creature-checkbox {
        right: 9px;
        width: 24px;
        height: 24px;
    }
}

/* Reusable creature XP disclosure — tap/click the Level badge */
.fk-creature-xp-details {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
    vertical-align: middle;
    color: inherit;
}

.fk-creature-xp-details > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 2px 8px;
    border: 1px solid rgba(196, 157, 75, 0.48);
    border-radius: 999px;
    background: rgba(7, 18, 24, 0.82);
    color: #f0cf78;
    font: inherit;
    font-weight: 800;
    line-height: 1.15;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fk-creature-xp-details > summary::-webkit-details-marker {
    display: none;
}

.fk-creature-xp-details > summary::marker {
    content: '';
}

.fk-creature-xp-details > summary::after {
    content: '＋';
    margin-left: 5px;
    color: #7fd8d2;
    font-size: 0.78em;
}

.fk-creature-xp-details[open] {
    flex: 1 1 100%;
    width: min(100%, 310px);
    z-index: 8;
}

.fk-creature-xp-details[open] > summary {
    border-color: rgba(104, 212, 204, 0.76);
    background: rgba(9, 55, 62, 0.9);
    color: #fff1ba;
}

.fk-creature-xp-details[open] > summary::after {
    content: '−';
}

.fk-creature-xp-panel {
    display: grid;
    width: 100%;
    gap: 6px;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 10px 11px;
    border: 1px solid rgba(188, 145, 57, 0.46);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(14, 27, 34, 0.98), rgba(5, 12, 17, 0.98));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(28, 119, 124, 0.08);
    color: #d8d8d8;
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
}

.fk-creature-xp-heading {
    color: #e9c66a;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.fk-creature-xp-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.fk-creature-xp-line strong {
    color: #fff;
}

.fk-creature-xp-line span {
    color: #9fc8c7;
}

.fk-creature-xp-track {
    display: block;
    width: 100%;
    height: 8px;
    overflow: hidden;
    border: 1px solid rgba(186, 151, 70, 0.35);
    border-radius: 999px;
    background: #34383c;
}

.fk-creature-xp-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #137b83, #55c8c4);
}

.fk-creature-xp-foot {
    color: #c8c8c8;
}

.fk-creature-xp-hint {
    color: #7f8f93;
    font-size: 10px;
}

/* Keep native XP details usable inside selectable label cards. */
label .fk-creature-xp-details {
    position: relative;
    cursor: default;
}

@media (max-width: 700px) {
    .fk-creature-xp-details > summary {
        min-height: 30px;
        padding: 4px 10px;
    }

    .fk-creature-xp-details[open] {
        width: 100%;
        max-width: none;
    }

    .fk-creature-xp-panel {
        font-size: 13px;
        padding: 11px 12px;
    }
}


/* Battles: keep the creature XP disclosure compact and mobile-safe. */
.fk-battle-attack-stats .fk-battle-xp-slot {
    display: contents;
}

.fk-battle-attack-stats .fk-creature-xp-details {
    min-width: 0;
    max-width: 100%;
}

.fk-battle-attack-stats .fk-creature-xp-details[open] {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin-top: 3px;
}

.fk-battle-attack-stats .fk-creature-xp-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    white-space: normal;
    overflow: hidden;
    font-size: .78rem !important;
    line-height: 1.28;
}

.fk-battle-attack-stats .fk-creature-xp-panel > span {
    min-width: 0;
    max-width: 100%;
}

.fk-battle-attack-stats .fk-creature-xp-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 10px;
    width: 100%;
}

.fk-battle-attack-stats .fk-creature-xp-line strong,
.fk-battle-attack-stats .fk-creature-xp-line span,
.fk-battle-attack-stats .fk-creature-xp-foot,
.fk-battle-attack-stats .fk-creature-xp-hint {
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
}

@media (max-width: 760px) {
    .fk-battle-attack-stats {
        display: grid;
        grid-template-columns: max-content max-content minmax(0, 1fr);
        align-items: center;
        gap: 5px 8px;
        width: 100%;
        white-space: normal;
    }

    .fk-battle-attack-stats .fk-battle-item-name {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
        padding-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fk-battle-attack-stats .fk-creature-xp-details > summary {
        min-height: 26px;
        padding: 3px 8px;
        font-size: .82rem;
    }

    .fk-battle-attack-stats .fk-creature-xp-panel {
        margin-top: 5px;
        padding: 9px 10px;
        border-radius: 9px;
        font-size: .76rem !important;
    }

    .fk-battle-attack-stats .fk-creature-xp-heading {
        font-size: .72rem;
    }

    .fk-battle-attack-stats .fk-creature-xp-line {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .fk-battle-attack-stats .fk-creature-xp-line > span {
        color: #9fc8c7;
    }

    .fk-battle-attack-stats .fk-creature-xp-hint {
        display: none;
    }
}

@media (max-width: 420px) {
    .fk-battle-attack-stats {
        grid-template-columns: max-content minmax(0, .8fr) minmax(0, 1.2fr);
        column-gap: 6px;
    }

    .fk-battle-attack-stats .fk-battle-damage-health,
    .fk-battle-attack-stats .fk-battle-defense-summary {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Battles: duplicate launch button above the creature selection list. */
.battle-launch-attack-top {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 14px;
}

.battle-launch-attack-top button {
    min-width: 190px;
}

@media (max-width: 700px) {
    .battle-launch-attack-top {
        display: block;
        margin: 10px 0 12px;
    }

    .battle-launch-attack-top button {
        width: 100%;
        min-width: 0;
    }
}

/* Creatures page: compact XP button with modal details.
   Keeps the creature row fixed-height and prevents XP text from overlapping stats. */
.fk-creature-line-stats .fk-creature-xp-trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 54px;
    min-height: 28px;
    margin: 0;
    padding: 2px 8px;
    border: 1px solid rgba(196, 157, 75, 0.48);
    border-radius: 999px;
    background: rgba(7, 18, 24, 0.82);
    box-shadow: none;
    color: #f0cf78;
    font: inherit;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fk-creature-line-stats .fk-creature-xp-trigger:hover,
.fk-creature-line-stats .fk-creature-xp-trigger:focus-visible {
    border-color: rgba(104, 212, 204, 0.8);
    background: rgba(9, 55, 62, 0.92);
    color: #fff1ba;
    outline: none;
}

.fk-creature-xp-modal-card {
    width: min(92vw, 430px);
}

.fk-creature-xp-modal-name {
    margin-bottom: 14px;
    color: #f4dda1;
    font-size: 1.12rem;
    font-weight: 900;
    text-align: center;
}

.fk-creature-xp-modal-levels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #d9cab0;
    font-size: .92rem;
    font-weight: 800;
}

.fk-creature-xp-modal-track {
    display: block;
    width: 100%;
    height: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(186, 151, 70, .5);
    border-radius: 999px;
    background: #353a3e;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .42);
}

.fk-creature-xp-modal-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #126f78, #51cbc3);
    transition: width .18s ease;
}

.fk-creature-xp-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.fk-creature-xp-modal-grid > div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(180, 139, 57, .34);
    border-radius: 10px;
    background: rgba(4, 13, 18, .55);
}

.fk-creature-xp-modal-grid span,
.fk-creature-xp-modal-grid strong {
    display: block;
}

.fk-creature-xp-modal-grid span {
    margin-bottom: 4px;
    color: #9eaaa9;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fk-creature-xp-modal-grid strong {
    color: #f7efd9;
    overflow-wrap: anywhere;
}

.fk-creature-xp-modal-total {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .fk-creature-line-stats {
        grid-template-columns: max-content max-content minmax(0, 1fr) minmax(0, .9fr);
    }

    .fk-creature-line-stats .fk-creature-xp-trigger {
        min-width: 52px;
        min-height: 30px;
        padding: 3px 7px;
        font-size: .9rem;
    }

    .fk-creature-xp-modal-card {
        width: min(94vw, 410px);
        max-height: calc(100vh - 36px);
        overflow-y: auto;
    }
}

@media (max-width: 420px) {
    .fk-creature-xp-modal-grid {
        grid-template-columns: 1fr;
    }

    .fk-creature-xp-modal-total {
        grid-column: auto;
    }
}


/* Creatures mobile: always keep all four defenses visible.
   XP + damage/health stay on the first row; defenses and item get their own rows. */
.fk-creature-defense-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fk-creature-defense-stat {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .fk-creature-line-stats {
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        column-gap: 12px;
        row-gap: 7px;
        white-space: normal;
    }

    .fk-creature-line-stats .fk-creature-xp-trigger {
        grid-column: 1;
        grid-row: 1;
    }

    .fk-creature-line-stats > span:nth-of-type(1) {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .fk-creature-line-stats .fk-creature-defense-stats {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 7px 14px;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .fk-creature-line-stats .fk-creature-item-name {
        grid-column: 1 / -1;
        grid-row: 3;
        width: 100%;
        overflow: visible;
        text-align: center;
        text-overflow: clip;
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

@media (max-width: 420px) {
    .fk-creature-line-stats {
        grid-template-columns: max-content minmax(0, 1fr);
        column-gap: 9px;
    }

    .fk-creature-line-stats .fk-creature-defense-stats {
        gap: 6px 11px;
    }
}

/* Ith support details */
.fk-battle-ith-bonus {
    display: block;
    width: 100%;
    margin-top: 5px;
    color: #d9c27a;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* Personal Buildings: clearer section and Magic class headings */
.personal-buildings-section-heading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 24px 0 14px;
    padding: 11px 18px;
    overflow: hidden;
    border: 1px solid rgba(174, 116, 39, .72);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(105, 57, 20, .98), rgba(59, 29, 12, .98));
    color: #fff0c4;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .025em;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(34, 14, 4, .95),
        0 0 10px rgba(255, 190, 78, .16);
    box-shadow:
        inset 0 1px 0 rgba(255, 226, 154, .12),
        0 8px 22px rgba(0, 0, 0, .2);
}

.personal-buildings-section-heading::before,
.personal-buildings-section-heading::after {
    content: '';
    flex: 1 1 70px;
    max-width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 185, 83, .72));
}

.personal-buildings-section-heading::after {
    background: linear-gradient(90deg, rgba(240, 185, 83, .72), transparent);
}

.personal-buildings-section-heading-classes {
    margin-top: 30px;
}

.personal-buildings-section-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(238, 187, 84, .42);
    border-radius: 50%;
    background: rgba(5, 7, 9, .42);
    font-size: 16px;
    line-height: 1;
}

.personal-buildings-magic-heading {
    --personal-building-accent: 218, 185, 122;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 18px 0 10px;
    padding: 10px 14px;
    overflow: hidden;
    border: 1px solid rgba(var(--personal-building-accent), .46);
    border-left: 4px solid rgb(var(--personal-building-accent));
    border-radius: 11px;
    background:
        linear-gradient(90deg, rgba(var(--personal-building-accent), .13), rgba(13, 18, 23, .98) 34%, rgba(10, 14, 18, .98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .045),
        0 7px 18px rgba(0, 0, 0, .16);
}

.personal-buildings-magic-heading-earth {
    --personal-building-accent: 196, 190, 179;
}

.personal-buildings-magic-heading-death {
    --personal-building-accent: 239, 102, 48;
}

.personal-buildings-magic-heading-air {
    --personal-building-accent: 176, 188, 210;
}

.personal-buildings-magic-heading-forest {
    --personal-building-accent: 78, 168, 239;
}

.personal-buildings-magic-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(var(--personal-building-accent), .45);
    border-radius: 50%;
    background: rgba(var(--personal-building-accent), .09);
    font-size: 20px;
    line-height: 1;
    box-shadow: inset 0 0 14px rgba(var(--personal-building-accent), .08);
}

.personal-buildings-magic-title {
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-width: 0;
}

.personal-buildings-magic-title strong {
    color: #fff1cf;
    font-size: 18px;
    line-height: 1.2;
}

.personal-buildings-magic-title span {
    color: #d6c7a7;
    font-size: 13px;
    white-space: nowrap;
}

.personal-buildings-main-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(242, 189, 85, .7);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(136, 78, 18, .95), rgba(82, 42, 9, .98));
    color: #ffe7a8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .personal-buildings-section-heading {
        margin: 20px 0 12px;
        padding: 10px 12px;
        font-size: 17px;
    }

    .personal-buildings-section-heading::before,
    .personal-buildings-section-heading::after {
        flex-basis: 24px;
        max-width: 48px;
    }

    .personal-buildings-section-icon {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .personal-buildings-magic-heading {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 9px 11px;
        margin-top: 15px;
        padding: 10px 11px;
    }

    .personal-buildings-magic-icon {
        grid-row: 1 / span 2;
        width: 36px;
        height: 36px;
        font-size: 19px;
    }

    .personal-buildings-magic-title {
        display: grid;
        gap: 2px;
    }

    .personal-buildings-magic-title strong {
        font-size: 17px;
    }

    .personal-buildings-magic-title span {
        font-size: 12px;
    }

    .personal-buildings-main-badge {
        grid-column: 2;
        justify-self: start;
        min-height: 24px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (max-width: 420px) {
    .personal-buildings-section-heading::before,
    .personal-buildings-section-heading::after {
        display: none;
    }
}

/* Settings tabs and email notification preferences */
.settings-tabs {
    display: grid;
    gap: 14px;
}

.settings-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--border, #4a3428);
    border-radius: 10px;
    background: rgba(13, 10, 8, .74);
}

.settings-tab-list button {
    flex: 1 1 150px;
    min-height: 42px;
    margin: 0;
    padding: 9px 13px;
    border: 1px solid rgba(217, 164, 65, .36);
    border-radius: 7px;
    background: rgba(49, 35, 25, .82);
    color: var(--text, #f2e6d0);
    font-weight: 700;
    cursor: pointer;
}

.settings-tab-list button:hover,
.settings-tab-list button:focus-visible {
    border-color: var(--link, #d9a441);
    outline: none;
}

.settings-tab-list button[aria-selected="true"] {
    border-color: var(--link, #d9a441);
    background: linear-gradient(180deg, rgba(130, 75, 28, .98), rgba(83, 43, 16, .98));
    color: #fff4d1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.settings-tab-panel[hidden] {
    display: none !important;
}

.settings-email-options {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.settings-email-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(217, 164, 65, .26);
    border-radius: 9px;
    background: rgba(10, 8, 7, .42);
    cursor: pointer;
}

.settings-email-option:hover {
    border-color: rgba(217, 164, 65, .58);
}

.settings-email-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: #a86424;
}

.settings-email-option span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.settings-email-option strong {
    color: #fff0c7;
    font-size: 15px;
}

.settings-email-option small {
    color: #cbbba1;
    font-size: 13px;
    line-height: 1.45;
}

.settings-email-save-row {
    margin-top: 16px;
}

@media (max-width: 760px) {
    .settings-tab-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-tab-list button {
        width: 100%;
        min-height: 44px;
        padding: 8px;
        font-size: 13px;
    }

    .settings-email-option {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .settings-tab-list {
        grid-template-columns: 1fr;
    }
}

/* Equipped creature item stat preview */
.fk-creature-stat-value.fk-creature-stat-bonus {
    color: #74df8a !important;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(56, 170, 87, .22);
}

.fk-creature-stat-value.fk-creature-stat-penalty {
    color: #ff9a8f !important;
    font-weight: 800;
}

/* Live server clock above the username and level in the top menu. */
.header-user-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.header-server-clock {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    color: #fff5d6;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.header-server-clock-label {
    color: #bda982;
    font-size: 9px !important;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.header-server-clock time {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: #fff5d6;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .025em;
}

.header-server-clock-date,
.header-server-clock-time,
.header-server-clock-zone {
    font: inherit;
    line-height: inherit;
}

.header-server-clock-zone {
    color: #bda982;
    font-size: 9px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .header-user-summary {
        gap: 0;
    }

    .header-server-clock {
        gap: 0;
    }

    .header-server-clock-label,
    .header-server-clock-date,
    .header-server-clock-zone {
        display: none;
    }

    .header-server-clock time,
    .header-server-clock-time {
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .header-server-clock time,
    .header-server-clock-time {
        font-size: 10px;
    }
}


/* Personal Buildings: compact CQ2-style presentation */
.personal-buildings-cq2 .personal-buildings-cq2-section {
    margin: 0;
}

.personal-buildings-cq2 .personal-buildings-cq2-body {
    padding: 0 12px 12px;
    color: var(--text);
    line-height: 1.55;
}

.personal-buildings-cq2 .personal-buildings-cq2-current strong {
    margin-right: .35em;
}

.personal-buildings-cq2 .personal-buildings-cq2-current span,
.personal-buildings-cq2 .personal-buildings-cq2-owned-list {
    overflow-wrap: anywhere;
}

.personal-buildings-cq2 .personal-buildings-cq2-intro {
    margin: 0 0 12px;
}

.personal-buildings-cq2 .personal-buildings-cq2-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .035);
}

.personal-buildings-cq2 .personal-buildings-cq2-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.personal-buildings-cq2 .personal-buildings-cq2-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.personal-buildings-cq2 .personal-buildings-cq2-table tr:last-child td {
    border-bottom: 0;
}

.personal-buildings-cq2 .personal-buildings-cq2-name {
    width: 25%;
    font-weight: 700;
}

.personal-buildings-cq2 .personal-buildings-cq2-cost {
    width: 20%;
    text-align: center;
    white-space: nowrap;
}

.personal-buildings-cq2 .personal-buildings-cq2-action {
    width: 15%;
    text-align: center;
}

.personal-buildings-cq2 .personal-buildings-cq2-form {
    display: inline;
    margin: 0;
}

.personal-buildings-cq2 .personal-buildings-cq2-construct {
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--link, #e7bd68);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    box-shadow: none;
    cursor: pointer;
}

.personal-buildings-cq2 .personal-buildings-cq2-construct:hover,
.personal-buildings-cq2 .personal-buildings-cq2-construct:focus-visible {
    color: var(--text);
    background: none;
    box-shadow: none;
}

.personal-buildings-cq2 .alert-text {
    color: var(--danger, #ff9c91);
    font-weight: 700;
}

@media (max-width: 760px) {
    .personal-buildings-cq2 .personal-buildings-cq2-body {
        padding-inline: 4px;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-table {
        min-width: 0;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-table,
    .personal-buildings-cq2 .personal-buildings-cq2-table tbody,
    .personal-buildings-cq2 .personal-buildings-cq2-table tr,
    .personal-buildings-cq2 .personal-buildings-cq2-table td {
        display: block;
        width: 100%;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-table tr {
        margin-bottom: 10px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        background: rgba(255, 255, 255, .035);
    }

    .personal-buildings-cq2 .personal-buildings-cq2-table tr:last-child {
        margin-bottom: 0;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-table td {
        padding: 3px 0;
        border: 0;
        text-align: left;
        white-space: normal;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-name {
        margin-bottom: 3px;
        font-size: 16px;
    }

    .personal-buildings-cq2 .personal-buildings-cq2-action {
        margin-top: 5px;
    }
}
/* ===== Dashboard, Resources and Creatures summary mobile inline statistics =====
   Keep dashboard cards, Dashboard resource cards and only the top Creatures
   summary cards compact. Individual creature rows/cards deliberately retain
   their existing layout. */
@media (max-width: 760px) {
    body.page-dashboard .fk-dashboard-stat-grid .stat-card:not(.fk-vip-stat-card),
    body.page-dashboard .resource-grid > .resource-card,
    body.page-creatures .fk-creature-stat-grid > .stat-card {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: baseline;
        column-gap: 7px;
        row-gap: 3px;
        min-height: 48px;
        padding: 9px 11px;
        text-align: left;
    }

    body.page-dashboard .fk-dashboard-stat-grid .stat-title,
    body.page-dashboard .resource-grid > .resource-card > .resource-title,
    body.page-creatures .fk-creature-stat-grid > .stat-card > .stat-title {
        margin: 0;
        line-height: 1.15;
        white-space: nowrap;
    }

    body.page-dashboard .fk-dashboard-stat-grid .stat-title::after,
    body.page-dashboard .resource-grid > .resource-card > .resource-title::after,
    body.page-creatures .fk-creature-stat-grid > .stat-card > .stat-title::after {
        content: ':';
    }

    body.page-dashboard .fk-dashboard-stat-grid .stat-value,
    body.page-dashboard .resource-grid > .resource-card > .resource-value,
    body.page-creatures .fk-creature-stat-grid > .stat-card > .stat-value {
        min-width: 0;
        font-size: 18px;
        line-height: 1.12;
        text-align: left;
        overflow-wrap: anywhere;
    }

    body.page-dashboard .fk-dashboard-stat-grid .stat-small,
    body.page-creatures .fk-creature-stat-grid > .stat-card > .stat-small {
        font-size: 14px;
    }

    body.page-dashboard .fk-dashboard-xp-card .fk-dashboard-xp-progress {
        grid-column: 1 / -1;
        font-size: 14px;
        white-space: nowrap;
    }

    body.page-dashboard .fk-dashboard-xp-card .fk-dashboard-xp-unit {
        display: none;
    }
}

/* ===== Patch 48: mobile creature name and defense alignment =====
   Give the creature name the space it actually needs. Keep the family,
   element and activity aligned on the right, and place the four defenses
   directly below that right-hand metadata without adding another card row. */
@media (max-width: 760px) {
    body.page-creatures .fk-creature-line-main {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    body.page-creatures .fk-creature-title {
        flex: 0 0 auto;
        max-width: none;
        overflow: visible;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-title strong {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-meta {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-line-stats {
        display: grid;
        grid-template-columns: max-content max-content minmax(0, 1fr);
        align-items: center;
        column-gap: 8px;
        row-gap: 6px;
        white-space: normal;
    }

    body.page-creatures .fk-creature-line-stats .fk-creature-xp-trigger {
        grid-column: 1;
        grid-row: 1;
    }

    body.page-creatures .fk-creature-line-stats > .fk-creature-primary-stats {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-line-stats .fk-creature-defense-stats {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        width: auto;
        overflow: visible;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 5px 9px;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-line-stats .fk-creature-item-name {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        overflow: visible;
        text-align: center;
        text-overflow: clip;
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

@media (max-width: 420px) {
    body.page-creatures .fk-creature-line-main {
        gap: 6px;
    }

    body.page-creatures .fk-creature-line-stats {
        column-gap: 6px;
    }

    body.page-creatures .fk-creature-line-stats .fk-creature-defense-stats {
        gap: 4px 6px;
    }
}

/* ===== Patch 50: desktop one-line creature overview + item hover details =====
   Wide desktop screens use one horizontal summary row per creature. The item
   column stays compact and exposes the full equipped-item effect through the
   browser tooltip. Tablet and mobile layouts retain their existing cards. */
@media (min-width: 1180px) {
    body.page-creatures .fk-creature-list-stacked {
        gap: 5px;
    }

    body.page-creatures .fk-creature-stacked-card {
        padding: 7px 10px;
    }

    body.page-creatures .fk-creature-summary {
        display: grid;
        grid-template-columns:
            minmax(215px, 1.75fr)
            minmax(155px, 1.15fr)
            max-content
            max-content
            minmax(180px, 1.15fr)
            minmax(135px, 1fr);
        align-items: center;
        column-gap: 12px;
        row-gap: 0;
        min-width: 0;
    }

    body.page-creatures .fk-creature-summary-line {
        display: contents;
    }

    body.page-creatures .fk-creature-title,
    body.page-creatures .fk-creature-meta,
    body.page-creatures .fk-creature-primary-stats,
    body.page-creatures .fk-creature-defense-stats,
    body.page-creatures .fk-creature-item-name {
        min-width: 0;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-title {
        overflow: visible;
    }

    body.page-creatures .fk-creature-title strong {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-meta {
        overflow: hidden;
        text-align: left;
        text-overflow: ellipsis;
    }

    body.page-creatures .fk-creature-line-stats {
        flex-wrap: nowrap;
    }

    body.page-creatures .fk-creature-defense-stats {
        display: inline-flex;
        justify-content: flex-start;
        gap: 9px;
    }

    body.page-creatures .fk-creature-item-name {
        display: block;
        overflow: hidden;
        text-align: left;
        text-overflow: ellipsis;
    }

    body.page-creatures .fk-creature-item-name.has-item-effect {
        cursor: help;
        text-decoration: underline dotted rgba(231, 189, 104, .72);
        text-underline-offset: 3px;
    }

    body.page-creatures .fk-creature-item-inline-effect {
        display: none;
    }
}

/* ===== Patch 51: desktop creature action sections =====
   On wide desktop screens, keep creature actions on one balanced row:
   item/sacrifice actions aligned left and position controls aligned right.
   Tablet and mobile retain the existing expanded-card layout. */
@media (min-width: 1180px) {
    body.page-creatures .fk-creature-action-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 24px;
        row-gap: 6px;
    }

    body.page-creatures .fk-creature-actions-row {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0;
        min-width: 0;
    }

    body.page-creatures .fk-creature-actions-row > * {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
    }

    body.page-creatures .fk-creature-actions-row > * + *::before {
        content: '|';
        margin: 0 8px;
        color: rgba(231, 189, 104, .72);
        text-decoration: none;
    }

    body.page-creatures .fk-creature-order-form {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        padding: 0;
        border-top: 0;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-order-form label {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    body.page-creatures .fk-creature-order-form input[type="number"] {
        flex: 0 0 82px;
        width: 82px;
    }

    body.page-creatures .fk-creature-order-form button {
        flex: 0 0 auto;
    }

    body.page-creatures .fk-creature-action-panel > .fk-creature-item-effect {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* ===== Patch 52: battle creature cards on mobile and desktop =====
   Battle attack and defense creature rows now follow the same compact visual
   hierarchy as the main creature list. Mobile keeps full names, moves the
   item to its own readable line and shows the effect inline. Wide desktop
   uses one horizontal data row and exposes the item effect on hover/focus. */
body.page-battles .fk-battle-item-name,
body.page-defense .fk-battle-item-name {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

body.page-battles .fk-battle-item-name.has-item-effect,
body.page-defense .fk-battle-item-name.has-item-effect {
    cursor: help;
    text-decoration: underline dotted rgba(231, 189, 104, .72);
    text-underline-offset: 3px;
}

body.page-battles .fk-battle-item-inline-effect,
body.page-defense .fk-battle-item-inline-effect {
    display: inline;
}

@media (max-width: 760px) {
    body.page-battles .fk-battle-attack-card .fk-creature-line-main,
    body.page-defense .fk-defense-attacker-card .fk-creature-line-main,
    body.page-defense .battle-defense-option .fk-creature-line-main {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-title,
    body.page-defense .fk-defense-attacker-card .fk-creature-title,
    body.page-defense .battle-defense-option .fk-creature-title {
        flex: 1 1 auto;
        max-width: none;
        overflow: visible;
        white-space: normal;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-title strong,
    body.page-defense .fk-defense-attacker-card .fk-creature-title strong,
    body.page-defense .battle-defense-option .fk-creature-title strong {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-meta,
    body.page-defense .fk-defense-attacker-card .fk-creature-meta,
    body.page-defense .battle-defense-option .fk-creature-meta {
        flex: 0 1 44%;
        min-width: 0;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-stats,
    body.page-defense .fk-battle-defense-stats {
        display: grid;
        grid-template-columns: max-content max-content minmax(0, 1fr);
        align-items: center;
        column-gap: 8px;
        row-gap: 6px;
        width: 100%;
        white-space: normal;
    }

    body.page-battles .fk-battle-attack-stats .fk-battle-xp-slot,
    body.page-defense .fk-battle-defense-stats .fk-battle-xp-slot,
    body.page-defense .fk-battle-defense-stats .fk-battle-level-slot {
        grid-column: 1;
        grid-row: 1;
    }

    body.page-battles .fk-battle-attack-stats .fk-battle-damage-health,
    body.page-defense .fk-battle-defense-stats .fk-battle-damage-health {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-stats .fk-battle-defense-summary,
    body.page-defense .fk-battle-defense-stats .fk-battle-defense-summary {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        min-width: 0;
        overflow: visible;
        text-align: right;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-stats .fk-battle-item-name,
    body.page-defense .fk-battle-defense-stats .fk-battle-item-name {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        overflow: visible;
        text-align: center;
        text-overflow: clip;
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

@media (max-width: 420px) {
    body.page-battles .fk-battle-attack-card .fk-creature-line-main,
    body.page-defense .fk-defense-attacker-card .fk-creature-line-main,
    body.page-defense .battle-defense-option .fk-creature-line-main {
        gap: 6px;
    }

    body.page-battles .fk-battle-attack-stats,
    body.page-defense .fk-battle-defense-stats {
        column-gap: 6px;
    }

    body.page-battles .fk-battle-attack-stats .fk-battle-defense-summary,
    body.page-defense .fk-battle-defense-stats .fk-battle-defense-summary {
        font-size: .92em;
    }
}

@media (min-width: 1180px) {
    body.page-battles .fk-battle-attack-list,
    body.page-defense .fk-creature-list-stacked {
        gap: 5px;
    }

    body.page-battles .fk-battle-attack-card,
    body.page-defense .fk-defense-attacker-card,
    body.page-defense .battle-defense-option {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
        align-items: center;
        column-gap: 16px;
        padding: 7px 10px;
        overflow: visible;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-summary,
    body.page-defense .fk-defense-attacker-card .fk-creature-summary,
    body.page-defense .battle-defense-option .fk-creature-summary {
        display: grid;
        grid-template-columns:
            minmax(215px, 1.55fr)
            minmax(155px, 1fr)
            max-content
            max-content
            minmax(180px, 1.08fr)
            minmax(150px, 1.18fr);
        align-items: center;
        column-gap: 12px;
        row-gap: 0;
        min-width: 0;
        padding-right: 0;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-summary-line,
    body.page-defense .fk-defense-attacker-card .fk-creature-summary-line,
    body.page-defense .battle-defense-option .fk-creature-summary-line,
    body.page-battles .fk-battle-attack-card .fk-battle-attack-stats,
    body.page-defense .fk-defense-attacker-card .fk-battle-defense-stats,
    body.page-defense .battle-defense-option .fk-battle-defense-stats {
        display: contents;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-title,
    body.page-defense .fk-defense-attacker-card .fk-creature-title,
    body.page-defense .battle-defense-option .fk-creature-title {
        min-width: 0;
        overflow: visible;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-title strong,
    body.page-defense .fk-defense-attacker-card .fk-creature-title strong,
    body.page-defense .battle-defense-option .fk-creature-title strong {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-card .fk-creature-meta,
    body.page-defense .fk-defense-attacker-card .fk-creature-meta,
    body.page-defense .battle-defense-option .fk-creature-meta {
        min-width: 0;
        overflow: hidden;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-card .fk-battle-xp-slot,
    body.page-defense .battle-defense-option .fk-battle-xp-slot,
    body.page-defense .fk-defense-attacker-card .fk-battle-level-slot,
    body.page-battles .fk-battle-attack-card .fk-battle-damage-health,
    body.page-defense .fk-battle-defense-stats .fk-battle-damage-health,
    body.page-battles .fk-battle-attack-card .fk-battle-defense-summary,
    body.page-defense .fk-battle-defense-stats .fk-battle-defense-summary,
    body.page-battles .fk-battle-attack-card .fk-battle-item-name,
    body.page-defense .fk-battle-defense-stats .fk-battle-item-name {
        min-width: 0;
        white-space: nowrap;
    }

    body.page-battles .fk-battle-attack-card .fk-battle-defense-summary,
    body.page-defense .fk-battle-defense-stats .fk-battle-defense-summary {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.page-battles .fk-battle-attack-card .fk-battle-item-name,
    body.page-defense .fk-battle-defense-stats .fk-battle-item-name {
        position: relative;
        display: block;
        overflow: visible;
        text-align: left;
        text-overflow: clip;
    }

    body.page-battles .fk-battle-item-inline-effect,
    body.page-defense .fk-battle-item-inline-effect {
        display: none;
    }

    body.page-battles .fk-battle-item-name.has-item-effect::after,
    body.page-defense .fk-battle-item-name.has-item-effect::after {
        content: attr(data-item-tooltip);
        position: absolute;
        z-index: 30;
        left: 0;
        bottom: calc(100% + 8px);
        width: max-content;
        max-width: min(440px, 58vw);
        padding: 8px 10px;
        border: 1px solid rgba(217, 180, 92, .72);
        border-radius: 8px;
        background: rgba(7, 10, 13, .98);
        color: #fff2c9;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
        font-size: .84rem;
        font-weight: 600;
        line-height: 1.35;
        opacity: 0;
        pointer-events: none;
        transform: translateY(3px);
        transition: opacity .12s ease, transform .12s ease;
        white-space: normal;
    }

    body.page-battles .fk-battle-item-name.has-item-effect:hover::after,
    body.page-battles .fk-battle-item-name.has-item-effect:focus::after,
    body.page-defense .fk-battle-item-name.has-item-effect:hover::after,
    body.page-defense .fk-battle-item-name.has-item-effect:focus::after {
        opacity: 1;
        transform: translateY(0);
    }

    body.page-battles .fk-battle-attack-card .fk-battle-attack-detail,
    body.page-defense .fk-defense-attacker-card .fk-defense-assignment-panel,
    body.page-defense .battle-defense-option .fk-defense-status-panel {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        margin: 0;
        padding: 0 42px 0 0;
        border-top: 0;
        white-space: nowrap;
    }

    body.page-defense .fk-defense-attacker-card .fk-defense-assignment-panel,
    body.page-defense .battle-defense-option .fk-defense-status-panel {
        padding-right: 0;
    }
}


/* Patch 53: owned locked items remain visible but cannot be used. */
.fk-item-storage-row-locked {
    border-style: dashed;
    background: rgba(120, 82, 38, .13);
}

.fk-item-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 7px;
    padding: 2px 7px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .9;
}

.fk-item-lock-reasons,
.fk-item-picker-lock-reason {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.fk-item-action-cell {
    min-width: 0;
}

.fk-item-action-note {
    display: block !important;
    margin: 5px 0 7px;
    font-size: 12px !important;
    line-height: 1.4;
    opacity: .88 !important;
}

.fk-item-unavailable {
    display: block;
}

.fk-item-destroy-button {
    white-space: nowrap;
}

.fk-item-picker-option-locked {
    border-style: dashed;
    opacity: .82;
}

.fk-item-picker-option-locked .fk-item-lock-badge {
    margin-left: 0;
    align-self: center;
}

@media (max-width: 760px) {
    .fk-item-storage-row .amulet-stats {
        grid-template-columns: 1fr;
    }
}

/* Patch 57: Rare Jewel Collectables */
.fk-jewel-collectables-card {
    overflow: hidden;
}

.fk-jewel-rules {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.fk-jewel-rules > div {
    display: flex;
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid rgba(213, 166, 77, .34);
    border-radius: 10px;
    background: rgba(7, 13, 18, .72);
    text-align: center;
}

.fk-jewel-rules strong {
    color: #ffe5a0;
    font-size: .94rem;
}

.fk-jewel-rules span {
    color: #d9e0e6;
    font-size: .83rem;
    line-height: 1.35;
}

.fk-jewel-discovery-note {
    margin: 0 0 14px;
    text-align: center;
}

.fk-jewel-encounter {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid rgba(250, 205, 93, .72);
    border-radius: 14px;
    background:
        radial-gradient(circle at 14% 30%, rgba(255, 231, 147, .17), transparent 42%),
        linear-gradient(145deg, rgba(43, 28, 8, .96), rgba(8, 14, 20, .98));
    box-shadow:
        inset 0 1px 0 rgba(255, 247, 211, .12),
        0 12px 28px rgba(0, 0, 0, .28);
}

.fk-jewel-encounter > img {
    display: block;
    width: min(100%, 220px);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .45));
}

.fk-jewel-encounter h3 {
    margin: 0 0 8px;
    color: #ffe6a0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
}

.fk-jewel-encounter p {
    margin: 0 0 14px;
    line-height: 1.55;
}

.fk-jewel-mine-button {
    min-width: 150px;
    font-size: 1rem;
    font-weight: 900;
}

.fk-jewel-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(115px, 1fr));
    gap: 12px;
}

.fk-jewel-slot {
    display: flex;
    min-width: 0;
    min-height: 190px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 10px 8px 11px;
    border: 1px solid rgba(201, 161, 83, .34);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(16, 24, 31, .93), rgba(7, 12, 17, .96));
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.fk-jewel-slot img {
    display: block;
    width: min(100%, 150px);
    height: 130px;
    object-fit: contain;
    transition: filter .18s ease, opacity .18s ease, transform .18s ease;
}

.fk-jewel-slot strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #ffe6aa;
    line-height: 1.2;
}

.fk-jewel-slot span {
    color: #aeb9c3;
    font-size: .78rem;
}

.fk-jewel-slot.is-collected {
    border-color: rgba(244, 201, 96, .64);
    background:
        radial-gradient(circle at 50% 26%, rgba(255, 228, 139, .12), transparent 50%),
        linear-gradient(180deg, rgba(22, 31, 38, .96), rgba(9, 15, 20, .98));
}

.fk-jewel-slot.is-collected:hover img {
    transform: translateY(-3px) scale(1.03);
}

.fk-jewel-slot.is-undiscovered img {
    opacity: .2;
    filter: grayscale(1) brightness(.38) blur(1.5px);
}

.fk-jewel-slot.is-undiscovered strong,
.fk-jewel-slot.is-undiscovered span {
    color: #7f8a94;
}

.fk-profile-jewel-grid {
    grid-template-columns: repeat(auto-fit, minmax(125px, 170px));
    justify-content: center;
}

@media (max-width: 980px) {
    .fk-jewel-rules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fk-jewel-grid {
        grid-template-columns: repeat(3, minmax(105px, 1fr));
    }
}

@media (max-width: 620px) {
    .fk-jewel-rules {
        grid-template-columns: 1fr;
    }

    .fk-jewel-rules > div {
        min-height: 0;
    }

    .fk-jewel-encounter {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
        text-align: center;
    }

    .fk-jewel-encounter > img {
        width: min(72vw, 220px);
    }

    .fk-jewel-grid,
    .fk-profile-jewel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .fk-jewel-slot {
        min-height: 156px;
        padding: 8px 5px 9px;
    }

    .fk-jewel-slot img {
        height: 100px;
    }
}


/* Patch 58: Travel Rare Jewel encounter and success reveal */
.fk-rare-jewel-cave .travel-special-status {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
}

.fk-rare-jewel-cave .travel-special-status p {
    margin: 5px 0;
    font-size: 1rem;
}

.fk-rare-jewel-cave .travel-encounter-actions {
    justify-content: center;
}

.fk-travel-jewel-result {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    margin: 14px 0 18px;
    padding: 18px;
    border: 1px solid rgba(250, 205, 93, .72);
    border-radius: 14px;
    background:
        radial-gradient(circle at 16% 28%, rgba(255, 231, 147, .18), transparent 43%),
        linear-gradient(145deg, rgba(43, 28, 8, .96), rgba(8, 14, 20, .98));
    box-shadow:
        inset 0 1px 0 rgba(255, 247, 211, .12),
        0 12px 28px rgba(0, 0, 0, .28);
}

.fk-travel-jewel-result img {
    display: block;
    width: min(100%, 240px);
    height: 220px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .45));
}

.fk-travel-jewel-result h3 {
    margin: 0 0 6px;
    color: #ffe6a0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.fk-travel-jewel-result strong {
    display: block;
    margin-bottom: 7px;
    color: #fff3c8;
    font-size: 1.05rem;
}

.fk-travel-jewel-result p {
    margin: 0 0 14px;
    line-height: 1.55;
}

@media (max-width: 620px) {
    .fk-travel-jewel-result {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
        text-align: center;
    }

    .fk-travel-jewel-result img {
        width: min(70vw, 220px);
        height: 190px;
    }
}

/* Patch 64: Rare Jewel Collectables from completed Mining expeditions */
.mining-collectible-result {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid rgba(242, 198, 86, .62);
    border-radius: 10px;
    background:
        radial-gradient(circle at 12% 28%, rgba(255, 226, 133, .14), transparent 44%),
        rgba(25, 20, 10, .72);
}

.mining-collectible-result img {
    display: block;
    width: 74px;
    height: 74px;
    object-fit: contain;
    filter: drop-shadow(0 7px 9px rgba(0, 0, 0, .38));
}

.mining-collectible-result strong,
.mining-collectible-result span {
    display: block;
}

.mining-collectible-result strong {
    margin-bottom: 3px;
    color: #ffe4a0;
}

.mining-collectible-result span {
    color: #d7dee4;
    line-height: 1.35;
}

@media (max-width: 520px) {
    .mining-collectible-result {
        grid-template-columns: 58px minmax(0, 1fr);
        padding: 9px;
    }

    .mining-collectible-result img {
        width: 58px;
        height: 58px;
    }
}


/* ===== Patch 73: clearer item class labels in Summon Amulets ===== */
.item-family-intro {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.item-class-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 14px;
}

.item-class-summary-label {
    color: #cbb783;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.item-class-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid rgba(217, 180, 92, .48);
    border-radius: 999px;
    background: rgba(217, 180, 92, .09);
    color: #f4ddb0;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.item-class-forest {
    border-color: rgba(67, 170, 220, .64);
    background: rgba(38, 121, 173, .16);
    color: #9bdcff;
}

.item-class-death {
    border-color: rgba(220, 83, 67, .68);
    background: rgba(165, 46, 35, .17);
    color: #ffb0a4;
}

.item-class-air {
    border-color: rgba(103, 195, 211, .66);
    background: rgba(55, 147, 165, .15);
    color: #b7f2ff;
}

.item-class-earth {
    border-color: rgba(188, 144, 74, .7);
    background: rgba(151, 100, 37, .18);
    color: #f0cf91;
}

.item-class-neutral {
    border-color: rgba(189, 189, 189, .5);
    background: rgba(160, 160, 160, .1);
    color: #e6e6e6;
}

.item-amulet-family-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.item-amulet-family-card {
    min-height: 112px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.item-amulet-family-card.is-active {
    border-color: rgba(244, 221, 176, .95) !important;
    box-shadow:
        inset 0 0 0 1px rgba(244, 221, 176, .25),
        0 0 20px rgba(217, 180, 92, .12);
}

.item-family-icon {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(217, 180, 92, .36);
    font-size: 27px;
}

.item-family-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.item-family-name {
    margin: 0;
    line-height: 1.2;
}

.item-family-element-text,
.item-class-inline {
    font-weight: 800;
}

.item-class-text-forest { color: #8fd8ff; }
.item-class-text-death { color: #ff9d90; }
.item-class-text-air { color: #a9edfa; }
.item-class-text-earth { color: #e9c782; }
.item-class-text-neutral { color: #dedede; }

.item-amulet-family-card .family-meta {
    margin: 0;
    opacity: .78;
}

.item-family-section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.item-amulet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

@media (max-width: 1180px) {
    .item-amulet-family-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .item-amulet-family-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-amulet-family-card {
        min-height: 100px;
        padding: 10px;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 9px;
    }

    .item-family-icon {
        width: 42px;
        height: 42px;
        font-size: 23px;
    }
}

@media (max-width: 480px) {
    .item-amulet-family-grid {
        grid-template-columns: 1fr;
    }

    .item-amulet-family-card {
        min-height: 82px;
    }

    .item-family-section-title {
        justify-content: flex-start;
        text-align: left;
    }
}


/* ===== Loyal Supporters: featured Social menu link ===== */
html body:not(.landing-page) aside.sidebar .fk-menu-link.is-supporter-highlight,
html body:not(.landing-page) .sidebar .fk-menu-link.is-supporter-highlight {
    position: relative !important;
    background:
        radial-gradient(circle at 86% 50%, rgba(255, 222, 120, .20), transparent 42%),
        linear-gradient(180deg, rgba(108, 67, 20, .98), rgba(57, 33, 12, .99)) !important;
    border-top-color: rgba(255, 215, 111, .42) !important;
    color: #fff2c2 !important;
    box-shadow:
        inset 3px 0 0 #f3c75f,
        inset 0 0 0 1px rgba(255, 221, 132, .18),
        0 0 13px rgba(224, 168, 54, .16) !important;
}

html body:not(.landing-page) aside.sidebar .fk-menu-link.is-supporter-highlight:hover,
html body:not(.landing-page) .sidebar .fk-menu-link.is-supporter-highlight:hover {
    background:
        radial-gradient(circle at 86% 50%, rgba(255, 234, 158, .30), transparent 44%),
        linear-gradient(180deg, rgba(137, 87, 27, .99), rgba(76, 44, 15, .99)) !important;
    color: #fff8df !important;
    box-shadow:
        inset 3px 0 0 #ffe08a,
        inset 0 0 0 1px rgba(255, 231, 162, .28),
        0 0 18px rgba(238, 185, 68, .24) !important;
}

html body:not(.landing-page) aside.sidebar .fk-menu-link.is-supporter-highlight.is-active,
html body:not(.landing-page) .sidebar .fk-menu-link.is-supporter-highlight.is-active {
    background:
        radial-gradient(circle at 86% 50%, rgba(255, 238, 176, .30), transparent 44%),
        linear-gradient(180deg, rgba(151, 96, 28, .99), rgba(79, 45, 14, .99)) !important;
    color: #fff9e7 !important;
    box-shadow:
        inset 4px 0 0 #ffe397,
        inset 0 0 0 1px rgba(255, 235, 175, .32),
        0 0 20px rgba(243, 190, 74, .28) !important;
}

html body:not(.landing-page) .sidebar .fk-menu-link.is-supporter-highlight .fk-menu-link-label {
    color: #ffe4a0 !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .70), 0 0 8px rgba(255, 210, 92, .18) !important;
}

html body:not(.landing-page) .sidebar .fk-menu-link.is-supporter-highlight .fk-menu-link-symbol {
    filter: drop-shadow(0 0 5px rgba(255, 211, 91, .35)) !important;
}

html body:not(.landing-page) .sidebar .fk-menu-link.is-supporter-highlight .fk-menu-link-badge {
    min-width: 24px !important;
    height: 24px !important;
    padding: 0 6px !important;
    border: 1px solid rgba(255, 238, 181, .66) !important;
    background: linear-gradient(180deg, #f5cf68, #b87a22) !important;
    color: #2b1908 !important;
    box-shadow: 0 0 8px rgba(246, 197, 77, .24) !important;
}


/* ===== Curses & Enchants system guides ===== */
.fk-system-guide {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(174, 126, 53, .55);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(91, 63, 24, .16), rgba(255,255,255,.025));
}
.fk-system-guide h3 {
    margin: 0 0 7px;
    color: #f0d596;
    font-size: 16px;
}
.fk-system-guide > p {
    margin: 7px 0 12px;
}
.fk-system-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.fk-system-guide-grid > div {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid rgba(143, 103, 48, .4);
    border-radius: 9px;
    background: rgba(0, 0, 0, .12);
}
.fk-system-guide-grid strong {
    display: block;
    margin-bottom: 4px;
    color: #ebd8a8;
}
.fk-system-guide-grid span {
    color: #c8c1b3;
    font-size: 12px;
    line-height: 1.5;
}
.fk-system-guide-note {
    margin: 11px 0 0 !important;
    padding-top: 10px;
    border-top: 1px solid rgba(143, 103, 48, .35);
    color: #d7ccb5;
    font-size: 12px;
    line-height: 1.5;
}
.fk-system-guide-table {
    margin-top: 12px;
}
@media (max-width: 720px) {
    .fk-system-guide-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   FK Compact Desktop UI pass - 2026-08-14
   Desktop only. Mobile/tablet <= 1100px keeps the existing UI.
   Goal: use more screen width and reduce oversized desktop chrome.
   ========================================================== */
@media (min-width: 1101px) {
    body:not(.landing-page) .game-header {
        width: calc(100% - 16px) !important;
        max-width: none !important;
        margin: 6px 8px 10px !important;
        padding: 9px 12px 11px !important;
        border-radius: 15px !important;
    }

    body:not(.landing-page) .game-header-topline {
        grid-template-columns: 185px minmax(0, 1fr) 285px !important;
        gap: 10px !important;
        min-height: 46px !important;
    }

    body:not(.landing-page) .header-logo a {
        font-size: clamp(34px, 3.15vw, 47px) !important;
        line-height: .96 !important;
    }

    body:not(.landing-page) .header-user {
        gap: 8px !important;
    }

    body:not(.landing-page) .header-user strong {
        font-size: 14px !important;
    }

    body:not(.landing-page) .header-user span {
        font-size: 12px !important;
    }

    body:not(.landing-page) .logout-btn {
        min-height: 32px !important;
        padding: 6px 12px !important;
        border-radius: 8px !important;
    }

    body:not(.landing-page) .header-resources {
        width: 100% !important;
        max-width: none !important;
        gap: 6px !important;
        margin: 8px 0 7px !important;
    }

    body:not(.landing-page) .resource-box {
        min-height: 46px !important;
        padding: 5px 9px !important;
        column-gap: 7px !important;
        border-radius: 9px !important;
    }

    body:not(.landing-page) .resource-icon {
        font-size: 18px !important;
    }

    body:not(.landing-page) .resource-name,
    body:not(.landing-page) .resource-box span:not(.resource-icon) {
        font-size: 9px !important;
    }

    body:not(.landing-page) .resource-box strong {
        margin-top: 2px !important;
        font-size: 16px !important;
    }

    body:not(.landing-page) .header-alerts {
        width: 100% !important;
        max-width: none !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 5px 8px !important;
        border-radius: 9px !important;
    }

    body:not(.landing-page) .header-alerts-empty {
        font-size: 12px !important;
    }

    /* Use the available desktop width instead of centering inside 1440px. */
    body:not(.landing-page) .layout {
        width: calc(100% - 16px) !important;
        max-width: none !important;
        grid-template-columns: 218px minmax(0, 1fr) !important;
        gap: 10px !important;
        margin: 10px 8px !important;
        padding: 0 !important;
        align-items: start !important;
    }

    body:not(.landing-page) .sidebar {
        width: 218px !important;
        min-width: 218px !important;
        max-width: 218px !important;
    }

    body:not(.landing-page) .sidebar .fk-menu-shell {
        padding: 5px !important;
        border-radius: 10px !important;
    }

    body:not(.landing-page) .sidebar .menu-box,
    body:not(.landing-page) .sidebar .fk-menu-box {
        margin-bottom: 6px !important;
    }

    body:not(.landing-page) .sidebar .menu-box h3,
    body:not(.landing-page) .sidebar .fk-menu-box h3 {
        min-height: 28px !important;
        margin-bottom: 3px !important;
        padding: 5px 7px !important;
        border-radius: 6px !important;
        font-size: 11px !important;
        line-height: 1 !important;
        letter-spacing: .11em !important;
    }

    body:not(.landing-page) .sidebar .menu-box h3::before,
    body:not(.landing-page) .sidebar .menu-box h3::after,
    body:not(.landing-page) .sidebar .fk-menu-box h3::before,
    body:not(.landing-page) .sidebar .fk-menu-box h3::after {
        width: 10px !important;
        flex-basis: 10px !important;
        margin: 0 5px !important;
    }

    body:not(.landing-page) .sidebar .fk-menu-links {
        border-radius: 7px !important;
    }

    /* Overrides the old "mobile emergency fix" which was also enlarging desktop. */
    html body:not(.landing-page) aside.sidebar .fk-menu-link,
    html body:not(.landing-page) .sidebar .fk-menu-link {
        grid-template-columns: 24px minmax(0, 1fr) auto !important;
        gap: 6px !important;
        min-height: 32px !important;
        padding: 4px 7px !important;
        font-size: 12.5px !important;
        line-height: 1.08 !important;
    }

    html body:not(.landing-page) aside.sidebar .fk-menu-link-icon,
    html body:not(.landing-page) .sidebar .fk-menu-link-icon {
        width: 21px !important;
        height: 21px !important;
        min-width: 21px !important;
        max-width: 21px !important;
        min-height: 21px !important;
        max-height: 21px !important;
        flex-basis: 21px !important;
    }

    html body:not(.landing-page) aside.sidebar .fk-menu-link-icon img,
    html body:not(.landing-page) aside.sidebar img.fk-menu-link-img,
    html body:not(.landing-page) .sidebar .fk-menu-link-icon img,
    html body:not(.landing-page) .sidebar img.fk-menu-link-img,
    html body:not(.landing-page) img.fk-menu-link-img {
        width: 19px !important;
        height: 19px !important;
        min-width: 19px !important;
        max-width: 19px !important;
        min-height: 19px !important;
        max-height: 19px !important;
    }

    html body:not(.landing-page) aside.sidebar .fk-menu-link-symbol,
    html body:not(.landing-page) .sidebar .fk-menu-link-symbol {
        width: 19px !important;
        height: 19px !important;
        min-width: 19px !important;
        max-width: 19px !important;
        min-height: 19px !important;
        max-height: 19px !important;
        font-size: 15px !important;
    }

    body:not(.landing-page) .sidebar .fk-menu-link-badge {
        min-width: 19px !important;
        min-height: 19px !important;
        padding: 2px 5px !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }

    body:not(.landing-page) .content-card {
        margin-bottom: 10px !important;
        padding: 10px !important;
        border-radius: 11px !important;
    }

    body:not(.landing-page) .content-title {
        min-height: 40px !important;
        margin: -10px -10px 10px !important;
        padding: 7px 12px !important;
        font-size: 18px !important;
        line-height: 1.05 !important;
    }

    body:not(.landing-page) .content-title::before,
    body:not(.landing-page) .content-title::after {
        width: 28px !important;
    }

    body:not(.landing-page) .content-title::before {
        left: 12px !important;
    }

    body:not(.landing-page) .content-title::after {
        right: 12px !important;
    }

    body:not(.landing-page) .dashboard-grid,
    body:not(.landing-page) .resource-grid,
    body:not(.landing-page) .stat-grid {
        gap: 8px !important;
    }

    body:not(.landing-page) .stat-card,
    body:not(.landing-page) .resource-card {
        padding: 7px 9px !important;
        border-radius: 9px !important;
    }

    body:not(.landing-page) table {
        border-radius: 9px !important;
    }

    body:not(.landing-page) th,
    body:not(.landing-page) td {
        padding: 6px 8px !important;
    }

    body:not(.landing-page) .page-intro,
    body:not(.landing-page) .welcome-text {
        margin-top: 6px !important;
        margin-bottom: 8px !important;
    }
}



/* ==========================================================================
   V42 — MINING CREATURE PICKER: SINGLE LEVEL-BADGE BORDER
   --------------------------------------------------------------------------
   <summary> receives a native/browser focus outline inside the selectable
   mining label, producing the visible double rounded border.
   Keep the badge's own border and remove only the extra outline/ring.
   ========================================================================== */

.mining-creature-option .fk-creature-xp-details > summary,
.mining-creature-option .fk-creature-xp-details > summary:focus,
.mining-creature-option .fk-creature-xp-details > summary:focus-visible,
.mining-creature-option .fk-creature-xp-details > summary:active {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

/* Keyboard focus remains visible through the badge's ONE existing border. */
.mining-creature-option .fk-creature-xp-details > summary:focus-visible {
    border-color: currentColor !important;
}


/* ==========================================================================
   V46 — KINGDOM / TOWN HALL: REQUESTED PARCHMENT READABILITY + MESSAGE WIDTH
   --------------------------------------------------------------------------
   Scoped to Modern UI only. Classic/Dark remains untouched.
   ========================================================================== */

/* Kingdom > Advanced Storage:
   the legacy stat-card text stays pale/white on the light parchment surface. */
html body.fk-modern-ui.page-kingdom:not(.landing-page)
.content-card .dashboard-grid .stat-card .stat-title,
html body.fk-modern-ui.page-kingdom:not(.landing-page)
.content-card .dashboard-grid .stat-card .stat-value,
html body.fk-modern-ui.page-kingdom:not(.landing-page)
.content-card .dashboard-grid .stat-card .stat-small {
    color: var(--ui-text) !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

html body.fk-modern-ui.page-kingdom:not(.landing-page)
.content-card .dashboard-grid .stat-card .stat-title {
    color: var(--ui-muted) !important;
    font-weight: 800 !important;
}

html body.fk-modern-ui.page-kingdom:not(.landing-page)
.content-card .dashboard-grid .stat-card .stat-value {
    font-weight: 900 !important;
}

/* Town Hall > Kingdom Message:
   remove only the visible label beside/above the textarea, keep the semantic
   label in the DOM, add breathing room above, and use the available width. */
html body.fk-modern-ui.page-town_hall:not(.landing-page)
label[for="kingdom_message"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html body.fk-modern-ui.page-town_hall:not(.landing-page)
form.stacked-form:has(#kingdom_message) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: none !important;
    padding: 14px 18px 16px !important;
    box-sizing: border-box !important;
}

html body.fk-modern-ui.page-town_hall:not(.landing-page)
#kingdom_message {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 145px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    resize: vertical !important;
}

html body.fk-modern-ui.page-town_hall:not(.landing-page)
form.stacked-form:has(#kingdom_message) > .btn-small {
    align-self: flex-start !important;
}

@media (max-width: 760px) {
    html body.fk-modern-ui.page-town_hall:not(.landing-page)
    form.stacked-form:has(#kingdom_message) {
        padding: 11px 10px 13px !important;
    }

    html body.fk-modern-ui.page-town_hall:not(.landing-page)
    #kingdom_message {
        min-height: 125px !important;
    }
}


/* =============================================================================
   Support / Questions navigation — shared responsive structure
   Anchors use the existing .button skin, so Classic/Dark and any non-Modern
   layout receive the same proven button treatment as the rest of the game.
   ========================================================================== */
html body:not(.landing-page) .content .fk-support-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin: 0 0 14px;
    padding: 0;
}

html body:not(.landing-page) .content .fk-support-nav > .fk-support-nav-link {
    min-width: 0;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

html body:not(.landing-page) .content .fk-support-nav > .fk-support-nav-link.active {
    border-color: rgba(230, 188, 91, .88) !important;
    background: linear-gradient(180deg, #996126, #6e421b) !important;
    color: #fff2c7 !important;
}

@media (max-width: 760px) {
    html body:not(.landing-page) .content .fk-support-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 12px;
    }

    html body:not(.landing-page) .content .fk-support-nav > .fk-support-nav-link {
        width: 100%;
        min-height: 42px;
        padding: 8px 7px;
        font-size: 13px;
    }

    html body:not(.landing-page) .content .fk-support-nav > .fk-support-nav-link:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 390px) {
    html body:not(.landing-page) .content .fk-support-nav > .fk-support-nav-link {
        padding-inline: 5px;
        font-size: 12px;
    }
}
