body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: url("pink2.jpg") center center / cover no-repeat fixed;
    background-color: #1c1b2b;
    color: black;
    overflow: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.page-layout {
    width: min(95%, 1500px);
    height: calc(100vh - 20px);
    margin: 10px auto;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: stretch;
}

.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    min-height: 0;
}

.main-column {
    min-width: 0;
    min-height: 0;
    display: flex;
}

.sidebar-right-empty {
    min-width: 0;
    min-height: 0;
    display: flex;
}

/* MAIN BOX */
.content-box {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18px 18px 16px;
    border: 2px solid #fdc0cb;
    background: rgba(24, 20, 40, 0.78);
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(253, 192, 203, 0.18);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* HEADER */
.header {
    text-align: center;
    margin-bottom: 14px;
    padding-inline: 70px;
    flex: 0 0 auto;
}

.header img {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    margin: 0 auto;
}

/* HOME BUTTON */
.home-button {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 56px;
    height: 56px;
    background: rgba(24, 20, 40, 0.92);
    border: 2px solid #fdc0cb;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.45);
    z-index: 5;
    transition: 0.2s ease;
}

.home-button:hover {
    background: rgba(40, 30, 60, 0.96);
    box-shadow: 0 0 14px rgba(253, 192, 203, 0.38);
    transform: translateY(-2px);
}

.home-button img {
    width: 70%;
    height: auto;
    display: block;
}

/* SIDEBAR PANELS */
.side-panel,
.empty-column-box {
    border: 2px solid #fdc0cb;
    background: rgba(24, 20, 40, 0.82);
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.22);
}

.panel-title {
    padding: 16px;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: bold;
    text-align: center;
    color: #fdc0cb;
    border-bottom: 2px solid #fdc0cb;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.side-link {
    display: block;
    width: 100%;
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    color: #fdc0cb;
    font-size: clamp(16px, 1.4vw, 18px);
    font-weight: bold;
    border-top: 2px solid #fdc0cb;
    background: rgba(253, 192, 203, 0.12);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transition: 0.2s ease;
}

.side-link:hover {
    background: rgba(253, 192, 203, 0.22);
}

/* DROPDOWN */
.side-dropdown {
    position: relative;
}

.dropdown-toggle {
    width: 100%;
    border: none;
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.dropdown-toggle.side-link {
    display: block;
    width: 100%;
    padding: 18px 12px;
    font-size: clamp(16px, 1.4vw, 18px);
    font-weight: bold;
    text-align: center;
    color: #fdc0cb;
    text-decoration: none;
    border-top: 2px solid #fdc0cb;
    background: rgba(253, 192, 203, 0.12);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: 0.2s ease;
}

.dropdown-toggle.side-link:hover {
    background: rgba(253, 192, 203, 0.22);
}

.dropdown-menu {
    position: absolute;
    top: 50%;
    left: calc(100% + 6px);
    transform: translateY(-18px);
    min-width: 260px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    background: rgba(24, 20, 40, 0.96);
    border: 2px solid #fdc0cb;
    box-shadow: 0 0 14px rgba(253, 192, 203, 0.25);
    border-radius: 10px;
    padding: 8px;
    display: none;
    z-index: 1000;
}

.side-dropdown.open .dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-dropdown.open::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: 8px;
    height: 2px;
    background: #fdc0cb;
    box-shadow: 0 0 6px rgba(253, 192, 203, 0.45);
    z-index: 1001;
    pointer-events: none;
}

.dropdown-item {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: black;
    background: rgba(255, 241, 246, 0.88);
    border: 2px solid #fdc0cb;
    border-radius: 8px;
    transition: 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(253, 192, 203, 0.45);
    transform: translateY(-2px);
}

/* ICON PANEL */
.icon-panel {
    padding: 12px;
    background: rgba(24, 20, 40, 0.82);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.icon-button {
    aspect-ratio: 1 / 1;
    background: rgba(253, 192, 203, 0.12);
    border: 2px solid #fdc0cb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.2s ease;
    color: #fdc0cb;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.icon-button:hover {
    background: rgba(253, 192, 203, 0.22);
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.28);
    transform: translateY(-2px);
}

.icon-button img {
    width: 60%;
    height: auto;
    display: block;
}

/* LORE PAGE MAIN */
.lore-browser {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.lore-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 240px));
    justify-content: start;
    gap: 16px;
    flex: 0 0 auto;
}

.lore-tab {
    min-height: 102px;
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.9);
    color: #e78fa6;
    font-size: clamp(22px, 2vw, 26px);
    font-weight: bold;
    text-shadow: 0 0 6px rgba(231, 143, 166, 0.22);
    cursor: pointer;
    transition: 0.2s ease;
}

.lore-tab:hover {
    background: rgba(253, 192, 203, 0.35);
    transform: translateY(-2px);
    color: #f4b6c6;
}

.lore-tab.active {
    background: rgba(253, 192, 203, 0.18);
    box-shadow: inset 0 0 0 2px rgba(231, 143, 166, 0.15);
    color: #fff1f6;
}

/* CENTER PANEL */
.lore-center-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.lore-center-frame {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.9);
    padding: 16px;
    height: 100%;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
}

/* SCROLL CONTROLS */
.scroll-controls {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    align-items: center;
    justify-items: center;
    height: 100%;
    min-height: 0;
    user-select: none;
}

.scroll-arrow {
    width: 72px;
    height: 120px;
    border: none;
    background: transparent;
    color: #e78fa6;
    font-size: 68px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-shadow: 0 0 8px rgba(231, 143, 166, 0.22);
}

.scroll-arrow:hover {
    transform: scale(1.06);
    color: #f4b6c6;
    text-shadow: 0 0 10px rgba(231, 143, 166, 0.35);
}

.scroll-arrow:active {
    transform: scale(0.98);
}

.scroll-sparkle {
    color: #e78fa6;
    font-size: 44px;
    line-height: 1;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 8px rgba(231, 143, 166, 0.28);
    margin: 0;
    padding: 0;
}

/* INTERNAL SCROLL AREA */
.cards-scroll-viewport {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.96);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    min-height: 0;
}

.cards-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* CHARACTER PROFILE CARD */
.profile-card {
    border: 2px solid #fdc0cb;
    background: rgba(255, 245, 248, 0.98);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.profile-card-main {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.profile-art-column {
    display: grid;
    grid-template-rows: 200px auto;
    gap: 10px;
    min-width: 0;
}

.profile-image-box {
    border: 2px solid #fdc0cb;
    background: rgba(253, 192, 203, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 200px;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-name-box {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.96);
    padding: 12px 16px;
    text-align: left;
}

.profile-name {
    font-size: 22px;
    font-weight: bold;
    color: #e78fa6;
    text-shadow: 0 0 6px rgba(231, 143, 166, 0.16);
    margin-bottom: 6px;
}

.profile-credit {
    font-size: 16px;
    color: black;
}

.profile-lore-box {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.96);
    padding: 22px 24px;
    text-align: left;
    color: black;
    line-height: 1.55;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-lore-box h2 {
    margin: 0 0 18px;
    font-size: 24px;
    color: #e78fa6;
    text-shadow: 0 0 6px rgba(231, 143, 166, 0.18);
    text-align: center;
}

.profile-lore-box p {
    margin: 0;
    font-size: 18px;
}

.profile-card-footer {
    min-height: 72px;
    border-top: 2px solid rgba(253, 192, 203, 0.55);
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding-top: 8px;
}

.profile-art-button {
    width: 52px;
    height: 52px;
    background: rgba(24, 20, 40, 0.92);
    border: 2px solid #fdc0cb;
    border-radius: 12px;
    color: #e78fa6;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.35);
    transition: 0.2s ease;
    cursor: pointer;
    padding: 0;
    text-transform: lowercase;
    text-shadow: 0 0 6px rgba(231, 143, 166, 0.18);
}

.profile-art-button:hover:not(:disabled) {
    background: rgba(40, 30, 60, 0.96);
    box-shadow: 0 0 14px rgba(253, 192, 203, 0.38);
    transform: translateY(-2px);
    color: #f4b6c6;
}

.profile-art-button:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

.empty-card-message {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.95);
    padding: 30px;
    text-align: center;
    font-size: 20px;
    color: black;
}

/* TRUE THIRD COLUMN */
.empty-column-box {
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.future-placeholder {
    text-align: center;
    color: #fdc0cb;
    font-size: clamp(26px, 2.5vw, 34px);
    font-weight: bold;
    line-height: 1.35;
    text-shadow: 0 0 8px rgba(253, 192, 203, 0.18);
}

/* STICKER */
.corner-sticker {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: clamp(50px, 7vw, 70px);
    height: auto;
    z-index: 999;
}

/* RESPONSIVE */
@media (max-width: 1350px) {
    .page-layout {
        grid-template-columns: 220px minmax(0, 1fr) 300px;
    }

    .profile-card-main {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .profile-art-column {
        grid-template-rows: 220px auto;
    }

    .profile-image-box {
        min-height: 220px;
    }
}

@media (max-width: 1200px) {
    body {
        overflow: auto;
    }

    .page-layout {
        height: auto;
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar-right-empty {
        display: none;
    }

    .content-box {
        height: auto;
    }

    .cards-scroll-viewport {
        min-height: 540px;
    }
}

@media (max-width: 1100px) {
    .page-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .header {
        padding-inline: 0;
        padding-top: 66px;
    }

    .home-button {
        top: 10px;
        left: 10px;
    }

    .dropdown-menu {
        top: calc(100% + 8px);
        left: 0;
        transform: none;
        min-width: 100%;
        max-height: none;
    }

    .side-dropdown.open::after {
        display: none;
    }

    body {
        overflow: auto;
    }
}

@media (max-width: 900px) {
    .lore-tabs {
        grid-template-columns: repeat(3, 1fr);
    }

    .lore-center-frame {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .scroll-controls {
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: 1fr;
        height: auto;
        min-height: 70px;
    }

    .scroll-arrow {
        width: 84px;
        height: 60px;
        font-size: 44px;
    }

    .scroll-sparkle {
        width: 42px;
        height: 42px;
        font-size: 30px;
    }

    .cards-scroll-viewport {
        min-height: 460px;
    }
}

@media (max-width: 700px) {
    .profile-card-main {
        grid-template-columns: 1fr;
    }

    .profile-art-column {
        grid-template-rows: 220px auto;
    }

    .profile-lore-box h2 {
        text-align: left;
    }
}

@media (max-width: 600px) {
    .content-box,
    .side-panel,
    .empty-column-box {
        padding-left: 12px;
        padding-right: 12px;
    }

    .corner-sticker {
        width: 48px;
        bottom: 10px;
        left: 10px;
    }
}