/* Global Pages CSS extracted from HTML files */

/* Styles from marketplace.html */
.marketplace-container {
    text-align: center;
    padding: 7.5rem 1rem 4rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.marketplace-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #d6b46a, #f0ddaf, #d6b46a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.marketplace-subtitle {
    color: var(--text-soft, #b8ccbe);
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
}

.construction-box {
    background: var(--bg-panel, #112018);
    border: 2px solid var(--border, #254734);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Styles from terms.html */
.terms-container {
            max-width: 900px;
            margin: 4rem auto;
            padding: 2.5rem;
            background: rgba(17, 32, 24, 0.85);
            border: 1px solid var(--border);
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            color: #d1d5db;
            line-height: 1.7;
        }

        .terms-title {
            font-family: 'Cinzel', serif;
            color: var(--gold);
            font-size: 2.2rem;
            margin-bottom: 0.5rem;
            text-align: center;
        }

        .terms-subtitle {
            text-align: center;
            color: var(--text-soft);
            font-size: 0.95rem;
            margin-bottom: 2rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 1.5rem;
        }

        .terms-section {
            margin-bottom: 2rem;
        }

        .terms-section h2 {
            color: #4ade80;
            font-size: 1.25rem;
            margin-bottom: 0.8rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .terms-section p, .terms-section ul {
            font-size: 0.95rem;
            margin-bottom: 0.8rem;
        }

        .terms-section ul {
            padding-left: 1.5rem;
            list-style-type: disc;
        }

        .terms-section li {
            margin-bottom: 0.4rem;
        }

        .law-badge {
            background: rgba(74, 222, 128, 0.1);
            border-left: 4px solid #4ade80;
            padding: 12px 16px;
            border-radius: 6px;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
            color: #bbf7d0;
        }

        .terms-currency-icon {
            width: 20px;
            height: 20px;
            vertical-align: -4px;
            display: inline-block;
            margin: 0 3px;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
            object-fit: contain;
        }

        .contact-box {
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            text-align: center;
            margin-top: 2rem;
        }

        .contact-box a {
            color: #4ade80;
            text-decoration: underline;
            font-weight: bold;
        }

/* Styles from support.html */
.support-container {
    text-align: center;
    padding: 10rem 1.5rem 5rem;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

        .support-title {
            font-size: clamp(2rem, 5vw, 3rem);
            margin-bottom: 0.5rem;
            color: var(--gold);
            font-family: 'Cinzel', serif;
        }

        .support-subtitle {
            color: var(--text-soft);
            font-size: 1.05rem;
            margin-bottom: 2.5rem;
        }

        .support-tabs {
            display: flex;
            justify-content: center;
            gap: 0.8rem;
            margin-bottom: 2.5rem;
            flex-wrap: wrap;
        }

        .tab-btn {
            padding: 0.8rem 1.6rem;
            background: rgba(30, 60, 45, 0.45);
            border: 2px solid rgba(74, 222, 128, 0.35);
            border-radius: 999px;
            color: #e2e8f0;
            font-weight: bold;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .tab-btn.active, .tab-btn:hover {
            background: linear-gradient(135deg, #2d6a4f, #40916c);
            color: white;
            border-color: #4ade80;
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(45, 106, 79, 0.3);
        }

        .tab-content {
            display: none;
            text-align: left;
        }

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

        .faq-item {
            background: rgba(17, 32, 24, 0.85);
            border: 1px solid var(--border);
            border-radius: 12px;
            margin-bottom: 1rem;
            overflow: hidden;
            transition: border-color 0.2s;
        }

        .faq-item:hover {
            border-color: #4ade80;
        }

        .faq-question {
            padding: 1.25rem 1.5rem;
            font-weight: 600;
            font-size: 1.05rem;
            color: #f3f4f6;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .faq-answer {
            padding: 0 1.5rem 1.25rem;
            color: #cbd5e1;
            line-height: 1.6;
            font-size: 0.95rem;
            display: none;
        }

        .faq-item.active .faq-answer {
            display: block;
        }

        .bug-card {
            background: rgba(17, 32, 24, 0.85);
            border: 1px solid var(--border);
            border-left: 4px solid #4ade80;
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
            margin-bottom: 1rem;
            transition: transform 0.2s ease;
        }

        .bug-card:hover {
            transform: translateY(-2px);
            border-color: #4ade80;
        }

        .bug-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
            gap: 8px;
        }

        .bug-badge {
            background: rgba(74, 222, 128, 0.15);
            color: #4ade80;
            border: 1px solid #4ade80;
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: bold;
        }

        .bug-title {
            color: #f3f4f6;
            font-weight: 600;
            font-size: 1.05rem;
            margin: 0;
        }

        .bug-fix {
            color: #cbd5e1;
            font-size: 0.95rem;
            line-height: 1.5;
            margin-top: 0.5rem;
        }

        .ticket-form-container {
            background: rgba(17, 32, 24, 0.85);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 2.5rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: #e5e7eb;
            font-size: 0.95rem;
        }

        .form-input, .form-select, .form-textarea {
            width: 100%;
            padding: 0.8rem 1rem;
            background: #0a120e;
            border: 1px solid var(--border);
            border-radius: 8px;
            color: #fff;
            font-size: 1rem;
            font-family: inherit;
            box-sizing: border-box;
        }

        .form-textarea {
            min-height: 120px;
            resize: vertical;
        }

        .form-input:focus, .form-select:focus, .form-textarea:focus {
            outline: none;
            border-color: #4ade80;
            box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
        }

        .submit-btn {
            width: 100%;
            padding: 1rem;
            background: linear-gradient(135deg, #2d6a4f, #40916c);
            border: none;
            border-radius: 8px;
            color: #fff;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .submit-btn:hover {
            opacity: 0.9;
        }

        .success-message {
            display: none;
            text-align: center;
            padding: 2rem;
            color: #4ade80;
        }

        .email-direct-box {
            margin-top: 2.5rem;
            background: rgba(17, 32, 24, 0.9);
            border: 1px solid rgba(74, 222, 128, 0.3);
            border-radius: 12px;
            padding: 1.25rem;
            text-align: center;
            color: #e2e8f0;
            font-size: 0.95rem;
        }

        .email-direct-box a {
            color: #6ee7a7;
            text-decoration: underline;
            font-weight: bold;
        }

/* Styles from settings.html */
/* ── Settings Layout ──────────────────────────────────── */
        .settings-page {
            padding: 7rem 1.5rem 4rem;
            max-width: 720px;
            margin: 0 auto;
            width: 100%;
        }

        .settings-page-title {
            font-size: clamp(1.6rem, 4vw, 2.2rem);
            margin-bottom: 1.5rem;
            background: linear-gradient(to right, #d6b46a, #f0ddaf, #d6b46a);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-align: center;
        }

        /* ── View Profile Banner ──────────────────────────────── */
        .profile-preview-banner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: linear-gradient(135deg, rgba(21, 60, 36, 0.8), rgba(45, 106, 79, 0.4));
            border: 1px solid rgba(74, 222, 128, 0.25);
            border-radius: 16px;
            padding: 18px 22px;
            margin-bottom: 24px;
            gap: 16px;
            flex-wrap: wrap;
        }

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

        .preview-avatar {
            width: 48px;
            height: 48px;
            min-width: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, #2d6a4f, #4ade80);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: 800;
            color: #0b1a0f;
            border: 2px solid var(--gold);
            overflow: hidden;
        }

        .preview-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .preview-text h3 {
            margin: 0 0 2px;
            color: var(--gold-soft);
            font-size: 1rem;
        }

        .preview-text p {
            margin: 0;
            color: var(--text-faint);
            font-size: 0.85rem;
        }

        .btn-view-profile {
            padding: 10px 22px;
            border-radius: 12px;
            background: linear-gradient(135deg, #2d6a4f, #4ade80);
            color: #0b1a0f;
            font-weight: 700;
            font-size: 0.9rem;
            text-decoration: none;
            transition: all 0.25s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border: none;
            cursor: pointer;
        }

        .btn-view-profile:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(74, 222, 128, 0.3);
        }

        /* ── Settings Cards ───────────────────────────────────── */
        .settings-card {
            background: linear-gradient(180deg, rgba(21, 60, 36, 0.92), rgba(11, 26, 15, 0.96));
            border: 1px solid rgba(110, 231, 167, 0.3);
            border-radius: 20px;
            padding: 28px 26px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 40px rgba(0, 0, 0, 0.3);
            margin-bottom: 20px;
        }

        .card-heading {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
        }

        .card-heading .icon {
            font-size: 1.4rem;
        }

        .card-heading h3 {
            margin: 0;
            color: var(--gold-soft);
            font-size: 1.1rem;
            letter-spacing: 0.5px;
        }

        .card-heading .heading-line {
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, var(--border), transparent);
        }

        .card-desc {
            color: var(--text-faint);
            font-size: 0.88rem;
            margin-bottom: 18px;
            line-height: 1.5;
        }

        /* ── Form Styles ──────────────────────────────────────── */
        .settings-form .form-group {
            margin-bottom: 18px;
        }

        .settings-form label {
            display: block;
            color: var(--text-soft);
            font-weight: 600;
            font-size: 0.88rem;
            margin-bottom: 7px;
            letter-spacing: 0.3px;
        }

        .settings-form input[type="email"],
        .settings-form input[type="password"],
        .settings-form input[type="text"],
        .settings-form select {
            width: 100%;
            padding: 12px 16px;
            border-radius: 12px;
            border: 2px solid var(--border);
            background-color: #0f2b1d;
            color: #e8f5e9;
            font-size: 0.95rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .settings-form input:focus,
        .settings-form select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
        }

        .settings-form input::placeholder {
            color: #6b8a73;
        }

        /* Password visibility wrapper */
        .pw-input-wrap {
            position: relative;
        }

        .pw-input-wrap input {
            padding-right: 46px;
        }

        .pw-toggle-btn {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 1.1rem;
            opacity: 0.6;
            transition: opacity 0.2s ease;
            padding: 4px;
        }

        .pw-toggle-btn:hover {
            opacity: 1;
        }

        /* Current email display */
        .current-value {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(110, 231, 167, 0.15);
            border-radius: 10px;
            padding: 10px 16px;
            color: var(--text-soft);
            font-size: 0.92rem;
            margin-bottom: 16px;
            width: 100%;
        }

        .current-value .cv-label {
            color: var(--text-faint);
            font-size: 0.82rem;
            margin-right: 4px;
        }

        /* ── Buttons ──────────────────────────────────────────── */
        .btn-settings {
            padding: 12px 24px;
            border-radius: 12px;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            border: none;
            transition: all 0.25s ease;
        }

        .btn-settings-primary {
            background: linear-gradient(135deg, #2d6a4f, #4ade80);
            color: #0b1a0f;
        }

        .btn-settings-primary:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 4px 18px rgba(74, 222, 128, 0.3);
        }

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

        .btn-settings-prefs {
            background: rgba(214, 180, 106, 0.15);
            color: var(--gold);
            border: 1px solid rgba(214, 180, 106, 0.3);
        }

        .btn-settings-prefs:hover {
            background: rgba(214, 180, 106, 0.25);
        }

        /* ── Feedback Messages ────────────────────────────────── */
        .form-msg {
            margin-top: 12px;
            padding: 10px 14px;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 600;
            display: none;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-4px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .form-msg.success {
            display: block;
            background: rgba(74, 222, 128, 0.12);
            color: #4ade80;
            border: 1px solid rgba(74, 222, 128, 0.25);
        }

        .form-msg.error {
            display: block;
            background: rgba(239, 68, 68, 0.12);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.25);
        }

        /* ── Password Strength Meter ──────────────────────────── */
        .pw-strength {
            margin-top: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pw-strength-bar {
            flex: 1;
            height: 4px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
            overflow: hidden;
        }

        .pw-strength-fill {
            height: 100%;
            width: 0%;
            border-radius: 2px;
            transition: width 0.3s ease, background 0.3s ease;
        }

        .pw-strength-label {
            font-size: 0.78rem;
            font-weight: 600;
            min-width: 52px;
            text-align: right;
        }

        /* ── Responsive ───────────────────────────────────────── */
        @media (max-width: 560px) {
            .profile-preview-banner {
                flex-direction: column;
                text-align: center;
            }

            .preview-info {
                flex-direction: column;
            }

            .settings-card {
                padding: 22px 18px;
            }
        }

/* Styles from profile.html */
.profile-container {
            max-width: 800px;
            margin: 40px auto;
            padding: 20px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            color: #fff;
        }
        .profile-header {
            display: flex;
            align-items: center;
            gap: 20px;
            margin-bottom: 30px;
        }
        .avatar-large {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: #555;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            overflow: hidden;
        }
        .avatar-large img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .profile-info h1 {
            margin: 0 0 5px 0;
        }
        .profile-info .title {
            color: #aaa;
            font-size: 1.1em;
            margin: 0 0 10px 0;
        }
        .profile-bio {
            background: rgba(0, 0, 0, 0.2);
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 30px;
        }
        .creatures-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
        }
        .creature-card {
            background: rgba(255, 255, 255, 0.1);
            padding: 15px;
            border-radius: 5px;
            text-align: center;
        }
        .creature-card h3 {
            margin: 0 0 10px 0;
        }



/* ================================================================
   LIGHT THEME LEGIBILITY OVERRIDES (Support & FAQ)
   ================================================================ */
:root[data-theme="light"] .support-title {
    color: #8c6e13 !important;
}

:root[data-theme="light"] .support-subtitle {
    color: #264331 !important;
}

:root[data-theme="light"] .tab-btn {
    background: #e1efe5 !important;
    border: 2px solid #8fc9a1 !important;
    color: #143522 !important;
}

:root[data-theme="light"] .tab-btn.active,
:root[data-theme="light"] .tab-btn:hover {
    background: linear-gradient(135deg, #2b8a51, #1f6b3e) !important;
    color: #ffffff !important;
    border-color: #1f6b3e !important;
    box-shadow: 0 4px 14px rgba(43, 138, 81, 0.25) !important;
}

:root[data-theme="light"] .faq-item {
    background: #ffffff !important;
    border: 1px solid #b8d4c2 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .faq-item:hover {
    border-color: #2b8a51 !important;
}

:root[data-theme="light"] .faq-question {
    color: #143522 !important;
}

:root[data-theme="light"] .faq-answer {
    color: #264331 !important;
}

:root[data-theme="light"] .bug-card {
    background: #ffffff !important;
    border: 1px solid #b8d4c2 !important;
    border-left: 4px solid #2b8a51 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .bug-title {
    color: #143522 !important;
}

:root[data-theme="light"] .bug-fix {
    color: #264331 !important;
}

:root[data-theme="light"] .bug-badge {
    background: #eef8f1 !important;
    color: #1b6338 !important;
    border-color: #8fc9a1 !important;
}

:root[data-theme="light"] .ticket-form-container {
    background: #ffffff !important;
    border: 1px solid #b8d4c2 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

:root[data-theme="light"] .form-label {
    color: #143522 !important;
}

:root[data-theme="light"] .form-input,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .form-textarea {
    background: #f5f9f6 !important;
    border: 1px solid #8fc9a1 !important;
    color: #143522 !important;
}

:root[data-theme="light"] .email-direct-box,
:root[data-theme="light"] .contact-box {
    background: #ffffff !important;
    border: 1px solid #b8d4c2 !important;
    color: #143522 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
}

:root[data-theme="light"] .email-direct-box a,
:root[data-theme="light"] .contact-box a {
    color: #1b6338 !important;
    font-weight: 700 !important;
}

/* ========================================================
   TOWN HUB & SQUARE GRID SYSTEM
   ======================================================== */
.town-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7.5rem 1.5rem 4rem;
}

.town-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.town-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-family: 'Cinzel', serif;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #d6b46a, #f7e7b4, #d6b46a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.town-subtitle {
    color: var(--text-soft, #b8ccbe);
    font-size: 1.15rem;
    max-width: 680px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.town-stats-banner {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0 auto 2.5rem;
    max-width: 800px;
}

.town-stat-chip {
    background: var(--bg-panel, #112018);
    border: 1px solid var(--border, #254734);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.town-stat-chip .chip-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-soft);
}

.town-stat-chip .chip-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold, #d6b46a);
}

/* Balanced Square Grid System */
.town-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.town-card {
    background: var(--bg-panel, #112018);
    border: 1px solid var(--border, #254734);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    user-select: none;
}

.town-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(214, 180, 106, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.town-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold, #d6b46a);
    box-shadow: 0 14px 32px rgba(0,0,0,0.22), 0 0 22px rgba(214, 180, 106, 0.2);
}

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

.town-card-icon {
    font-size: 3.6rem;
    margin-bottom: 0.6rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
    transition: transform 0.2s ease;
}

.town-card:hover .town-card-icon {
    transform: scale(1.1);
}

.town-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--gold, #d6b46a);
    margin: 0.25rem 0 0.45rem;
}

.town-card-desc {
    color: var(--text-soft, #b8ccbe);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.town-badge-construction {
    position: absolute;
    top: 12px;
    right: -32px;
    background: #eab308;
    color: #000;
    font-weight: 800;
    font-size: 0.65rem;
    padding: 4px 35px;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.town-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    margin-bottom: 0.5rem;
}

/* Town Modals */
.town-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.town-modal-overlay.active {
    display: flex;
}

.town-modal-box {
    background: var(--bg-panel, #112018);
    border: 2px solid var(--border, #254734);
    border-radius: 18px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    position: relative;
    color: var(--text);
}

.town-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.town-modal-close {
    background: none;
    border: none;
    color: var(--text-soft);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 6px;
}

.town-modal-close:hover {
    color: #ef4444;
}

.town-upgrade-card {
    background: var(--bg-muted, rgba(0,0,0,0.3));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.town-upgrade-info h4 {
    margin: 0 0 4px 0;
    color: var(--gold, #d6b46a);
    font-size: 1.05rem;
}

.town-upgrade-info p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-soft);
}

/* Isle Shrine & Lost and Found Styling */
.shrine-lore-box {
    background: linear-gradient(145deg, rgba(16, 32, 24, 0.9), rgba(8, 20, 14, 0.95));
    border: 1px solid rgba(214, 180, 106, 0.35);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}

.shrine-lore-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.shrine-read-more-content {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(214, 180, 106, 0.25);
    animation: fadeIn 0.3s ease;
}

.shrine-read-more-content.expanded {
    display: block;
}

.shrine-toggle-btn {
    background: none;
    border: none;
    color: var(--gold, #d6b46a);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 0;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shrine-toggle-btn:hover {
    color: #fef08a;
}

.shrine-sign-quote {
    background: rgba(0,0,0,0.35);
    border-left: 3px solid var(--gold, #d6b46a);
    padding: 0.75rem 1rem;
    margin-top: 0.85rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #fef08a;
    font-size: 0.92rem;
}

.shrine-offerings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.shrine-offer-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border, #254734);
    border-radius: 12px;
    padding: 1.1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.shrine-offer-card:hover:not(.disabled) {
    transform: translateY(-3px);
    border-color: var(--gold, #d6b46a);
    box-shadow: 0 6px 18px rgba(214, 180, 106, 0.2);
}

.shrine-offer-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.shrine-result-banner {
    display: none;
    margin-top: 1.25rem;
    padding: 1.2rem 1.4rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.55;
    animation: fadeIn 0.35s ease;
}

.shrine-result-banner.blessed {
    display: block;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.18), rgba(168, 85, 247, 0.18));
    border: 1px solid #facc15;
    color: black;
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.2);
}

.shrine-result-banner.fail {
    display: block;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: black;
}

/* Lost and Found */
.laf-attendant-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.laf-attendant-avatar {
    font-size: 2.4rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.laf-attendant-speech {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #cbd5e1;
    margin: 0;
}

.laf-attendant-speech strong {
    color: #f8fafc;
}

.laf-bucket-sign {
    background: #78350f;
    color: #fef3c7;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-align: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: 2px dashed #d97706;
    margin: 1rem 0 1rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.laf-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.laf-tab-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.18s ease;
}

.laf-tab-btn.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.laf-creature-card, .laf-item-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.75rem;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.laf-creature-card:hover, .laf-item-card:hover {
    border-color: var(--gold, #d6b46a);
    transform: translateY(-2px);
}

.laf-time-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .town-card {
        aspect-ratio: auto;
        min-height: 250px;
    }
}
