* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* user-select: none; */
    scrollbar-color: rgb(155, 155, 155) transparent;
}

*::selection {
    background: var(--border-color);
    color: var(--card-bg);
}

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #4a4a4a;
    --light-bg: #e8e4df;
    --card-bg: #f5f3f0;
    --text-color: #1a1a1a;
    --text-secondary: #6a6a6a;
    --accent: #2d9a5f;
    --border-color: #d4d0cb;
    --navbar-bg: rgba(232, 228, 223, 0.8);
    --navbar-border: rgba(212, 208, 203, 0.65);
    --dropdown-bg: rgba(245, 243, 240, 0.92);
    --menu-bg: rgba(245, 243, 240, 0.95);
    --menu-border: rgba(212, 208, 203, 0.7);
    --notice-bg-start: #efe9e3;
    --notice-bg-end: #f5f3f0;
    --input-bg: #ffffff;
    --input-disabled-bg: #ece8e2;
    --input-disabled-text: #7a7a7a;
    --input-disabled-border: #cfc8c0;
    --theme-toggle-track: #ddd9d4;
    --theme-toggle-knob: #ffffff;
    --theme-toggle-active: #1f1f1f;
    --table-border-subtle: #ece8e2;
    --table-border-subtle-2: #f0ece7;
    --table-head-bg: #f8f6f3;
    --request-card-bg-start: #efe9e3;
    --request-card-bg-end: #f5f3f0;
    --admin-summary-bg-start: #efe9e3;
    --admin-summary-bg-end: #f5f3f0;
    --admin-override-active-border: #9eaf8b;
    --admin-override-active-bg: #edf4e6;
    --edit-row-bg: rgba(245, 243, 240, 0.55);
    --edit-panel-bg: rgba(245, 243, 240, 0.65);
    --upload-widget-bg: rgba(232, 228, 223, 0.35);
    --upload-widget-dragover-bg: rgba(232, 228, 223, 0.7);
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #991b1b;
    --success-bg: #e8f5eb;
    --success-border: #a6cfad;
    --success-text: #1f5f35;
}

html[data-theme='dark'] {
    --primary-color: #f0ece6;
    --secondary-color: #b5aba0;
    --light-bg: #181613;
    --card-bg: #25211d;
    --text-color: #f0ece6;
    --text-secondary: #c1b7ab;
    --accent: #57b97f;
    --border-color: #3f3831;
    --navbar-bg: rgba(24, 22, 19, 0.88);
    --navbar-border: rgba(63, 56, 49, 0.95);
    --dropdown-bg: rgba(37, 33, 29, 0.95);
    --menu-bg: rgba(37, 33, 29, 0.97);
    --menu-border: rgba(63, 56, 49, 0.95);
    --notice-bg-start: #2d2924;
    --notice-bg-end: #25211d;
    --input-bg: #1f1b17;
    --input-disabled-bg: #2b2620;
    --input-disabled-text: #9f9588;
    --input-disabled-border: #474038;
    --theme-toggle-track: #3a342d;
    --theme-toggle-knob: #efe8dd;
    --theme-toggle-active: #12100e;
    --table-border-subtle: #3a342d;
    --table-border-subtle-2: #312b25;
    --table-head-bg: #2b2621;
    --request-card-bg-start: #2e2924;
    --request-card-bg-end: #25211d;
    --admin-summary-bg-start: #2e2924;
    --admin-summary-bg-end: #25211d;
    --admin-override-active-border: #5f7853;
    --admin-override-active-bg: #2f3d2a;
    --edit-row-bg: rgba(42, 37, 32, 0.7);
    --edit-panel-bg: rgba(36, 31, 27, 0.78);
    --upload-widget-bg: rgba(48, 42, 36, 0.45);
    --upload-widget-dragover-bg: rgba(58, 52, 45, 0.7);
    --error-bg: #3a1f1f;
    --error-border: #6e3131;
    --error-text: #f3b8b8;
    --success-bg: #1f3526;
    --success-border: #3f6b4b;
    --success-text: #bee7c8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 5000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--navbar-border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo-link {
    color: inherit;
    text-decoration: none;
}

.u-no-select {
    user-select: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu-toggle {
    display: none;
    border: none;
    background: var(--theme-toggle-track);
    border-radius: 10px;
    padding: 0.45rem;
    cursor: pointer;
    line-height: 0;
}

.nav-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-color);
    margin: 3px 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.nav-links a:hover {
    color: var(--text-color);
}

.nav-links a.active {
    color: var(--text-color);
    position: relative;
    font-weight: 500;
}

.nav-links a.nav-login {
    font-weight: 700;
}

.nav-links a.active::after {
    display: none;
}

.nav-user {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.2px;
}

.nav-user-menu {
    position: relative;
    z-index: 5100;
}

.nav-user-toggle {
    color: var(--text-color);
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.nav-user-name {
    display: inline-block;
}

.nav-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.nav-user-avatar[data-has-custom='false'] {
    object-fit: contain;
    padding: 4px;
    background: var(--card-bg);
}

.nav-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    min-width: 220px;
    border: 1px solid var(--border-color);
    background: var(--dropdown-bg);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    padding: 0.4rem;
    display: grid;
    gap: 0.25rem;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5200;
}

.nav-user-menu.open .nav-user-dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.nav-user-dropdown a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.92rem;
}

.nav-user-dropdown a:hover {
    background: var(--light-bg);
}

.nav-user-dropdown a.nav-user-logout {
    color: #a94444;
    font-weight: 600;
}

.nav-user-dropdown a.nav-user-logout:hover {
    color: #8d3636;
    background: #f5e5e5;
}

html[data-theme='dark'] .nav-user-dropdown a.nav-user-logout:hover {
    color: #f3b8b8;
    background: rgba(169, 68, 68, 0.28);
}

/* Main Content */
main {
    padding: 2rem 0 4rem;
}

.section {
    margin-bottom: 4rem;
}

.wip-notice {
    margin: 0 0 2rem;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: linear-gradient(90deg, var(--notice-bg-start) 0%, var(--notice-bg-end) 100%);
}

.wip-notice p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.games-update-note {
    display: block;
    width: fit-content;
    margin: 2rem auto 0;
}

/* Hero Section with Collage */
.hero-collage {
    text-align: center;
    padding: 4rem 2rem 6rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.collage-container {
    position: relative;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.collage-images {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(2, 200px);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.collage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: filter 0.3s, transform 0.3s;
}

.collage-img:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
    z-index: 10;
}

.collage-img-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
}

.collage-img-2 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.collage-img-3 {
    grid-column: 4 / 6;
    grid-row: 1 / 3;
}

.collage-img-4 {
    grid-column: 6 / 7;
    grid-row: 1 / 2;
}

.collage-img-5 {
    grid-column: 7 / 9;
    grid-row: 1 / 2;
}

.collage-img-6 {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.collage-img-7 {
    grid-column: 2 / 4;
    grid-row: 2 / 3;
}

.collage-img-8 {
    grid-column: 6 / 9;
    grid-row: 2 / 3;
}

.collage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
}

.collage-title {
    font-size: 9rem;
    font-weight: 800;
    letter-spacing: -5px;
    line-height: 0.9;
    /* Semi-transparent text effect */
    color: rgba(0, 0, 0, 0.822);
    /* Slight white shadow for glow */
    text-shadow: 0 6px 57px rgba(255, 255, 255, 0.32);
    mix-blend-mode: multiply;
}

.hero-content {
    max-width: 700px;
    margin: 2rem auto;
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 300;
}

/* scroll indicator removed */

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.25rem;
}

.hero-button {
    padding: 1rem 2.5rem;
    background: var(--text-color);
    color: var(--light-bg);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: transform 0.3s, opacity 0.3s;
    letter-spacing: 0.3px;
}

.hero-button:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* Standard Hero for other pages */
.hero {
    text-align: center;
    padding: 8rem 2rem 6rem;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-title {
    font-size: 7rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -3px;
    color: var(--text-color);
    line-height: 0.95;
}

.section-title {
    font-size: 4rem;
    margin-top: 1rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -2px;
}

/* Profile Section */
.profile-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.profile-image {
    width: 220px;
    height: 220px;
    border-radius: 8px;
    object-fit: cover;
    border: none;
}

.profile-info h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -1px;
}

.profile-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--text-color);
    color: var(--light-bg);
    text-decoration: none;
    border-radius: 50px;
    transition: transform 0.3s, opacity 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-link:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Music grid interactions */
.music-grid .music-card {
    display: block;
    aspect-ratio: 3 / 2;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    scrollbar-color: transparent transparent;
}

.music-grid:hover .music-card,
.music-grid:focus-within .music-card {
    filter: grayscale(38%) brightness(0.84);
}

.music-grid:hover .music-card:hover,
.music-grid:focus-within .music-card:focus {
    transform: translateY(-10px);
    filter: none;
    z-index: 2;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

.music-preview {
    height: 100%;
    background: transparent;
    line-height: 0;
    border-radius: 12px;
}

.music-preview iframe {
    border-radius: 12px;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.music-pagination {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

.music-pagination-button {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.music-pagination-button:hover:not(:disabled),
.music-pagination-button:focus-visible:not(:disabled) {
    transform: translateY(-1px);
}

.music-pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.music-pagination-status {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Games stacked cards */
.games-stack {
    --stack-count: 1;
    --stack-peek: 88px;
    --stack-card-height: 440px;
    --stack-hit-step: 90px;
    /* decides the area of interaction when hovering */
    --stack-hit-offset: 18px;
    --stack-width: min(100%, 760px);
    --side-card-height: calc(var(--stack-card-height) + var(--side-card-height-extra));
    --side-card-width: calc(var(--side-card-height) * 2 / 3);
    --side-card-gap: clamp(14px, 2vw, 24px);
    --side-card-top-shift: 10px;
    --side-card-height-extra: 72px;
    position: relative;
    width: var(--stack-width);
    margin: 0 auto;
    min-height: calc(var(--stack-card-height) + (var(--stack-count) - 1) * var(--stack-peek));
}

.games-stack .card {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    top: calc(var(--stack-index, 0) * var(--stack-peek));
    z-index: calc(10 + var(--stack-index, 0));
    transform-origin: center top;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.games-stack.has-active-card .card {
    filter: brightness(0.86);
}

.games-stack .card.is-active {
    transform: translateY(-12px) scale(1.035);
    z-index: 999;
    filter: none;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

.games-stack .card:not(.is-active):hover {
    transform: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.games-stack:not(.has-active-card) .card {
    transform: none;
}

.game-side-card {
    position: absolute;
    width: var(--side-card-width);
    height: var(--side-card-height);
    aspect-ratio: 2 / 3;
    background: color-mix(in srgb, var(--card-bg) 92%, white 8%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    padding: 1rem 1rem 1.1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

.game-side-card.is-visible {
    opacity: 1;
}

.game-side-card-left {
    height: calc(var(--stack-card-height) * 0.956);
    width: calc(var(--stack-card-height) * 7 / 10 * 0.96);
    right: calc(100% + var(--side-card-gap));
}

.game-side-card-right {
    height: calc(var(--stack-card-height) * 0.96);
    width: calc(var(--stack-card-height) * 7 / 10 * 0.96);
    left: calc(100% + var(--side-card-gap));
}

.game-side-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.game-side-card h4 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-color);
}

.game-side-card-main-name {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    text-align: right;
}

.game-side-card-images {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    flex: 1;
}

.game-side-card-image-block {
    display: grid;
    gap: 0.35rem;
}

.game-side-card-images img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.game-side-card-images.is-single .game-side-card-image-block {
    height: 100%;
}

.game-side-card-images.is-single img {
    flex: 1;
    display: block;
    width: 100%;
    min-height: 0;
    height: 100%;
    margin: 0 auto;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    background: var(--light-bg);
}

.game-side-card ul {
    list-style: disc;
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
}

.game-side-card li {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.35;
}

.game-side-card-empty,
.game-side-card-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.game-side-card-note {
    margin-top: 0.75rem;
    white-space: pre-line;
}

/* Mobile game detail modal */
.game-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    padding-top: calc(80px + 1rem);
    overflow: auto;
}

@media (min-width: 769px) {
    .game-modal-overlay {
        padding-top: 1rem;
    }
}

html[data-theme='light'] .game-modal-overlay {
    background: rgba(255, 255, 255, 0.4);
}

.game-modal-overlay.is-visible {
    display: flex;
}

.game-modal {
    background: rgba(25, 25, 25, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    max-width: 740px;
    width: 100%;
    max-height: calc(100vh - 80px - 2rem);
    overflow: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
    padding: 1rem;
    margin-top: 0;
    z-index: 1500;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

@media (min-width: 769px) {
    .game-modal {
        margin-top: 0;
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 768px) {
    .game-modal {
        margin-top: 0;
        max-height: calc(100vh - 80px - 2rem);
    }
}

html[data-theme='light'] .game-modal {
    background: rgba(245, 243, 240, 0.65);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.1);
    border: 1.5px solid rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    html[data-theme='light'] .game-modal {
        margin-top: 0;
        max-height: calc(100vh - 80px - 2rem);
    }
}

.game-modal .modal-main-card {
    margin-bottom: 1rem;
}

.game-modal .modal-main-card img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.game-modal .modal-side-card {
    margin-bottom: 1rem;
    border-radius: 10px;
    padding: 0.75rem;
    background: rgba(50, 50, 50, 0.5);
    backdrop-filter: blur(4px);
}

html[data-theme='light'] .game-modal .modal-side-card {
    background: rgba(232, 228, 223, 0.6);
}

.game-modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    width: auto;
    height: auto;
    transition: color 0.2s ease;
    z-index: 1600;
}

.game-modal-close:hover {
    color: rgba(255, 255, 255, 1);
}

html[data-theme='light'] .game-modal-close {
    color: rgba(0, 0, 0, 0.7);
}

html[data-theme='light'] .game-modal-close:hover {
    color: rgba(0, 0, 0, 1);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 1.75rem;
}

.card-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: -0.5px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    background: var(--light-bg);
    color: var(--text-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Hide card details on mobile, show only name and image */
@media (max-width: 768px) {
    .card-content {
        padding: 0.5rem 0.75rem;
    }

    .card-description,
    .card-meta {
        display: none;
    }
}

/* Footer */
footer {
    background: transparent;
    padding: 3rem 0;
    text-align: center;
    margin-top: 6rem;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* Auth and owner panel */
.auth-main {
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-main-login,
.auth-main-register,
.auth-main-manage {
    align-items: flex-start;
    padding-top: 2.8rem;
}

.auth-card {
    width: 100%;
    max-width: 580px;
    padding: 2.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.06);
}

.admin-card {
    max-width: 700px;
    margin-top: 1.2rem;
}

.auth-title {
    font-size: 2.1rem;
    margin-bottom: 1.4rem;
}

.auth-form {
    display: grid;
    gap: 0.7rem;
}

.auth-form label,
.auth-fieldset legend {
    color: var(--text-color);
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.72rem 0.82rem;
    font: inherit;
    background: var(--input-bg);
    color: var(--text-color);
}

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

.auth-form input:disabled {
    background: var(--input-disabled-bg);
    color: var(--input-disabled-text);
    border-color: var(--input-disabled-border);
    cursor: not-allowed;
    opacity: 1;
}

.profile-image-manager {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem;
    background: linear-gradient(90deg, var(--notice-bg-start) 0%, var(--notice-bg-end) 100%);
    margin-bottom: 0.35rem;
    text-align: center;
}

.profile-image-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.6rem;
}

.profile-image-open-button {
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    margin: 0 auto;
}

.profile-image-open-text {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.profile-image-manager-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.profile-image-preview {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    flex-shrink: 0;
}

.profile-image-preview[data-has-custom='false'] {
    object-fit: contain;
    padding: 6px;
    background: var(--card-bg);
}

.profile-image-actions {
    display: grid;
    gap: 0.35rem;
}

.profile-image-upload-button {
    width: fit-content;
    margin-top: 0;
}

.profile-image-delete-button {
    margin-top: 0.35rem;
    width: fit-content;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.profile-image-delete-button:hover {
    background: var(--text-color);
    color: var(--light-bg);
}

.profile-image-delete-button.is-disabled,
.profile-image-delete-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.profile-image-delete-button.is-disabled:hover,
.profile-image-delete-button:disabled:hover {
    background: transparent;
    color: var(--text-color);
}

.profile-image-help-text {
    margin-top: 0;
}

.profile-image-modal {
    position: fixed;
    inset: 0;
    z-index: 5400;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.profile-image-modal[hidden] {
    display: none;
}

.profile-image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.profile-image-modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 95vw);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    padding: 1rem;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.profile-image-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.profile-image-modal-header .auth-subtitle {
    margin-bottom: 0;
}

.profile-image-current {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    margin-bottom: 0;
}

.profile-image-current-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.profile-image-current-preview {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
}

.profile-image-current-preview[data-has-custom='false'] {
    object-fit: contain;
    padding: 6px;
    background: var(--card-bg);
}

.profile-image-modal-close {
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.profile-image-error {
    margin-top: 0;
}

.profile-crop-editor {
    margin-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
    display: grid;
    gap: 0.6rem;
}

.profile-crop-layout {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr);
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    /* reduced gap */
}

.profile-crop-frame {
    width: min(280px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    position: relative;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
    margin: 0 auto;
}

.profile-crop-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.24);
    pointer-events: none;
}

.profile-crop-frame:active {
    cursor: grabbing;
}

.profile-crop-image {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    transform-origin: top left;
    user-select: none;
    pointer-events: none;
}

.profile-crop-zoom-label {
    font-size: 0.86rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

#profile_crop_zoom {
    width: min(440px, 82%);
    margin: 0 auto;
}

.profile-crop-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-crop-actions .hero-button {
    margin-top: 0;
}

@media (max-width: 620px) {
    .profile-crop-layout {
        grid-template-columns: 1fr;
    }

    .profile-image-current {
        margin-bottom: 0.2rem;
    }
}

.profile-crop-cancel {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
}

.profile-crop-cancel:hover {
    background: var(--text-color);
    color: var(--light-bg);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    line-height: 0;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--text-color);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.auth-submit {
    margin-top: 0.8rem;
    border: none;
    cursor: pointer;
}

.auth-switch {
    margin-top: 1.3rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-inline-error {
    margin-top: 0.2rem;
    color: var(--error-text);
    font-size: 0.86rem;
}

.auth-notice {
    margin-bottom: 1rem;
}

.auth-notice-error {
    border-color: var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
    margin-bottom: 2rem;
}

.auth-notice-error p {
    color: var(--error-text);
}

.auth-notice-success {
    border-color: var(--success-border);
    background: var(--success-bg);
    color: var(--success-text);
}

.auth-notice-success p {
    color: var(--success-text);
}

.admin-user-form {
    margin-bottom: 1.2rem;
}

.admin-role-form {
    margin-bottom: 1rem;
}

.admin-user-summary {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--admin-summary-bg-start) 0%, var(--admin-summary-bg-end) 100%);
}

.admin-user-summary-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.2rem 0;
    color: var(--text-secondary);
}

.admin-role-badge,
.admin-override-pill {
    display: inline-block;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.18rem 0.65rem;
    font-size: 0.8rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: 600;
}

.admin-override-pill-active {
    border-color: var(--admin-override-active-border);
    background: var(--admin-override-active-bg);
}

.admin-help-text {
    margin-top: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.forbidden-card {
    display: flex;
    flex-direction: column;
}

.forbidden-card .auth-notice-error {
    margin-bottom: 1rem;
}

.forbidden-action-row {
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.forbidden-back-home {
    margin-top: 0;
    flex-shrink: 0;
}

.forbidden-request-toggle {
    margin-top: 0;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
    user-select: none;
}

.forbidden-request-toggle:hover {
    background: var(--text-color);
    color: var(--light-bg);
    opacity: 1;
}

.forbidden-request-cooldown {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--input-disabled-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: default;
    opacity: 1;
}

.forbidden-request-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.forbidden-request-modal[hidden] {
    display: none;
}

.forbidden-request-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
}

.forbidden-request-modal-panel {
    position: relative;
    width: min(460px, 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.2);
    padding: 1rem;
}

.forbidden-request-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.forbidden-request-modal-header .auth-subtitle {
    margin-bottom: 0;
}

.forbidden-request-close {
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.forbidden-request-form {
    position: static;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
}

.forbidden-request-submit {
    width: 100%;
    margin-top: 0.4rem;
}

.forbidden-help-text {
    margin-top: 0.15rem;
    margin-bottom: 0.2rem;
}

.auth-inline-help {
    margin-top: 0;
    font-size: 0.82rem;
}

.admin-reset-form {
    margin-top: 0.2rem;
}

.admin-inline-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
}

.admin-inline-actions .auth-form:not(.admin-split-form) {
    display: block;
}

.admin-inline-actions.admin-split-buttons {
    gap: 0.6rem;
}

.admin-split-form {
    flex: 1 1 50%;
}

.admin-split-form button {
    width: 100%;
}

.admin-secondary-button {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.admin-delete-form {
    margin-top: 0.25rem;
}

.admin-account-actions {
    margin-top: 0.25rem;
}

.admin-account-actions .admin-delete-form {
    margin-top: 0;
}

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

.admin-warning-button {
    background: #c38a2e;
    color: #fff;
    border: 1px solid #a9731f;
}

.admin-warning-button:hover {
    opacity: 0.92;
}

.admin-danger-button {
    background: #a94444;
    color: #fff;
    border: 1px solid #8d3636;
}

.admin-danger-button:hover {
    opacity: 0.92;
}

.admin-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.2rem 0;
}

.auth-subtitle {
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.admin-role-defaults {
    margin-top: 0.2rem;
}

.container.admin-main {
    max-width: 98vw;
    padding: 0 12rem;
}

.admin-main {
    min-height: 72vh;
    display: block;
}

.admin-main .hero-button {
    padding: 0.72rem 1.55rem;
    font-size: 0.88rem;
}

.admin-wide-card {
    max-width: none;
    width: 100%;
}

.admin-dual-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5.4rem;
    align-items: start;
    position: relative;
}

.admin-dual-columns::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--border-color);
    transform: translateX(-0.5px);
}

.admin-panel-column {
    min-width: 0;
}

.admin-triple-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 0;
    align-items: stretch;
}

.admin-triple-columns::before {
    display: none;
}

.admin-triple-columns .admin-panel-column {
    padding: 0 1.8rem 1rem;
}

.admin-triple-columns .admin-panel-column:first-child {
    padding-left: 0;
}

.admin-triple-columns .admin-panel-column:last-child {
    padding-right: 0;
}

.admin-triple-columns .admin-panel-column+.admin-panel-column {
    border-left: 1px solid var(--border-color);
    padding-left: 1.8rem;
}

.admin-requests-column {
    max-height: 100%;
}

.admin-request-search-form {
    margin-bottom: 0.8rem;
}

.admin-request-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.7rem;
}

.admin-request-toolbar-form {
    display: block;
}

.admin-request-delete-all {
    margin-top: 0;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
}

.admin-request-list {
    display: grid;
    gap: 0.65rem;
    max-height: 62vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.admin-request-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.8rem;
    background: linear-gradient(90deg, var(--request-card-bg-start) 0%, var(--request-card-bg-end) 100%);
}

.admin-request-line {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

.admin-request-line+.admin-request-line {
    margin-top: 0.2rem;
}

.admin-request-muted {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.admin-request-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.admin-request-action-form {
    display: block;
    flex: 1 1 50%;
}

.admin-request-action-form .hero-button {
    width: 100%;
    margin-top: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    font-size: 0.83rem;
}

.admin-request-grant {
    background: #2f8d5f;
    color: #fff;
    border: 1px solid #266f4b;
}

.admin-request-delete {
    background: #a94444;
    color: #fff;
    border: 1px solid #8d3636;
}

.container.db-admin-main {
    max-width: 98vw;
    padding: 0 12rem;
}

.db-admin-main {
    min-height: 72vh;
    display: block;
}

.db-admin-card {
    max-width: none;
    width: 100%;
    margin-top: 1.2rem;
}

.db-admin-table-form {
    max-width: 380px;
}

.db-admin-table-wrap {
    overflow-x: auto;
    margin-top: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
}

.db-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.db-admin-table th,
.db-admin-table td {
    border-bottom: 1px solid var(--table-border-subtle);
    padding: 0.6rem 0.65rem;
    text-align: left;
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-admin-table th {
    font-weight: 700;
    background: var(--table-head-bg);
}

.db-admin-edit-link {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
}

.db-admin-edit-link:hover {
    text-decoration: underline;
}

.db-admin-row-actions {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.65rem;
}

.db-admin-inline-form {
    margin: 0;
    display: inline;
}

.db-admin-actions-cell {
    max-width: none;
    overflow: visible;
}

.db-admin-delete-button {
    margin-top: 0;
    border: none;
    background: transparent;
    color: #a94444;
    padding: 0;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    line-height: normal;
    cursor: pointer;
}

.db-admin-delete-button:hover {
    color: #8d3636;
    text-decoration: underline;
}

/* Modal backdrop base styles */
.db-admin-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 600;
}

/* Hide modal when [hidden] attribute is present */
.db-admin-modal-backdrop[hidden] {
    display: none !important;
}

.db-admin-modal {
    width: min(920px, 96vw);
    max-height: 86vh;
    overflow: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
    padding: 1.1rem 1.2rem 1.3rem;
}

.db-admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

.db-admin-modal-header .auth-subtitle {
    margin-bottom: 0;
}

.db-admin-close-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.db-admin-close-link:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.db-admin-edit-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.db-admin-edit-actions .hero-button {
    margin-top: 0.8rem;
}

.db-admin-edit-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.72rem 0.82rem;
    font: inherit;
    background: var(--input-bg);
    color: var(--text-color);
    resize: vertical;
}

.db-admin-null-row {
    margin-top: -0.25rem;
    margin-bottom: 0.4rem;
}

.admin-role-permissions-form {
    margin-top: 1.2rem;
}

.auth-fieldset {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
}

.permission-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-secondary);
    margin: 0.52rem 0;
}

.permission-row input[type='checkbox'] {
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: nowrap;
        row-gap: 0;
        position: relative;
    }

    .nav-menu-toggle {
        display: inline-block;
        margin-left: auto;
    }

    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 1.7rem);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(360px, calc(100vw - 2rem));
        max-height: 72vh;
        overflow: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 0.5rem;
        border: 1px solid var(--menu-border);
        border-radius: 12px;
        background: var(--menu-bg);
        backdrop-filter: blur(14px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
        z-index: 250;
    }

    .navbar.nav-open .nav-links {
        display: flex;
    }

    .nav-links a,
    .nav-user-toggle {
        font-size: 0.92rem;
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.45rem 0.6rem;
        border-radius: 8px;
    }

    .nav-user-toggle {
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    .nav-user-toggle .nav-user-avatar {
        margin-left: auto;
        width: 32px;
        height: 32px;
    }

    .nav-links a:hover,
    .nav-user-toggle:hover {
        background: var(--light-bg);
    }

    .nav-user-menu {
        width: 100%;
    }

    .nav-user-dropdown {
        position: static;
        top: auto;
        right: auto;
        min-width: 0;
        border: 1px solid var(--border-color);
        box-shadow: none;
        margin-top: 0.35rem;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        display: none;
    }

    .nav-user-menu.open .nav-user-dropdown {
        display: grid;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .container.admin-main {
        padding: 0 1rem;
    }

    .container.db-admin-main {
        padding: 0 1rem;
    }

    .admin-dual-columns {
        grid-template-columns: 1fr;
    }

    .admin-dual-columns::before {
        display: none;
    }

    .admin-triple-columns .admin-panel-column,
    .admin-triple-columns .admin-panel-column+.admin-panel-column {
        border-left: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .forbidden-action-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .forbidden-back-home,
    .forbidden-request-toggle {
        width: 100%;
        text-align: center;
    }

    .forbidden-request-modal {
        padding: 0.75rem;
    }

    .forbidden-request-modal-panel {
        width: 100%;
    }

    .forbidden-request-form {
        position: static;
        width: 100%;
        margin-top: 0;
    }

    .admin-request-list {
        max-height: none;
    }

    .admin-request-actions {
        flex-wrap: wrap;
    }

    .db-admin-table-form {
        max-width: none;
    }

    .db-admin-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .db-admin-table thead {
        display: none;
    }

    .db-admin-table tbody {
        display: grid;
        gap: 0.75rem;
        padding: 0.7rem;
    }

    .db-admin-table tbody tr {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: var(--input-bg);
        padding: 0.45rem 0.55rem;
    }

    .db-admin-table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) 1fr;
        gap: 0.5rem;
        align-items: start;
        border-bottom: 1px solid var(--table-border-subtle-2);
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        padding: 0.45rem 0.2rem;
    }

    .db-admin-table td:last-child {
        border-bottom: 0;
    }

    .db-admin-table td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .db-admin-actions-cell {
        display: flex;
        align-items: center;
    }

    .db-admin-actions-cell::before {
        margin-right: 0.5rem;
    }

    .db-admin-row-actions {
        gap: 0.85rem;
    }

    .db-admin-modal-backdrop {
        padding: 0.7rem;
        align-items: flex-start;
    }

    .db-admin-modal {
        width: 100%;
        max-height: 92vh;
        margin-top: 0.8rem;
        border-radius: 12px;
    }

    .db-admin-edit-actions {
        flex-wrap: wrap;
    }

    .db-admin-edit-actions .hero-button {
        width: 100%;
        text-align: center;
    }

    .music-grid:hover .music-card,
    .music-grid:focus-within .music-card {
        filter: none;
    }

    .music-grid:hover .music-card:hover,
    .music-grid:focus-within .music-card:focus {
        transform: none;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    }

    .games-stack {
        --stack-width: 100%;
        min-height: auto;
        display: grid;
        gap: 1.25rem;
    }

    .games-stack .card {
        position: static;
        width: 100%;
        top: auto;
        transform: none;
    }

    .games-stack .card:hover,
    .games-stack .card:focus-within {
        top: auto;
        transform: none;
    }

    .game-side-card {
        display: none;
    }

    .hero-title {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .hero-button {
        width: 100%;
    }

    .logo {
        font-size: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.7rem;
    }

    /* Collage responsive */
    .collage-images {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 150px);
    }

    .collage-img-1 {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }

    .collage-img-2 {
        grid-column: 3 / 5;
        grid-row: 1 / 2;
    }

    .collage-img-3 {
        grid-column: 1 / 3;
        grid-row: 2 / 4;
    }

    .collage-img-4 {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    .collage-img-5 {
        grid-column: 4 / 5;
        grid-row: 2 / 3;
    }

    .collage-img-6 {
        grid-column: 3 / 5;
        grid-row: 3 / 4;
    }

    .collage-img-7 {
        grid-column: 1 / 3;
        grid-row: 4 / 5;
    }

    .collage-img-8 {
        grid-column: 3 / 5;
        grid-row: 4 / 5;
    }

    .collage-title {
        font-size: 4.5rem;
        letter-spacing: -3px;
    }

    .hero-tagline {
        font-size: 1rem;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Error State */
.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--error-text);
    margin: 1rem 0;
}

.edit-website-main .auth-title {
    margin-bottom: 2rem;
}

.edit-website-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.4rem;
    margin-top: 1.4rem;
}

.edit-website-form {
    margin-top: 1rem;
}

.edit-website-form-row {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    background: var(--edit-row-bg);
}

.edit-website-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.edit-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.edit-tab {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    cursor: pointer;
}

.edit-tab.is-active {
    background: var(--text-color);
    color: var(--light-bg);
}

.edit-panel {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    background: var(--edit-panel-bg);
}

.edit-panel.is-active {
    display: block;
}

.edit-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.edit-header-actions {
    margin-left: auto;
}

@media (max-width: 768px) {
    .edit-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-header-actions {
        margin-left: 0;
    }
}

.edit-item-list {
    list-style: none;
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
}

.edit-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    padding: 0.6rem 0.8rem;
}

.edit-item-row.is-dragging {
    opacity: 0.5;
}

.edit-item-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.edit-item-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.edit-item-handle {
    color: var(--text-secondary);
    font-weight: 700;
    cursor: grab;
}

/* Memorias Section */
.memorias-section {
    padding: 0 0 3rem;
}

.memorias-title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 1rem;
    margin-bottom: 3rem;
    letter-spacing: -2px;
}

.memorias-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
}

.memoria-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 140px;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    background-image: var(--memoria-bg);
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.memoria-card:hover {
    transform: translateY(-6px);
    filter: brightness(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.memoria-card:active {
    transform: translateY(-3px);
}

.memoria-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.memoria-card-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1.5rem;
    width: 100%;
}

.memoria-card-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.3px;
}

/* Responsive */
@media (max-width: 768px) {
    .memorias-title {
        font-size: 2.5rem;
        margin-bottom: 3rem;
    }

    .memoria-card {
        height: 110px;
    }

    .memoria-card-title {
        font-size: 1.8rem;
    }
}

.edit-inline-button {
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
}

.edit-item-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.edit-inline-delete-form {
    margin: 0;
}

.edit-order-form,
.edit-create-form {
    margin-bottom: 1rem;
}

.edit-modal {
    position: fixed;
    inset: 0;
    z-index: 5500;
    background: rgba(26, 26, 26, 0.45);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.edit-modal[hidden] {
    display: none !important;
}

.edit-modal-card {
    width: min(680px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
}

.edit-modal-card .auth-form label {
    display: block;
    margin-top: 0.6rem;
    margin-bottom: 0.25rem;
}

.edit-modal-card .auth-form input,
.edit-modal-card .auth-form textarea,
.edit-modal-card .auth-form select {
    margin-bottom: 0.35rem;
}

.edit-modal-close {
    position: absolute;
    right: 0.6rem;
    top: 0.35rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

body.modal-open {
    overflow: hidden;
}

.image-upload-widget {
    margin-top: 0.45rem;
    margin-bottom: 0.8rem;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    background: var(--upload-widget-bg);
    display: grid;
    gap: 0.35rem;
}

.image-upload-widget.is-dragover {
    border-color: var(--text-color);
    background: var(--upload-widget-dragover-bg);
}

.image-upload-button {
    width: fit-content;
    padding: 0.35rem 0.8rem;
    font-size: 0.86rem;
}

.image-upload-hint {
    color: var(--text-secondary);
    font-size: 0.83rem;
}

.image-upload-path {
    color: var(--text-color);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.image-upload-preview {
    width: min(260px, 100%);
    max-height: 160px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
}

.image-upload-status {
    color: var(--text-secondary);
    font-size: 0.83rem;
    min-height: 1.1em;
}

.image-upload-status.is-error {
    color: #991b1b;
}

.edit-form-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.15rem 0;
}

.edit-form-section-title {
    font-size: 0.95rem;
    margin-bottom: 0.55rem;
    color: var(--text-secondary);
}

.edit-form-section {
    padding: 0.2rem 0;
}

.nav-theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.45rem 0.5rem;
}

.nav-theme-label {
    color: var(--text-color);
    font-size: 0.88rem;
    font-weight: 600;
}

.nav-theme-toggle {
    border: 1px solid var(--border-color);
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--theme-toggle-track);
    padding: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-theme-toggle-knob {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--theme-toggle-knob);
    transition: transform 0.2s ease;
}

.nav-theme-toggle.is-dark {
    background: var(--theme-toggle-active);
}

.nav-theme-toggle.is-dark .nav-theme-toggle-knob {
    transform: translateX(20px);
}

.nav-user-divider {
    border-top: 1px solid var(--border-color);
    margin: 0 0.2rem 0.2rem;
}