:root {
  color-scheme: dark;
  --ink: #f6edd2;
  --muted: #c7b98c;
  --paper: #f3dfad;
  --paper-ink: #332613;
  --gold: #d8ad4e;
  --gold-bright: #ffd873;
  --green: #123c32;
  --green-deep: #071b19;
  --green-soft: #1f5a47;
  --red: #7d2e24;
  --blue: #234a68;
  --line: rgba(244, 214, 139, 0.28);
  --panel: rgba(11, 35, 31, 0.78);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  font-family:
    "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP",
    Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(216, 173, 78, 0.16), transparent 30rem),
    radial-gradient(circle at 86% 20%, rgba(42, 114, 84, 0.22), transparent 25rem),
    linear-gradient(135deg, #081412 0%, #102d25 45%, #070f12 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: 0.24;
  background-image:
    linear-gradient(30deg, transparent 47%, rgba(255, 218, 115, 0.18) 48%, transparent 49%),
    linear-gradient(150deg, transparent 47%, rgba(255, 218, 115, 0.12) 48%, transparent 49%);
  background-size: 86px 86px;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.58));
}

a {
  color: inherit;
}

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

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 40px) 56px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -20px calc(clamp(16px, 3vw, 40px) * -1) 18px;
  padding: 16px max(300px, clamp(16px, 3vw, 40px)) 16px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 20, 18, 0.82);
  backdrop-filter: blur(16px);
}

.user-area {
  position: fixed;
  top: 10px;
  right: 64px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 124px;
}

.user-login-button,
.user-logout-button,
.menu-toggle,
.site-menu button,
.text-button {
  border: 1px solid rgba(244, 214, 139, 0.28);
  color: var(--gold-bright);
  background: rgba(5, 18, 16, 0.62);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.user-login-button,
.user-logout-button {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.user-logout-button {
  min-width: 88px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .user-name {
    display: none;
  }

  .user-logout-button {
    min-width: 82px;
    padding: 0 10px;
  }
}

.user-name {
  max-width: 140px;
  padding: 8px 12px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--gold-bright);
  background: rgba(5, 18, 16, 0.46);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-toggle {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 42;
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  padding: 7px 9px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--gold-bright);
}

.site-menu {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 42;
  display: grid;
  width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(244, 214, 139, 0.28);
  background: rgba(5, 18, 16, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

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

.site-menu button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-color: transparent;
  color: var(--ink);
  text-align: left;
}

.site-menu button img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.menu-brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 216, 115, 0.78);
  background:
    linear-gradient(45deg, transparent 40%, rgba(255, 216, 115, 0.88) 41% 44%, transparent 45%),
    radial-gradient(circle, rgba(255, 216, 115, 0.5), transparent 58%),
    #143c31;
  box-shadow: inset 0 0 0 3px rgba(8, 22, 20, 0.72), 0 0 18px rgba(255, 216, 115, 0.2);
  transform: rotate(45deg);
}

.site-menu button:hover {
  border-color: rgba(255, 216, 115, 0.48);
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 216, 115, 0.78);
  background:
    linear-gradient(45deg, transparent 40%, rgba(255, 216, 115, 0.88) 41% 44%, transparent 45%),
    radial-gradient(circle, rgba(255, 216, 115, 0.5), transparent 58%),
    #143c31;
  box-shadow: inset 0 0 0 5px rgba(8, 22, 20, 0.72), 0 0 30px rgba(255, 216, 115, 0.24);
  transform: rotate(45deg);
}

.brand strong {
  display: block;
  color: var(--gold-bright);
  font-size: 1rem;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
}

.top-nav a {
  padding: 8px 10px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
  text-transform: uppercase;
}

.top-nav a:hover {
  border-color: var(--line);
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.08);
}

.mobile-work-tabs {
  display: none;
}

.apply-book-button {
  position: fixed;
  right: 16px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 36;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 216, 115, 0.82);
  color: #271a07;
  background: linear-gradient(180deg, #ffdf7f, #c9932d);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.apply-book-button[hidden] {
  display: none;
}

.apply-book-button.is-pending {
  animation: applyPulse 1.1s ease-in-out infinite;
}

@keyframes applyPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 4px rgba(255, 216, 115, 0.18), 0 18px 34px rgba(0, 0, 0, 0.34);
  }
}

body:not(.screen-app) [data-app-content] {
  display: none !important;
}

body:not(.screen-app) .apply-book-button {
  display: none !important;
}

[data-screen][hidden] {
  display: none !important;
}

body.screen-app [data-screen] {
  display: none !important;
}

.landing-page {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.72fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  min-height: min(720px, calc(100dvh - 92px));
  padding: clamp(36px, 6vw, 82px) 0;
}

.landing-side {
  display: grid;
  gap: 14px;
}

.landing-copy {
  min-width: 0;
}

.landing-copy h1,
.register-page h1 {
  margin: 12px 0 18px;
  color: #fff4cf;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.register-page h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.landing-copy p,
.register-page p,
.landing-steps p {
  margin: 0;
  color: #e4d4a8;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.98rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.landing-actions .button {
  min-width: 160px;
}

.site-disclaimer {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(244, 214, 139, 0.18);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.4);
  font-size: 0.82rem;
  line-height: 1.8;
}

.landing-process,
.landing-knowledge,
.feature-compare {
  border: 1px solid rgba(244, 214, 139, 0.24);
  background:
    linear-gradient(140deg, rgba(18, 60, 50, 0.62), rgba(4, 18, 17, 0.82)),
    rgba(5, 20, 18, 0.54);
}

.landing-process,
.landing-knowledge {
  padding: 16px;
}

.landing-process h2,
.landing-knowledge h2,
.feature-compare h2 {
  margin: 0 0 12px;
  color: #fff1c8;
  font-size: 1.15rem;
}

.landing-steps {
  display: grid;
  gap: 12px;
}

.landing-steps article {
  min-height: 142px;
  padding: 18px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  background: rgba(5, 18, 16, 0.46);
}

.landing-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: #271a07;
  background: linear-gradient(180deg, #ffdf7f, #c9932d);
  font-weight: 800;
}

.landing-steps strong {
  display: block;
  margin-bottom: 8px;
  color: #fff1c8;
  font-size: 1.24rem;
}

.feature-compare {
  grid-column: 1 / -1;
  padding: 16px;
  overflow-x: auto;
}

.feature-compare table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.86rem;
}

.feature-compare th,
.feature-compare td {
  padding: 10px;
  border: 1px solid rgba(244, 214, 139, 0.18);
  text-align: left;
}

.feature-compare th {
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.1);
}

.register-page,
.login-page,
.simple-page {
  width: min(720px, 100%);
  margin: clamp(34px, 7vw, 82px) auto;
  padding: clamp(20px, 4vw, 34px);
}

.simple-page h1 {
  margin: 10px 0 18px;
  color: #fff4cf;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.simple-page p {
  margin: 0;
  color: #e4d4a8;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.9;
}

.simple-page a {
  color: var(--gold-bright);
}

.registration-form {
  margin-top: 18px;
}

.text-button {
  display: inline-flex;
  min-height: 34px;
  margin-top: 12px;
  padding: 0;
  border-color: transparent;
  background: transparent;
}

body:not(.is-registered) [data-registered-only] {
  display: none !important;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  min-height: min(720px, calc(100vh - 92px));
  padding: clamp(28px, 5vw, 70px) 0 clamp(44px, 7vw, 86px);
}

.compact-hero {
  min-height: min(620px, calc(100vh - 92px));
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  color: var(--gold-bright);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hero h1 {
  margin: 12px 0 18px;
  color: #fff4cf;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 1.05;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 12px 42px rgba(0, 0, 0, 0.4);
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: #e4d4a8;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.9;
}

.hero-actions,
.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(6, 22, 19, 0.72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: rgba(255, 216, 115, 0.72);
  color: #271a07;
  background: linear-gradient(180deg, #ffdf7f, #c9932d);
}

.button.secondary:hover,
.chip:hover {
  border-color: rgba(255, 216, 115, 0.62);
  color: var(--gold-bright);
}

.hero-board {
  position: relative;
  min-height: 520px;
  border: 1px solid rgba(255, 216, 115, 0.24);
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(18, 60, 50, 0.78), rgba(4, 18, 17, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 216, 115, 0.05) 18px 19px);
  box-shadow: var(--shadow);
}

.flow-board {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(255, 216, 115, 0.24);
  background:
    linear-gradient(140deg, rgba(18, 60, 50, 0.78), rgba(4, 18, 17, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 216, 115, 0.05) 18px 19px);
  box-shadow: var(--shadow);
}

.flow-step {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 6px 16px;
  align-items: center;
  min-height: 124px;
  padding: 18px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  background: rgba(5, 18, 16, 0.48);
}

.flow-step span {
  grid-row: span 2;
  color: var(--gold-bright);
  font-size: 2rem;
}

.flow-step strong {
  color: #fff1c8;
  font-size: 1.4rem;
}

.flow-step small {
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.86rem;
  line-height: 1.7;
}

.hero-board::before {
  position: absolute;
  inset: 24px;
  content: "";
  border: 1px solid rgba(255, 216, 115, 0.2);
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 216, 115, 0.16) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(255, 216, 115, 0.1) 50%, transparent 51%);
  background-size: 82px 82px;
}

.rune-ring {
  position: absolute;
  right: 12%;
  bottom: 10%;
  width: min(60vw, 380px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 216, 115, 0.38);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 18px rgba(255, 216, 115, 0.05),
    inset 0 0 0 42px rgba(17, 70, 55, 0.24),
    0 0 70px rgba(216, 173, 78, 0.26);
}

.rune-ring::after {
  position: absolute;
  inset: 68px;
  content: "";
  border: 1px dashed rgba(255, 216, 115, 0.48);
  border-radius: 50%;
}

.floating-card {
  position: absolute;
  width: 170px;
  min-height: 235px;
  padding: 16px;
  border: 1px solid rgba(255, 216, 115, 0.55);
  color: var(--paper-ink);
  background:
    linear-gradient(180deg, rgba(255, 251, 223, 0.92), rgba(231, 198, 126, 0.92)),
    var(--paper);
  box-shadow: 0 24px 38px rgba(0, 0, 0, 0.36);
}

.floating-card::before {
  display: block;
  height: 106px;
  margin-bottom: 14px;
  content: "";
  border: 1px solid rgba(65, 42, 15, 0.24);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.4), transparent 26px),
    linear-gradient(135deg, rgba(32, 96, 72, 0.92), rgba(101, 58, 28, 0.82));
}

.floating-card.creature {
  top: 64px;
  left: 42px;
  transform: rotate(-8deg);
}

.floating-card.spell {
  right: 52px;
  top: 120px;
  transform: rotate(7deg);
}

.floating-card.item {
  left: 35%;
  bottom: 50px;
  transform: rotate(-2deg);
}

.floating-card span,
.floating-card small {
  display: block;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
}

.floating-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1rem;
}

.ai-brief,
.workspace,
.prompt-lab,
.mypage-grid,
.reference-strip,
.lp-guide {
  margin-top: 28px;
}

.ai-brief {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 20, 18, 0.44);
}

h2 {
  margin: 4px 0 0;
  color: #fff1c8;
  font-size: clamp(1.35rem, 2.2vw, 2.05rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.ai-brief p,
.share-panel p,
.hint {
  margin: 0;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.9rem;
  line-height: 1.8;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: start;
}

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

.reference-strip a {
  min-height: 128px;
  padding: 18px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  background: rgba(5, 20, 18, 0.62);
  text-decoration: none;
}

.reference-strip a:hover {
  border-color: rgba(255, 216, 115, 0.62);
  background: rgba(216, 173, 78, 0.1);
}

.reference-strip span,
.source-note {
  color: var(--gold-bright);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reference-strip strong {
  display: block;
  margin: 10px 0 8px;
  color: #fff1c8;
  font-size: 1.3rem;
}

.reference-strip small {
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.7;
}

.lp-guide {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  background:
    linear-gradient(135deg, rgba(18, 60, 50, 0.72), rgba(5, 18, 16, 0.82)),
    rgba(5, 20, 18, 0.54);
}

.lp-guide-copy p,
.lp-guide-steps p {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.9rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.lp-guide-copy,
.lp-guide-steps,
.lp-guide-steps article,
.lp-guide h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.lp-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lp-guide-steps article {
  min-height: 166px;
  padding: 16px;
  border: 1px solid rgba(244, 214, 139, 0.22);
  background: rgba(5, 18, 16, 0.46);
}

.lp-guide-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  color: #271a07;
  background: linear-gradient(180deg, #ffdf7f, #c9932d);
  font-weight: 800;
}

.lp-guide-steps strong {
  display: block;
  color: #fff1c8;
  font-size: 1.08rem;
}

.mypage-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.profile-panel {
  padding: clamp(18px, 2.3vw, 28px);
}

.side-stack {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(22, 60, 50, 0.8), rgba(7, 25, 22, 0.86)),
    var(--panel);
  box-shadow: var(--shadow);
}

.card-library,
.summary-panel,
.side-stack .panel,
.prompt-inputs .panel,
.prompt-output,
.share-context-panel {
  padding: clamp(18px, 2.3vw, 28px);
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.search-tools {
  align-items: center;
}

.category-tabs {
  position: sticky;
  top: 68px;
  z-index: 11;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 18px 0 14px;
  padding: 8px;
  border: 1px solid rgba(244, 214, 139, 0.2);
  background: rgba(5, 18, 16, 0.95);
  backdrop-filter: blur(12px);
}

.card-sticky-book-meter {
  display: grid;
  flex: 0 0 160px;
  gap: 7px;
  min-height: 44px;
  margin: 0 6px 0 0;
  padding: 6px 8px;
  border-right: 1px solid rgba(244, 214, 139, 0.2);
}

.card-sticky-book-meter .meter-label {
  font-size: 0.82rem;
}

.card-sticky-book-meter .meter-track {
  height: 8px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.72);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
}

.category-tab img {
  display: inline-flex;
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: auto;
}

.category-tab:hover,
.category-tab.active {
  border-color: rgba(255, 216, 115, 0.72);
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.13);
}

.search-input {
  min-height: 34px;
  width: min(280px, 100%);
  padding: 0 10px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--ink);
  background: rgba(5, 18, 16, 0.72);
  outline: none;
}

.source-note {
  margin: -4px 0 18px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.chip {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.62);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
}

.chip.active {
  border-color: rgba(255, 216, 115, 0.72);
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.13);
}

.card-grid {
  display: block;
}

.game-card {
  display: grid;
  gap: 12px;
  min-height: 252px;
  padding: 12px;
  border: 1px solid rgba(255, 216, 115, 0.24);
  color: var(--paper-ink);
  background: linear-gradient(180deg, #f2dfae, #d0a963);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.dense-grid {
  display: block;
}

.card-table-wrap {
  overflow-x: hidden;
  border: 1px solid rgba(244, 214, 139, 0.24);
  background: rgba(5, 18, 16, 0.42);
}

.card-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--paper-ink);
  background: linear-gradient(180deg, #f4e6c2, #dcc07b);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.8rem;
  line-height: 1.56;
}

.card-table th,
.card-table td {
  padding: 8px 6px;
  border: 1px solid rgba(81, 57, 24, 0.24);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.card-table th {
  color: #005087;
  background: rgba(255, 255, 255, 0.45);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.card-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.18);
}

.card-table tbody tr:hover {
  background: rgba(255, 248, 194, 0.5);
}

.name-cell {
  min-width: 0;
  color: #0068a8;
  font-weight: 700;
  white-space: normal;
}

.card-table th:nth-child(1),
.card-table td:nth-child(1) {
  width: 13%;
}

.card-table th:nth-child(2),
.card-table td:nth-child(2) {
  width: 4%;
}

.card-table th:nth-child(3),
.card-table td:nth-child(3) {
  width: 6%;
}

.card-table th:nth-child(4),
.card-table td:nth-child(4) {
  width: 6%;
}

.card-table th:nth-child(5),
.card-table td:nth-child(5),
.card-table th:nth-child(6),
.card-table td:nth-child(6) {
  width: 4%;
}

.card-table th:nth-child(7),
.card-table td:nth-child(7),
.card-table th:nth-child(8),
.card-table td:nth-child(8) {
  width: 6%;
}

.card-table th:nth-child(9),
.card-table td:nth-child(9) {
  width: 31%;
}

.card-table th:nth-child(10),
.card-table td:nth-child(10),
.card-table th:nth-child(11),
.card-table td:nth-child(11) {
  width: 10%;
}

.kind-pill {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 3px 6px;
  color: #f8edcf;
  background: rgba(49, 42, 25, 0.78);
  font-weight: 700;
}

.icon-cell,
.cost-cell {
  white-space: nowrap;
  text-align: center;
}

.inline-icon {
  width: 18px;
  height: 18px;
  margin: 0 2px;
  object-fit: contain;
  vertical-align: -4px;
}

.rarity-icon-img {
  width: 22px;
  height: 22px;
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.effect-cell {
  min-width: 0;
  max-width: none;
  line-height: 1.75;
}

.table-count {
  width: 120px;
  min-height: 34px;
  padding: 4px 6px;
  accent-color: #c9932d;
}

.count-control {
  display: inline-flex;
  align-items: center;
}

.mobile-count-control {
  display: none;
}

.desktop-count-control {
  display: inline-grid;
  grid-template-columns: 26px 36px 26px;
  align-items: center;
  border: 1px solid rgba(111, 96, 48, 0.34);
  background: rgba(255, 250, 228, 0.42);
}

.count-step {
  width: 26px;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  color: var(--paper-ink);
  background: rgba(215, 177, 89, 0.28);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.count-step:hover,
.count-step:focus-visible {
  background: rgba(215, 177, 89, 0.52);
}

.table-count-number {
  width: 36px;
  min-height: 30px;
  border: 0;
  border-left: 1px solid rgba(111, 96, 48, 0.28);
  border-right: 1px solid rgba(111, 96, 48, 0.28);
  padding: 0 4px;
  color: var(--paper-ink);
  background: rgba(255, 250, 228, 0.76);
  text-align: center;
  font-family: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.table-count-number::-webkit-outer-spin-button,
.table-count-number::-webkit-inner-spin-button {
  margin: 0;
}

.range-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.range-count.mobile-count-control {
  display: none;
}

.range-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  color: var(--paper-ink);
  background: rgba(255, 250, 228, 0.68);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.desktop-card-name {
  display: inline;
}

.mobile-card-toggle,
.mobile-card-meta {
  display: none;
}

.database-card {
  min-height: 380px;
}

.game-card[data-type="creature"] .card-art {
  background:
    radial-gradient(circle at 56% 42%, rgba(255, 248, 191, 0.44), transparent 22px),
    linear-gradient(145deg, #4f8e5b, #203f34 55%, #7f5530);
}

.game-card[data-type="spell"] .card-art {
  background:
    radial-gradient(circle at 42% 44%, rgba(255, 255, 255, 0.42), transparent 18px),
    linear-gradient(145deg, #4f83a1, #263b69 58%, #413574);
}

.game-card[data-type="item"] .card-art {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 246, 171, 0.55), transparent 20px),
    linear-gradient(145deg, #9c7c36, #46351d 58%, #8b3d2f);
}

.neutral-art {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 248, 191, 0.44), transparent 22px),
    linear-gradient(145deg, #4b815f, #314134 55%, #7b5d31);
}

.card-art {
  position: relative;
  height: 92px;
  border: 1px solid rgba(58, 35, 12, 0.26);
  overflow: hidden;
}

.card-art::before,
.card-art::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 231, 156, 0.38);
}

.card-art::before {
  inset: 18px 50px;
  transform: rotate(45deg);
}

.card-art::after {
  inset: 34px 74px;
  border-radius: 50%;
}

.card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-meta h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.type-label {
  padding: 4px 7px;
  color: #f9edc7;
  background: rgba(43, 28, 11, 0.72);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.67rem;
  white-space: nowrap;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.card-tags span {
  padding: 4px 7px;
  border: 1px solid rgba(66, 43, 16, 0.22);
  background: rgba(255, 246, 210, 0.36);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.68rem;
}

.card-spec {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
}

.card-spec div {
  padding: 6px;
  background: rgba(255, 246, 210, 0.35);
}

.card-spec dt {
  color: rgba(51, 38, 19, 0.66);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.62rem;
}

.card-spec dd {
  margin: 2px 0 0;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
}

.effect-text {
  min-height: 72px;
  margin: 0;
  color: rgba(51, 38, 19, 0.9);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.77rem;
  line-height: 1.55;
}

.count-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.count-field {
  display: grid;
  gap: 4px;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.74rem;
}

.count-field input,
.field input,
.field select,
.share-panel input,
textarea {
  width: 100%;
  border: 1px solid rgba(244, 214, 139, 0.28);
  color: var(--ink);
  background: rgba(5, 18, 16, 0.72);
  outline: none;
}

.count-field input {
  min-height: 36px;
  padding: 6px 8px;
  color: var(--paper-ink);
  background: rgba(255, 250, 228, 0.78);
}

.field {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.82rem;
}

.field input,
.field select,
.share-panel input {
  min-height: 42px;
  padding: 0 12px;
}

.knowledge-card-input {
  font-size: 0.92rem;
}

.field select {
  cursor: pointer;
}

textarea {
  display: block;
  resize: vertical;
  min-height: 160px;
  padding: 14px;
  line-height: 1.7;
}

.profile-note {
  margin: 10px 0 0;
  color: #d8c899;
  font-size: 0.86rem;
}

.active-book-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  margin: 10px 0 6px;
  padding: 0 10px;
  border: 1px solid rgba(244, 214, 139, 0.2);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.42);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.78rem;
}

.active-book-chip strong {
  margin-left: 6px;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.strategy-copy-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid rgba(244, 214, 139, 0.18);
  background: rgba(5, 18, 16, 0.34);
}

.strategy-copy-tools .field {
  margin: 0;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 6px;
}

.book-editor {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.book-editor-divider {
  height: 5px;
  margin: 8px 0 10px;
  background: var(--gold-bright);
  box-shadow: 0 0 14px rgba(255, 216, 115, 0.28);
}

.book-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: stretch;
}

.delete-book-button {
  min-height: 42px;
  border: 1px solid rgba(244, 214, 139, 0.28);
  color: var(--gold-bright);
  background: rgba(5, 18, 16, 0.72);
  cursor: pointer;
}

.delete-book-button:hover:not(:disabled) {
  border-color: rgba(255, 216, 115, 0.72);
  background: rgba(216, 173, 78, 0.13);
}

.delete-book-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.book-register-open {
  width: 100%;
  margin-top: 10px;
}

.book-registration {
  margin-top: 10px;
}

.book-actions .button {
  min-height: 40px;
  padding: 10px 14px;
}

.book-status {
  min-height: 1.4em;
  margin: 0 0 12px;
}

.book-meter {
  display: grid;
  gap: 8px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.84rem;
}

.meter-label strong {
  color: var(--gold-bright);
  transition:
    color 160ms ease,
    font-size 160ms ease;
}

.meter-label strong.book-count-ok {
  color: #85e070;
  font-size: 1.08rem;
  font-weight: 800;
}

.meter-label strong.book-count-over {
  color: #ff6b5f;
  font-size: 1.08rem;
  font-weight: 800;
}

.meter-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 216, 115, 0.28);
  background: rgba(5, 18, 16, 0.72);
}

.meter-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6aa36f, var(--gold-bright));
  transition:
    width 180ms ease,
    background 180ms ease;
}

.meter-track span.meter-over {
  background: linear-gradient(90deg, #ffb15f, #ff5c5c);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.stat-grid div {
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(244, 214, 139, 0.2);
  background: rgba(5, 18, 16, 0.42);
}

.stat-grid span {
  display: block;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
}

.stat-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--gold-bright);
  font-size: 1.4rem;
}

.book-breakdown {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--ink);
  background: rgba(5, 18, 16, 0.56);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255, 216, 115, 0.05);
}

.book-panel-title {
  padding: 7px 10px;
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.14);
  font-weight: 700;
}

.book-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 3px 10px;
  border-bottom: 1px solid rgba(244, 214, 139, 0.14);
  font-size: 0.92rem;
  line-height: 1.45;
}

.book-line span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.book-line i {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

.book-line i .inline-icon {
  margin: 0;
}

.book-line strong {
  color: var(--gold-bright);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.book-total {
  color: #fff1c8;
  background: rgba(255, 216, 115, 0.08);
  font-weight: 700;
}

.book-line-child span {
  padding-left: 24px;
}

.rarity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  padding: 6px 8px 8px;
}

.rarity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 2px 6px;
  color: var(--ink);
  font-size: 0.9rem;
}

.rarity-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #271a07;
  font-weight: 700;
}

.rarity-item .icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.rarity-item strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.muted-rarity {
  opacity: 0.42;
}

.knowledge-panel {
  position: relative;
  margin-top: 28px;
  padding: clamp(18px, 2.3vw, 28px);
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.62);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
}

.dev-mode-toggle {
  opacity: 0.72;
  font-size: 0.72rem;
}

.required-mark {
  color: #ffdf7f;
  font-size: 0.9em;
}

.knowledge-layout {
  display: block;
}

.knowledge-form {
  position: relative;
  display: none;
  padding: 14px;
  border: 1px solid rgba(244, 214, 139, 0.2);
  background: rgba(5, 18, 16, 0.36);
}

.knowledge-form-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--gold-bright);
  background: rgba(5, 18, 16, 0.74);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.knowledge-panel.compose-open .knowledge-form {
  display: block;
}

.knowledge-panel.compose-open .knowledge-board {
  display: none;
}

.related-card-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.knowledge-form .button {
  width: 100%;
}

.badge-guide {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(244, 214, 139, 0.2);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.42);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.8rem;
  line-height: 1.6;
}

.badge-guide strong {
  display: block;
  margin-bottom: 2px;
  color: var(--gold-bright);
}

.badge-guide p {
  margin: 0;
}

.badge-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge-scale span,
.badge-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.knowledge-public-id {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--gold-bright);
  background: rgba(5, 18, 16, 0.62);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
}

.knowledge-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

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

.knowledge-card {
  padding: 14px;
  border: 1px solid rgba(244, 214, 139, 0.22);
  background: rgba(5, 18, 16, 0.5);
}

.knowledge-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.knowledge-card-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.knowledge-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.knowledge-viewpoint {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: #271a07;
  background: linear-gradient(180deg, #ffdf7f, #c9932d);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
}

.author-badge,
.private-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.62);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
}

.author-badge {
  position: relative;
  width: 24px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.author-badge::before,
.author-badge::after {
  position: absolute;
  content: "";
}

.author-badge::before {
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--badge-bg);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(244, 214, 139, 0.22);
}

.author-badge::after {
  bottom: 0;
  left: 5px;
  width: 14px;
  height: 13px;
  content: "";
  background: var(--badge-bg);
  clip-path: polygon(0 0, 48% 28%, 100% 0, 78% 100%, 50% 78%, 22% 100%);
}

.badge-green {
  --badge-bg: linear-gradient(180deg, #72d38c, #22924f);
}

.badge-blue {
  --badge-bg: linear-gradient(180deg, #b8e7ff, #5aa9dc);
}

.badge-purple {
  --badge-bg: linear-gradient(180deg, #d6b8ff, #8d55cf);
}

.badge-red {
  --badge-bg: linear-gradient(180deg, #ffb2a7, #d84e4a);
}

.badge-gold {
  --badge-bg: linear-gradient(180deg, #ffdf7f, #c9932d);
}

.private-badge {
  color: #c7d7ff;
  border-color: rgba(150, 178, 255, 0.28);
}

.like-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.74);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
}

.delete-knowledge-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(244, 214, 139, 0.24);
  color: #ffd1c8;
  background: rgba(96, 28, 20, 0.34);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.76rem;
  cursor: pointer;
}

.like-button.liked {
  border-color: rgba(255, 216, 115, 0.72);
  color: var(--gold-bright);
  background: rgba(216, 173, 78, 0.14);
}

.knowledge-card h3 {
  margin: 0 0 8px;
  color: #fff1c8;
  font-size: 1.08rem;
  line-height: 1.35;
}

.knowledge-date {
  display: block;
  margin: -2px 0 8px;
  color: var(--muted);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
}

.knowledge-card p {
  margin: 0;
  color: #e4d4a8;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.88rem;
  line-height: 1.75;
}

.knowledge-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.knowledge-related span {
  padding: 4px 8px;
  border: 1px solid rgba(244, 214, 139, 0.18);
  color: var(--muted);
  background: rgba(216, 173, 78, 0.08);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.72rem;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(244, 214, 139, 0.2);
  color: var(--muted);
  background: rgba(5, 18, 16, 0.42);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
}

.knowledge-compose-button {
  position: fixed;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 35;
  display: none;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 216, 115, 0.72);
  border-radius: 50%;
  color: #271a07;
  background: linear-gradient(180deg, #ffdf7f, #c9932d);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  font-size: 1.28rem;
  font-weight: 800;
  cursor: pointer;
}

.knowledge-panel.knowledge-registered .knowledge-compose-button {
  display: inline-flex;
}

.prompt-lab {
  display: grid;
  gap: 18px;
}

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

.share-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.prompt-output pre {
  max-height: 560px;
  margin: 18px 0 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(244, 214, 139, 0.26);
  color: #f9efd1;
  background: rgba(4, 13, 12, 0.78);
  font-family: Consolas, "SFMono-Regular", "Hiragino Sans", monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.prompt-output pre[hidden] {
  display: none;
}

.share-body {
  background:
    radial-gradient(circle at 18% 12%, rgba(216, 173, 78, 0.14), transparent 30rem),
    linear-gradient(135deg, #081412 0%, #102d25 45%, #070f12 100%);
}

.share-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 40px) 56px;
}

.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.limited-badge {
  padding: 8px 12px;
  border: 1px solid rgba(255, 216, 115, 0.34);
  color: var(--gold-bright);
  background: rgba(5, 18, 16, 0.62);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.share-context-panel h1 {
  margin: 8px 0 18px;
  color: #fff1c8;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1.15;
}

.share-context-panel pre {
  min-height: 70vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(244, 214, 139, 0.26);
  color: #f9efd1;
  background: rgba(4, 13, 12, 0.78);
  font-family: Consolas, "SFMono-Regular", "Hiragino Sans", monospace;
  font-size: 0.9rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .site-header,
  .workspace,
  .prompt-inputs,
  .ai-brief,
  .hero,
  .landing-page,
  .lp-guide,
  .mypage-grid,
  .reference-strip,
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .lp-guide-steps {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    justify-items: start;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .user-area {
    justify-self: end;
    min-width: 0;
  }

  .hero {
    min-height: auto;
  }

  .landing-page {
    min-height: auto;
  }

  .hero-board {
    min-height: 430px;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  body:not(.screen-app) {
    padding-bottom: 0;
  }

  body.screen-knowledge {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .page-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    padding: 0 10px 24px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 -10px 10px;
    padding: 10px 112px 10px 12px;
  }

  .brand {
    gap: 9px;
  }

  .user-area {
    left: auto;
    right: 58px;
    width: 84px;
    min-width: 0;
  }

  .user-login-button {
    width: 84px;
    padding: 0;
  }

  .menu-toggle {
    left: auto;
    right: 12px;
  }

  .site-menu {
    left: auto;
    right: 12px;
  }

  .user-name {
    max-width: 84px;
    padding: 8px 6px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand strong {
    font-size: 0.92rem;
  }

  .brand small,
  .top-nav,
  .hero,
  .ai-brief,
  .reference-strip {
    display: none;
  }

  .mobile-work-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(244, 214, 139, 0.28);
    background: rgba(5, 18, 16, 0.92);
    backdrop-filter: blur(16px);
  }

  body.screen-knowledge .mobile-work-tabs {
    display: grid !important;
  }

  .mobile-work-tab {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 46px;
    padding: 0 1px;
    border: 1px solid rgba(244, 214, 139, 0.22);
    color: var(--muted);
    background: rgba(5, 18, 16, 0.74);
    font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
    font-size: clamp(0.52rem, 2.35vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    line-height: 1;
  }

  .mobile-work-tab.active {
    border-color: rgba(255, 216, 115, 0.72);
    color: #271a07;
    background: linear-gradient(180deg, #ffdf7f, #c9932d);
  }

  .mypage-grid,
  .prompt-lab,
  .prompt-inputs {
    display: contents;
  }

  body.mobile-tabs-ready [data-mobile-pane] {
    display: none;
  }

  body.mobile-tabs-ready [data-mobile-pane].mobile-pane-active {
    display: block;
  }

  .panel,
  .card-library,
  .summary-panel,
  .profile-panel,
  .knowledge-panel,
  .prompt-inputs .panel,
  .prompt-output,
  .share-panel {
    margin: 10px 0;
    padding: 14px;
    box-shadow: none;
  }

  .lp-guide,
  .panel,
  .card-library,
  .summary-panel,
  .profile-panel,
  .knowledge-panel,
  .prompt-output,
  .mobile-work-tabs {
    max-width: 100%;
  }

  .lp-guide {
    display: block;
    margin: 10px 0;
    padding: 14px;
    box-shadow: none;
  }

  .landing-page {
    display: block;
    padding: 22px 0 32px;
  }

  .landing-copy h1,
  .register-page h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  .landing-copy p,
  .register-page p,
  .landing-steps p {
    font-size: 0.9rem;
    line-height: 1.8;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 20px;
  }

  .landing-actions .button {
    width: 100%;
    min-width: 0;
  }

  .landing-steps {
    margin-top: 20px;
    gap: 8px;
  }

  .landing-steps article {
    min-height: 0;
    padding: 14px;
    min-width: 0;
  }

  .landing-steps span {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
  }

  .landing-steps strong {
    font-size: 1.08rem;
  }

  .register-page {
    margin: 10px 0;
    padding: 16px;
  }

  .feature-compare {
    padding: 12px;
    overflow-x: visible;
    min-width: 0;
  }

  .feature-compare table {
    table-layout: fixed;
    min-width: 0;
    font-size: 0.72rem;
  }

  .feature-compare th,
  .feature-compare td {
    padding: 7px 6px;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .lp-guide-steps {
    display: block;
    margin-top: 14px;
    gap: 8px;
  }

  .lp-guide-steps article {
    min-height: 0;
    padding: 12px;
  }

  .lp-guide-steps article + article {
    margin-top: 8px;
  }

  .lp-guide-steps span {
    width: 26px;
    height: 26px;
    margin-bottom: 8px;
  }

  h2 {
    font-size: 1.25rem;
    overflow-wrap: anywhere;
  }

  .section-kicker {
    min-height: 20px;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
  }

  .field {
    margin: 12px 0;
  }

  .field input,
  .field select,
  .share-panel input {
    min-height: 46px;
    font-size: 1rem;
  }

  textarea {
    min-height: calc(100dvh - 260px);
    padding: 12px;
    font-size: 0.95rem;
    line-height: 1.65;
  }

  #questionText {
    min-height: calc(100dvh - 300px);
  }

  #knowledgeComment {
    min-height: 140px;
  }

  .book-actions,
  .prompt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .button {
    min-height: 46px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .mode-toggle {
    width: 100%;
    justify-content: center;
  }

  .strategy-copy-tools {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .knowledge-layout {
    gap: 12px;
  }

  .knowledge-form {
    padding: 12px;
  }

  .knowledge-compose-button {
    position: fixed;
    right: 18px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 31;
    display: none;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 216, 115, 0.72);
    border-radius: 50%;
    color: #271a07;
    background: linear-gradient(180deg, #ffdf7f, #c9932d);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
    font-size: 1.35rem;
    font-weight: 800;
  }

  .knowledge-panel.knowledge-registered .knowledge-compose-button {
    display: inline-flex;
  }

  .related-card-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .knowledge-tools {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .knowledge-tools .search-input {
    grid-column: 1 / -1;
  }

  .knowledge-card {
    padding: 12px;
  }

  .summary-panel .book-meter {
    margin-top: 12px;
  }

  .book-breakdown {
    margin-top: 12px;
    max-height: 190px;
    overflow: auto;
  }

  .book-line {
    min-height: 28px;
    font-size: 0.86rem;
  }

  .card-library .panel-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .search-tools {
    display: grid;
    grid-template-columns: 1fr repeat(3, auto);
    gap: 6px;
    width: 100%;
  }

  .search-input {
    width: 100%;
    min-height: 38px;
    grid-column: 1 / -1;
  }

  .chip {
    min-height: 34px;
    min-width: 0;
    padding: 0 8px;
  }

  .category-tabs {
    position: sticky;
    top: 58px;
    z-index: 11;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
    padding: 8px 0;
    overflow: visible;
    border-right: 0;
    border-left: 0;
    background: rgba(5, 18, 16, 0.94);
    backdrop-filter: blur(12px);
  }

  .card-sticky-book-meter {
    display: grid;
    grid-column: 1 / -1;
    gap: 8px;
    width: 100%;
    margin: 0 0 6px;
    padding: 10px 12px;
    border: 1px solid rgba(244, 214, 139, 0.28);
    background: rgba(5, 18, 16, 0.94);
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-tab {
    min-width: 0;
    min-height: 36px;
    justify-content: center;
    padding: 0;
    white-space: nowrap;
    font-size: 0;
  }

  .category-tab img {
    width: 22px;
    height: 22px;
    margin: 0;
  }

  .source-note {
    display: none;
  }

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

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

  .card-table {
    table-layout: auto;
    background: transparent;
    font-size: 0.82rem;
  }

  .card-table thead {
    display: none;
  }

  .card-table tbody {
    display: grid;
    gap: 7px;
  }

  .card-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(81, 57, 24, 0.28);
    color: var(--paper-ink);
    background: linear-gradient(180deg, #f3e2b6, #d3ae69);
  }

  .card-table th,
  .card-table td {
    width: 100% !important;
    border: 0;
    padding: 0;
  }

  .card-table tbody tr:nth-child(even),
  .card-table tbody tr:hover {
    background: linear-gradient(180deg, #f3e2b6, #d3ae69);
  }

  .name-cell {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    min-width: 0;
    padding-bottom: 2px;
    font-size: 1rem;
    white-space: normal;
  }

  .desktop-card-name {
    display: none;
  }

  .mobile-card-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 34px;
    padding: 0;
    border: 0;
    color: #0068a8;
    background: transparent;
    font: inherit;
    font-weight: 800;
    text-align: left;
  }

  .mobile-card-toggle::after {
    content: "詳細";
    padding: 3px 7px;
    color: rgba(51, 38, 19, 0.72);
    background: rgba(255, 250, 228, 0.42);
    font-size: 0.68rem;
    font-weight: 700;
  }

  .mobile-card-meta {
    display: none;
    padding: 8px;
    background: rgba(255, 246, 210, 0.42);
  }

  .card-table tr.press-card-meta .mobile-card-meta {
    display: grid;
    gap: 8px;
  }

  .mobile-card-meta dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
  }

  .mobile-card-meta div {
    min-width: 0;
  }

  .mobile-card-meta dt {
    color: rgba(51, 38, 19, 0.62);
    font-size: 0.62rem;
    font-weight: 700;
  }

  .mobile-card-meta dd {
    margin: 2px 0 0;
    font-weight: 700;
  }

  .mobile-card-meta p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.55;
  }

  .card-table td:not(.name-cell):not([data-label="所持"]):not([data-label="ブック"]) {
    display: none;
  }

  .card-table td:not(.name-cell)::before {
    display: block;
    margin-bottom: 2px;
    color: rgba(51, 38, 19, 0.62);
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .icon-cell,
  .cost-cell,
  .number-cell {
    text-align: left;
  }

  .card-table td[data-label="所持"],
  .card-table td[data-label="ブック"] {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: center;
    padding: 8px;
    background: rgba(255, 250, 228, 0.44);
  }

  .card-table td[data-label="所持"]::before,
  .card-table td[data-label="ブック"]::before {
    margin: 0;
    font-size: 0.78rem;
  }

  .table-count {
    width: 100%;
    min-height: 32px;
  }

  .count-control {
    display: block;
  }

  .desktop-count-control {
    display: none;
  }

  .range-count.mobile-count-control {
    display: grid;
  }

  .range-count {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: center;
  }

  .range-value {
    min-width: 28px;
    min-height: 28px;
    font-size: 0.9rem;
  }

  .prompt-output pre {
    max-height: calc(100dvh - 220px);
    min-height: calc(100dvh - 280px);
    margin-top: 12px;
    padding: 12px;
    font-size: 0.82rem;
    line-height: 1.6;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 12px;
  }

  .site-header {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .hero,
  .hero-copy,
  .ai-brief,
  .panel {
    min-width: 0;
  }

  .eyebrow {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    line-height: 1.6;
    white-space: normal;
  }

  .hero h1 {
    font-size: 2.18rem;
    line-height: 1.12;
  }

  .hero p,
  .ai-brief p,
  .share-panel p {
    overflow-wrap: anywhere;
  }

  .panel-head {
    display: grid;
  }

  .filters {
    justify-content: flex-start;
  }

  .card-grid,
  .stat-grid,
  .count-row {
    grid-template-columns: 1fr;
  }

  .hero-board {
    width: 100%;
    min-height: 360px;
  }

  .floating-card {
    width: 112px;
    min-height: 168px;
    padding: 12px;
  }

  .floating-card::before {
    height: 68px;
  }

  .floating-card.item {
    left: 32%;
    bottom: 42px;
  }

  .floating-card.creature {
    left: 24px;
  }

  .floating-card.spell {
    right: 62px;
    top: 118px;
  }
}
