:root {
    --bg: #2a1548;
    --card: rgba(255, 240, 252, 0.08);
    --border: rgba(255, 182, 230, 0.25);
    --text: #fff5fd;
    --muted: #ddb8e8;
    --accent: #ff6bcb;
    --accent2: #a78bfa;
    --ok: #4ade80;
    --err: #f87171;
    --gold: #ffe566;
    --mlp-pink: #ff9eeb;
    --mlp-lavender: #c4a7ff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 158, 235, 0.35), transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(164, 167, 255, 0.3), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(255, 230, 102, 0.15), transparent 45%),
        linear-gradient(165deg, #3b1d6e 0%, #2a1548 40%, #1f1038 100%);
    color: var(--text);
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.75), transparent),
        radial-gradient(1.5px 1.5px at 28% 72%, rgba(255,255,255,0.55), transparent),
        radial-gradient(1px 1px at 62% 24%, rgba(255,255,255,0.65), transparent),
        radial-gradient(2px 2px at 78% 68%, rgba(255,230,102,0.8), transparent),
        radial-gradient(1px 1px at 90% 35%, rgba(255,255,255,0.5), transparent);
    opacity: 0.8;
    z-index: 0;
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.top h1 {
    margin: 0.25rem 0;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(90deg, #fff, var(--mlp-pink), var(--mlp-lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top h1 span {
    line-height: 1.2;
}

.card h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.card h2 span {
    line-height: 1.2;
}
.sub { margin: 0; color: var(--muted); font-size: 0.95rem; }

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    background: rgba(31, 21, 51, 0.85);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.nav-tab {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 0.6rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-tab:hover:not(:disabled) {
    color: var(--text);
    background: rgba(167, 139, 250, 0.12);
}

.nav-tab.active {
    color: #1a1028;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
}

.nav-tab:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tab-panel {
    display: none;
    animation: tabIn 0.2s ease-out;
}

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

@keyframes tabIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.back {
    color: var(--accent2);
    text-decoration: none;
    font-size: 0.9rem;
}
.back:hover { text-decoration: underline; }

.userbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.card {
    background: linear-gradient(145deg, rgba(255, 240, 252, 0.1), rgba(120, 80, 180, 0.15));
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(80, 30, 120, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
}

.card h2 { margin-top: 0; font-size: 1.2rem; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}

label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.85rem;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input:not([type]) {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1a1028;
    color: var(--text);
    font-size: 1rem;
}

.btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    background: var(--border);
    color: var(--text);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #1a1028;
    font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { margin-top: 0; padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1.05rem; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); margin-top: 0; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.flash-ok { background: rgba(74, 222, 128, 0.15); border: 1px solid var(--ok); }
.flash-err { background: rgba(248, 113, 113, 0.15); border: 1px solid var(--err); }

.hint { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

.pony-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.pony-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(0,0,0,0.15));
    border: 3px solid var(--pony-color, var(--border));
    border-radius: 20px;
    padding: 0.85rem 0.85rem 1rem;
    text-align: center;
    box-shadow: 0 0 24px color-mix(in srgb, var(--pony-glow, var(--accent)) 35%, transparent);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pony-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 36px color-mix(in srgb, var(--pony-glow, var(--accent)) 55%, transparent);
}

.pony-portrait,
.hero-portrait,
.pvp-portrait {
    display: flex;
    justify-content: center;
    margin-bottom: 0.65rem;
}

.pony-portrait {
    position: relative;
    padding: 0.35rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.03));
    border: 2px solid color-mix(in srgb, var(--pony-color) 60%, white);
}

.pony-portrait::after {
    content: "✦";
    position: absolute;
    top: 0.2rem;
    right: 0.45rem;
    color: var(--pony-glow, var(--gold));
    font-size: 0.85rem;
    text-shadow: 0 0 8px var(--pony-glow);
}

.pony-img {
    display: block;
    object-fit: cover;
    border-radius: 12px;
    background: #fff;
}

.pony-img-card {
    width: 100%;
    max-width: 180px;
    height: 180px;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.pony-img-hero {
    width: 160px;
    height: 160px;
    border: 4px solid var(--pony-color, var(--accent));
    box-shadow: 0 0 28px color-mix(in srgb, var(--pony-glow, var(--accent)) 70%, transparent);
}

.pony-img-sm {
    width: 56px;
    height: 56px;
    border: 2px solid rgba(255,255,255,0.4);
}

.pony-img-xs {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.35);
    vertical-align: middle;
    margin-right: 0.35rem;
}

.hero-mlp {
    border-color: color-mix(in srgb, var(--pony-color) 50%, white);
    box-shadow: 0 0 40px color-mix(in srgb, var(--pony-glow) 30%, transparent);
}

.hero-portrait {
    position: relative;
    flex-shrink: 0;
}

.hero-portrait::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px dashed color-mix(in srgb, var(--pony-glow) 70%, transparent);
    animation: spinSlow 18s linear infinite;
}

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

.pony-card h3 { margin: 0.5rem 0; font-size: 1rem; color: #fff; text-shadow: 0 1px 8px var(--pony-color); }
.pony-card p { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.5rem; }

.stats-mini {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.dashboard { display: flex; flex-direction: column; gap: 0; }

.hero-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.hero-icon { font-size: 3rem; }
.level { color: var(--accent2); font-size: 0.95rem; margin: 0.15rem 0 0; }

.xp-block { margin: 0.5rem 0 0.35rem; max-width: 320px; }
.xp-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}
.xp-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 230, 102, 0.35);
}
.xp-bar div {
    height: 100%;
    background: linear-gradient(90deg, #ffe566, #ff9eeb, #a78bfa);
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(255, 230, 102, 0.45);
    transition: width 0.4s ease;
}

.exp-xp { color: #c4b5fd !important; font-weight: 600; }
.free-points { color: var(--ok); font-size: 0.9rem; margin: 0.2rem 0 0; font-weight: 600; }
.gold { color: var(--gold); font-size: 1.15rem; font-weight: 600; margin: 0.25rem 0 0; }
.pvp-record { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 0; }
.hint.locked { padding: 0.75rem; background: #1f1533; border-radius: 8px; border: 1px dashed var(--border); }

.stat-bars { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.35rem; }

.stat-upgrade-note {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 72px 1fr 2.6rem auto auto;
    align-items: center;
    gap: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

.stat-label { color: var(--muted); }

.stat-val {
    text-align: right;
    font-size: 0.9rem;
    white-space: nowrap;
}

.stat-upgrade-free .btn,
.stat-upgrade-paid .btn {
    margin: 0;
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.stat-upgrade-paid .btn .cost {
    font-size: 0.65rem;
    opacity: 0.85;
    margin-left: 0.1rem;
}

@media (max-width: 520px) {
    .stat-row {
        grid-template-columns: 64px 1fr auto;
        grid-template-areas:
            "label bar bar"
            "val free paid";
    }
    .stat-label { grid-area: label; }
    .stat-row .bar { grid-area: bar; }
    .stat-val { grid-area: val; text-align: left; }
    .stat-upgrade-free { grid-area: free; justify-self: end; }
    .stat-upgrade-paid { grid-area: paid; justify-self: end; }
}

.bar {
    height: 8px;
    background: #1a1028;
    border-radius: 4px;
    overflow: hidden;
}
.bar div {
    height: 100%;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    border-radius: 4px;
}

.exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.exp-card {
    background: #1f1533;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.exp-icon { font-size: 1.75rem; }
.exp-card h3 { margin: 0.35rem 0; font-size: 0.95rem; }
.exp-card p { margin: 0.2rem 0; font-size: 0.8rem; color: var(--muted); }

.expedition-status {
    padding: 1rem;
    background: #1f1533;
    border-radius: 10px;
    text-align: center;
}
.expedition-status.ready { border: 1px solid var(--ok); }

.upgrade-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.upgrade-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #1f1533;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.upgrade-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.upgrade-paid { justify-content: flex-end; }

.btn-free {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid var(--ok);
    color: var(--ok);
    margin-top: 0;
}

.btn-free:not(:disabled):hover {
    background: rgba(74, 222, 128, 0.35);
}

.upgrade-row span { display: block; font-size: 0.8rem; color: var(--muted); }
.cost { color: var(--gold); font-size: 0.9rem; white-space: nowrap; }

.btn-danger {
    background: linear-gradient(135deg, #fb7185, #e879f9);
    color: #1a1028;
    font-weight: 600;
}

.pvp-list { display: flex; flex-direction: column; gap: 0.5rem; }

.pvp-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 182, 230, 0.2);
}

.pvp-portrait { margin-bottom: 0; }
.pvp-info span { display: block; font-size: 0.8rem; color: var(--muted); }

.leaderboard { margin-top: 0.5rem; }
.lb-wrap { overflow-x: auto; }

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

.lb-table th,
.lb-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.lb-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lb-table tr.is-me {
    background: rgba(167, 139, 250, 0.12);
}

.lb-table tr.is-me td:first-child { color: var(--accent); }

footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}
footer a { color: var(--muted); }

/* Admin panel */
.admin-wrap { max-width: 1100px; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.stat-box span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-box strong {
    font-size: 1.4rem;
    color: var(--gold);
}

.admin-form { margin-top: 0.5rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-section {
    margin: 1.25rem 0 0.75rem;
    font-size: 1rem;
    color: var(--accent2);
}

select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1a1028;
    color: var(--text);
    font-size: 0.95rem;
}

input[type="number"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1a1028;
    color: var(--text);
    font-size: 1rem;
}

input[type="file"] {
    width: 100%;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    margin: 1rem 0;
}

.profile-compare {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.25rem 0;
}

.profile-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.profile-caption {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.profile-preview-current {
    border-color: rgba(255, 230, 102, 0.45);
}

.profile-preview-box {
    padding: 0.5rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255, 182, 230, 0.35);
}

.pony-img-profile {
    width: 140px;
    height: 140px;
    border-radius: 14px;
    object-fit: cover;
}

.profile-meta p { margin: 0.25rem 0; }
.profile-upload { margin-top: 1rem; }
.profile-remove { margin-top: 0.75rem; }

input:disabled {
    opacity: 0.65;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.check-row input { margin-right: 0.35rem; }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.danger-zone {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.admin-message-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.admin-message-form:first-of-type {
    border-top: none;
    padding-top: 0;
}

.admin-message-form textarea,
.admin-message-form input[type="text"],
.admin-message-form input:not([type="hidden"]),
.admin-message-form select {
    width: 100%;
    max-width: 520px;
    margin-bottom: 0.5rem;
}

.admin-notify-form {
    margin-top: 1.25rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.section-head h2 { margin: 0; }

.expedition-alert {
    margin-bottom: 0.75rem;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.nav-tab.has-badge {
    position: relative;
}

.stat-bonus {
    color: #ffe666;
    font-weight: 600;
}

.daily-card .daily-title {
    font-size: 1.05rem;
    margin: 0.35rem 0;
}

.daily-bar {
    margin: 0.75rem 0;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: baseline;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.history-time {
    color: var(--muted);
    font-size: 0.8rem;
    min-width: 7.5rem;
}

.history-reward {
    margin-left: auto;
    color: #ffe666;
    font-weight: 600;
}

.shop-section-title {
    margin: 1.35rem 0 0.35rem;
    font-size: 1rem;
}

.shop-catalog-hint {
    margin: 0 0 0.5rem;
}

.shop-buy-form {
    margin: 0.5rem 0 0;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.shop-item.is-unavailable {
    opacity: 0.72;
    border-style: dashed;
}

.shop-item.is-in-daily {
    border-color: rgba(255, 230, 102, 0.45);
}

.shop-offer-locked {
    color: #f0a0a0;
}

.shop-rotation-banner {
    margin: 1rem 0 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 2px solid rgba(255, 230, 102, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.shop-subhead {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.shop-owned-grid {
    margin-top: 0.5rem;
}

.shop-item.tier-mid {
    border-color: rgba(96, 165, 250, 0.35);
}

.shop-item.tier-premium {
    border-color: rgba(167, 139, 250, 0.4);
}

.shop-item.tier-legendary {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.06);
}

.shop-offer-tag {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.shop-item {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255, 182, 230, 0.25);
    text-align: center;
}

.shop-item.is-owned {
    border-color: rgba(120, 255, 160, 0.35);
    opacity: 0.9;
}

.shop-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.35rem;
}

.shop-item h3 {
    margin: 0.25rem 0;
    font-size: 1rem;
}

.shop-item p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.owned-tag {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #8f8;
}

.item-bonus-line {
    color: #ffe666;
}

.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.65rem;
}

.ach-category {
    margin-top: 1.25rem;
}

.ach-cat-head {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
}

.ach-cat-head span {
    font-size: 0.8rem;
    font-weight: normal;
}

.ach-progress {
    margin: 0.5rem 0 0.25rem;
}

.ach-card {
    padding: 0.75rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.ach-card.is-unlocked {
    border-color: rgba(255, 230, 102, 0.45);
    background: rgba(255, 230, 102, 0.08);
}

.ach-card.is-locked {
    opacity: 0.45;
    filter: grayscale(0.8);
}

.ach-icon {
    font-size: 1.75rem;
    display: block;
}

.ach-card strong {
    display: block;
    margin: 0.35rem 0 0.15rem;
    font-size: 0.85rem;
}

.ach-card span {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
}

.ach-card small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: var(--muted);
}

.exp-bonus {
    font-size: 0.78rem;
    color: #ffe666;
    line-height: 1.3;
}

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

.guild-box {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(180, 140, 255, 0.3);
}

.guild-box h3 {
    margin: 0 0 0.5rem;
}

.guild-subhead {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.guild-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guild-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.guild-member-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.guild-member-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.guild-member-list li span:last-child {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.82rem;
}

.guild-raid-grid .exp-card {
    text-align: left;
}

.guild-raid-party {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guild-raid-party li {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 0.85rem;
}

.guild-lobby-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.guild-raid-active,
.guild-raid-lobby {
    margin-top: 0.5rem;
}

.guild-boss-card {
    margin-top: 1rem;
}

.boss-hp-wrap {
    position: relative;
    height: 2rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(239, 68, 68, 0.45);
    overflow: hidden;
    margin: 0.75rem 0;
}

.boss-hp-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f97316);
    transition: width 0.35s ease;
    min-width: 2%;
}

.boss-hp-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.guild-boss-dmg-list li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.guild-boss-active,
.guild-boss-defeated,
.guild-boss-spectate {
    margin-top: 0.5rem;
}

.guild-boss-card-item {
    border-color: rgba(239, 68, 68, 0.25);
}

.guild-leaderboard {
    margin-top: 1rem;
}

.guild-stats-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.guild-stats-line strong {
    color: #fde68a;
}

.guild-lb-jump {
    margin-left: auto;
}

.achievement-alert {
    border-color: rgba(255, 230, 102, 0.45);
}

.daily-quest-row {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.daily-quest-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.inbox-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.inbox-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    margin-bottom: 0.5rem;
}

.inbox-item.is-unread {
    border: 1px solid rgba(255, 230, 102, 0.35);
    background: rgba(255, 230, 102, 0.06);
}

.inbox-icon {
    font-size: 1.5rem;
}

.inbox-body p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.inbox-time {
    font-size: 0.75rem;
    color: var(--muted);
}

.inbox-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pm-compose {
    margin-bottom: 1rem;
}

.pm-compose-row {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .pm-compose-row {
        grid-template-columns: 180px 1fr;
        align-items: start;
    }
}

.pm-compose textarea,
.pm-reply-form textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    resize: vertical;
}

.pm-thread-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pm-thread-item {
    border-bottom: 1px solid var(--border);
}

.pm-thread-item.is-unread {
    background: rgba(255, 230, 102, 0.06);
}

.pm-thread-link {
    display: block;
    padding: 0.75rem 0.5rem;
    color: inherit;
    text-decoration: none;
}

.pm-thread-link:hover {
    background: rgba(255, 255, 255, 0.04);
}

.pm-preview {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.pm-thread-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.pm-thread-title {
    margin: 0.5rem 0 1rem;
}

.pm-messages {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
}

.pm-bubble {
    max-width: 85%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.pm-bubble-mine {
    align-self: flex-end;
    background: rgba(147, 112, 219, 0.25);
    border-color: rgba(147, 112, 219, 0.35);
}

.pm-bubble-theirs {
    align-self: flex-start;
}

.pm-sender {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.15rem;
}

.pm-bubble p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.pm-time {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.pm-reply-form {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.pm-empty {
    margin-top: 0.75rem;
}

.pm-quick-link {
    margin-left: 0.35rem;
    text-decoration: none;
    opacity: 0.85;
    font-size: 0.95rem;
}

.pm-quick-link:hover {
    opacity: 1;
}

.admin-pm-detail {
    margin-top: 0.75rem;
}

.admin-pm-delete-thread {
    margin: 0.75rem 0 1rem;
}

.admin-pm-log {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-pm-log-item {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.admin-pm-log-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.admin-pm-log-item p {
    margin: 0 0 0.5rem;
    word-break: break-word;
}

.pm-preview-cell {
    max-width: 220px;
    font-size: 0.85rem;
    color: var(--muted);
}

.inline-form {
    display: inline;
    margin-left: 0.35rem;
}

.guild-bank-card .guild-donate-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
    margin-top: 0.75rem;
}

.guild-buff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.guild-buff-card {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    text-align: center;
}

.guild-buff-card p {
    font-size: 0.8rem;
    color: var(--muted);
}

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

.craft-item {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    text-align: center;
}

.mat-line {
    margin-top: 0.5rem;
}

.pvp-weekly-card {
    margin-top: 1rem;
}

.pvp-replay-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 6, 18, 0.82);
    backdrop-filter: blur(4px);
}

.pvp-replay-overlay[hidden] {
    display: none !important;
}

.pvp-replay-modal {
    width: min(100%, 520px);
    max-height: 92vh;
    overflow: auto;
    margin: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.pvp-replay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.pvp-replay-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.pvp-replay-round {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}

.pvp-replay-arena {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 0.75rem;
}

.pvp-replay-fighter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.pvp-replay-fighter.pvp-replay-hit {
    transform: scale(0.94);
    filter: brightness(1.25) saturate(1.2);
}

.pvp-replay-vs {
    align-self: center;
    font-size: 1.4rem;
    opacity: 0.85;
}

.pvp-replay-hp-wrap {
    width: 100%;
}

.pvp-replay-hp-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.pvp-replay-hp-bar span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: width 0.35s ease;
}

.pvp-replay-fighter:last-child .pvp-replay-hp-bar span {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

.pvp-replay-hp-text {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.pvp-replay-log {
    min-height: 120px;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    line-height: 1.45;
}

.pvp-replay-log-line {
    margin: 0.15rem 0;
}

.pvp-replay-log-line.is-you {
    color: #86efac;
}

.pvp-replay-log-line.is-them {
    color: #fca5a5;
}

.pvp-replay-result {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
}

.pvp-replay-result.is-win {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid var(--ok);
}

.pvp-replay-result.is-loss {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid var(--err);
}

.pvp-replay-result p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.pvp-replay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.expedition-encounter-card {
    margin-top: 1rem;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), transparent);
}

.expedition-encounter-card h3 {
    margin: 0 0 0.35rem;
}

.expedition-encounter-npc {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.expedition-encounter-npc img {
    border-radius: 12px;
}

.admin-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.admin-inline-actions form {
    margin: 0;
}

.evo-badge {
    font-size: 0.55em;
    font-weight: 600;
    color: #fde68a;
    vertical-align: middle;
}

.evo-from {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: normal;
}

.evo-preview {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 14px;
    border: 2px solid rgba(255, 230, 102, 0.35);
    background: rgba(255,255,255,0.05);
}

.evo-preview-head {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.evo-preview-head span {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.evo-list {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0;
    font-size: 0.85rem;
}

.evo-list li {
    padding: 0.2rem 0;
}

.evo-pros li { color: #8f8; }
.evo-cons li { color: #f9a8a8; }

.evo-form {
    margin-top: 1rem;
}

.evo-hint {
    font-size: 0.78rem;
    color: #fde68a;
    margin: 0.5rem 0 0;
}

.guild-app-pending {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 230, 102, 0.35);
    background: rgba(255, 230, 102, 0.08);
}

.guild-app-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guild-app-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.guild-app-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.guild-app-user span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.guild-app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guild-role-actions {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
}

.guild-role-actions form {
    margin: 0;
}

.guild-member-list li {
    flex-wrap: wrap;
}

.story-card h3 {
    margin: 0.5rem 0 0.35rem;
}

.story-progress-label {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.story-current {
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.story-start {
    margin-top: 1rem;
}

.story-claim {
    margin-top: 0.75rem;
}

.story-outline {
    margin-top: 1rem;
}

.story-outline summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.9rem;
}

.story-steps {
    list-style: none;
    padding: 0.75rem 0 0;
    margin: 0;
}

.story-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    opacity: 0.55;
}

.story-step.active,
.story-step.done {
    opacity: 1;
}

.story-step-num {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
}

.story-step.active .story-step-num {
    background: var(--accent);
    color: #1a1028;
    border-color: transparent;
}

.story-step.done .story-step-num {
    background: rgba(100, 220, 140, 0.2);
    border-color: rgba(100, 220, 140, 0.4);
}

.story-tag {
    font-size: 0.75rem;
    color: var(--accent);
    margin-left: 0.35rem;
}

.story-complete {
    margin-bottom: 1rem;
}

.tutorial-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(180deg, transparent, rgba(8, 6, 18, 0.92) 25%);
    pointer-events: none;
}

.tutorial-inner {
    pointer-events: auto;
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 230, 120, 0.35);
    background: rgba(26, 18, 42, 0.96);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.tutorial-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.tutorial-step-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 230, 102, 0.15);
    color: #ffe666;
}

.tutorial-banner p {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.45;
}

.tutorial-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tutorial-ack-form,
.tutorial-skip-form {
    margin: 0;
}

.nav-tab.tutorial-highlight {
    box-shadow: 0 0 0 2px rgba(255, 230, 102, 0.65);
    animation: tutorial-tab-pulse 1.6s ease-in-out infinite;
}

@keyframes tutorial-tab-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 230, 102, 0.45); }
    50% { box-shadow: 0 0 0 4px rgba(255, 230, 102, 0.85); }
}

.tutorial-pulse {
    animation: tutorial-target-pulse 1.6s ease-in-out infinite;
    border-radius: 10px;
}

@keyframes tutorial-target-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 230, 102, 0.35); }
    50% { box-shadow: 0 0 0 4px rgba(255, 230, 102, 0.55); }
}

body:has(.tutorial-banner) .wrap {
    padding-bottom: 9rem;
}

.stat-box-alert strong {
    color: #ff8a80;
}

.reset-request-card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.reset-request-head {
    margin-bottom: 0.35rem;
}

.copy-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.copy-input,
.copy-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
}

.copy-textarea {
    margin-bottom: 0.5rem;
    resize: vertical;
}

.reset-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.reset-request-actions form {
    margin: 0;
}

.wellness-mini {
    margin-top: 0.65rem;
    display: grid;
    gap: 0.35rem;
    max-width: 220px;
}

.wellness-mini-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.wellness-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .wellness-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.wellness-block {
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
}

.wellness-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
}

.wellness-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.wellness-bar.sm {
    height: 6px;
}

.wellness-bar > div {
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s ease;
}

.mood-bar > div {
    background: linear-gradient(90deg, #f472b6, #fde68a);
}

.fatigue-bar > div {
    background: linear-gradient(90deg, #6366f1, #f87171);
}

.wellness-effect {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
}

.rest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.rest-form {
    margin: 0;
}

.activity-start-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-bottom: 1rem;
}

.activity-card {
    margin: 0;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-icon {
    font-size: 1.6rem;
}

.activity-card h3 {
    margin: 0;
    font-size: 0.95rem;
}

.activity-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.activity-meta {
    font-size: 0.78rem !important;
}

.activity-open-title {
    margin: 0.5rem 0 0.75rem;
    font-size: 1rem;
}

.activity-open-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.activity-open-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.activity-open-item form {
    margin: 0;
}

.public-chat-log {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.public-chat-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem 0.6rem;
    align-items: baseline;
    font-size: 0.9rem;
}

.public-chat-author {
    font-weight: 700;
    color: var(--mlp-pink);
    white-space: nowrap;
}

.public-chat-body {
    word-break: break-word;
}

.public-chat-time {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.public-chat-form {
    display: grid;
    gap: 0.5rem;
}

.public-chat-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 3rem;
}

.exp-fatigue {
    font-size: 0.82rem;
    color: #c4b5fd;
    margin: 0.15rem 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.activity-play-card {
    border-color: rgba(255, 158, 235, 0.45);
    box-shadow: 0 0 24px rgba(255, 107, 203, 0.15);
}

.activity-play-prompt {
    font-size: 1.05rem;
    margin: 0.5rem 0 0.75rem;
}

.activity-timer {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.activity-resume-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dance-sequence-display,
.dance-input-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
    min-height: 2.5rem;
}

.dance-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.35);
    font-weight: 700;
    transition: transform 0.15s, background 0.15s;
}

.dance-step.is-active {
    transform: scale(1.15);
    background: rgba(255, 158, 235, 0.45);
}

.dance-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.activity-pick-grid {
    display: grid;
    gap: 0.5rem;
}

.activity-pick-btn {
    text-align: left;
    justify-content: flex-start;
    white-space: normal;
    height: auto;
    padding: 0.65rem 0.85rem;
}

.activity-star-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 220px;
    margin: 0.5rem 0 1rem;
}

.star-cell {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
    transition: transform 0.12s, box-shadow 0.12s;
}

.star-cell:hover {
    transform: scale(1.08);
}

.star-bright {
    box-shadow: 0 0 12px rgba(255, 230, 102, 0.8);
    background: radial-gradient(circle, #ffe566 0%, rgba(255, 230, 102, 0.2) 65%, transparent 70%);
}

.star-mid {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

.star-dim {
    opacity: 0.55;
}

.activity-word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.activity-word-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.5rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
}

.activity-word-picked {
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: rgba(255, 158, 235, 0.25);
    border: 1px solid rgba(255, 158, 235, 0.35);
}

.world-map-card {
    margin-bottom: 1rem;
}

.map-location-hint {
    margin-bottom: 0.75rem;
}

.world-map {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 3.2;
    min-height: 220px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse 80% 60% at 50% 80%, rgba(74, 222, 128, 0.12), transparent 70%),
        radial-gradient(ellipse 50% 40% at 20% 30%, rgba(168, 85, 247, 0.15), transparent 65%),
        linear-gradient(180deg, #1a1030 0%, #120a20 45%, #0d1628 100%);
    overflow: hidden;
}

.world-map-routes {
    position: absolute;
    inset: 8% 4% 12% 4%;
    width: calc(100% - 8%);
    height: calc(100% - 20%);
    pointer-events: none;
}

.world-map-route {
    stroke: rgba(196, 181, 253, 0.35);
    stroke-width: 0.6;
    stroke-dasharray: 2 1.5;
}

.world-map-route.is-active {
    stroke: rgba(250, 204, 21, 0.85);
    stroke-width: 1;
    stroke-dasharray: none;
    animation: map-route-pulse 1.6s ease-in-out infinite;
}

@keyframes map-route-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.world-map-node {
    position: absolute;
    left: var(--mx);
    top: var(--my);
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    max-width: 28%;
}

.world-map-node-dot {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto 0.2rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: var(--accent2);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.45);
}

.world-map-node.theme-farm .world-map-node-dot { background: #86efac; box-shadow: 0 0 10px rgba(134, 239, 172, 0.45); }
.world-map-node.theme-forest .world-map-node-dot { background: #4ade80; }
.world-map-node.theme-crystal .world-map-node-dot { background: #67e8f9; box-shadow: 0 0 12px rgba(103, 232, 249, 0.55); }
.world-map-node.theme-storm .world-map-node-dot { background: #94a3b8; }
.world-map-node.theme-aurora .world-map-node-dot { background: #f0abfc; box-shadow: 0 0 14px rgba(240, 171, 252, 0.6); }

.world-map-node-label {
    display: block;
    font-size: 0.62rem;
    line-height: 1.15;
    color: var(--muted);
    text-shadow: 0 1px 3px #000;
}

.world-map-node.is-here .world-map-node-dot,
.world-map-node.is-dest .world-map-node-dot {
    width: 18px;
    height: 18px;
    border-color: #fde68a;
}

.world-map-node.is-locked .world-map-node-dot {
    opacity: 0.45;
    background: #64748b;
}

.world-map-node.is-locked .world-map-node-label {
    opacity: 0.55;
}

.world-map-pony-marker {
    position: absolute;
    left: 50%;
    top: -1.1rem;
    transform: translateX(-50%);
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    animation: map-pony-bob 2s ease-in-out infinite;
}

@keyframes map-pony-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

.map-travel-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.map-travel-heading {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.map-travel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #1f1533;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.map-travel-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.map-travel-info strong {
    font-size: 0.9rem;
}

.map-travel-info .hint {
    font-size: 0.75rem;
}

.map-lock {
    font-size: 0.75rem;
    color: #fbbf24;
}

.map-travel-form {
    margin: 0;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .world-map-node-label {
        font-size: 0.55rem;
    }

    .map-travel-row {
        flex-direction: column;
        align-items: stretch;
    }

    .map-travel-form .btn {
        width: 100%;
    }
}

.open-world-card {
    overflow: hidden;
}

.open-world-wrap {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: #0b1220;
}

#open-world-canvas {
    display: block;
    width: 100%;
    cursor: crosshair;
    touch-action: none;
}

.open-world-hud {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: rgba(15, 10, 28, 0.92);
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
}

.ow-hud-zone {
    color: #fde68a;
    font-weight: 600;
}

.ow-hud-online {
    color: var(--muted);
}

.ow-controls-hint {
    margin: 0.5rem 0 0;
    padding: 0 0.25rem;
}

.ow-blocked {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.map-teaser-card {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
}

.grid-world-card {
    overflow: hidden;
}

.grid-board-wrap {
    width: 100%;
    max-width: min(960px, 100%);
    margin: 0.75rem auto;
}

.grid-board {
    display: grid;
    grid-template-columns: repeat(var(--grid-w), 1fr);
    grid-template-rows: repeat(var(--grid-h), 1fr);
    gap: 2px;
    width: 100%;
    aspect-ratio: 24 / 18;
    background: #0b1220;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.grid-cell {
    position: relative;
    border-radius: 3px;
    min-height: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.7);
    overflow: visible;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.grid-cell.tile-grass { background-image: url('/pony-hra/img/map/grass.svg'); }
.grid-cell.tile-forest { background-image: url('/pony-hra/img/map/forest.svg'); }
.grid-cell.tile-path { background-image: url('/pony-hra/img/map/path.svg'); }
.grid-cell.tile-town { background-image: url('/pony-hra/img/map/town.svg'); }
.grid-cell.tile-farm { background-image: url('/pony-hra/img/map/farm.svg'); }
.grid-cell.tile-crystal { background-image: url('/pony-hra/img/map/crystal.svg'); }
.grid-cell.tile-storm { background-image: url('/pony-hra/img/map/storm.svg'); }
.grid-cell.tile-aurora { background-image: url('/pony-hra/img/map/aurora.svg'); }
.grid-cell.tile-water-deep { background-image: url('/pony-hra/img/map/water-deep.svg'); }
.grid-cell.tile-mountain { background-image: url('/pony-hra/img/map/mountain.svg'); }
.grid-cell.tile-water-shallow { background-image: url('/pony-hra/img/map/water-shallow.svg'); }

.grid-cell.is-blocked { pointer-events: none; }
.grid-cell.is-locked { opacity: 0.45; }

.grid-cell.is-clickable {
    outline: 2px solid rgba(250, 204, 21, 0.65);
    cursor: pointer;
}

.grid-cell.is-here {
    box-shadow: inset 0 0 0 2px #fde68a;
}

.grid-cell.is-landmark {
    box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.45);
}

.grid-landmark-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -62%);
    width: 72%;
    height: 72%;
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}

.grid-landmark-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1px 2px;
    font-size: clamp(0.34rem, 0.85vw, 0.5rem);
    line-height: 1.05;
    text-align: center;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    border-radius: 0 0 3px 3px;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.grid-move-form {
    margin: 0;
    width: 100%;
    height: 100%;
}

.grid-cell-btn {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: inherit;
    font: inherit;
}

.grid-player-stack {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    pointer-events: none;
}

.grid-player-avatar {
    width: clamp(22px, 2.8vw, 36px);
    height: clamp(22px, 2.8vw, 36px);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
    background: #1e293b;
}

.grid-player-avatar.is-self {
    width: clamp(26px, 3.2vw, 40px);
    height: clamp(26px, 3.2vw, 40px);
    border-color: #fde68a;
    box-shadow: 0 0 0 2px rgba(253, 230, 138, 0.35), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.grid-cell.is-dest .grid-player-avatar.is-self {
    opacity: 0.45;
    transform: scale(0.85);
}

.grid-event-flash {
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--ok);
    background: rgba(74, 222, 128, 0.1);
}

.grid-event-reward {
    color: #fde68a;
    margin: 0.35rem 0 0;
}

.grid-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.grid-legend .lg-img {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 0.3rem;
    vertical-align: middle;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

button.linkish {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--accent2);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}
