:root { color-scheme: light; --ink: #221a15; --muted: #78675c; --paper: #fff7ec; --line: #e7d5bd; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top, #fffaf1, #ead7bd); color: var(--ink); font-family: Georgia, "Times New Roman", serif; }
a { color: #7a3d12; }
.book { max-width: 860px; margin: 0 auto; padding: 48px 22px 80px; }
.hero { text-align: center; margin-bottom: 48px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; color: var(--muted); font-size: 13px; }
h1 { font-size: clamp(36px, 7vw, 72px); line-height: .95; margin: 12px 0; }
.step { background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 22px; padding: 30px; margin: 28px 0; box-shadow: 0 20px 60px rgba(73, 41, 15, .08); }
.step p { font-size: 21px; line-height: 1.72; margin: 0 0 18px; }
.step-meta { font-family: system-ui, sans-serif; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.comic { margin: 28px 0 0; }
.comic img, .detail-comic { max-width: 100%; border-radius: 16px; border: 1px solid var(--line); display: block; }
figcaption { color: var(--muted); font-family: system-ui, sans-serif; font-size: 14px; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); font-size: 20px; }
.admin { width: min(1280px, 100%); margin: 0 auto; padding: 36px 20px; font-family: system-ui, sans-serif; }
.admin.narrow { max-width: 760px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fffaf3; border-radius: 12px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 12px; vertical-align: top; overflow-wrap: anywhere; }
th { background: #f1dfc5; }
.error { color: #9b1c1c; }
.notice { color: #256d35; }
.panel { background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 18px 0; overflow: hidden; }
.admin-menu { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.admin-menu a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); text-decoration: none; font-weight: 700; }
.admin-menu a.active { background: #7a3d12; color: #fffaf3; border-color: #7a3d12; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
input, select, textarea, button { width: 100%; max-width: 100%; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
button { background: #7a3d12; color: #fffaf3; cursor: pointer; white-space: nowrap; }
textarea { resize: vertical; }
label { display: grid; gap: 5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form, .actions button { flex: 1 1 120px; }
.danger { background: #9b1c1c; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.table-scroll table { margin: 0; }
.setting-description { color: var(--muted); font-size: 14px; line-height: 1.4; }
.player-cell { display: flex; gap: 10px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; }
.profile-avatar { width: 72px; height: 72px; }
.avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; background: #f1dfc5; color: var(--muted); font-family: system-ui, sans-serif; line-height: 1; }
.energy-icon { color: #f3b400; font-weight: 800; text-shadow: 0 0 8px rgba(243, 180, 0, .35); }
.step-contributors { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -8px 0 18px; }
.contributor { position: relative; }
.contributor-avatar { width: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; line-height: 0; }
.contributor-avatar:focus-visible { outline: 2px solid #7a3d12; outline-offset: 3px; }
.avatar-small { width: 28px; height: 28px; box-shadow: 0 3px 10px rgba(73, 41, 15, .12); }
.contributor-hint { position: absolute; z-index: 5; top: calc(100% + 10px); left: 0; display: none; width: min(320px, calc(100vw - 44px)); gap: 12px; align-items: flex-start; padding: 14px; background: #fffaf3; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 44px rgba(73, 41, 15, .18); font-family: system-ui, sans-serif; }
.contributor:hover .contributor-hint, .contributor:focus-within .contributor-hint { display: flex; }
.hint-avatar-link { flex: 0 0 auto; line-height: 0; }
.hint-avatar { width: 62px; height: 62px; transition: transform .15s ease; }
.hint-avatar-link:hover .hint-avatar { transform: scale(1.04); }
.hint-name { display: inline-block; margin-bottom: 6px; font-weight: 700; text-decoration: none; }
.step .hint-prompt { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.public-profile { text-align: center; }
.muted { color: var(--muted); }
.stats-bars { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding-right: 4px; }
.stat-row { display: grid; grid-template-columns: 80px 1fr 48px; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.stat-row meter { width: 100%; }
.support-thread { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.support-messages { display: grid; gap: 8px; margin-bottom: 12px; }
.support-message { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fffaf3; border: 1px solid var(--line); }
.support-message.admin { background: #f1dfc5; }
.support-message span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  .book { padding: 32px 14px 56px; }
  .admin { padding: 24px 12px; }
  .panel { padding: 14px; border-radius: 14px; }
  .grid-form { grid-template-columns: 1fr; }
  .inline-form { display: grid; grid-template-columns: 1fr; }
  table { min-width: 680px; }
  .stat-row { grid-template-columns: 72px 1fr 40px; }
  th, td { padding: 10px; }
  .step { padding: 20px; border-radius: 18px; }
  .step p { font-size: 18px; line-height: 1.65; }
  .contributor-hint { position: fixed; top: auto; right: 14px; bottom: 16px; left: 14px; width: auto; }
}
