@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap');

:root {
  color-scheme: dark;
  font: 15px/1.48 'DM Sans', system-ui, sans-serif;
  color: #eee8db;
  background: #17132c;
  --ink: #17132c;
  --panel: #282044;
  --panel-light: #352853;
  --gold: #d9c18e;
  --gold-bright: #f3e3b6;
  --line: #d9c18e66;
  --muted: #c8bed8;
  --star: #d9c7ff;
  --cut: polygon(0 13px, 13px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 13px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 13px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 11%, #e9d7ff95 0 1px, transparent 2px),
    radial-gradient(circle at 68% 6%, #fff1c293 0 1px, transparent 2px),
    radial-gradient(circle at 81% 37%, #f0c8e96b 0 1px, transparent 2px),
    radial-gradient(circle at 24% 66%, #fff1c278 0 1px, transparent 2px),
    radial-gradient(ellipse at 78% 0%, #65428d78, transparent 42%),
    radial-gradient(ellipse at 8% 58%, #354b8491, transparent 53%),
    linear-gradient(170deg, #24193f 0%, #17132c 50%, #20172f 100%);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .58;
  background: radial-gradient(ellipse 420px 300px at 82% var(--glow-y, 12%), #d58acb2b, transparent 72%);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .character-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.ambient { position: fixed; z-index: 0; pointer-events: none; width: 430px; height: 430px; border-radius: 50%; filter: blur(80px); opacity: .12; }
.ambient-one { right: -290px; top: 70px; background: #a779e6; }
.ambient-two { left: -290px; bottom: 120px; background: #df85bd; }
.app-shell { position: relative; z-index: 1; max-width: 760px; margin: auto; padding: 0 18px calc(106px + env(safe-area-inset-bottom)); }

/* A compass-like crest and a restrained, angled frame replace the old soft shapes. */
.topbar { display: flex; align-items: center; gap: 14px; min-height: 88px; border-bottom: 1px solid #d9c18e36; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: none; color: var(--gold-bright); font: 25px Georgia, serif; background: linear-gradient(145deg, #59447c, #262043); border: 1px solid var(--gold); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 10px #ddcb9a44); }
.topbar strong, .brand-kicker { display: block; }
.brand-kicker { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .21em; }
.topbar strong { font: 600 19px 'Playfair Display', Georgia, serif; letter-spacing: .01em; }
.top-sparkle { margin-left: auto; color: var(--gold); font-size: 27px; filter: drop-shadow(0 0 7px #e8d7aa77); }
#status { position: fixed; z-index: 20; top: 78px; left: 50%; transform: translateX(-50%); width: min(92vw, 500px); padding: 13px 17px; color: #f7eddb; background: #36264f; border: 1px solid var(--gold); clip-path: var(--cut); box-shadow: 0 16px 44px #10091ecc; }
#status.error { color: #ffd8d8; border-color: #d88b8b; }
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .22em; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 272px;
  margin-top: 19px;
  padding: 30px 32px;
  border: 1px solid #d9c18e7d;
  clip-path: var(--cut);
  background:
    linear-gradient(145deg, #dbca9c2b 0 1px, transparent 1px 100%),
    radial-gradient(circle at 82% 46%, #cc79bc66, transparent 35%),
    linear-gradient(126deg, #493568 0%, #272447 52%, #25365e 100%);
  box-shadow: inset 0 1px 0 #fff7, 0 20px 47px #030a197d;
}
.hero::before {
  content: '';
  position: absolute;
  top: 17px; right: 17px; bottom: 17px; left: 17px;
  border: 1px solid #d9c18e36;
  clip-path: var(--cut);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  top: 8%; right: 5%; width: 54%; height: 80%;
  opacity: .7;
  pointer-events: none;
  background:
    linear-gradient(33deg, transparent 48.7%, #d9c18e46 49%, #d9c18e46 49.3%, transparent 49.6%),
    linear-gradient(142deg, transparent 49%, #e0b9f445 49.2%, #e0b9f445 49.5%, transparent 49.8%),
    radial-gradient(circle at 19% 61%, #fff3cb 0 2px, transparent 3px),
    radial-gradient(circle at 78% 22%, #f2d6ff 0 2px, transparent 3px),
    radial-gradient(circle at 86% 79%, #f4deb1 0 2px, transparent 3px);
}
.hero > *:not(.hero-orb) { position: relative; z-index: 2; }
.hero h1, .page-intro h1 { font: 600 clamp(33px, 7vw, 49px)/1.08 'Playfair Display', Georgia, serif; letter-spacing: -.025em; margin: 12px 0 27px; }
.hero-orb {
  position: absolute;
  z-index: 1;
  right: 4%; top: 24px;
  width: 215px; height: 215px;
  display: grid; place-items: center;
  font: 108px Georgia, serif;
  color: #f5e5b9;
  text-shadow: 0 0 10px #f4e9c4, 0 0 35px #d8c4988a;
  background: radial-gradient(circle, #d7c6912e 0 16%, #d7c69115 17% 21%, transparent 22% 43%, #d7c69138 43.5% 44%, transparent 44.5% 58%, #d7c6913b 58.5% 59%, transparent 60%);
  filter: drop-shadow(0 0 16px #d8baff78);
  animation: star-breathe 8s ease-in-out infinite alternate;
}
.hero-star {
  width: 98px;
  height: 98px;
  background: linear-gradient(135deg, #fff8d9 0%, #d9bd7c 49%, #f8eab7 52%, #af9568 100%);
  clip-path: polygon(50% 0, 60% 32%, 85% 15%, 68% 40%, 100% 50%, 68% 60%, 85% 85%, 60% 68%, 50% 100%, 40% 68%, 15% 85%, 32% 60%, 0 50%, 32% 40%, 15% 15%, 40% 32%);
  filter: drop-shadow(0 0 18px #f5dc9a);
}
.hero-orb::before, .hero-orb::after { content: '✧'; position: absolute; color: #e6c5f6; font: 24px Georgia, serif; text-shadow: 0 0 12px #fff; }
.hero-orb::before { top: 26px; left: 18px; }
.hero-orb::after { bottom: 15px; right: 12px; font-size: 17px; }
.hero-button, .primary-button, .secondary-button { min-height: 43px; border: 1px solid #e4d4a7; clip-path: var(--cut); font-weight: 700; }
.hero-button, .primary-button { color: #261d3d; background: linear-gradient(125deg, #f6efd7, #dfc895 70%, #eadcb8); box-shadow: inset 0 1px 0 #fff, 0 9px 24px #150d24a1; }
.hero-button { padding: 10px 18px; }
.hero-button span { padding-left: 14px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 31px 2px 14px; padding-bottom: 12px; border-bottom: 1px solid #d9c18e45; }
.section-heading h2, .form-section-heading h2, .settings-card h2 { font: 600 26px 'Playfair Display', Georgia, serif; margin: 2px 0 0; }
.section-sigil { color: var(--gold); font-size: 30px; line-height: 1; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 15px; background: #2c2347; border: 1px solid var(--line); clip-path: var(--cut); }
.search-box > span { color: var(--gold); font-size: 29px; line-height: 1; }
.search-box input { width: 100%; height: 51px; color: #f5efe1; background: none; border: 0; outline: 0; }
.search-box input::placeholder, .form-panel input::placeholder, .form-panel textarea::placeholder { color: #afa4c6; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip, .tag-chip { color: #e6dcec; background: #382b53; border: 1px solid #d9c18e4f; clip-path: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px)); }
.chip { white-space: nowrap; padding: 8px 13px; }
.chip.active, .tag-chip.include { color: #251c3b; border-color: var(--gold); background: linear-gradient(135deg, #f1e6c7, #d5bc84); font-weight: 700; }
.list-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 2px 12px; color: #e3ded2; font-size: 13px; font-weight: 700; }
.list-heading select { max-width: 134px; color: var(--gold); background: transparent; border: 0; text-align: right; }
.list-heading option, .form-panel option { background: #282044; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.character-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #f1ede4;
  background: linear-gradient(155deg, #45325e, #252247 74%);
  border: 1px solid #cdb68280;
  clip-path: var(--cut);
  box-shadow: inset 0 1px 0 #ffffff29, 0 9px 28px #050d1e9c;
  transition: transform .2s, box-shadow .2s;
}
.character-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px #050c1fad; }
.character-card::after { content: ''; position: absolute; z-index: 2; inset: -60% -100%; pointer-events: none; opacity: 0; background: linear-gradient(110deg, transparent 43%, #fff6d552 50%, transparent 57%); transform: translateX(-60%) rotate(8deg); }
.character-card.is-visible::after { animation: card-glint 1.2s ease-out .2s both; }
.card-art { position: relative; display: grid; place-items: center; height: 145px; overflow: hidden; background: radial-gradient(circle at 48% 44%, #b276bd8a, transparent 53%), linear-gradient(145deg, #5b477d, #293960); }
.character-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-art:has(.character-photo)::before, .card-art:has(.character-photo) .card-symbol { display: none; }
.detail-art:has(.character-photo) { position: relative; overflow: hidden; }
.card-art::before { content: ''; position: absolute; width: 113px; height: 113px; border: 1px solid #e8d6a886; transform: rotate(45deg); box-shadow: 0 0 0 15px #d9c18e0d, inset 0 0 22px #bdc7ed1b; }
.card-art::after { content: '✧'; position: absolute; top: 13px; right: 18px; color: var(--gold-bright); font: 21px Georgia, serif; text-shadow: 0 0 9px #fff6ca; }
.card-symbol { position: relative; z-index: 1; color: #f3e8c7; font: 72px Georgia, serif; line-height: 1; text-shadow: 0 0 11px #f3e9c4, 0 0 32px #b6c6ff9e; }
.art-1 { background: radial-gradient(circle at 50% 45%, #aa81dc96, transparent 50%), linear-gradient(145deg, #5e4a85, #2e315d); }
.art-2 { background: radial-gradient(circle at 50% 45%, #e18faf82, transparent 50%), linear-gradient(145deg, #71476c, #343052); }
.art-3 { background: radial-gradient(circle at 50% 45%, #b492ed8c, transparent 50%), linear-gradient(145deg, #514b88, #282c5d); }
.art-4 { background: radial-gradient(circle at 50% 45%, #98a6eb80, transparent 50%), linear-gradient(145deg, #425b92, #2a2d59); }
.art-5 { background: radial-gradient(circle at 50% 45%, #db8fc08c, transparent 50%), linear-gradient(145deg, #694775, #303057); }
.card-category { position: absolute; left: 10px; bottom: 9px; z-index: 1; color: #f2e4bf; background: #241b3dc9; border: 1px solid #d9c18e7a; padding: 3px 9px; font-size: 10px; letter-spacing: .04em; clip-path: var(--cut); }
.card-body { padding: 12px; }
.card-body h3 { margin: 0 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 18px 'Playfair Display', Georgia, serif; }
.card-tagline { margin: 0; height: 36px; overflow: hidden; color: #d2c7dd; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; max-height: 36px; overflow: hidden; margin-top: 8px; }
.card-tags span { padding: 2px 5px; color: #e9d7a6; background: #d5bd8422; border: 1px solid #d5bd843b; font-size: 9px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 10px; color: #dccba7; font-size: 10px; }
.selected-pill { padding: 3px 6px; color: #251b3d; background: var(--gold); }
.card-select { width: 100%; margin-top: 10px; padding: 7px 5px; color: var(--gold-bright); background: #d5bd8420; border: 1px solid #d5bd8466; font-size: 11px; font-weight: 700; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; border: 1px dashed #d9c18e69; }

.page-intro { margin: 20px 2px 21px; border-bottom: 1px solid #d9c18e44; }
.page-intro h1 { font-size: 38px; margin: 9px 0 16px; }
.wide-create { display: flex; align-items: center; gap: 13px; width: 100%; margin-bottom: 17px; padding: 13px 15px; color: #f2ead7; text-align: left; background: linear-gradient(120deg, #584071, #30345d); border: 1px solid var(--gold); clip-path: var(--cut); box-shadow: inset 0 1px 0 #ffffff30, 0 10px 27px #160d2587; }
.wide-create strong, .wide-create small { display: block; }
.wide-create small { color: var(--muted); }
.wide-create .arrow { margin-left: auto; color: var(--gold); font-size: 21px; }
.create-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--gold-bright); background: #d9c18e29; border: 1px solid #d9c18e75; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); font-size: 25px; }
.text-back { padding: 13px 1px 0; color: var(--gold); background: none; border: 0; }
.form-panel { margin-bottom: 15px; padding: 19px; color: #ede8db; background: linear-gradient(150deg, #3a2d58, #241f3e 82%); border: 1px solid #d9c18e68; clip-path: var(--cut); box-shadow: inset 0 1px 0 #ffffff24, 0 10px 28px #130c2170; }
.form-section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.form-section-heading > span { display: grid; place-items: center; flex: none; width: 39px; height: 39px; color: var(--gold-bright); background: #d9c18e26; border: 1px solid var(--gold); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); font-size: 12px; }
.form-section-heading h2 { margin: 0; font-size: 22px; }
.form-panel label { display: block; margin: 14px 0 0; font-weight: 600; }
.form-panel label b { color: var(--gold); }
.form-panel label small, .publish-tag-label small { color: var(--muted); font-weight: 400; }
.form-panel input, .form-panel textarea, .form-panel select { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; color: #f5efe2; background: #1b1833d9; border: 1px solid #d9c18e5f; border-radius: 2px; outline: none; resize: vertical; }
.form-panel input:focus, .form-panel textarea:focus, .form-panel select:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 2px #d9c18e36; }
.extras summary { cursor: pointer; list-style: none; font-weight: 700; }
.extras summary::-webkit-details-marker, .tag-filter summary::-webkit-details-marker { display: none; }
.extras summary span { float: right; }
.extra-fields { padding-top: 5px; }
.form-actions { display: grid; gap: 8px; margin: 18px 0; }
.primary-button { width: 100%; padding: 11px 17px; }
.primary-button span { float: right; }
.secondary-button { margin-top: 14px; padding: 10px 15px; color: var(--gold-bright); background: #d9c18e22; }
.quiet-danger { padding: 10px; color: #e8a9a9; background: none; border: 0; }
.privacy-note { color: var(--muted); font-size: 12px; }
.publish-tag-label { margin: 18px 0 10px; font-weight: 700; }
.publish-tag-label small { margin-left: 5px; }
.publish-panel .tag-cloud { padding-bottom: 2px; }
.settings-card { min-height: 258px; }
.settings-symbol { color: var(--gold-bright); font: 38px Georgia, serif; }
.settings-card p { color: var(--muted); }
.settings-card label { margin-top: 20px; }
.active-label { padding-top: 14px; border-top: 1px solid #d9c18e4e; font-size: 12px; }
.form-panel .setting-switch { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0; cursor: pointer; }
.setting-switch strong, .setting-switch small { display: block; }
.setting-switch small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.form-panel .setting-switch input { appearance: none; position: relative; flex: none; width: 49px; height: 28px; margin: 0; padding: 0; background: #221a3c; border: 1px solid #d9c18e8c; clip-path: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px)); }
.setting-switch input::before { content: ''; position: absolute; top: 5px; left: 5px; width: 16px; height: 16px; background: #c4aed4; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transition: transform .2s, background .2s; }
.form-panel .setting-switch input:checked { background: #d9c18e45; border-color: var(--gold-bright); }
.setting-switch input:checked::before { transform: translateX(21px); background: var(--gold-bright); }

.tag-filter { margin: 10px 0 0; padding: 0 13px; background: #2c2347; border: 1px solid #d9c18e64; clip-path: var(--cut); }
.tag-filter summary { display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; list-style: none; color: #eee7d9; font-weight: 700; }
.tag-filter summary > span:last-child { margin-left: auto; color: var(--gold); }
.tag-filter[open] summary > span:last-child { transform: rotate(180deg); }
.tag-search { width: 100%; min-height: 38px; padding: 8px 10px; color: #f5efe2; background: #1b1833d9; border: 1px solid #d9c18e5f; border-radius: 2px; outline: none; }
.tag-search::placeholder { color: #afa4c6; }
.tag-search:focus { border-color: var(--gold-bright); }
.tag-filter .tag-search { margin: 1px 0 9px; }
.publish-panel .tag-search { margin-bottom: 11px; }
.tag-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 9px; color: var(--muted); }
.tag-filter-head small, .tag-filter-head button { font-size: 11px; }
.tag-filter-head button { color: var(--gold); background: none; border: 0; }
.tag-cloud, .detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud { padding: 0 0 14px; }
#tag-filters, #publish-tags { max-height: 222px; overflow-y: auto; scrollbar-color: #d9c18e7d transparent; }
.tag-chip { padding: 6px 9px; font-size: 11px; line-height: 1.2; }
.tag-chip.exclude { color: #ffddd9; background: #713f4a; border-color: #ce9c9a; }
.detail-tags { margin: 10px 0 16px; }

.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: min(4vw, 28px); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #1e1835ed; border-top: 1px solid #d9c18e7a; backdrop-filter: blur(16px); box-shadow: 0 -9px 28px #100a209a; }
.bottom-nav button { min-width: 68px; padding: 7px 8px; color: #bdafd0; background: none; border: 0; font-size: 11px; }
.bottom-nav button span { display: block; color: #d1bfe2; font-size: 21px; line-height: 1.1; }
.bottom-nav button.active { color: var(--gold-bright); background: linear-gradient(140deg, #d9c18e27, #c3caea15); clip-path: var(--cut); }
.bottom-nav button.active span { color: var(--gold-bright); }

dialog { position: fixed; inset: auto 0 0; width: min(100%, 600px); max-height: 87vh; margin: auto; padding: 0 20px 24px; overflow-y: auto; color: #f2ecde; background: linear-gradient(155deg, #49345f, #231c3b 85%); border: 1px solid var(--gold); border-radius: 0; clip-path: polygon(0 17px, 17px 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 0 100%); box-shadow: 0 -20px 65px #10091fba; }
dialog::backdrop { background: #100b20c2; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; z-index: 1; top: 14px; right: 14px; width: 34px; height: 34px; color: var(--gold-bright); background: #261d40b8; border: 1px solid var(--gold); font-size: 23px; }
.detail-art { display: grid; place-items: center; height: 160px; margin: 0 -20px 20px; color: var(--gold-bright); font: 84px Georgia, serif; text-shadow: 0 0 22px #ffe6b3; }
dialog h2 { margin: 5px 0; font: 600 31px 'Playfair Display', Georgia, serif; }
dialog h3 { margin: 0 0 5px; font: 600 18px 'Playfair Display', Georgia, serif; }
.detail-tagline { color: #d0d3db; font-size: 16px; }
.detail-count { display: inline-block; padding: 6px 10px; color: var(--gold-bright); background: #d9c18e22; font-size: 12px; }
.detail-section { padding: 14px 0; border-top: 1px solid #d9c18e4b; }
.detail-section p { margin: 0; color: #d3d7df; white-space: pre-wrap; }
.detail-section + .primary-button { margin-top: 10px; }

.view-enter { animation: page-rise .42s cubic-bezier(.2,.7,.25,1) both; }
.character-card.reveal-ready { opacity: 0; transform: translateY(18px); }
.character-card.is-visible { animation: card-arrive .55s cubic-bezier(.18,.73,.24,1) both; }
.character-card.is-visible:nth-child(even) { animation-delay: .07s; }
@keyframes star-breathe { from { filter: brightness(.9) drop-shadow(0 0 12px #c5d2ff52); transform: scale(.97) rotate(-3deg); } to { filter: brightness(1.12) drop-shadow(0 0 22px #e8dbab9c); transform: scale(1.02) rotate(3deg); } }
@keyframes page-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-glint { 0% { opacity: 0; transform: translateX(-60%) rotate(8deg); } 30% { opacity: .65; } 100% { opacity: 0; transform: translateX(65%) rotate(8deg); } }

@media (max-width: 600px) {
  html, body { height: 100%; overflow: hidden; }
  .app-shell { height: 100vh; height: var(--tg-viewport-stable-height, 100dvh); max-height: 100dvh; overflow-y: auto; overscroll-behavior-y: contain; }
  .app-shell { padding-right: 15px; padding-left: 15px; }
  .form-panel input, .form-panel textarea, .form-panel select, .search-box input, .tag-search { font-size: 16px; }
  .hero { min-height: 255px; padding: 25px 22px; }
  .hero h1 { max-width: 225px; font-size: 36px; }
  .hero-orb { right: -36px; top: 45px; width: 174px; height: 174px; font-size: 80px; }
  .hero-star { width: 78px; height: 78px; }
  .card-art { height: 120px; }
  .card-body { padding: 10px; }
  .card-body h3 { font-size: 16px; }
  .card-meta { font-size: 9px; }
  .bottom-nav { gap: 1vw; }
  dialog[open] { display: flex; flex-direction: column; inset: 0; width: 100%; height: 100vh; height: var(--tg-viewport-stable-height, 100dvh); max-height: 100dvh; margin: 0; padding: env(safe-area-inset-top) 15px env(safe-area-inset-bottom); overflow: hidden; clip-path: none; }
  .dialog-close { position: relative; top: auto; right: auto; flex: none; align-self: flex-end; }
  #detail-content { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { display: none; }
  .hero-orb, .view-enter, .character-card.is-visible, .character-card.is-visible::after { animation: none !important; }
  .character-card.reveal-ready { opacity: 1; transform: none; }
  .character-card { transition: none; }
  .setting-switch input::before { transition: none; }
}
