:root {
    color-scheme: dark;
    --bg-0: #050b14;
    --bg-1: #07111d;
    --bg-2: #0d1b2a;
    --panel: rgba(10, 18, 32, 0.78);
    --panel-strong: rgba(11, 20, 36, 0.92);
    --border: rgba(157, 187, 225, 0.14);
    --text: #ecf5ff;
    --muted: #9caec5;
    --accent: #69e7d9;
    --accent-2: #85dbff;
    --danger: #ff8c8c;
    --success: #6ef0a7;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
    --radius: 26px;
    --radius-sm: 18px;
    --font: "Inter", "Segoe UI", "Arial", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at 20% 10%, rgba(105, 231, 217, 0.14), transparent 26%),
        radial-gradient(circle at 80% 90%, rgba(133, 219, 255, 0.12), transparent 24%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2) 60%, var(--bg-0));
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.75;
    z-index: 0;
}

body::before {
    width: 360px;
    height: 360px;
    left: -120px;
    top: 10%;
    background: rgba(105, 231, 217, 0.13);
}

body::after {
    width: 280px;
    height: 280px;
    right: -90px;
    bottom: 10%;
    background: rgba(133, 219, 255, 0.11);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select {
    font: inherit;
}

.page-wrap,
.auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    width: min(1180px, 100%);
    min-height: min(860px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 500px);
    gap: 24px;
}

.auth-shell-single {
    width: min(640px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
}

.auth-card,
.panel,
.dashboard-hero {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(16, 26, 45, 0.92), var(--panel));
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.auth-brand,
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #03111c;
    box-shadow: 0 18px 40px rgba(105, 231, 217, 0.22);
}

.dashboard-hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    max-width: 52ch;
}

.auth-card {
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.error-card {
    gap: 16px;
    text-align: center;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.auth-tab {
    border: 0;
    border-radius: 14px;
    padding: 14px 18px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transition: 0.18s ease;
}

.auth-tab.is-active {
    color: #04121d;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 32px rgba(105, 231, 217, 0.18);
}

.auth-form {
    display: none;
    gap: 16px;
}

.auth-form.is-active,
.auth-form-active {
    display: grid;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: #d5e4f4;
    font-size: 0.95rem;
    font-weight: 600;
}

.field input,
.field select,
.mini-select {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(160, 190, 230, 0.15);
    border-radius: 16px;
    background-color: #0d1727;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.field input:focus,
.field select:focus,
.mini-select:focus {
    border-color: rgba(105, 231, 217, 0.5);
    box-shadow: 0 0 0 4px rgba(105, 231, 217, 0.12);
}

.password-row {
    display: grid;
    gap: 10px;
}

.field-hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.field-hint.is-warning {
    color: #f2c96d;
}

.password-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.password-rules span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 140, 140, 0.22);
    background: rgba(255, 140, 140, 0.08);
    color: #ffb2b2;
    font-size: 0.72rem;
    line-height: 1;
    transition: 0.18s ease;
}

.password-rules span.is-ok {
    color: #04211a;
    border-color: rgba(110, 240, 167, 0.2);
    background: linear-gradient(135deg, rgba(110, 240, 167, 0.95), rgba(105, 231, 217, 0.95));
}

.password-generate {
    margin-top: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(105, 231, 217, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.password-generate:hover {
    border-color: rgba(105, 231, 217, 0.32);
    background: rgba(105, 231, 217, 0.08);
}

.strength-track {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.strength-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8c8c, #ffd36a, var(--accent));
    transition: width 0.2s ease;
}

.toggle-password,
.action-button,
.submit-button {
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.toggle-password {
    justify-self: end;
    padding: 0;
    color: var(--accent);
    background: transparent;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    user-select: none;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.submit-button,
.action-button {
    min-height: 52px;
    padding: 0 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04121d;
    font-weight: 800;
    box-shadow: 0 18px 34px rgba(105, 231, 217, 0.18);
}

.submit-button:hover,
.action-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.auth-link,
.muted {
    color: var(--muted);
}

.auth-link:hover {
    color: var(--accent);
}

.auth-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    line-height: 1.6;
}

.notice ul {
    margin: 0;
    padding-left: 20px;
}

.notice-error {
    color: #ffd5d5;
    background: rgba(255, 140, 140, 0.08);
    border-color: rgba(255, 140, 140, 0.22);
}

.notice-success {
    color: #d8ffe9;
    background: rgba(110, 240, 167, 0.08);
    border-color: rgba(110, 240, 167, 0.22);
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    backdrop-filter: blur(18px);
    background: rgba(5, 11, 20, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-text {
    color: var(--text);
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.topnav a {
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.topnav a:hover {
    color: var(--text);
    text-decoration: none;
    border-color: rgba(105, 231, 217, 0.22);
}

.dashboard {
    width: min(1360px, calc(100% - 32px));
    margin: 24px auto 60px;
    display: grid;
    gap: 22px;
}

.dashboard-hero {
    border-radius: calc(var(--radius) + 2px);
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 460px);
    gap: 22px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #03111c;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-stats,
.stats-grid,
.grid {
    display: grid;
    gap: 18px;
}

.hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: end;
}

.stat-card,
.stat-tile,
.history-item {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 18px;
}

.stat-card span,
.stat-tile span,
.history-item span,
.info-list span,
.bonus-card p,
.panel-head + p {
    color: var(--muted);
}

.stat-card strong,
.stat-tile strong {
    display: block;
    margin-top: 8px;
    font-size: 1.6rem;
}

.grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    border-radius: var(--radius);
    padding: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel h2 {
    margin: 0;
    font-size: 1.2rem;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stack {
    display: grid;
    gap: 16px;
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.top-row-1 td {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent 70%);
}

.top-row-2 td {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.10), transparent 70%);
}

.top-row-3 td {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.10), transparent 70%);
}

.top-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.98rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-medal-gold {
    color: #ffd76a;
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.26);
}

.top-medal-silver {
    color: #e6edf5;
    background: rgba(220, 220, 220, 0.10);
    border-color: rgba(220, 220, 220, 0.22);
}

.top-medal-bronze {
    color: #ffbf85;
    background: rgba(205, 127, 50, 0.10);
    border-color: rgba(205, 127, 50, 0.24);
}

.top-medal-neutral {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-row form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.mini-select {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
}

.mini-select option,
.field select option {
    color: #ecf5ff;
    background: #0b1422;
}

.mini-select option:checked,
.field select option:checked {
    background: #12314a;
}

.bonus-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.bonus-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.history-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.history-list h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.panel-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.character-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.character-summary {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.character-summary span {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.character-summary strong {
    font-size: 1.05rem;
    line-height: 1.5;
}

.character-summary-soft {
    background: linear-gradient(135deg, rgba(105, 231, 217, 0.08), rgba(133, 219, 255, 0.05));
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.character-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.02);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.character-card:hover {
    transform: translateY(-2px);
    border-color: rgba(105, 231, 217, 0.18);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.character-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.character-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.character-subtitle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.badge-bellato { color: #66e8ff; }
.badge-cora { color: #b18cff; }
.badge-accretia { color: #7dffb1; }
.badge-neutral { color: #d7e4f4; }

.character-level {
    min-width: 76px;
    text-align: right;
}

.character-level span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.character-level strong {
    font-size: 2rem;
    line-height: 1;
}

.character-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.character-meta > div {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.character-meta span {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.character-actions {
    display: grid;
    gap: 10px;
}

.action-button-soft {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    background: linear-gradient(135deg, rgba(105, 231, 217, 0.95), rgba(133, 219, 255, 0.95));
}

.class-change-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.dashboard-footer {
    color: var(--muted);
    text-align: center;
    padding: 4px 0 20px;
}

.muted {
    margin: 0;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar-backdrop {
    display: none;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(6, 12, 22, 0.8);
    backdrop-filter: blur(18px);
}

.brand-sidebar {
    padding: 2px 4px 10px;
}

.sidebar-user {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-label {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.side-nav {
    display: grid;
    gap: 10px;
    align-content: start;
}

.side-group {
    display: grid;
    gap: 8px;
}

.side-group-toggle {
    width: 100%;
    justify-content: flex-start;
    position: relative;
}

.side-caret {
    margin-left: auto;
    color: var(--muted);
    transition: transform 0.18s ease;
}

.side-group.is-open .side-caret {
    transform: rotate(180deg);
}

.side-subnav {
    display: none;
    margin-left: 14px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    gap: 8px;
}

.side-group.is-open .side-subnav {
    display: grid;
}

.side-sublink {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    text-decoration: none;
    transition: 0.18s ease;
}

.side-sublink:hover,
.side-sublink.is-active {
    color: var(--text);
    border-color: rgba(105, 231, 217, 0.18);
    background: rgba(105, 231, 217, 0.07);
    text-decoration: none;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 16px;
    color: var(--muted);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.18s ease;
    text-decoration: none;
}

.side-link:hover,
.side-link.is-active {
    color: var(--text);
    border-color: rgba(105, 231, 217, 0.18);
    background: rgba(105, 231, 217, 0.07);
    text-decoration: none;
}

.side-icon {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    color: var(--accent);
    flex: 0 0 auto;
}

.side-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.side-icon-rank {
    color: var(--accent-2);
}

.side-text {
    font-weight: 600;
}

.side-logout {
    margin-top: auto;
}

.page-wrap {
    min-width: 0;
    padding: 24px;
}

.mobile-topbar {
    display: none;
}

.quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-card {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border-radius: var(--radius);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.quick-card:hover {
    text-decoration: none;
    border-color: rgba(105, 231, 217, 0.22);
    transform: translateY(-1px);
}

.quick-title {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.quick-card strong {
    font-size: 1.4rem;
}

.quick-card small {
    color: var(--muted);
    line-height: 1.5;
}

.auth-card-wide {
    width: 100%;
    padding: 30px;
}

.auth-head {
    display: grid;
    gap: 18px;
    margin-bottom: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-head-copy h1 {
    margin: 12px 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.auth-head-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.auth-shell-single {
    min-height: auto;
    width: min(720px, 100%);
}

.auth-shell-single .auth-card {
    min-height: auto;
}

.auth-shell-single .auth-card,
.auth-shell-single .auth-card-wide {
    border-radius: 30px;
}

.auth-wrap {
    padding: 20px;
}

.auth-wrap .auth-shell {
    min-height: auto;
}

.auth-wrap .auth-card {
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.dashboard {
    width: min(1480px, calc(100% - 20px));
}

@media (max-width: 1080px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 86vw);
        height: 100vh;
        z-index: 40;
        transform: translateX(-102%);
        transition: transform 0.24s ease;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
        border-bottom: 0;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(1, 4, 10, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .auth-shell,
    .dashboard-hero,
    .grid.two-up,
    .quick-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 18px;
        padding: 14px 16px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(10, 18, 32, 0.72);
        backdrop-filter: blur(18px);
        box-shadow: var(--shadow);
    }

    .mobile-menu-button {
        width: 48px;
        height: 48px;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding: 0 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.03);
        cursor: pointer;
    }

    .mobile-menu-button span {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 999px;
        background: var(--text);
    }

    .mobile-topbar-title {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    .mobile-topbar-title strong {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-topbar-title span {
        color: var(--muted);
        font-size: 0.82rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 720px) {
    .auth-wrap {
        padding: 14px;
    }

    .auth-card,
    .panel,
    .dashboard-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 16px;
    }

    .page-wrap {
        padding: 14px;
    }

    .dashboard {
        width: calc(100% - 12px);
        margin-top: 16px;
    }

    .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .action-row form {
        width: 100%;
        flex-wrap: wrap;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    .character-toolbar {
        grid-template-columns: 1fr;
    }

    .character-top {
        flex-direction: column;
    }

    .character-level {
        text-align: left;
    }

    .class-change-row {
        grid-template-columns: 1fr;
    }

    .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-list > div,
    .character-meta > div {
        padding: 12px 14px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.92rem;
    }

    .quick-card {
        padding: 16px;
    }

    .dashboard-hero {
        gap: 16px;
    }

    .hero-stats {
        gap: 10px;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .data-table {
        min-width: 0;
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 18px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(255, 255, 255, 0.03);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    }

    .data-table td {
        padding: 8px 0;
        border-bottom: 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        text-align: left;
        flex: 1 1 auto;
    }

    .data-table td > .top-rank {
        margin-left: auto;
    }

    .history-item,
    .stat-tile,
    .quick-card,
    .character-summary,
    .character-card {
        border-radius: 18px;
    }
}
