/* Obsidian Shores — RP City Player Portal
   Minecraft-inspired theme: pixel headings, blocky panels, torch-glow accents. */

:root {
    --bg-void: #0a0b0f;
    --bg-panel: #16181f;
    --bg-panel-2: #1d2029;
    --border-block: #33384a;
    --purple: #a855f7;
    --purple-dark: #6d28d9;
    --teal: #2dd4bf;
    --gold: #f5c144;
    --ember: #f97316;
    --text: #e7e6ef;
    --text-muted: #9a9cb0;
    --ok: #4ade80;
    --warn: #f5c144;
    --input-bg: #0e0f14;
    --shadow-hi: rgba(255, 255, 255, 0.25);
    --shadow-lo: rgba(0, 0, 0, 0.45);
    --shadow-hi-soft: rgba(168, 85, 247, 0.18);
    --shadow-lo-soft: rgba(0, 0, 0, 0.55);
    --panel-frame: #23273a;
    --topbar-bg: rgba(15, 16, 22, 0.92);
    --heading-color: #fff;
    --heading-shadow: 2px 2px 0 rgba(0,0,0,0.55);
    --frame-border: #000;
    --btn-text: #fff;
}

/* Light mode: Minecraft "book/parchment" GUI palette instead of a plain invert. */
:root[data-theme="light"] {
    --bg-void: #e9dcc0;
    --bg-panel: #f4ead2;
    --bg-panel-2: #fbf3de;
    --border-block: #b89a5f;
    --purple: #7c3aed;
    --purple-dark: #5b21b6;
    --teal: #0f8a7c;
    --gold: #b8860b;
    --ember: #c2410c;
    --text: #3a2c1a;
    --text-muted: #6b5a3d;
    --ok: #2f8f4e;
    --warn: #b8860b;
    --input-bg: #fffaf0;
    --shadow-hi: rgba(255, 255, 255, 0.85);
    --shadow-lo: rgba(120, 96, 45, 0.35);
    --shadow-hi-soft: rgba(124, 58, 237, 0.12);
    --shadow-lo-soft: rgba(120, 96, 45, 0.3);
    --panel-frame: #cbb27a;
    --topbar-bg: rgba(244, 234, 210, 0.94);
    --heading-color: #2a1d0f;
    --heading-shadow: 1px 1px 0 rgba(255,255,255,0.7);
    --frame-border: #8a6d3b;
    --btn-text: #2a1d0f;
}

:root[data-theme="light"] .theme-icon-dark { display: none; }
:root:not([data-theme="light"]) .theme-icon-light { display: none; }
:root[data-theme="light"] .btn { text-shadow: none; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html { min-height: 100%; }
html, body { overflow-x: hidden; }

body {
    background:
        radial-gradient(ellipse at top, rgba(168, 85, 247, 0.12), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(45, 212, 191, 0.08), transparent 55%),
        var(--bg-void);
    color: var(--text);
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ---------------- Minecraft-style world backdrop ---------------- */
.mc-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Faint blocky world grid, like Minecraft chunk borders */
.mc-grid {
    position: absolute;
    inset: -2px;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 20%, black 0%, transparent 75%);
    mask-image: radial-gradient(ellipse at 50% 20%, black 0%, transparent 75%);
    animation: grid-drift 30s linear infinite;
}

:root[data-theme="light"] .mc-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
}

:root[data-theme="light"] .mc-particles span { filter: brightness(0.8) saturate(1.3); }

@keyframes grid-drift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 42px 84px, 84px 42px; }
}

/* Floating glowing "ore dust" particles */
.mc-particles span {
    position: absolute;
    bottom: -10px;
    width: 4px;
    height: 4px;
    background: var(--purple);
    box-shadow: 0 0 6px 2px rgba(168, 85, 247, 0.8);
    border-radius: 1px;
    opacity: 0;
    animation: particle-rise linear infinite;
}

.mc-particles span:nth-child(3n) { background: var(--teal); box-shadow: 0 0 6px 2px rgba(45, 212, 191, 0.8); }
.mc-particles span:nth-child(4n) { background: var(--gold); box-shadow: 0 0 6px 2px rgba(245, 193, 68, 0.8); width: 3px; height: 3px; }

.mc-particles span:nth-child(1) { left: 4%; animation-duration: 14s; animation-delay: 0s; }
.mc-particles span:nth-child(2) { left: 11%; animation-duration: 18s; animation-delay: 2s; }
.mc-particles span:nth-child(3) { left: 18%; animation-duration: 12s; animation-delay: 4s; }
.mc-particles span:nth-child(4) { left: 25%; animation-duration: 20s; animation-delay: 1s; }
.mc-particles span:nth-child(5) { left: 32%; animation-duration: 16s; animation-delay: 5s; }
.mc-particles span:nth-child(6) { left: 39%; animation-duration: 13s; animation-delay: 3s; }
.mc-particles span:nth-child(7) { left: 46%; animation-duration: 19s; animation-delay: 6s; }
.mc-particles span:nth-child(8) { left: 53%; animation-duration: 15s; animation-delay: 0.5s; }
.mc-particles span:nth-child(9) { left: 60%; animation-duration: 17s; animation-delay: 2.5s; }
.mc-particles span:nth-child(10) { left: 67%; animation-duration: 21s; animation-delay: 4.5s; }
.mc-particles span:nth-child(11) { left: 74%; animation-duration: 14s; animation-delay: 1.5s; }
.mc-particles span:nth-child(12) { left: 81%; animation-duration: 18s; animation-delay: 3.5s; }
.mc-particles span:nth-child(13) { left: 88%; animation-duration: 12s; animation-delay: 5.5s; }
.mc-particles span:nth-child(14) { left: 95%; animation-duration: 20s; animation-delay: 0.8s; }
.mc-particles span:nth-child(15) { left: 8%; animation-duration: 22s; animation-delay: 7s; }
.mc-particles span:nth-child(16) { left: 42%; animation-duration: 16s; animation-delay: 8s; }
.mc-particles span:nth-child(17) { left: 70%; animation-duration: 19s; animation-delay: 9s; }
.mc-particles span:nth-child(18) { left: 90%; animation-duration: 13s; animation-delay: 6.5s; }
.mc-particles span:nth-child(19) { left: 15%; animation-duration: 17s; animation-delay: 10s; }
.mc-particles span:nth-child(20) { left: 55%; animation-duration: 15s; animation-delay: 11s; }
.mc-particles span:nth-child(21) { left: 30%; animation-duration: 21s; animation-delay: 12s; }
.mc-particles span:nth-child(22) { left: 63%; animation-duration: 14s; animation-delay: 13s; }
.mc-particles span:nth-child(23) { left: 78%; animation-duration: 18s; animation-delay: 14s; }
.mc-particles span:nth-child(24) { left: 20%; animation-duration: 20s; animation-delay: 15s; }

@keyframes particle-rise {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-100vh) translateX(24px); opacity: 0; }
}

.topbar, .page-shell, .bare-body, .site-footer, .login-shell { position: relative; z-index: 1; }

/* Pixel blocky headings, Minecraft style */
.rp-heading, .panel-title, .section-heading, .subcard-title {
    font-family: 'Press Start 2P', 'Rajdhani', monospace;
    text-shadow: var(--heading-shadow);
    letter-spacing: 0.5px;
}

.rp-heading { font-size: 1.4rem; color: var(--heading-color); margin: 0; }
.panel-title {
    font-size: 1.05rem;
    color: var(--heading-color);
    margin: 0 0 0.9rem;
    padding-left: 0.9rem;
    border-left: 4px solid var(--purple);
    text-shadow: var(--heading-shadow), 0 0 12px rgba(168,85,247,0.35);
}
.section-heading { font-size: 0.9rem; color: var(--teal); margin: 0 0 0.8rem; }
.subcard-title { font-size: 0.75rem; color: var(--gold); margin: 0 0 0.6rem; }

.text-muted { color: var(--text-muted); }

/* ---------------- Login / Welcome screen ---------------- */
.bare-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-shell {
    width: 100%;
    max-width: 460px;
}

.login-card {
    background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 2px;
    padding: 2.4rem 2rem;
    text-align: center;
    box-shadow:
        inset 3px 3px 0 var(--shadow-hi-soft),
        inset -3px -3px 0 var(--shadow-lo-soft),
        0 0 0 3px var(--frame-border),
        0 0 0 6px var(--panel-frame),
        0 20px 60px rgba(0,0,0,0.35),
        0 0 70px rgba(168,85,247,0.18);
}

.logo-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 1.2rem;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    animation: logo-float 4.5s ease-in-out infinite;
    filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.55));
}

.logo-glow {
    position: absolute;
    inset: -20px;
    z-index: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168,85,247,0.45) 0%, rgba(45,212,191,0.25) 45%, transparent 72%);
    filter: blur(6px);
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes logo-pulse {
    0%, 100% { opacity: 0.55; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.06); }
}

.theme-toggle-floating {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 5;
}

.wordmark-img {
    display: block;
    max-width: 260px;
    width: 80%;
    height: auto;
    margin: -0.6rem auto 0.6rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

.rp-subtext { color: var(--text-muted); margin-bottom: 1.6rem; }

.login-footnote {
    margin-top: 1.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------------- Buttons (Minecraft GUI button bevel) ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-decoration: none;
    cursor: pointer;
    border-radius: 2px;
    border: none;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    position: relative;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
    box-shadow:
        inset 2px 2px 0 var(--shadow-hi),
        inset -2px -2px 0 var(--shadow-lo),
        0 0 0 2px var(--frame-border),
        0 3px 0 var(--frame-border);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.14); }
.btn:active {
    transform: translateY(3px);
    box-shadow:
        inset 2px 2px 0 var(--shadow-lo),
        inset -2px -2px 0 var(--shadow-hi),
        0 0 0 2px var(--frame-border);
}

.btn-primary {
    background: linear-gradient(180deg, var(--purple), var(--purple-dark));
    color: #fff;
}

.btn-lg { padding: 0.95rem 1.8rem; font-size: 1rem; width: 100%; letter-spacing: 1px; }

.btn-ghost {
    background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
    color: var(--btn-text);
    text-shadow: none;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    box-shadow: inset 1px 1px 0 var(--shadow-hi), inset -1px -1px 0 var(--shadow-lo), 0 0 0 1px var(--frame-border), 0 2px 0 var(--frame-border);
}
.btn-sm:active { box-shadow: inset 1px 1px 0 var(--shadow-lo), 0 0 0 1px var(--frame-border); transform: translateY(2px); }

.btn-discord {
    width: 100%;
    background: linear-gradient(180deg, #5865F2, #4752c4);
    color: #fff;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
}

/* ---------------- App shell ---------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.6rem;
    background: var(--topbar-bg);
    box-shadow: inset 0 -2px 0 rgba(168,85,247,0.25), 0 0 0 2px var(--frame-border), 0 4px 20px rgba(0,0,0,0.35);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(6px);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--heading-color);
    text-decoration: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
}

.topbar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(168,85,247,0.7)) drop-shadow(0 0 22px rgba(45,212,191,0.35));
    animation: logo-float 5s ease-in-out infinite;
}

.topbar-wordmark {
    height: 54px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(168,85,247,0.35));
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid var(--border-block);
}

.page-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.4rem 3rem;
    display: grid;
    gap: 1.6rem;
    flex: 1 0 auto;
}

.topbar { flex-shrink: 0; }

.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1.2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-block);
}

.site-footer p { margin: 0; word-break: break-word; }

/* ---------------- Onboarding progress bar ---------------- */
.progress-panel { padding: 1.2rem 1.4rem; }

.mc-progress {
    display: flex;
    align-items: flex-start;
}

.mc-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    width: 84px;
}

.mc-progress-node {
    width: 40px;
    height: 40px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    background: var(--bg-panel-2);
    color: var(--text-muted);
    box-shadow:
        inset 1px 1px 0 var(--shadow-hi-soft),
        inset -1px -1px 0 var(--shadow-lo-soft),
        0 0 0 2px var(--frame-border),
        0 0 0 4px var(--panel-frame);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mc-progress-step.is-current .mc-progress-node {
    background: linear-gradient(180deg, var(--purple), var(--purple-dark));
    color: #fff;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.35),
        inset -1px -1px 0 rgba(0,0,0,0.4),
        0 0 0 2px var(--frame-border),
        0 0 0 4px var(--panel-frame),
        0 0 16px rgba(168, 85, 247, 0.65);
    animation: progress-pulse 1.8s ease-in-out infinite;
}

.mc-progress-step.is-done .mc-progress-node {
    background: linear-gradient(180deg, var(--teal), #0f8a7c);
    color: #fff;
}

@keyframes progress-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.mc-progress-label {
    font-size: 0.72rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    line-height: 1.2;
}

.mc-progress-step.is-current .mc-progress-label { color: var(--heading-color); font-weight: 700; }
.mc-progress-step.is-done .mc-progress-label { color: var(--teal); }

.mc-progress-connector {
    flex: 1 1 auto;
    height: 4px;
    margin-top: 18px;
    background: var(--bg-panel-2);
    box-shadow: 0 0 0 1px var(--frame-border);
    min-width: 16px;
}

.mc-progress-connector.is-filled {
    background: linear-gradient(90deg, var(--teal), var(--purple));
}

@media (max-width: 640px) {
    .mc-progress { overflow-x: auto; padding-bottom: 0.6rem; }
    .mc-progress-step { width: 68px; }
    .mc-progress-label { font-size: 0.62rem; }
    .mc-progress-node { width: 34px; height: 34px; font-size: 0.68rem; }
}

/* ---------------- Panels / cards ---------------- */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.panel, .subcard {
    background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 2px;
    padding: 1.6rem;
    position: relative;
    box-shadow:
        inset 2px 2px 0 var(--shadow-hi-soft),
        inset -2px -2px 0 var(--shadow-lo-soft),
        0 0 0 2px var(--frame-border),
        0 0 0 5px var(--panel-frame),
        0 10px 30px rgba(0,0,0,0.3);
}

.subcard {
    padding: 1rem 1.2rem;
    margin-top: 1rem;
    box-shadow:
        inset 1px 1px 0 var(--shadow-hi-soft),
        inset -1px -1px 0 var(--shadow-lo-soft),
        0 0 0 1px var(--frame-border),
        0 0 0 3px var(--panel-frame);
}

.panel-hero { text-align: center; }
.panel-hero form { margin-top: 1.2rem; }

/* ---------------- Forms ---------------- */
.rp-form { display: grid; gap: 1rem; }

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

.form-section-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--teal);
    border-bottom: 1px solid var(--border-block);
    padding-bottom: 0.3rem;
    margin: 0.6rem 0 0;
}

.rp-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rp-form input[type="text"],
.rp-form input[type="datetime-local"],
.rp-form textarea {
    background: var(--input-bg);
    border: none;
    border-radius: 2px;
    color: var(--text);
    padding: 0.6rem 0.7rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    box-shadow: inset 2px 2px 0 var(--shadow-lo-soft), inset -1px -1px 0 var(--shadow-hi-soft), 0 0 0 2px var(--frame-border);
}

.rp-form input:focus, .rp-form textarea:focus {
    outline: none;
    box-shadow: inset 2px 2px 0 var(--shadow-lo-soft), 0 0 0 2px var(--frame-border), 0 0 0 4px rgba(168,85,247,0.35);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text);
}

.req { color: var(--ember); }

.form-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---------------- Badges / callouts ---------------- */
.badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--bg-panel-2);
    color: var(--text);
    box-shadow: inset 1px 1px 0 var(--shadow-hi-soft), inset -1px -1px 0 var(--shadow-lo-soft), 0 0 0 1px var(--frame-border);
}

.badge-stage {
    background: linear-gradient(180deg, var(--purple), var(--purple-dark));
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

.callout {
    border-radius: 2px;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
    box-shadow: inset 1px 1px 0 var(--shadow-hi-soft), inset -1px -1px 0 var(--shadow-lo-soft), 0 0 0 2px var(--frame-border);
}
.callout-ok { background: linear-gradient(180deg, rgba(74,222,128,0.16), rgba(74,222,128,0.05)); }
.callout-warn { background: linear-gradient(180deg, rgba(245,193,68,0.16), rgba(245,193,68,0.05)); }

.callout p { margin: 0.3rem 0 0; color: var(--text-muted); }

.dmv-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dmv-banner form { flex-shrink: 0; }

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

@media (max-width: 640px) {
    .split-2 { grid-template-columns: 1fr; }
    .dmv-banner { flex-direction: column; align-items: stretch; }
    .dmv-banner form { width: 100%; }
    .dmv-banner .btn { width: 100%; }
}

/* ---------------- Citizen Dashboard ---------------- */

/* Tall sidebar column on the left, a 3-column grid of tiles filling two
   rows next to it, then one full-width info panel spanning those columns. */
.dashboard-layout {
    display: grid;
    grid-template-columns: 300px repeat(3, 1fr);
    gap: 1.2rem;
}

.dash-sidebar {
    grid-column: 1;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.dash-fullrow {
    grid-column: 2 / span 3;
}

/* Plain responsive grid used for secondary tile sections. */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.dash-section-title {
    font-family: 'Press Start 2P', 'Rajdhani', monospace;
    font-size: 0.8rem;
    color: var(--gold);
    margin: 0 0 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Character card — glossy avatar + stat rows, sits in the sidebar column */
.char-card {
    background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 16px;
    border: 1px solid var(--border-block);
    padding: 1.5rem 1.3rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.char-avatar {
    width: 84px;
    height: 84px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 2.3rem;
    background: radial-gradient(circle at 35% 30%, rgba(168,85,247,0.4), rgba(45,212,191,0.16));
    box-shadow: 0 0 0 3px var(--frame-border), 0 0 0 5px color-mix(in srgb, var(--gold) 45%, transparent), 0 6px 16px rgba(0,0,0,0.45);
}

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

/* Minecraft head renders are pixel art — keep them crisp instead of letting
   the browser blur them when scaled up. Discord avatars are photographic and
   should not get this treatment, so it's opt-in via this class. */
.char-avatar img.avatar-pixelated {
    image-rendering: pixelated;
}

.char-name {
    font-family: 'Press Start 2P', 'Rajdhani', monospace;
    font-size: 0.95rem;
    color: var(--heading-color);
    text-shadow: var(--heading-shadow);
    margin: 0 0 0.6rem;
}

.char-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-block), transparent);
    margin: 1rem 0;
}

.char-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.82rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    text-align: left;
}
.char-stat-row:last-child { border-bottom: none; }
.char-stat-row .label { color: var(--text-muted); }
.char-stat-row .value { color: var(--text); font-weight: 600; text-align: right; }

.char-bio {
    text-align: left;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    max-height: 130px;
    overflow-y: auto;
}

/* Icon tiles — the main "app grid" feel for city services */
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1.5rem 1rem 1.3rem;
    border-radius: 14px;
    text-align: center;
    background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));
    border: 1px solid var(--border-block);
    box-shadow: 0 3px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% -10%, rgba(45,212,191,0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.tile:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
    box-shadow: 0 10px 24px rgba(0,0,0,0.45), 0 0 0 1px var(--teal), 0 0 18px rgba(45,212,191,0.22);
}
.tile:hover::after { opacity: 1; }

.tile-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: radial-gradient(circle at 35% 30%, rgba(168,85,247,0.3), rgba(45,212,191,0.12));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.3);
}

/* Custom crystal-art icons render full size with no circular badge behind
   them — the artwork already carries its own glow. */
.tile-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}

.tile-label {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text);
    letter-spacing: 0.2px;
}

.tile-value {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.tile-value-ok { color: var(--ok); }

.tile-admin {
    text-decoration: none;
    color: inherit;
    border-color: color-mix(in srgb, var(--gold) 55%, var(--border-block));
}
.tile-admin .tile-icon {
    background: radial-gradient(circle at 35% 30%, rgba(245,193,68,0.35), rgba(168,85,247,0.14));
}
.tile-admin:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 24px rgba(0,0,0,0.45), 0 0 0 1px var(--gold), 0 0 18px rgba(245,193,68,0.25);
}

.tile-sm {
    padding: 1.1rem 0.7rem;
    border-radius: 12px;
}
.tile-sm .tile-icon { width: 42px; height: 42px; font-size: 1.25rem; }
.tile-sm .tile-icon-img { width: 48px; height: 48px; }
.tile-sm .tile-label { font-size: 0.76rem; }
.tile-sm .tile-value { font-size: 0.66rem; }

/* Info panel — for content that's a list rather than a single tile action */
.info-panel {
    background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 14px;
    border: 1px solid var(--border-block);
    padding: 1.2rem 1.3rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.info-panel-title {
    font-family: 'Press Start 2P', 'Rajdhani', monospace;
    font-size: 0.78rem;
    color: var(--gold);
    margin: 0 0 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-empty { color: var(--text-muted); margin: 0; }

@media (max-width: 1100px) {
    .dashboard-layout { grid-template-columns: 240px repeat(2, 1fr); }
    .dash-fullrow { grid-column: 2 / span 2; }
    .widget-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------- RP City Admin section ---------------- */

/* Admin app frame: sidebar + content */
.admin-frame {
    flex: 1 0 auto;
    display: flex;
    position: relative;
    z-index: 1;
    min-height: 0;
}

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(11,12,19,0.98), rgba(9,10,14,0.99));
    border-right: 1px solid var(--border-block);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-block) transparent;
}

:root[data-theme="light"] .admin-sidebar {
    background: linear-gradient(180deg, rgba(228,216,189,0.99), rgba(240,229,205,0.99));
    border-right-color: #c0a86a;
}

.admin-sidebar-brand {
    padding: 1.2rem 1.1rem 1rem;
    border-bottom: 1px solid var(--border-block);
}

:root[data-theme="light"] .admin-sidebar-brand { border-bottom-color: #c0a86a; }

.admin-tag {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    letter-spacing: 1.5px;
    color: var(--gold);
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
    background: rgba(245,193,68,0.08);
    padding: 0.28rem 0.55rem;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.admin-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.1px;
    line-height: 1.4;
}

.admin-sidebar-nav {
    flex: 1 0 auto;
    padding: 0.5rem 0;
}

.admin-nav-section {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0.9rem 1.1rem 0.25rem;
    opacity: 0.55;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
    letter-spacing: 0.1px;
}

.admin-nav-item:hover {
    color: var(--text);
    background: rgba(168,85,247,0.07);
    border-left-color: rgba(168,85,247,0.35);
}

.admin-nav-item.is-active {
    color: #fff;
    background: rgba(168,85,247,0.13);
    border-left-color: var(--purple);
}

:root[data-theme="light"] .admin-nav-item.is-active { color: var(--purple-dark); }

.admin-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--border-block);
    flex-shrink: 0;
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.admin-nav-item:hover .admin-nav-dot { background: var(--purple); }
.admin-nav-item.is-active .admin-nav-dot { background: var(--purple); box-shadow: 0 0 6px rgba(168,85,247,0.7); }

.admin-sidebar-footer {
    border-top: 1px solid var(--border-block);
    padding: 0.5rem 0;
}

:root[data-theme="light"] .admin-sidebar-footer { border-top-color: #c0a86a; }

.admin-sidebar-footer .admin-nav-item { color: var(--teal); font-size: 0.8rem; }
.admin-sidebar-footer .admin-nav-item:hover { background: rgba(45,212,191,0.07); border-left-color: var(--teal); }
.admin-sidebar-footer .admin-nav-dot { background: var(--teal); }

/* Admin main content area */
.admin-main {
    flex: 1 1 auto;
    padding: 2.2rem 2rem 3rem;
    min-width: 0;
}

/* Admin page headers */
.admin-page-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.6rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-block);
}

.admin-page-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0 0 0.15rem;
    line-height: 1.1;
    letter-spacing: 0.2px;
}

.admin-page-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0;
}

.admin-back-link {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.admin-back-link:hover { color: var(--text); }

/* Metric accent colours */
.metric-accent-purple .metric-value { color: var(--purple); }
.metric-accent-teal   .metric-value { color: var(--teal); }
.metric-accent-gold   .metric-value { color: var(--gold); }
.metric-accent-ember  .metric-value { color: var(--ember); }
.metric-accent-red    .metric-value { color: #f87171; }

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

.metric {
    background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 12px;
    border: 1px solid var(--border-block);
    padding: 1rem 1.1rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
}

.metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.metric-value {
    font-family: 'Press Start 2P', 'Rajdhani', monospace;
    font-size: 1.4rem;
    color: var(--heading-color);
}

.badge-ok { background: linear-gradient(180deg, var(--ok), #2f8f4e); color: #06240f; }
.badge-warn { background: linear-gradient(180deg, var(--warn), #b8860b); color: #2a1d0f; }
.badge-error { background: linear-gradient(180deg, #f87171, #b91c1c); color: #fff; }
.badge-muted { background: var(--bg-panel-2); color: var(--text-muted); }

.rp-form select {
    background: var(--input-bg);
    border: none;
    border-radius: 2px;
    color: var(--text);
    padding: 0.6rem 0.7rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    box-shadow: inset 2px 2px 0 var(--shadow-lo-soft), inset -1px -1px 0 var(--shadow-hi-soft), 0 0 0 2px var(--frame-border);
}

.inline-form { display: inline; }

.btn-danger {
    background: linear-gradient(180deg, #f87171, #b91c1c);
    color: #fff;
}

.permission-groups {
    display: grid;
    gap: 1rem;
}

.permission-group-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--teal);
    margin: 0 0 0.5rem;
}

.permission-list {
    display: grid;
    gap: 0.4rem;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.permission-item input { margin-top: 0.2rem; }

.role-chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

@media (max-width: 900px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .dash-sidebar { grid-column: 1; grid-row: auto; }
    .dash-fullrow { grid-column: 1; }
    .widget-grid { grid-template-columns: repeat(3, 1fr); }
}

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

/* ---------------- Tables / lists ---------------- */
.rp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.rp-table th, .rp-table td {
    text-align: left;
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--border-block);
}
.rp-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
}

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.timeline li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }

.steps-list { padding-left: 1.4rem; color: var(--text-muted); }
.steps-list li { margin-bottom: 0.4rem; }

.definition-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
}
.definition-list dt { color: var(--text-muted); font-size: 0.85rem; }
.definition-list dd { margin: 0; }

/* ---------------- Tab system (used by Player 360 and future pages) ---------------- */

.tabs { }

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--border-block);
    margin-bottom: 1.6rem;
}

.tab-nav-link {
    padding: 0.65rem 0;
    margin-right: 1.4rem;
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.14s ease, border-color 0.14s ease;
    letter-spacing: 0.1px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.tab-nav-link:hover { color: var(--text); text-decoration: none; }

.tab-nav-link.active {
    color: var(--heading-color);
    border-bottom-color: var(--purple);
}

/* Small count bubble on a tab label */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--bg-panel-2);
    color: var(--text-muted);
    border: 1px solid var(--border-block);
    line-height: 1;
}

.tab-count-alert {
    background: rgba(249,115,22,0.15);
    color: var(--ember);
    border-color: rgba(249,115,22,0.35);
}

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

/* ---------------- Player 360 view ---------------- */

/* Identity header card */
.p360-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.4rem;
    background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 2px;
    padding: 1.6rem 1.8rem;
    margin-bottom: 1.4rem;
    box-shadow:
        inset 2px 2px 0 var(--shadow-hi-soft),
        inset -2px -2px 0 var(--shadow-lo-soft),
        0 0 0 2px var(--frame-border),
        0 0 0 5px var(--panel-frame),
        0 10px 30px rgba(0,0,0,0.28);
    border-left: 4px solid var(--purple);
}

.p360-avatar-wrap { flex-shrink: 0; }

.p360-avatar {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    display: block;
    border: 2px solid var(--border-block);
    box-shadow: 0 0 0 1px var(--frame-border), 0 4px 14px rgba(0,0,0,0.4);
}

.p360-avatar-placeholder {
    background: var(--bg-panel-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--text-muted);
    border-radius: 4px;
    border: 2px solid var(--border-block);
    box-shadow: 0 0 0 1px var(--frame-border);
}

.p360-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.p360-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.2rem;
    margin-bottom: 0.4rem;
}

.p360-meta-item {
    font-size: 0.84rem;
    color: var(--text);
}

.p360-meta-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-right: 0.3rem;
}

.p360-pid {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
    font-family: monospace;
    letter-spacing: 0.3px;
}

/* Stat strip inside the header */
.p360-stat-strip {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 110px;
}

.p360-stat {
    background: var(--bg-panel);
    border-radius: 2px;
    padding: 0.45rem 0.8rem;
    text-align: center;
    border: 1px solid var(--border-block);
}

.p360-stat-alert { border-color: var(--ember); }
.p360-stat-alert .p360-stat-val { color: var(--ember); }

.p360-stat-val {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    color: var(--heading-color);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.p360-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Overview tab summary grid */
.p360-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    align-items: start;
}

/* Standing banner */
.p360-standing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1.2rem 1.4rem;
    border-radius: 2px;
    border: 1px solid var(--border-block);
    margin-bottom: 1.2rem;
    box-shadow: 0 0 0 1px var(--frame-border), 0 8px 22px rgba(0,0,0,0.25);
}

.p360-standing-approved { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.25); }
.p360-standing-approved .p360-standing-title { color: #34d399; }

.p360-standing-denied { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.25); }
.p360-standing-denied .p360-standing-title { color: #f87171; }

.p360-standing-restricted { background: rgba(251, 146, 60, 0.08); border-color: rgba(251, 146, 60, 0.3); }
.p360-standing-restricted .p360-standing-title { color: #fb923c; }

.p360-standing-progress { background: rgba(250, 204, 21, 0.06); border-color: rgba(250, 204, 21, 0.25); }
.p360-standing-progress .p360-standing-title { color: #facc15; }

.p360-standing-neutral { background: var(--bg-panel-2); border-color: var(--border-block); }
.p360-standing-neutral .p360-standing-title { color: var(--text-muted); }

.p360-standing-main { flex: 1 1 260px; }

.p360-standing-title {
    margin: 0 0 0.25rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.p360-standing-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    max-width: 540px;
}

.p360-standing-stats {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.p360-standing-stat {
    text-align: center;
    min-width: 70px;
}

.p360-standing-stat-val {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.95rem;
    color: var(--heading-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.p360-standing-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Quick action bar under standing banner */
.p360-quick-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 1.4rem;
}

.p360-quick-bar .btn {
    border-radius: 2px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
}

/* Overview feature card */
.p360-card-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.p360-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.p360-card-ft {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-block);
}

.p360-kv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-block);
}

.p360-kv-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.p360-kv-val {
    color: var(--text);
    font-size: 0.9rem;
}

.p360-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-block);
    font-size: 0.9rem;
}

.p360-mini-name {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p360-mini-row:last-child { border-bottom: none; }

/* Flag rows inside the flags panel */
.p360-flag-row {
    border-radius: 2px;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-block);
}

.p360-flag-active {
    background: rgba(248, 113, 113, 0.06);
    border-color: rgba(248, 113, 113, 0.35);
}

.p360-flag-inactive {
    background: var(--bg-panel);
    opacity: 0.65;
}

/* Alert-coloured panel border for when flags are active */
.p360-panel-alert {
    border-left: 4px solid var(--ember) !important;
}

@media (max-width: 1000px) {
    .p360-header { grid-template-columns: auto 1fr; }
    .p360-stat-strip { flex-direction: row; grid-column: 1 / span 2; }
}

/* ---------------- Obsidian Shores Bank ---------------- */

.bank-dash {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.bank-balance-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));
    border: 1px solid var(--border-block);
    border-left: 4px solid var(--purple);
    border-radius: 2px;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 0 0 1px var(--frame-border), 0 10px 30px rgba(0,0,0,0.25);
}

.bank-balance-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
}

.bank-balance-amount {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.3rem;
    color: var(--heading-color);
    line-height: 1.4;
}

.bank-balance-available {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.bank-account-picker select {
    min-width: 240px;
    background: var(--bg-panel);
    color: var(--text);
    border: 1px solid var(--border-block);
    padding: 0.45rem 0.7rem;
    border-radius: 2px;
    font-family: inherit;
}

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

.bank-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.2rem;
    text-decoration: none;
    background: var(--bg-panel);
    border: 1px solid var(--border-block);
    border-radius: 2px;
    box-shadow: 0 0 0 1px var(--frame-border);
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.bank-action-card:hover {
    border-color: var(--purple);
    transform: translateY(-2px);
    text-decoration: none;
}

.bank-action-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.bank-action-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

/* Admin bank */
.bank-admin-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .bank-balance-panel { flex-direction: column; align-items: flex-start; }
    .bank-admin-grid { grid-template-columns: 1fr; }
}

.bank-frame {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.4rem;
    align-items: start;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

.bank-sidebar {
    position: sticky;
    top: 5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-block);
    border-radius: 2px;
    box-shadow: 0 0 0 1px var(--frame-border), 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    align-self: start;
}

.bank-sidebar-brand {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-block);
    background: linear-gradient(160deg, rgba(168,85,247,0.15), transparent);
}

.bank-tag {
    display: inline-block;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.62rem;
    letter-spacing: 1px;
    color: var(--purple);
    margin-bottom: 0.3rem;
}

.bank-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.bank-sidebar-nav,
.bank-sidebar-footer {
    padding: 0.6rem;
}

.bank-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-bottom: 1px solid var(--border-block);
}

.bank-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.8rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 2px;
    transition: background 0.12s ease, color 0.12s ease;
}

.bank-nav-item:hover,
.bank-nav-item.is-active {
    background: rgba(168,85,247,0.12);
    color: var(--purple);
    text-decoration: none;
}

.bank-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.bank-nav-item.is-active .bank-nav-dot,
.bank-nav-item:hover .bank-nav-dot {
    background: var(--purple);
}

.bank-main {
    min-width: 0;
    width: 100%;
}

@media (max-width: 900px) {
    .bank-frame { grid-template-columns: 1fr; }
    .bank-sidebar { position: static; }
}

/* ---------------- Mobile block overlay ---------------- */
.mobile-block-overlay {
    display: none;
}

@media (max-width: 820px) {
    .mobile-block-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        inset: 0;
        z-index: 9999;
        padding: 1.6rem;
        background:
            radial-gradient(ellipse at top, rgba(168, 85, 247, 0.18), transparent 60%),
            var(--bg-void);
    }

    /* Prevent scrolling/interacting with the app underneath. */
    body:has(.mobile-block-overlay) {
        overflow: hidden;
    }
}

.mobile-block-card {
    max-width: 420px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
    border-radius: 2px;
    padding: 2rem 1.6rem;
    box-shadow:
        inset 3px 3px 0 var(--shadow-hi-soft),
        inset -3px -3px 0 var(--shadow-lo-soft),
        0 0 0 3px var(--frame-border),
        0 0 0 6px var(--panel-frame),
        0 20px 60px rgba(0,0,0,0.5);
}

.mobile-block-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.5));
}

.mobile-block-card .rp-heading {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.mobile-block-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
    body { font-size: 15px; }

    .definition-list { grid-template-columns: 1fr; }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        padding: 0.8rem 1rem;
    }
    .topbar-brand { flex-wrap: wrap; }
    .topbar-wordmark { height: 42px; }
    .topbar-user { flex-wrap: wrap; justify-content: flex-end; }

    .page-shell { padding: 1.4rem 1rem 2.4rem; gap: 1.2rem; }

    .panel, .subcard { padding: 1.1rem; }

    .form-grid { grid-template-columns: 1fr; }

    .form-actions { justify-content: stretch; }
    .form-actions .btn { flex: 1 1 auto; }

    .dash-header { flex-direction: column; align-items: flex-start; }

    .rp-table { display: block; overflow-x: auto; white-space: nowrap; }

    .login-card { padding: 1.8rem 1.4rem; }
    .logo-wrap { width: 130px; height: 130px; }
    .wordmark-img { max-width: 220px; }
}

@media (max-width: 400px) {
    .rp-heading { font-size: 1.1rem; }
    .panel-title { font-size: 0.9rem; }
    .topbar-wordmark { height: 32px; }
}

/* --- App rail (player portal switcher) --- */
body.has-app-rail {
    padding-left: 64px;
}

.app-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0;
    background:
        linear-gradient(180deg, rgba(168,85,247,0.12), transparent 160px),
        #12131a;
    border-right: 1px solid rgba(168,85,247,0.28);
    box-shadow:
        0 0 30px rgba(0,0,0,0.4),
        inset -1px 0 0 rgba(255,255,255,0.04);
    z-index: 900;
}

.app-rail-brand {
    width: 40px;
    height: 40px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.4);
    overflow: hidden;
}

.app-rail-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.app-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    width: 100%;
    align-items: center;
}

.app-rail-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid transparent;
    gap: 0.25rem;
    transition: all 0.15s ease;
}

.app-rail-item:hover {
    background: rgba(168,85,247,0.12);
    border-color: rgba(168,85,247,0.45);
    color: var(--purple);
    text-decoration: none;
}

.app-rail-item:hover .app-rail-avatar {
    box-shadow: 0 0 8px rgba(168,85,247,0.4);
}

.app-rail-item.is-active {
    color: var(--purple);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.app-rail-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background:
        radial-gradient(ellipse at top, rgba(255,255,255,0.12), transparent 60%),
        linear-gradient(160deg, rgba(168,85,247,0.35), rgba(88,28,135,0.25));
    border: 1px solid rgba(168,85,247,0.55);
    box-shadow:
        0 4px 10px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.1);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.app-rail-item.is-active .app-rail-avatar {
    background:
        radial-gradient(ellipse at top, rgba(255,255,255,0.22), transparent 60%),
        linear-gradient(160deg, var(--purple), #6d28d9);
    border-color: rgba(216,180,254,0.7);
    box-shadow:
        0 0 14px rgba(168,85,247,0.65),
        0 4px 12px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.app-rail-item.is-admin .app-rail-avatar {
    background:
        radial-gradient(ellipse at top, rgba(255,255,255,0.18), transparent 60%),
        linear-gradient(160deg, rgba(216,180,254,0.55), rgba(168,85,247,0.35));
    border-color: rgba(216,180,254,0.75);
    color: #fff;
    box-shadow:
        0 0 12px rgba(216,180,254,0.45),
        0 4px 10px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.app-rail-item.is-admin:hover .app-rail-avatar {
    background:
        radial-gradient(ellipse at top, rgba(255,255,255,0.25), transparent 60%),
        linear-gradient(160deg, rgba(216,180,254,0.7), rgba(168,85,247,0.45));
    border-color: rgba(216,180,254,0.95);
    box-shadow:
        0 0 16px rgba(216,180,254,0.55),
        0 4px 12px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.app-rail-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.app-rail-footer {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border-block);
    margin-top: 0.6rem;
    flex-shrink: 0;
}

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

/* ── Bank Customer 360 Tabs ── */
.bank-c360-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    margin-bottom: 1.2rem;
    background: var(--bg-panel-2);
    border: 1px solid var(--border-block);
    border-radius: 0.6rem;
}

.bank-c360-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.4rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-block);
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.bank-c360-tab a,
.bank-c360-tab a:hover,
.bank-c360-tab a:focus {
    color: inherit;
    text-decoration: none;
    outline: none;
}

.bank-c360-tab:hover {
    background: var(--bg-panel-2);
    color: var(--text);
    border-color: rgba(168,85,247,0.45);
    text-decoration: none;
}

.bank-c360-tab.active {
    background: linear-gradient(160deg, rgba(168,85,247,0.9), #6d28d9);
    color: #fff;
    border-color: rgba(216,180,254,0.7);
    box-shadow:
        0 0 14px rgba(168,85,247,0.45),
        0 2px 6px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.bank-c360-tab .bank-c360-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 0.3rem;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    color: inherit;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease;
}

.bank-c360-tab:hover .bank-c360-close,
.bank-c360-close:hover {
    background: rgba(255,255,255,0.2);
}

.bank-c360-close-all {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.4rem;
}
