:root {
    --bg-main: #f7f3ed;
    --bg-soft: #f2ece3;
    --paper: #f7f3ed;
    --paper-soft: #f2ece3;
    --paper-deep: #e8dcc8;
    --card-bg: rgba(255, 255, 255, 0.72);
    --card: rgba(255, 255, 255, 0.72);
    --text-primary: #43352a;
    --text-secondary: #7a6a5d;
    --ink: #43352a;
    --ink-soft: #7a6a5d;
    --accent-primary: #c9a46b;
    --accent-hover: #b8894e;
    --gold: #c9a46b;
    --gold-deep: #b8894e;
    --brown: #6a4e3b;
    --line: rgba(201, 164, 107, 0.22);
    --border-soft: rgba(201, 164, 107, 0.22);
    --line-strong: rgba(106, 78, 59, 0.3);
    --shadow: 0 24px 70px rgba(74, 52, 29, 0.1);
    --shadow-soft: 0 16px 40px rgba(74, 52, 29, 0.08);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --nav-max-width: 1360px;
    --page-side-padding: 32px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 231, 190, 0.32), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(255, 244, 223, 0.44), transparent 30%),
        linear-gradient(180deg, #fbf7f1 0%, var(--bg-main) 34%, var(--paper) 62%, #f0e8dc 100%);
}

.site-texture {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(120, 91, 54, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 91, 54, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    background:
        radial-gradient(circle at top left, rgba(201, 164, 107, 0.1), transparent 32%),
        linear-gradient(180deg, #f7f3ed 0%, #f2ece3 100%);
}

.paper-shell {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 26px 24px 40px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

body.page-home .paper-shell {
    position: relative;
    max-width: none;
    padding-top: 0;
}

.site-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.site-header {
    width: min(var(--nav-max-width), calc(100vw - (var(--page-side-padding) * 2)));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 20px 26px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 26px;
    background: rgba(255, 250, 243, 0.72);
    border: 1px solid rgba(190, 160, 120, 0.16);
    box-shadow: 0 12px 32px rgba(105, 84, 61, 0.06);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

body.page-home .site-header {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    margin-bottom: 0;
}

.site-header.is-scrolled {
    background: rgba(255, 250, 243, 0.94);
    border-color: rgba(190, 160, 120, 0.24);
    box-shadow: 0 16px 36px rgba(105, 84, 61, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 250px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    flex-shrink: 0;
}

.brand-logo-image {
    width: 52px;
    height: 52px;
    object-fit: contain;
    display: block;
    background: transparent;
    transform: scaleX(-1);
    transform-origin: center;
}

.brand-title {
    display: block;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.brand-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 0.96rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.site-nav a,
.nav-user {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 15px;
    color: var(--brown);
}

.site-nav a:hover {
    color: var(--brown);
    background: rgba(199, 155, 107, 0.08);
}

.nav-user {
    background: rgba(199, 155, 107, 0.08);
    border: 1px solid rgba(199, 155, 107, 0.2);
}

.nav-link {
    color: #6a4e3b;
    font-weight: 600;
    position: relative;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #5a4636;
    background: rgba(255, 255, 255, 0.36);
}

.nav-link.active {
    color: #5a3f2e;
    background: rgba(201, 164, 107, 0.16);
    box-shadow: inset 0 0 0 1px rgba(201, 164, 107, 0.22);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #c9a46b;
}

.nav-inline {
    margin: 0;
}

.nav-button {
    padding: 10px 16px;
}

.site-footer {
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    padding: 54px 24px 46px;
    display: grid;
    gap: 16px;
    justify-items: center;
    background: rgba(247, 243, 237, 0.92);
    border-top: 1px solid rgba(201, 164, 107, 0.18);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--brown);
}

.footer-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.surface,
.hero,
.section,
.page-header,
.detail-panel,
.play-shell,
.chat-shell,
.profile-shell,
.author-shell,
.create-shell,
.login-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.hero {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0;
    margin-bottom: 26px;
    min-height: 100vh;
}

.hero-full-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.hero-cinematic {
    background: url("/static/images/heroPic.png") center center / cover no-repeat;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(248, 245, 240, 0.12), rgba(248, 245, 240, 0.30)),
        linear-gradient(to bottom, rgba(248, 245, 240, 0.08), rgba(248, 245, 240, 0.24));
    z-index: 1;
    pointer-events: none;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 180px 24px 80px;
}

.hero-content {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transform: translateY(14px);
    animation: heroTextIn 1.2s ease forwards 0.25s;
}

.hero-kicker {
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #b8894e;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero-title {
    margin: 0;
    font-size: clamp(72px, 8vw, 120px);
    line-height: 0.95;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #3f332a;
    text-shadow: 0 12px 36px rgba(126, 92, 54, 0.16);
}

.hero-subtitle {
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1.2;
    color: #6a4e3b;
    margin-top: 16px;
    margin-bottom: 0;
}

.hero-description {
    font-size: 18px;
    line-height: 1.8;
    color: #6f6258;
    max-width: 680px;
    margin-top: 18px;
    margin-bottom: 0;
}

.page-header h1,
.detail-title,
.login-card h1 {
    margin: 0;
    font-size: clamp(2.5rem, 4vw, 4.1rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-actions,
.section-heading,
.meta-row,
.tag-row,
.stat-row,
.score-bar,
.form-actions,
.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: center;
    margin-top: 34px;
    flex-wrap: wrap;
}

.detail-actions {
    margin-top: 22px;
    flex-wrap: wrap;
}

.hero-actions .btn {
    min-width: 190px;
    height: 62px;
    padding: 0 36px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #c9a46b, #b8894e);
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(166, 118, 63, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.42);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.58);
    color: #5a4636;
    border: 1px solid rgba(201, 164, 107, 0.38);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.art-frame,
.cover-art,
.avatar-art,
.hero-visual,
.detail-cover,
.portrait-card,
.chat-portrait {
    background:
        linear-gradient(145deg, rgba(22, 19, 18, 0.18), rgba(199, 155, 107, 0.3)),
        radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.68), transparent 20%),
        linear-gradient(135deg, #65513f, #8a6a4b 52%, #d7c1a0);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.section,
.page-header,
.detail-panel,
.profile-side,
.profile-main,
.play-aside,
.play-main,
.play-status,
.chat-side,
.chat-main,
.author-shell,
.create-shell,
.login-card {
    padding: 24px;
}

.hero-continue-card {
    width: min(460px, 92vw);
    margin-top: 34px;
    padding: 22px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(88, 64, 42, 0.16);
    text-align: left;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.hero-continue-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.hero-continue-card h3 {
    margin: 4px 0 0;
    font-size: 1.5rem;
    font-weight: 500;
}

.hero-continue-card p,
.hero-continue-card small {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.continue-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.continue-poster-wrap {
    width: 86px;
}

.continue-poster {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    border-radius: 18px;
    box-shadow: 0 16px 26px rgba(88, 64, 42, 0.16);
}

.continue-poster-placeholder {
    background:
        radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.58), transparent 28%),
        linear-gradient(135deg, #e9d8be, #b88d5c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.78);
    font-size: 30px;
}

.continue-time {
    font-size: 0.88rem;
    white-space: nowrap;
}

.continue-subtitle {
    font-size: 1rem;
    color: #6f6258;
}

.continue-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.continue-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8f673e;
    font-weight: 700;
    font-size: 0.96rem;
}

.continue-link:hover {
    color: #6f4d2f;
}

.subtle {
    color: var(--ink-soft);
}

.section {
    margin-bottom: 24px;
}

.section-heading,
.meta-row {
    justify-content: space-between;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h3,
.panel-title,
.play-title,
.chat-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 500;
}

.section-link {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.section-link:hover {
    color: var(--brown);
}

.home-section {
    width: min(1280px, calc(100% - 96px));
    margin: 48px auto;
    padding: 32px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.56);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(88, 64, 42, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #43352a;
}

.feature-hold-card {
    min-height: 320px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 36px 24px;
    text-align: center;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 248, 236, 0.9), transparent 28%),
        linear-gradient(145deg, rgba(255, 252, 247, 0.94), rgba(244, 236, 223, 0.92));
    border: 1px solid rgba(201, 164, 107, 0.2);
    box-shadow: 0 20px 48px rgba(88, 64, 42, 0.08);
}

.feature-hold-card strong {
    color: #5f4631;
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.feature-hold-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(201, 164, 107, 0.14);
    border: 1px solid rgba(201, 164, 107, 0.22);
    color: #8f673e;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.continue-grid,
.library-grid,
.avatar-row,
.stats-grid,
.mini-grid,
.saves-grid,
.author-grid,
.create-grid {
    display: grid;
    gap: 18px;
}

.poster-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 22px;
}

.continue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.continue-card,
.library-card,
.character-card,
.poster-card,
.mini-card,
.list-card,
.choice-button,
.message,
.stat-card {
    background: rgba(255, 250, 244, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 28px rgba(74, 52, 29, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.continue-card,
.library-card,
.character-card,
.list-card,
.stat-card,
.poster-card {
    overflow: hidden;
}

.poster-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(201, 164, 107, 0.18);
    box-shadow: 0 18px 42px rgba(88, 64, 42, 0.1);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.poster-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 52px rgba(88, 64, 42, 0.14);
    border-color: rgba(201, 164, 107, 0.26);
}

.poster-cover-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #e9d8be;
}

.poster-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-placeholder {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), transparent 28%),
        linear-gradient(135deg, #e9d8be, #b88d5c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 40px;
}

.poster-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 14px 16px;
}

.poster-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #43352a;
    line-height: 1.35;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poster-meta {
    font-size: 13px;
    color: #7a6a5d;
    line-height: 1.5;
}

.poster-excerpt {
    margin: 0;
    font-size: 13px;
    color: #7a6a5d;
    line-height: 1.6;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poster-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(201, 164, 107, 0.12);
}

.poster-dialogue-count {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: #8a745f;
    font-weight: 500;
}

.poster-library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.continue-card {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
}

.continue-art {
    width: 96px;
    height: 112px;
    border-radius: 18px;
}

.continue-body h4,
.library-body h4,
.library-body h3,
.detail-panel h2,
.profile-name,
.author-name {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 500;
}

.continue-body p,
.library-body p,
.page-header p,
.detail-summary,
.profile-copy,
.author-copy,
.login-card p,
.panel-note {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.75;
}

.pill,
.tag-row span,
.stat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(199, 155, 107, 0.12);
    border: 1px solid rgba(199, 155, 107, 0.18);
    color: var(--brown);
    font-size: 0.82rem;
}

.pill-row,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.story-tags,
.character-tags,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.library-card,
.character-card {
    display: grid;
    grid-template-rows: auto 1fr;
}

.mini-card {
    display: block;
    overflow: hidden;
    border-radius: 20px;
}

.mini-card .cover-art {
    height: 120px;
}

.cover-art {
    height: 220px;
}

.avatar-art {
    height: 220px;
}

.library-body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.meta-row {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    margin-bottom: 10px;
}

.library-toolbar {
    width: min(1280px, calc(100% - 96px));
    margin: 28px auto 24px;
}

.story-grid-section {
    width: min(1280px, calc(100% - 96px));
    margin: 36px auto 48px;
}

.library-search {
    width: 100%;
}

.library-search-input {
    width: 100%;
    height: 58px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid rgba(201, 164, 107, 0.22);
    background: rgba(255, 255, 255, 0.68);
    color: #43352a;
    font-size: 16px;
    outline: none;
    box-shadow: 0 14px 34px rgba(88, 64, 42, 0.07);
}

.library-search-input::placeholder {
    color: #a39588;
}

.library-search-input:focus {
    border-color: rgba(201, 164, 107, 0.48);
    box-shadow: 0 18px 42px rgba(88, 64, 42, 0.12);
}

.popular-tags {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.popular-tags-label {
    color: #7a6a5d;
    font-size: 14px;
    font-weight: 700;
}

.popular-tags-list {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.popular-tag {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(201, 164, 107, 0.22);
    color: #7a5f42;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.popular-tag:hover,
.popular-tag.active {
    background: rgba(201, 164, 107, 0.18);
    color: #5a3f2e;
    border-color: rgba(201, 164, 107, 0.42);
}

.library-empty-state {
    display: grid;
    gap: 10px;
    padding: 24px;
    grid-column: 1 / -1;
    border-radius: 24px;
    border: 1px dashed rgba(106, 78, 59, 0.24);
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.45);
}

.library-empty-state p {
    margin: 0;
}

.library-clear-link {
    color: #8f673e;
    font-weight: 700;
}

.library-clear-link:hover {
    color: #6f4d2f;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr auto;
    gap: 12px;
    margin-bottom: 22px;
}

.filter-bar.compact {
    grid-template-columns: 1fr 1fr auto;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(199, 155, 107, 0.75);
    box-shadow: 0 0 0 4px rgba(199, 155, 107, 0.16);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

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

.primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #fff;
    box-shadow: 0 12px 24px rgba(168, 120, 67, 0.24);
}

.button.primary:hover,
.btn-primary:hover {
    box-shadow: 0 18px 36px rgba(164, 119, 62, 0.2);
}

.button.primary::after,
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transition: transform 0.8s ease;
}

.button.primary:hover::after,
.btn-primary:hover::after {
    transform: translateX(120%);
}

.secondary {
    background: rgba(199, 155, 107, 0.14);
    border-color: rgba(199, 155, 107, 0.28);
    color: var(--brown);
}

.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-soft);
}

.danger {
    background: rgba(177, 84, 64, 0.12);
    border-color: rgba(177, 84, 64, 0.24);
    color: #8c3e2d;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
    gap: 24px;
    margin-bottom: 24px;
}

.detail-cover {
    min-height: 560px;
    border-radius: var(--radius-xl);
}

.detail-panel {
    display: grid;
    gap: 18px;
}

.detail-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag-row-below-count {
    margin-top: 4px;
    margin-bottom: 10px;
}

.detail-tag-link {
    text-decoration: none;
}

.detail-title {
    font-size: clamp(2.2rem, 4vw, 3.3rem);
}

.subtitle {
    margin: 0;
    color: var(--brown);
    font-size: 1.08rem;
}

.detail-conversation-count {
    margin: -2px 0 2px;
    color: #8a7562;
    font-size: 0.95rem;
}

.character-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 16px;
}

.strip-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
}

.strip-card .avatar-art {
    width: 82px;
    height: 82px;
    border-radius: 50%;
}

.play-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 260px;
    gap: 18px;
    padding: 18px;
}

.play-aside,
.play-main,
.play-status,
.chat-side,
.chat-main,
.profile-side,
.profile-main {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.play-list,
.status-list,
.chat-log,
.profile-menu,
.saves-list,
.author-list {
    display: grid;
    gap: 12px;
}

.list-card {
    padding: 14px;
}

.list-card strong,
.author-list strong {
    display: block;
    margin-bottom: 6px;
}

.play-main {
    display: grid;
    gap: 18px;
}

.chapter-banner {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.narrative-card {
    padding: 22px 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 240, 0.96));
    border-radius: 24px;
    border: 1px solid var(--line);
    line-height: 1.95;
    font-size: 1.05rem;
}

.choice-grid {
    display: grid;
    gap: 12px;
}

.choice-button {
    padding: 14px 16px;
    text-align: left;
    border: 0;
}

.free-input,
.chat-input {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.status-list .list-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-shell {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
}

.chat-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.chat-portrait {
    min-height: 420px;
    border-radius: 24px;
}

.progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(106, 78, 59, 0.12);
    overflow: hidden;
}

.progress-track i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
}

.chat-main {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 16px;
    min-height: 720px;
}

.chat-log {
    align-content: start;
}

.message {
    max-width: 76%;
    padding: 14px 16px;
    line-height: 1.75;
}

.message.user {
    margin-left: auto;
    background: rgba(199, 155, 107, 0.12);
}

.message.character {
    background: rgba(255, 255, 255, 0.98);
}

.profile-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    width: min(1280px, calc(100% - 48px));
    margin: 32px auto 0;
    min-height: 780px;
    align-items: stretch;
}

.profile-side {
    display: grid;
    align-content: start;
    gap: 18px;
    min-height: 100%;
}

.account-main {
    display: grid;
    gap: 18px;
    min-height: 742px;
    max-height: 742px;
    overflow-y: auto;
    padding-right: 6px;
}

.profile-avatar,
.author-avatar {
    width: 116px;
    height: 116px;
    border-radius: 50%;
}

.profile-name,
.author-name {
    font-size: 1.5rem;
}

.profile-menu a,
.profile-menu-link {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--ink-soft);
}

.profile-menu a:hover,
.profile-menu-link:hover {
    background: rgba(199, 155, 107, 0.08);
    color: var(--brown);
}

.profile-menu-link.active {
    background: rgba(201, 164, 107, 0.14);
    color: var(--brown);
    box-shadow: inset 0 0 0 1px rgba(201, 164, 107, 0.22);
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
    gap: 10px;
}

.stats-grid .stat-card {
    min-height: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 16px;
}

.stats-grid .stat-card .subtle {
    font-size: 0.82rem;
    line-height: 1.2;
}

.stats-grid .stat-card strong {
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
}

.saves-grid,
.author-grid,
.create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.author-shell,
.create-shell {
    padding: 24px;
}

.author-top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.author-list .list-card,
.saves-list .list-card {
    display: block;
}

.manage-card {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.manage-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.manage-actions form {
    margin: 0;
}

.create-form {
    display: grid;
    gap: 12px;
}

.create-form p {
    margin: 0;
}

.create-switch-shell {
    display: grid;
    gap: 22px;
}

.creator-sections,
.created-content-grid,
.author-content-grid {
    margin-top: 56px;
}

.create-toggle {
    display: grid;
    gap: 22px;
}

.create-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.create-switch-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.create-switch-text {
    color: var(--ink-soft);
    font-size: 0.98rem;
    transition: color 160ms ease, font-weight 160ms ease;
}

.create-switch {
    position: relative;
    width: 86px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background: rgba(199, 155, 107, 0.18);
    border: 1px solid rgba(199, 155, 107, 0.24);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(74, 52, 29, 0.08);
}

.create-switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    box-shadow: 0 12px 24px rgba(168, 120, 67, 0.22);
    transition: transform 180ms ease;
}

#create-mode-switch:not(:checked) ~ .create-switch-row .create-switch-text:first-child,
#create-mode-switch:checked ~ .create-switch-row .create-switch-text:last-child {
    color: var(--brown);
    font-weight: 600;
}

#create-mode-switch:checked ~ .create-switch-row .create-switch-thumb {
    transform: translateX(40px);
}

.create-panels {
    display: grid;
}

.create-panel {
    display: none;
    gap: 14px;
}

#create-mode-switch:not(:checked) ~ .create-panels .panel-story,
#create-mode-switch:checked ~ .create-panels .panel-character {
    display: grid;
}

.login-wrap {
    display: flex;
    justify-content: center;
    padding: 52px 0;
}

.login-card {
    width: min(100%, 540px);
}

.login-card .stack-form {
    display: grid;
    gap: 14px;
}

.login-card .stack-form p {
    margin: 0;
}

.login-button {
    width: 100%;
    margin-top: 8px;
}

.login-note {
    display: grid;
    gap: 6px;
    margin-top: 22px;
    padding: 16px;
    background: rgba(199, 155, 107, 0.1);
    border: 1px solid rgba(199, 155, 107, 0.2);
    border-radius: 18px;
    color: var(--brown);
}

.auth-stage {
    width: min(1180px, calc(100% - 56px));
    min-height: calc(100vh - 230px);
    margin: 36px auto 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel {
    width: min(520px, 100%);
    padding: 44px 42px 38px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 243, 236, 0.76));
    border: 1px solid rgba(201, 164, 107, 0.2);
    box-shadow: 0 30px 72px rgba(88, 64, 42, 0.14);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-panel-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-panel-kicker {
    margin: 0 0 10px;
    color: #b8894e;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.auth-panel-title {
    margin: 0;
    color: #3f332a;
    font-size: clamp(42px, 4vw, 60px);
    line-height: 0.98;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.auth-panel-copy {
    margin: 16px auto 0;
    max-width: 400px;
    color: #756659;
    font-size: 15px;
    line-height: 1.85;
}

.auth-form-grid {
    width: 100%;
    display: grid;
    gap: 18px;
}

.auth-field {
    width: 100%;
    display: grid;
    gap: 8px;
}

.auth-label {
    color: #5a4636;
    font-size: 14px;
    font-weight: 700;
}

.auth-form-grid .auth-input,
.auth-form-grid .form-input {
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 0 18px;
    border: 1px solid rgba(201, 164, 107, 0.24);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    color: #43352a;
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    appearance: none;
    -webkit-appearance: none;
}

.auth-form-grid .auth-input::placeholder,
.auth-form-grid .form-input::placeholder {
    color: #ab9d90;
}

.auth-form-grid .auth-input:focus,
.auth-form-grid .form-input:focus {
    border-color: rgba(201, 164, 107, 0.5);
    box-shadow:
        0 0 0 4px rgba(201, 164, 107, 0.1),
        0 14px 30px rgba(88, 64, 42, 0.08);
}

.auth-cta {
    width: 100%;
    margin-top: 8px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c9a46b, #b8894e);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(166, 118, 63, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.auth-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 52px rgba(166, 118, 63, 0.34);
}

.auth-panel-switch {
    margin: 22px 0 0;
    text-align: center;
    color: #7a6a5d;
    font-size: 14px;
}

.auth-panel-switch a {
    color: #b8894e;
    font-weight: 700;
    text-decoration: none;
}

.auth-feedback,
.auth-field-error {
    color: #9b4a3f;
    font-size: 13px;
    line-height: 1.55;
}

.auth-feedback ul,
.auth-field-error ul {
    margin: 0;
    padding-left: 18px;
}

.story-library-shell {
    width: 100%;
    margin: 0 0 56px;
}

.story-library-hero {
    width: 100%;
    margin: 0;
    padding: 30px 26px 28px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.48);
    box-shadow: 0 24px 64px rgba(88, 64, 42, 0.11);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.story-library-kicker {
    margin: 0 0 8px;
    color: #7f6a57;
    font-size: 15px;
}

.story-library-title {
    margin: 0;
    color: #3f332a;
    font-size: clamp(54px, 6vw, 76px);
    line-height: 0.95;
    font-weight: 500;
    letter-spacing: -0.05em;
}

.story-library-copy {
    margin: 18px 0 0;
    max-width: 760px;
    color: #706357;
    font-size: 16px;
    line-height: 1.85;
}

.story-library-toolbar {
    margin: 30px auto 0;
}

.unified-library-toolbar {
    width: 100%;
    margin: 30px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.unified-library-search {
    width: 100%;
}

.unified-library-search-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.story-search-input {
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 22px;
    border: 1px solid rgba(201, 164, 107, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #43352a;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
    box-shadow: 0 16px 38px rgba(88, 64, 42, 0.08);
    appearance: none;
    -webkit-appearance: none;
}

.story-search-input::placeholder {
    color: #a59688;
}

.story-search-input:focus {
    border-color: rgba(201, 164, 107, 0.46);
    box-shadow:
        0 0 0 4px rgba(201, 164, 107, 0.08),
        0 18px 42px rgba(88, 64, 42, 0.1);
}

.toolbar-filter {
    position: relative;
}

.toolbar-filter-button {
    min-width: 112px;
    height: 58px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(201, 164, 107, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #5d4736;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(88, 64, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.toolbar-search-button {
    min-width: 112px;
    height: 58px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c9a46b, #b8894e);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(166, 118, 63, 0.24);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.toolbar-search-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(166, 118, 63, 0.3);
}

.toolbar-filter-button:hover,
.toolbar-filter-button[aria-expanded="true"] {
    border-color: rgba(201, 164, 107, 0.42);
    box-shadow: 0 18px 42px rgba(88, 64, 42, 0.12);
    transform: translateY(-1px);
}

.toolbar-filter-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 20;
    width: 190px;
    padding: 10px;
    display: grid;
    gap: 6px;
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.96);
    border: 1px solid rgba(201, 164, 107, 0.22);
    box-shadow: 0 24px 56px rgba(88, 64, 42, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toolbar-filter-menu[hidden] {
    display: none;
}

.toolbar-filter-item {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    color: #6a4e3b;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.toolbar-filter-item:hover,
.toolbar-filter-item.active {
    background: rgba(201, 164, 107, 0.16);
    color: #4f392b;
}

.story-library-tags {
    width: 100%;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.popular-tags-title {
    color: #6f5f53;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.story-library-tag-list,
.detail-panel .detail-tags-unified {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tag-pill,
.unified-pill,
.detail-panel .detail-tags-unified .detail-tag,
.detail-panel .detail-tags-unified .story-tag,
.detail-panel .detail-tags-unified .character-tag,
.detail-panel .detail-tags-unified .tag-item,
.detail-panel .detail-tags-unified .pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    height: 30px !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 13px !important;
    border-radius: 999px !important;
    aspect-ratio: auto !important;
    border: 1px solid #e4d4c0 !important;
    background: #fbf6ef !important;
    color: #7b6047 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    text-decoration: none;
    box-shadow: none !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease !important;
}

.tag-pill:hover,
.unified-pill:hover,
.tag-pill.active,
.unified-pill.active,
.detail-tag-link:hover {
    background: #f8f1e8 !important;
    border-color: #d8c2a7 !important;
    color: #6f4d2f !important;
    transform: none !important;
}

.story-grid-section {
    width: 100%;
    margin: 34px auto 0;
}

.story-grid-section .library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.story-library-empty {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 26px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px dashed rgba(201, 164, 107, 0.3);
    color: #756659;
}

.story-library-empty p {
    margin: 0;
}

.story-library-reset {
    color: #8f673e;
    font-weight: 700;
    text-decoration: none;
}

.auth-page {
    width: min(1180px, calc(100% - 64px));
    min-height: calc(100vh - 220px);
    margin: 40px auto 80px;
    display: flex;
    flex: 1 0 auto;
    align-self: center;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(520px, 100%);
    max-width: 520px;
    margin: 0 auto;
    padding: 42px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(201, 164, 107, 0.18);
    box-shadow: 0 28px 76px rgba(88, 64, 42, 0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-kicker {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 0.18em;
    color: #b8894e;
    font-weight: 700;
}

.auth-header h1 {
    margin: 0;
    font-size: clamp(36px, 4vw, 52px);
    line-height: 1.05;
    color: #3f332a;
    font-weight: 600;
}

.auth-title {
    margin: 0;
    font-size: clamp(36px, 4vw, 52px);
    line-height: 1.05;
    color: #3f332a;
    font-weight: 600;
}

.auth-header p {
    margin: 16px auto 0;
    color: #7a6a5d;
    font-size: 15px;
    line-height: 1.8;
    max-width: 380px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #5a4636;
    font-size: 14px;
    font-weight: 700;
}

.auth-form .auth-input,
.auth-form .form-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid rgba(201, 164, 107, 0.24);
    background: rgba(255, 255, 255, 0.64);
    color: #43352a;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.form-input {
    width: 100%;
    max-width: 100%;
}

.auth-form .auth-input:focus,
.auth-form .form-input:focus {
    border-color: rgba(201, 164, 107, 0.56);
    box-shadow: 0 0 0 4px rgba(201, 164, 107, 0.1);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    height: 56px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #c9a46b, #b8894e);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(166, 118, 63, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease;
    appearance: none;
    -webkit-appearance: none;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(166, 118, 63, 0.34);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    text-decoration: none;
}

.auth-page .form-group,
.auth-page .field-errors,
.auth-page .form-errors,
.auth-page .auth-switch,
.auth-page .field-help {
    width: 100%;
}

.auth-page form {
    width: 100%;
}

.auth-page input.auth-input,
.auth-page input.form-input,
.auth-page button.auth-submit {
    display: block;
}

.auth-switch {
    margin: 24px 0 0;
    text-align: center;
    color: #7a6a5d;
    font-size: 14px;
}

.auth-switch a {
    color: #b8894e;
    font-weight: 700;
    text-decoration: none;
}

.field-errors,
.form-errors {
    color: #9b4a3f;
    font-size: 13px;
    line-height: 1.5;
}

.field-errors ul,
.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.field-help {
    margin: 0;
    color: #8a7b6f;
    font-size: 13px;
    line-height: 1.6;
}

.field-help ul {
    margin: 0;
    padding-left: 18px;
}

.auth-info,
.form-success {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(201, 164, 107, 0.18);
    color: #6a4e3b;
    line-height: 1.7;
}

.auth-info p,
.form-success {
    margin: 0;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-link-button {
    width: 100%;
}

.empty-state {
    padding: 18px;
    border-radius: 20px;
    border: 1px dashed rgba(106, 78, 59, 0.24);
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.45);
}

.profile-identity {
    display: grid;
    gap: 16px;
}

.profile-avatar-image {
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 14px 34px rgba(74, 52, 29, 0.12);
}

.profile-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fffaf4;
}

.profile-signature {
    margin: 8px 0 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

.profile-edit-link {
    width: 100%;
}

.story-cover-surface {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 26% 20%, rgba(255, 255, 255, 0.62), transparent 24%),
        linear-gradient(140deg, #ead8bc, #b8894e 55%, #73573f);
}

.detail-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.78);
    font-size: 4rem;
}

.detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.edit-pill,
.like-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(201, 164, 107, 0.28);
    color: #6a4e3b;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.like-pill {
    cursor: pointer;
}

.detail-login-tip {
    margin: 0;
    color: var(--text-secondary);
}

.strip-avatar-image {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 1180px) {
    .poster-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .play-shell {
        grid-template-columns: 1fr;
    }

    .chat-shell,
    .profile-shell,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-shell {
        width: calc(100% - 48px);
        min-height: auto;
    }

    .account-main {
        min-height: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .hero-overlay {
        padding: 160px 24px 64px;
    }
}

@media (max-width: 840px) {
    .poster-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-header {
        display: grid;
        justify-content: stretch;
    }

    .continue-grid,
    .saves-grid,
    .author-grid,
    .create-grid,
    .detail-stats,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .continue-card {
        grid-template-columns: 1fr;
    }

    .filter-bar,
    .filter-bar.compact,
    .free-input,
    .chat-input {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-stage,
    .library-toolbar {
        width: calc(100% - 32px);
    }

    .auth-stage {
        margin: 24px auto 56px;
        min-height: auto;
    }

    .story-library-shell {
        width: 100%;
        margin-bottom: 40px;
    }

    .story-grid-section {
        width: 100%;
        margin-top: 28px;
    }

    .unified-library-toolbar {
        grid-template-columns: 1fr;
    }

    .unified-library-search-row {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        padding: 30px 22px 28px;
        border-radius: 28px;
    }

    .auth-panel-title {
        font-size: 44px;
    }

    .story-library-hero {
        padding: 24px 20px 22px;
        border-radius: 26px;
    }

    .story-library-title {
        font-size: 52px;
    }

    .library-search-input {
        height: 52px;
        font-size: 15px;
    }

    .story-search-input {
        height: 54px;
        font-size: 15px;
    }

    .story-library-tags,
    .popular-tags {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .story-grid-section .library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .toolbar-filter {
        width: 100%;
    }

    .toolbar-filter-button {
        width: 100%;
        height: 54px;
    }

    .toolbar-search-button {
        width: 100%;
        height: 54px;
    }

    .toolbar-filter-menu {
        width: 100%;
        position: static;
        margin-top: 10px;
    }
}

@media (max-width: 680px) {
    .site-footer {
        width: 100%;
        padding: 36px 20px 30px;
    }

    .footer-links {
        gap: 12px 18px;
    }

    .home-section {
        width: calc(100% - 32px);
        padding: 20px;
    }

    .poster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .paper-shell {
        padding: 14px 14px 28px;
    }

    .profile-shell {
        width: calc(100% - 16px);
        margin-top: 20px;
    }

    .library-grid,
    .story-grid-section .library-grid {
        grid-template-columns: 1fr;
    }

    .section,
    .page-header,
    .detail-panel,
    .play-aside,
    .play-main,
    .play-status,
    .chat-side,
    .chat-main,
    .profile-side,
    .profile-main,
    .author-shell,
    .create-shell,
    .login-card {
        padding: 18px;
    }

    body.page-home .site-header {
        width: calc(100vw - 28px);
        top: 14px;
    }

    .hero {
        min-height: 100vh;
    }

    .hero-overlay {
        min-height: 100vh;
        padding: 140px 14px 42px;
    }

    .hero-continue-card {
        width: 100%;
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 18px;
    }

    .continue-poster-wrap {
        width: 72px;
    }
}

@media (max-width: 640px) {
    .auth-panel-title {
        font-size: 36px;
    }

    .story-library-title {
        font-size: 42px;
    }
}

.site-container {
    width: min(var(--nav-max-width), calc(100vw - (var(--page-side-padding) * 2)));
    margin-left: auto;
    margin-right: auto;
}

.static-page {
    max-width: 900px;
    margin-top: 10px;
    margin-bottom: 40px;
}

.static-page-hero,
.static-page-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(190, 160, 120, 0.2);
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(247, 241, 232, 0.9));
    box-shadow: var(--shadow-soft);
    border-radius: 28px;
}

.static-page-hero {
    padding: 42px 42px 34px;
    margin-bottom: 22px;
}

.static-page-hero::after {
    content: "";
    position: absolute;
    inset: auto -5% -35% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 164, 107, 0.18), transparent 68%);
    pointer-events: none;
}

.static-page-kicker {
    margin: 0 0 10px;
    color: var(--accent-hover);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.static-page-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    line-height: 1.08;
}

.static-page-lead {
    max-width: 42rem;
    margin: 16px 0 0;
    color: var(--text-secondary);
    font-size: 1.04rem;
    line-height: 1.85;
}

.static-page-card {
    padding: 34px 42px;
}

.static-page-card p {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.95;
}

.static-page-card p + p {
    margin-top: 18px;
}

.static-page-list {
    margin: 16px 0 20px 1.4rem;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.9;
}

.static-page-list li + li {
    margin-top: 10px;
}

.static-page-list-bulleted {
    list-style: disc;
}

.static-page-inline-link {
    color: var(--accent-hover);
    font-weight: 700;
}

.static-page-inline-link:hover {
    color: var(--brown);
}

.static-page-section-list {
    margin: 0;
    padding-left: 1.4rem;
    color: var(--text-primary);
}

.static-page-section-list > li + li {
    margin-top: 22px;
}

.static-page-section-list strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.02rem;
}

.static-page-section-list p {
    margin: 0;
}

.static-page-section-list p + p {
    margin-top: 10px;
}

.account-page .paper-shell {
    max-width: none;
}

.account-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    margin-top: 10px;
    margin-bottom: 40px;
    align-items: start;
}

.account-sidebar {
    position: sticky;
    top: 24px;
}

.account-sidebar-card,
.settings-panel,
.settings-card,
.dashboard-hero,
.dashboard-stat-card,
.dashboard-card {
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(251, 247, 241, 0.9));
    border: 1px solid rgba(201, 164, 107, 0.18);
    box-shadow: 0 24px 64px rgba(88, 64, 42, 0.1);
}

.account-sidebar-card {
    padding: 28px 22px 22px;
}

.account-sidebar-head {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
}

.account-sidebar-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 34px rgba(88, 64, 42, 0.14);
}

.account-sidebar-avatar-fallback,
.avatar-preview-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.46), transparent 28%),
        linear-gradient(135deg, #d8ba8f, #b8894e);
    color: #fffaf3;
    font-weight: 700;
}

.account-sidebar-avatar-fallback {
    font-size: 2.1rem;
}

.account-sidebar-copy {
    display: grid;
    gap: 8px;
}

.account-sidebar-name {
    margin: 0;
    font-size: 1.7rem;
    color: #43352a;
}

.account-sidebar-meta {
    margin: 0;
    color: #8a7b6d;
    font-size: 0.95rem;
}

.account-sidebar-signature {
    margin: 2px 0 0;
    color: #66584b;
    font-size: 0.95rem;
    line-height: 1.7;
}

.account-sidebar-nav {
    display: grid;
    gap: 10px;
}

.account-sidebar-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    color: #6e6053;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.account-sidebar-link:hover {
    background: rgba(201, 164, 107, 0.08);
    color: #4f392b;
    transform: translateX(1px);
}

.account-sidebar-link.active {
    background: rgba(201, 164, 107, 0.18);
    color: #4f392b;
    box-shadow: inset 0 0 0 1px rgba(201, 164, 107, 0.24);
}

.account-content {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.account-panel {
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(251, 247, 241, 0.92));
    border: 1px solid rgba(201, 164, 107, 0.18);
    box-shadow: 0 24px 64px rgba(88, 64, 42, 0.1);
}

.account-panel-wide {
    min-width: 0;
}

.account-panel-header,
.account-subsection-head,
.account-form-actions,
.account-save-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.account-panel-header {
    margin-bottom: 26px;
}

.account-panel-header h1,
.account-subsection-head h2 {
    margin: 0;
    color: #3f332a;
}

.account-panel-header p:not(.account-panel-kicker),
.account-save-card p,
.account-field-note {
    margin: 10px 0 0;
    color: #77695d;
    line-height: 1.8;
}

.account-panel-kicker {
    margin: 0 0 10px;
    color: #b8894e;
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}

.account-form-grid,
.account-save-grid {
    display: grid;
    gap: 24px;
}

.account-save-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-save-column {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.account-subsection-head {
    align-items: center;
}

.account-subsection-head span {
    color: #8a7b6d;
    font-size: 0.92rem;
}

.account-save-list {
    display: grid;
    gap: 14px;
}

.account-save-card {
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(170, 143, 108, 0.16);
}

.account-save-card strong {
    color: #4f392b;
}

.settings-panel {
    padding: 28px;
}

.settings-header,
.dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.settings-eyebrow {
    margin: 0 0 10px;
    color: #b8894e;
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}

.settings-title {
    margin: 0;
    color: #3f332a;
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.04;
}

.settings-subtitle {
    margin: 14px 0 0;
    max-width: 640px;
    color: #77695d;
    line-height: 1.8;
}

.settings-form {
    margin-top: 26px;
    display: grid;
    gap: 22px;
}

.profile-edit-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 24px;
    align-items: stretch;
    min-width: 0;
}

.settings-card {
    padding: 24px;
}

.profile-edit-grid > .profile-form-card,
.avatar-card,
.basic-info-card {
    height: 100%;
    min-width: 0;
    width: 100%;
}

.profile-form-card,
.avatar-card,
.basic-info-card {
    display: flex;
    flex-direction: column;
}

.basic-info-card .settings-field {
    flex: 1;
}

.settings-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}

.settings-card-head h3,
.dashboard-card-head h3 {
    margin: 0;
    color: #43352a;
    font-size: 1.28rem;
}

.settings-card-head p,
.dashboard-card-head p {
    margin: 8px 0 0;
    color: #87796c;
    line-height: 1.7;
}

.avatar-uploader {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.avatar-preview-wrap {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(242, 236, 227, 0.88);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-fallback {
    width: 100%;
    height: 100%;
    font-size: 2.1rem;
}

.is-hidden {
    display: none;
}

.avatar-uploader-body {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.avatar-uploader-actions,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.settings-upload-button,
.settings-remove-button {
    min-width: 124px;
}

.avatar-uploader-note,
.avatar-file-name {
    margin: 0;
    color: #87796c;
    line-height: 1.6;
}

.avatar-file-name {
    font-size: 0.92rem;
}

.avatar-uploader input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.settings-field {
    display: grid;
    gap: 10px;
}

.settings-label {
    color: #5a4636;
    font-size: 0.95rem;
    font-weight: 700;
}

.settings-input,
.settings-field input[type="text"] {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid rgba(201, 164, 107, 0.24);
    background: rgba(255, 255, 255, 0.9);
    color: #43352a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.settings-input:focus,
.settings-field input[type="text"]:focus {
    border-color: rgba(201, 164, 107, 0.5);
    box-shadow:
        0 0 0 4px rgba(201, 164, 107, 0.1),
        0 14px 34px rgba(88, 64, 42, 0.08);
    outline: none;
}

.settings-field-error,
.settings-alert {
    color: #9b4a3f;
    font-size: 0.9rem;
    line-height: 1.6;
}

.settings-alert {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(177, 84, 64, 0.08);
    border: 1px solid rgba(177, 84, 64, 0.14);
}

.settings-field-error ul,
.settings-alert ul {
    margin: 0;
    padding-left: 18px;
}

.dashboard-hero,
.dashboard-card {
    padding: 24px;
}

.dashboard-hero {
    align-items: center;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-stat-card {
    padding: 20px 22px;
    display: grid;
    gap: 8px;
}

.dashboard-stat-card span {
    color: #7c6d60;
    font-size: 0.92rem;
}

.dashboard-stat-card strong {
    color: #43352a;
    font-size: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.dashboard-inline-link {
    color: #8f673e;
    font-weight: 700;
}

.dashboard-list,
.dashboard-mini-grid {
    display: grid;
    gap: 12px;
}

.dashboard-list-item,
.dashboard-mini-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(201, 164, 107, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.dashboard-list-item:hover,
.dashboard-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(88, 64, 42, 0.08);
}

.dashboard-list-item strong,
.dashboard-mini-card strong {
    display: block;
    color: #43352a;
}

.dashboard-list-item span,
.dashboard-mini-card p,
.dashboard-list-item em,
.dashboard-mini-kicker {
    margin: 0;
    color: #817264;
    font-style: normal;
    font-size: 0.92rem;
}

.dashboard-mini-kicker {
    font-weight: 700;
    color: #b8894e;
}

.relation-page,
.relationship-shell {
    display: grid;
    gap: 24px;
    padding: 28px 0 40px;
}

.relation-page-hero,
.relationship-hero,
.relationship-board-card,
.relationship-person-card {
    background: rgba(255, 251, 246, 0.9);
    border: 1px solid rgba(201, 164, 107, 0.16);
    box-shadow: 0 18px 42px rgba(88, 64, 42, 0.08);
}

.relation-page-hero,
.relationship-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding: 32px;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(245, 229, 205, 0.7), transparent 28%),
        linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(248, 241, 231, 0.88));
}

.relation-page-hero h1,
.relationship-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 3vw, 3rem);
    color: #46362b;
    letter-spacing: -0.03em;
}

.relation-page-hero p,
.relationship-hero p {
    margin: 0;
    color: #7d6d5f;
    line-height: 1.85;
    max-width: 760px;
}

.relation-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.relation-hero-stat {
    min-width: 124px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(201, 164, 107, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    display: grid;
    gap: 6px;
}

.relation-hero-stat span {
    color: #927960;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.relation-hero-stat strong {
    color: #473628;
    font-size: 1.4rem;
    line-height: 1;
}

.relationship-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.relation-tabs,
.relationship-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 250, 244, 0.7);
    border: 1px solid rgba(201, 164, 107, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    width: fit-content;
    max-width: 100%;
}

.relation-tab,
.relationship-tab-button {
    border: 1px solid rgba(201, 164, 107, 0.14);
    background: rgba(255, 253, 249, 0.84);
    color: #7c634d;
    border-radius: 999px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.relation-tab.active,
.relationship-tab-button.active {
    background: linear-gradient(180deg, rgba(241, 223, 196, 0.92), rgba(232, 204, 161, 0.82));
    color: #59402d;
    border-color: rgba(201, 164, 107, 0.26);
    box-shadow: 0 10px 24px rgba(155, 119, 73, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.relation-tab:hover,
.relationship-tab-button:hover {
    transform: translateY(-1px);
    border-color: rgba(201, 164, 107, 0.24);
    color: #5f4735;
}

.relation-panel.is-hidden,
.relationship-tab-panel.is-hidden {
    display: none;
}

.relation-panel,
.relationship-tab-panel {
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(248, 242, 234, 0.92));
    border: 1px solid rgba(201, 164, 107, 0.14);
    box-shadow: 0 18px 42px rgba(97, 72, 48, 0.06);
    position: relative;
    overflow: hidden;
}

.relation-panel::before,
.relationship-tab-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(242, 224, 198, 0.34), transparent 68%);
    pointer-events: none;
}

.relation-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.relation-panel-head h2 {
    margin: 0 0 6px;
    color: #4d3a2d;
    font-size: 1.45rem;
}

.relation-panel-head p {
    margin: 0;
    color: #847365;
    line-height: 1.8;
}

.relation-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.relation-feature-grid-compact {
    margin-bottom: 18px;
}

.relation-spotlight-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(244, 227, 205, 0.52), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 246, 239, 0.92));
    border: 1px solid rgba(201, 164, 107, 0.14);
    box-shadow: 0 16px 34px rgba(97, 72, 48, 0.06);
}

.relation-spotlight-card-soft {
    background:
        radial-gradient(circle at top right, rgba(239, 218, 193, 0.48), transparent 36%),
        linear-gradient(180deg, rgba(255, 251, 248, 0.98), rgba(247, 238, 229, 0.92));
}

.relation-spotlight-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.relation-spotlight-head strong {
    display: block;
    color: #453327;
    font-size: 1.02rem;
}

.relation-spotlight-head span:last-child {
    color: #8a7563;
    line-height: 1.6;
}

.relation-avatar-medallion {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(232, 204, 161, 0.96), rgba(197, 158, 98, 0.88));
    color: #fffdf8;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(172, 130, 76, 0.18);
}

.relation-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.relation-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(245, 235, 221, 0.78);
    border: 1px solid rgba(201, 164, 107, 0.12);
    color: #6d533e;
    font-size: 0.84rem;
    line-height: 1.2;
}

.relation-chip-soft {
    background: rgba(255, 252, 247, 0.92);
    color: #8a735c;
}

.relation-note {
    margin: 0;
    color: #715d4d;
    line-height: 1.8;
}

.relation-inline-score {
    color: #8a704f;
    font-weight: 700;
    font-size: 0.88rem;
}

.relation-subsection {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.relation-subsection h3 {
    margin: 0;
    color: #5b4735;
    font-size: 1.08rem;
}

.relation-table-wrap {
    overflow-x: auto;
    border-radius: 22px;
}

.relation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 20px;
    background: #fffdf8;
    border: 1px solid #eadfce;
    box-shadow: 0 12px 26px rgba(97, 72, 48, 0.04);
}

.relation-table th {
    background: #f6efe5;
    color: #7a6047;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 14px 18px;
    text-align: left;
    white-space: nowrap;
}

.relation-table td {
    padding: 16px 18px;
    border-top: 1px solid #efe6d8;
    color: #3f3329;
    font-size: 0.92rem;
    line-height: 1.65;
    vertical-align: top;
}

.relation-table tr:hover td {
    background: #fbf6ee;
}

.relation-name-cell strong {
    display: block;
    color: #4a382b;
}

.relation-name-cell em {
    display: block;
    margin-top: 6px;
    color: #9a8878;
    font-style: normal;
    font-size: 0.85rem;
}

.relation-score-cell {
    display: grid;
    gap: 8px;
    min-width: 110px;
}

.relation-score-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(216, 198, 170, 0.42);
    overflow: hidden;
}

.relation-score-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(201, 164, 107, 0.72), rgba(184, 137, 78, 0.92));
}

.relation-card-list {
    display: grid;
    gap: 14px;
}

.relation-data-card {
    display: grid;
    gap: 8px;
    padding: 18px 18px 17px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 240, 0.88));
    border: 1px solid rgba(201, 164, 107, 0.14);
    box-shadow: 0 14px 28px rgba(97, 72, 48, 0.05);
}

.relation-data-card strong {
    color: #4d3a2d;
    font-size: 1rem;
}

.relation-data-card span,
.relation-data-card p {
    margin: 0;
    color: #7b6a5d;
    line-height: 1.75;
}

.relation-data-card b {
    color: #5f4835;
    font-weight: 700;
}

.relation-data-card-soft {
    background:
        radial-gradient(circle at top right, rgba(241, 224, 205, 0.52), transparent 34%),
        linear-gradient(180deg, rgba(255, 250, 247, 0.98), rgba(249, 240, 234, 0.92));
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.relationship-person-card {
    display: grid;
    gap: 8px;
    padding: 20px;
    border-radius: 22px;
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 240, 0.86));
    border: 1px solid rgba(201, 164, 107, 0.12);
    box-shadow: 0 14px 28px rgba(97, 72, 48, 0.05);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.relationship-person-card:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 164, 107, 0.22);
    box-shadow: 0 18px 34px rgba(97, 72, 48, 0.08);
}

.relationship-person-card strong {
    color: #4d3a2d;
    font-size: 1.04rem;
}

.relationship-person-card span,
.relationship-person-card p,
.relationship-person-card em {
    margin: 0;
    color: #7d6d5f;
    line-height: 1.7;
}

.relationship-person-card em {
    color: #9a8878;
    font-style: normal;
}

.relationship-board-card {
    padding: 22px;
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 240, 230, 0.9));
}

.relationship-board-card-inline {
    margin-bottom: 18px;
}

.relationship-board-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding-bottom: 18px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(201, 164, 107, 0.12);
}

.relationship-board-topline h4 {
    margin: 4px 0 0;
    color: #47372b;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.relationship-board-goal {
    display: grid;
    gap: 6px;
    color: #806f61;
    font-size: 0.94rem;
    text-align: right;
}

.board-summary-table {
    display: grid;
    gap: 8px;
}

.board-summary-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) minmax(120px, 0.9fr) minmax(100px, 0.7fr) minmax(120px, 0.9fr) minmax(180px, 1.2fr);
    gap: 16px;
    align-items: center;
    padding: 18px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(201, 164, 107, 0.12);
    box-shadow: 0 10px 20px rgba(97, 72, 48, 0.04);
}

.board-summary-row-head {
    padding: 0 8px 10px;
    border: 0;
    background: transparent;
    color: #8a745f;
    font-size: 0.9rem;
    font-weight: 700;
}

.board-summary-person,
.board-summary-meta,
.board-summary-status,
.board-summary-note {
    display: grid;
    gap: 4px;
    color: #756556;
}

.board-summary-person strong {
    color: #47372b;
    font-size: 0.98rem;
}

.board-summary-person em {
    font-style: normal;
    color: #9a8878;
    line-height: 1.6;
}

.board-support-line {
    display: grid;
    gap: 8px;
}

.board-support-line strong {
    color: #6e553e;
}

.board-support-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(216, 198, 170, 0.42);
    overflow: hidden;
}

.board-support-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(201, 164, 107, 0.72), rgba(184, 137, 78, 0.92));
}

.board-summary-note {
    color: #918071;
}

.relationship-metric-block {
    display: grid;
    gap: 8px;
}

.relation-board-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(238, 220, 192, 0.55), transparent 30%),
        linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(247, 238, 226, 0.92));
    border: 1px solid rgba(201, 164, 107, 0.14);
}

.relation-board-summary-main {
    display: grid;
    gap: 4px;
}

.relation-board-label {
    color: #9b7b56;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.relation-board-summary-main strong {
    color: #4a3728;
    font-size: 2rem;
    line-height: 1;
}

.relation-board-summary-main p {
    margin: 0;
    color: #866f5a;
}

.relation-board-summary-meta {
    display: grid;
    gap: 10px;
    align-content: center;
    color: #7d6b5b;
    line-height: 1.75;
}

.relation-board-meta-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(201, 164, 107, 0.12);
}

.relation-board-meta-card b {
    color: #604633;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.relation-empty-state {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 22px 24px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(248, 241, 233, 0.9));
    border: 1px dashed rgba(201, 164, 107, 0.24);
}

.relation-empty-state strong {
    color: #5d4837;
}

.relation-empty-state p {
    margin: 0;
    color: #8a7666;
    line-height: 1.8;
}

.interactive-jump-link {
    margin-top: 14px;
    display: inline-flex;
}

.relationship-intimacy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.relationship-intimacy-card {
    background:
        radial-gradient(circle at top right, rgba(241, 224, 205, 0.52), transparent 34%),
        linear-gradient(180deg, rgba(255, 250, 247, 0.98), rgba(249, 240, 234, 0.92));
}

.relationship-intimacy-card strong {
    color: #60403a;
}

.relationship-faction-card p {
    margin: 0;
    color: #79695b;
    line-height: 1.8;
}

.relationship-faction-card {
    background:
        radial-gradient(circle at 84% 18%, rgba(239, 225, 201, 0.44), transparent 30%),
        linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 239, 229, 0.88));
}

.relationship-empty {
    margin: 0;
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(201, 164, 107, 0.2);
    color: #877769;
    line-height: 1.85;
}

.relation-empty-state {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(201, 164, 107, 0.2);
}

.relation-empty-state strong {
    color: #6d5845;
}

.relation-empty-state p {
    margin: 0;
    color: #8a7868;
    line-height: 1.8;
}

.relationship-editor-shell,
.relationship-editor-grid {
    display: grid;
    gap: 18px;
}

.relationship-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.relationship-editor-card {
    display: grid;
    gap: 14px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 252, 248, 0.92);
    border: 1px solid rgba(201, 164, 107, 0.16);
}

.relationship-editor-head {
    display: grid;
    gap: 4px;
}

.relationship-editor-head strong {
    color: #49382b;
}

.relationship-editor-head span {
    color: #8a796a;
}

.relationship-editor-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.relationship-editor-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 248, 239, 0.84);
    border: 1px solid rgba(201, 164, 107, 0.18);
    color: #715c49;
}

@media (max-width: 1180px) {
    .account-shell {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: static;
    }

    .dashboard-grid,
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .relationship-intimacy-grid,
    .relationship-editor-grid {
        grid-template-columns: 1fr;
    }

    .relationship-card-grid {
        grid-template-columns: 1fr;
    }

    .relation-board-summary {
        grid-template-columns: 1fr;
    }

    .relation-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 840px) {
    .site-container {
        width: calc(100vw - 32px);
    }

    .relationship-hero {
        display: grid;
        padding: 22px;
    }

    .relationship-tab-nav {
        width: 100%;
        border-radius: 24px;
    }

    .relationship-board-topline {
        display: grid;
    }

    .relationship-board-goal {
        text-align: left;
    }

    .board-summary-row-head {
        display: none;
    }

    .board-summary-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 18px;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: grid;
    }

    .relation-tabs,
    .relationship-tab-nav {
        width: 100%;
        border-radius: 24px;
    }

    .relation-panel,
    .relationship-tab-panel {
        padding: 22px;
    }

    .relation-hero-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-header,
    .dashboard-hero,
    .dashboard-card-head,
    .avatar-uploader {
        grid-template-columns: 1fr;
        display: grid;
    }

    .avatar-uploader {
        justify-items: start;
    }

    .dashboard-grid,
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }
}

@media (max-width: 768px) {
    .profile-edit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-container {
        width: calc(100vw - 20px);
    }

    .account-shell {
        gap: 18px;
        margin-bottom: 24px;
    }

    .account-sidebar-card,
    .settings-panel,
    .settings-card,
    .dashboard-hero,
    .dashboard-card,
    .dashboard-stat-card {
        padding: 18px;
        border-radius: 22px;
    }

    .account-sidebar-avatar,
    .avatar-preview-wrap {
        width: 96px;
        height: 96px;
    }
}

.creator-page .paper-shell {
    max-width: none;
}

.creator-hub-shell {
    display: grid;
    gap: 22px;
}

.creator-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.creator-switch {
    display: inline-flex;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(201, 164, 107, 0.18);
    box-shadow: 0 18px 34px rgba(88, 64, 42, 0.08);
}

.creator-switch-option {
    min-width: 158px;
    min-height: 46px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #7d6d5f;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.creator-switch-option.active {
    background: linear-gradient(135deg, #c9a46b, #b8894e);
    color: #fffaf3;
    box-shadow: 0 12px 24px rgba(166, 118, 63, 0.22);
}

.creator-shell {
    margin-top: 8px;
    margin-bottom: 42px;
}

.creator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.creator-main {
    display: grid;
    gap: 18px;
}

.character-creator-shell {
    display: grid;
}

.character-creator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.character-basic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 18px;
}

.character-basic-fields,
.character-detail-grid {
    display: grid;
    gap: 16px;
}

.character-detail-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.character-avatar-card {
    align-content: start;
}

.character-avatar-preview-wrap,
.character-preview-cover {
    aspect-ratio: 1 / 1;
}

.role-switch-block {
    margin-top: 18px;
    justify-content: flex-start;
}

.creator-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 6px 0;
}

.creator-title {
    margin: 0;
    color: #3f3127;
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.creator-subtitle {
    margin: 10px 0 0;
    color: #8a7868;
    font-size: 1rem;
    line-height: 1.7;
}

.creator-header-actions,
.creator-bottom-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.creator-steps {
    margin: 0;
    padding: 0 10px;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.creator-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9a8a7b;
    font-weight: 600;
    position: relative;
}

.creator-steps li::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(201, 164, 107, 0.28);
}

.creator-steps li:last-child::after {
    display: none;
}

.creator-steps span {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(201, 164, 107, 0.3);
    background: rgba(255, 255, 255, 0.75);
    color: #8f714d;
}

.creator-steps li.active span {
    background: linear-gradient(135deg, #c9a46b, #b8894e);
    color: #fffaf4;
}

.creator-card,
.preview-card,
.preview-panel {
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(251, 247, 241, 0.92));
    border: 1px solid rgba(201, 164, 107, 0.18);
    box-shadow: 0 24px 60px rgba(88, 64, 42, 0.08);
}

.creator-card {
    padding: 22px;
}

.creator-card-head {
    margin-bottom: 18px;
}

.creator-card-head h2,
.preview-card-head h2,
.preview-panel h3 {
    margin: 0;
    color: #43352a;
    font-size: 1.7rem;
}

.creator-card-head-split {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.creator-card-head-split p,
.creator-role-actions p,
.preview-empty,
.preview-description,
.cover-upload-note {
    margin: 6px 0 0;
    color: #8b7a6c;
    line-height: 1.7;
}

.creator-role-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.story-basic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 18px;
}

.story-basic-fields {
    display: grid;
    gap: 16px;
}

.story-inline-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 16px;
}

.story-field {
    display: grid;
    gap: 10px;
    position: relative;
}

.story-field label,
.role-field label {
    color: #5c4937;
    font-size: 0.95rem;
    font-weight: 700;
}

.creator-layout input[type="text"],
.creator-layout input[type="url"],
.creator-layout select,
.creator-layout textarea {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(201, 164, 107, 0.22);
    background: rgba(255, 255, 255, 0.88);
    color: #43352a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.creator-layout input[type="text"],
.creator-layout input[type="url"],
.creator-layout select {
    min-height: 52px;
    padding: 0 16px;
}

.creator-layout textarea {
    min-height: 110px;
    padding: 14px 16px;
    resize: vertical;
}

.creator-layout input:focus,
.creator-layout select:focus,
.creator-layout textarea:focus {
    outline: none;
    border-color: rgba(201, 164, 107, 0.48);
    box-shadow:
        0 0 0 4px rgba(201, 164, 107, 0.08),
        0 14px 34px rgba(88, 64, 42, 0.08);
}

.story-count {
    position: absolute;
    right: 14px;
    bottom: 10px;
    color: #a08f80;
    font-size: 0.88rem;
}

.story-tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.story-tag-suggestions button,
.preview-tag-row span {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(201, 164, 107, 0.2);
    background: rgba(255, 252, 247, 0.92);
    color: #7d654a;
    font-size: 0.92rem;
}

.story-tag-suggestions button {
    cursor: pointer;
}

.cover-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(201, 164, 107, 0.14);
    background: rgba(255, 255, 255, 0.56);
}

.cover-card-head h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #43352a;
}

.cover-preview-wrap,
.preview-cover-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.48), transparent 26%),
        linear-gradient(145deg, #eadcc8, #b78e61);
}

.cover-preview-wrap {
    aspect-ratio: 3 / 4;
}

.cover-preview-image,
.preview-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-preview-fallback,
.preview-cover-fallback {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 250, 244, 0.86);
}

.cover-upload-button {
    width: 100%;
}

.cover-card input[type="file"],
.package-body input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.package-list {
    display: grid;
    gap: 10px;
}

.package-card {
    border-radius: 20px;
    border: 1px solid rgba(201, 164, 107, 0.18);
    background: rgba(255, 255, 255, 0.62);
    overflow: hidden;
}

.package-card summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 18px;
    cursor: pointer;
}

.package-card summary::-webkit-details-marker {
    display: none;
}

.package-summary-copy {
    display: grid;
    gap: 4px;
}

.package-summary-copy strong {
    color: #43352a;
    font-size: 1.08rem;
}

.package-summary-copy span,
.package-meta-text {
    color: #8a7a6c;
    font-size: 0.92rem;
}

.package-summary-meta {
    display: grid;
    gap: 4px;
    justify-items: end;
    text-align: right;
}

.package-status {
    color: #7a6b2a;
    font-weight: 700;
}

.package-body {
    padding: 0 18px 18px;
    display: grid;
    gap: 12px;
}

.package-upload-button {
    justify-self: start;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.role-editor-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(201, 164, 107, 0.18);
    background: rgba(255, 255, 255, 0.64);
}

.role-remove-button {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: transparent;
    color: #a78f7a;
    cursor: pointer;
}

.role-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.48), transparent 26%),
        linear-gradient(145deg, #e5d2b5, #b8894e);
    color: #fff7f0;
    font-size: 1.4rem;
    font-weight: 700;
}

.role-avatar-preview img,
.preview-role-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.role-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #5c4937;
    font-weight: 700;
}

.role-switch input {
    display: none;
}

.role-switch-ui {
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: rgba(201, 164, 107, 0.24);
    position: relative;
    transition: background 0.2s ease;
}

.role-switch-ui::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fffaf3;
    transition: transform 0.2s ease;
}

.role-switch input:checked + .role-switch-ui {
    background: #c9a46b;
}

.role-switch input:checked + .role-switch-ui::after {
    transform: translateX(18px);
}

.character-editor-shell {
    display: grid;
    gap: 22px;
}

.character-editor-card {
    display: grid;
    gap: 16px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(201, 164, 107, 0.16);
}

.character-editor-card h2,
.character-editor-card h3 {
    margin: 0;
    color: #43352a;
}

.character-editor-card p {
    margin: 0;
    color: #7d6d5f;
    line-height: 1.75;
}

.character-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 320px;
    gap: 24px;
    align-items: start;
}

.character-editor-main,
.character-editor-sidebar {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.character-editor-sidebar {
    position: sticky;
    top: 24px;
}

.character-editor-portrait-card {
    display: grid;
    gap: 14px;
}

.character-editor-portrait-card .clean-image-preview {
    width: 180px;
    height: 180px;
    border-radius: 28px;
}

.character-editor-portrait-card .clean-image-placeholder {
    font-size: 0.95rem;
}

.character-editor-file {
    display: grid;
    gap: 10px;
}

.character-editor-file input[type="file"] {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px dashed rgba(201, 164, 107, 0.32);
    background: rgba(255, 255, 255, 0.72);
    color: #6c5a49;
}

.character-editor-file-note,
.character-editor-current-file {
    color: #8b7a6c;
    font-size: 0.92rem;
}

.character-editor-current-file a {
    color: #8f673e;
    font-weight: 700;
}

.character-text-count {
    justify-self: end;
    color: #a08f80;
    font-size: 0.88rem;
}

.character-tag-builder {
    display: grid;
    gap: 12px;
}

.character-tag-builder-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.character-tag-builder-row input[type="text"] {
    width: 100%;
}

.character-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.character-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 252, 247, 0.95);
    border: 1px solid rgba(201, 164, 107, 0.22);
    color: #7d654a;
}

.character-tag-pill button {
    border: 0;
    background: transparent;
    color: #9a7a58;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.character-tag-help,
.character-tag-error {
    font-size: 0.92rem;
}

.character-tag-help {
    color: #8b7a6c;
}

.character-tag-error {
    color: #9b4a3f;
    min-height: 1.4em;
}

.character-editor-preview {
    display: grid;
    gap: 14px;
}

.character-editor-preview-cover {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 26px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.48), transparent 26%),
        linear-gradient(145deg, #eadcc8, #b78e61);
}

.character-editor-preview-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-editor-preview-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 250, 244, 0.86);
    font-size: 2.6rem;
    font-weight: 700;
}

.character-editor-preview-copy {
    display: grid;
    gap: 10px;
}

.character-editor-preview-copy h3 {
    margin: 0;
    color: #3f332a;
    font-size: 1.8rem;
}

.character-editor-preview-copy p {
    margin: 0;
    color: #7a6a5d;
    line-height: 1.75;
}

@media (max-width: 1120px) {
    .character-editor-grid {
        grid-template-columns: 1fr;
    }

    .character-editor-sidebar {
        position: static;
    }
}

.creator-sidebar {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 24px;
}

.preview-card,
.preview-panel {
    padding: 18px;
}

.preview-card-head {
    margin-bottom: 14px;
}

.preview-card-head h2 {
    font-size: 1.5rem;
}

.preview-cover-wrap {
    aspect-ratio: 3 / 4;
    margin-bottom: 16px;
}

.preview-card-body {
    display: grid;
    gap: 12px;
}

.preview-card-body h3 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
    color: #3e3127;
}

.preview-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.preview-status-list li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #6f6154;
}

.preview-status-list strong {
    color: #4e7b2e;
    font-weight: 700;
}

.preview-role-list {
    display: grid;
    gap: 12px;
}

.preview-role-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.preview-role-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(201, 164, 107, 0.14);
}

.preview-role-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8f714d;
    font-weight: 700;
}

.preview-role-copy {
    display: grid;
    gap: 4px;
}

.preview-role-copy strong {
    color: #43352a;
}

.preview-role-copy span,
.preview-role-copy p,
.preview-role-meta {
    margin: 0;
    color: #857668;
    line-height: 1.5;
    font-size: 0.92rem;
}

.preview-role-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preview-role-meta b {
    color: #8f714d;
}

.preview-tip-panel ul {
    margin: 0;
    padding-left: 18px;
    color: #7d6d5f;
    line-height: 1.8;
}


.creator-alert,
.creator-field-error {
    color: #9b4a3f;
    font-size: 0.92rem;
    line-height: 1.6;
}

.clean-image-upload {
    display: grid;
    gap: 14px;
    align-items: start;
}

.clean-image-preview {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(244, 237, 226, 0.9);
    border: 1px solid rgba(190, 160, 120, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clean-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.clean-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a8470;
    font-size: 0.82rem;
    text-align: center;
    padding: 10px;
}

.clean-image-button {
    width: fit-content;
    cursor: pointer;
}

.clean-image-button input {
    display: none;
}

.clean-image-hint {
    margin: 0;
    color: #8f7d6c;
    font-size: 0.92rem;
    line-height: 1.7;
}

.clean-image-upload.cover .clean-image-preview {
    width: 180px;
    height: 120px;
    border-radius: 22px;
}

.creator-alert {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(177, 84, 64, 0.08);
    border: 1px solid rgba(177, 84, 64, 0.14);
}

.creator-field-error ul,
.creator-alert ul {
    margin: 0;
    padding-left: 18px;
}

.interactive-shell,
.game-layout {
    display: grid;
    grid-template-columns: 300px minmax(560px, 1fr) 300px;
    gap: 28px;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - 154px);
    padding: 28px 0 36px;
    align-items: start;
}

.interactive-shell-story {
    position: relative;
}

.interactive-panel,
.interactive-chat,
.game-left,
.game-main,
.game-right {
    display: grid;
    gap: 18px;
    min-height: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.interactive-chat,
.game-main {
    align-self: stretch;
}

.interactive-panel {
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

.interactive-card {
    background: rgba(255, 252, 247, 0.92);
    border: 1px solid rgba(170, 143, 108, 0.18);
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(118, 94, 68, 0.08);
    padding: 22px;
    min-width: 0;
}

.interactive-card-chat {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    min-height: 680px;
    height: auto;
    max-height: calc(100vh - 190px);
    overflow: hidden;
    min-width: 0;
}

.interactive-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.interactive-card-head h2,
.interactive-title {
    color: #5f4631;
    margin: 0;
}

.interactive-kicker {
    margin: 0 0 6px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9f876a;
}

.interactive-subtitle,
.interactive-empty,
.interactive-form-actions p,
.timeline-item p,
.status-card p,
.knowledge-card p {
    color: #786655;
    line-height: 1.8;
}

.interactive-warning,
.interactive-error {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.interactive-warning {
    background: rgba(184, 149, 97, 0.14);
    color: #8b6b44;
}

.interactive-error {
    background: rgba(163, 75, 54, 0.1);
    color: #9b4a3f;
}

.interactive-error-hidden {
    display: none;
}

.interactive-status-line {
    margin: -4px 0 0;
    color: #8b6b44;
    font-size: 0.92rem;
    line-height: 1.6;
}

.story-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(184, 137, 78, 0.72);
    animation: dotPulse 1.2s ease-in-out infinite;
}

.story-loading span:nth-child(2) {
    animation-delay: 0.18s;
}

.story-loading span:nth-child(3) {
    animation-delay: 0.36s;
}

.chat-stream {
    display: grid;
    gap: 14px;
    align-content: start;
    overflow-y: auto;
    min-height: 0;
    max-height: 100%;
    padding-right: 6px;
    min-width: 0;
    scrollbar-gutter: stable;
}

.butterfly-scroll-region {
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 164, 107, 0.72) rgba(255, 248, 239, 0.7);
}

.butterfly-scroll-region::-webkit-scrollbar,
.interactive-panel::-webkit-scrollbar {
    width: 10px;
}

.butterfly-scroll-region::-webkit-scrollbar-track,
.interactive-panel::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(255, 248, 239, 0.34), rgba(235, 223, 203, 0.45));
    border-radius: 999px;
}

.butterfly-scroll-region::-webkit-scrollbar-thumb,
.interactive-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(210, 183, 140, 0.86), rgba(191, 155, 97, 0.68));
    border: 2px solid rgba(255, 250, 244, 0.95);
    border-radius: 999px;
}

.butterfly-scroll-region::-webkit-scrollbar-thumb:hover,
.interactive-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(201, 164, 107, 0.95), rgba(184, 137, 78, 0.78));
}

.chat-entry {
    display: grid;
    gap: 12px;
}

.chat-entry.user {
    justify-items: end;
}

.chat-bubble {
    max-width: 86%;
    padding: 16px 18px;
    border-radius: 22px;
    line-height: 1.85;
    box-shadow: 0 10px 24px rgba(118, 94, 68, 0.06);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-bubble.user {
    margin-left: auto;
    background: rgba(210, 177, 132, 0.24);
}

.chat-bubble.assistant {
    background: rgba(255, 255, 255, 0.98);
}

.chat-bubble.is-streaming::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 1.2em;
    margin-left: 6px;
    vertical-align: bottom;
    border-radius: 999px;
    background: rgba(184, 137, 78, 0.5);
    animation: storyloom-caret 0.9s ease-in-out infinite;
}

.interactive-input-form {
    display: grid;
    gap: 12px;
    min-height: 0;
}

.interactive-input-form textarea {
    min-height: 110px;
    resize: vertical;
    border-radius: 20px;
    border: 1px solid rgba(170, 143, 108, 0.22);
    background: rgba(255, 255, 255, 0.94);
    padding: 16px 18px;
    line-height: 1.8;
    color: #4d3b2e;
}

.interactive-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.interactive-form-actions p {
    margin: 0;
    font-size: 0.92rem;
}

.interactive-submit {
    min-width: 132px;
    justify-content: center;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.interactive-submit.is-loading {
    opacity: 0.92;
}

.button-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: rgba(255, 255, 255, 0.96);
    display: none;
}

.interactive-submit.is-loading .button-label {
    opacity: 0.92;
}

.status-stack,
.metric-list,
.timeline-list,
.accordion-list {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.status-card,
.timeline-item,
.knowledge-card {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(170, 143, 108, 0.16);
}

.status-card-head,
.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.status-card em {
    display: block;
    margin-top: 8px;
    color: #9b8468;
    font-style: normal;
}

.metric-row {
    padding: 14px 0;
    border-bottom: 1px solid rgba(170, 143, 108, 0.12);
}

.metric-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.timeline-item strong,
.status-card strong,
.knowledge-card summary {
    color: #5f4631;
}

.knowledge-card summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.knowledge-card summary::-webkit-details-marker {
    display: none;
}

.knowledge-card summary span:last-child {
    color: #9b8468;
    font-size: 0.86rem;
    white-space: nowrap;
}

.knowledge-card summary span:first-child,
.knowledge-card p,
.metric-row strong,
.metric-row span,
.interactive-title,
.interactive-subtitle {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-bubble p,
.knowledge-card p {
    margin: 0;
}

.chat-bubble p + p {
    margin-top: 12px;
}

.choice-stack {
    display: grid;
    gap: 10px;
    width: min(520px, 100%);
}

.choice-card {
    width: 100%;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(195, 158, 103, 0.26);
    background: rgba(255, 250, 243, 0.92);
    color: #5e4835;
    text-align: left;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(122, 92, 56, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.choice-card:hover {
    transform: translateY(-2px);
    border-color: rgba(184, 137, 78, 0.48);
    box-shadow: 0 18px 36px rgba(122, 92, 56, 0.13);
    background: rgba(255, 252, 247, 0.97);
}

.choice-card.is-selected {
    background: rgba(250, 237, 213, 0.96);
    border-color: rgba(184, 137, 78, 0.34);
    box-shadow: inset 0 0 0 1px rgba(184, 137, 78, 0.22), 0 18px 34px rgba(122, 92, 56, 0.1);
}

.choice-key {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 164, 107, 0.18);
    color: #8f673e;
    font-weight: 700;
}

.choice-text {
    line-height: 1.75;
}

.interactive-role-card {
    cursor: pointer;
}

.interactive-role-open {
    margin-top: 8px;
    justify-self: start;
}

.interactive-role-item,
.interactive-role-modal-item {
    transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.interactive-role-card:hover .interactive-role-item {
    border-color: rgba(201, 164, 107, 0.28);
}

.timeline-item-latest p {
    margin: 0;
    line-height: 1.65;
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

#story-updates {
    gap: 8px;
}

#story-updates .timeline-item-latest {
    padding: 12px 14px;
    min-height: 0;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

#story-updates .timeline-item-latest.is-empty {
    background: rgba(255, 252, 247, 0.72);
}

.interactive-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.interactive-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(68, 48, 29, 0.24);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.interactive-modal-panel {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: min(78vh, 760px);
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 251, 246, 0.96);
    border: 1px solid rgba(201, 164, 107, 0.22);
    box-shadow: 0 26px 70px rgba(88, 64, 42, 0.18);
}

.interactive-modal-list {
    display: grid;
    gap: 12px;
    overflow-y: auto;
    min-height: 0;
    padding-right: 6px;
}

.interactive-modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(201, 164, 107, 0.12);
    color: #7b6248;
    cursor: pointer;
    font-size: 1.4rem;
}

body.interactive-modal-open {
    overflow: hidden;
}

.relationship-settlement {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(201, 164, 107, 0.16);
    display: grid;
    gap: 6px;
}

.relationship-settlement-label {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9f876a;
}

.relationship-settlement-delta {
    font-size: 0.95rem;
    line-height: 1.7;
}

.relationship-delta-up {
    color: #7f6a2d;
}

.relationship-delta-down {
    color: #9b4a3f;
}

.relationship-delta-flat {
    color: #7d6d5f;
}

@keyframes storyloom-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes heroTextIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dotPulse {
    0%,
    100% {
        opacity: 0.28;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@keyframes storyloom-caret {
    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.9;
    }
}

.chat-table-wrap,
.knowledge-card table {
    max-width: 100%;
    overflow-x: auto;
}

.chat-bubble table,
.knowledge-card table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.8);
}

.chat-bubble th,
.chat-bubble td,
.knowledge-card th,
.knowledge-card td {
    padding: 10px 12px;
    border: 1px solid rgba(170, 143, 108, 0.16);
    text-align: left;
    vertical-align: top;
}

.chat-bubble pre,
.chat-bubble code,
.knowledge-card pre,
.knowledge-card code {
    max-width: 100%;
    overflow-x: auto;
}

.interactive-portrait {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(232, 219, 200, 0.8), rgba(214, 194, 167, 0.8));
}

.interactive-portrait-fallback {
    min-height: 320px;
}

.reveal-card {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1200px) {
    .account-save-grid,
    .interactive-shell,
    .game-layout {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .interactive-card-chat {
        min-height: 680px;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .interactive-panel {
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .site-texture {
        opacity: 0.08;
    }

    .hero-content {
        animation-duration: 0.9s;
    }

    .reveal-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .button.primary::after {
        display: none;
    }

    .interactive-modal-panel {
        padding: 20px;
        max-height: 84vh;
    }

    .choice-card {
        grid-template-columns: 30px minmax(0, 1fr);
        padding: 14px 15px;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-content,
    .reveal-card {
        opacity: 1 !important;
        transform: none !important;
    }

    .button:hover,
    .poster-card:hover,
    .choice-card:hover {
        transform: none;
    }

    .site-texture {
        opacity: 0.06;
    }
}
