@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@300;400;500;600;700&display=swap');

body,
button,
input,
textarea,
select {
  font-family: "Lexend Deca", "Noto Sans JP", sans-serif;
}
/* Dark（デフォルトの際に、htmlに data-theme="dark" を付ける） */
:root[data-theme="dark"]{
  --bg: linear-gradient(
    180deg,
    #0e101d 0%,
    #191a30 40%,
    #29263a 75%,
    #393044 100%
  );
  --bg-p: #0e101d;
  --text: #e5e7eb;
  --muted: rgb(170, 170, 170);
  --border:1px solid rgba(255,255,255,.08);
  --hover: rgba(255,255,255,0.06);
  --card: #ffffff08;
  --title:#ffffffb0;

  --btn-bg: #e5e6eb;
  --btn-text: #0b1220;

  --subbtn-bg: rgba(80, 80, 80, 0.035);
  --subbtn-text: #e5e7eb;
  --subbtn-hover: rgba(255,255,255,0.10);
  --input-bg:#1c1e2a52;

  --text-shadow:
  0 0 8px rgba(200, 210, 255, 0.35),
  0 0 18px rgba(200, 210, 255, 0.18);
  --footer:rgba(255,255,255,0.45);
}

:root{
  --bg: linear-gradient(
    180deg,
    #ffffff 0%,
    #edf3fa 30%,
    #e9e5f4 65%,
    #eee0ee 100%
  );
  --bg-p:  #ffffff;
  --text: #333;
   --muted: rgb(120, 120, 120);
  --border:1px solid rgba(210, 210, 210, 0.5);
  --hover: #f3f3f3;
  --card: #ffffff08;
  --title:#111111;

  --btn-bg: #111;
  --btn-text: #ffffff;

  --subbtn-bg: #f3f3f345;
  --subbtn-text: #111;
  --subbtn-hover: #cdcdcd46;
  --input-bg:#f3f3f30f;

  --text-shadow:
  0 0px 8px rgba(0, 0, 0, 0.18),
  0 0 18px rgba(40, 50, 80, 0.12);
  --footer:#333;
}

/* デフォルト（dark） */
.tally-embed--light { display: none; }
.tally-embed--dark  { display: block; }

/* light のとき */
[data-theme="light"] .tally-embed--dark  { display: none; }
[data-theme="light"] .tally-embed--light { display: block; }


.cover img{
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
}

.ep-nav,
.header {
  transition: none !important;
  animation: none !important;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; */
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.05em;
  font-family: 'Lexend Deca', sans-serif;

  min-height: 100vh;
  background: transparent;
}

html {
  background-color: #0e101d;
  color-scheme: dark;
}

html[data-theme="light"] {
  background-color: #ffffff;
  color-scheme: light;
}

body {
  background-color: transparent;
}

html {
  min-height: 100%;
}

/* body {
  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  flex-direction: column;
} */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  pointer-events: none;
}

main {
  flex: 1 0 auto;
}

h1{
  margin:10px;
  text-align: center;
  text-shadow:var(--text-shadow);
  color:var(--title);
}

h2{
    margin:0;
    padding-bottom: 20px;
    text-shadow:var(--text-shadow);
}

/* .navbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
} */

.navbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
}

.navbar .menu {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navbar .menu-item-toggle {
  margin-left: auto;
}

.site-title {
   font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.menu {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.menu a {
  text-decoration: none;
  color: var(--text);
  border-radius: 999px;
  padding: 10px;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .menu a {
    font-size: 0.85rem;
    padding: 4px;
  }
   .menu {
    gap: 6px;
  }
}

.card {
  display: block;
  border-radius: 14px;
  padding: 30px;
  background: var(--card);
  margin: 45px 0; 
  border: none;
  box-shadow: 0 0 10px rgba(123, 123, 123, 0.2);
}

main {
  max-width: 760px;
  margin: 5px auto 20px;
  padding: 25px;
}

label { 
  display: block; 
  font-size: 14px; 
  margin-bottom: 8px; 
  color: var(--muted); 
}

input[type="text"]{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:0 0 5px rgba(123, 123, 123, 0.2);
  font-size: 16px;
  background:var(--input-bg);
  color: var(--text);
}

.actions {
  margin: 20px 0 8px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

button, .btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  text-decoration: none;
   box-shadow:0 0 5px rgba(123, 123, 123, 0.2);
}

.btn {
  background: var(--subbtn-bg);
  color: var(--subbtn-text);
  margin-right: 8px;
  font-weight:bold;
}
.btn:hover { 
  background: var(--subbtn-hover); 
}

button:not(.theme-toggle):hover{
  opacity:0.7;
}

.episode-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 10px;
  justify-content: center; 
  align-content: start;
}

.story-title{
    text-align: center;
    font-size: 18px;
  }

/* 丸ボタン */
.episode-link {
  width: 44px;
  aspect-ratio: 1;         /* 常に正円 */
  display: grid;
  place-items: center;     /* 文字をど真ん中に */
  border-radius: 999px;
  line-height: 1;          /* 文字の縦ズレ防止 */
}

.lyra-link{
  width:auto;
 aspect-ratio: auto;
}

@media (max-width: 420px) {
  .episode-nav {
    grid-template-columns: repeat(auto-fill, 40px);
    gap: 8px;
  }
  .episode-link { width: 40px; }
}
 
.utility-link, a.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  border: var(--border);
  line-height: 1;
  letter-spacing: .08em;
  min-height: 36px;      
  white-space: nowrap;   
}

.utility-link {
  opacity: .85;
  font-size: 11.5px;
}

.utility-link{ transform: translateY(1px); }

.utility-link-wrap{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center; 
}

.theme-toggle{
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: var(--border);
  background: var(--card);
  color: var(--text);

  display: grid;
  place-items: center;

  pointer-events: auto;
}

.theme-toggle i{
  display: block;
  line-height: 1;
  font-size: 1.2rem;
  -webkit-text-stroke: .1px currentColor;
   filter: drop-shadow(0 0 4px currentColor);
  /* transform: translateY(1.5px) rotate(30deg) translateX(-1.2px); */
  transform: rotate(30deg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.sub-title {
  font-size: 15px;
  color: var(--muted);
  margin-left: 20px;
}

p a, h3 a, .small a {
  text-decoration: none;
  color: inherit;
}

.small,.small a {
  font-size: 13px;
  color: var(--muted);
}

.landing-wrap a:hover{
  text-decoration: none;
}

/* ===== Header ===== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  background: rgba(0, 0, 0, 0.08);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);

  transition: transform 0.25s ease;
}

/* Light mode */

[data-theme="light"] header {
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}


body{
  padding-top: 64px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

 .save-notice {
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity .2s ease;
}

.save-notice.show {
  opacity: 1;
}

.episode-item {
  display: flex;
  align-items: baseline;   
  gap: 15px;
  padding: 5px 0 8px;
}

.episode-title {
  margin: 16px 0;
  font-size: 18px;
}

.ep-sub{
  color: var(--muted);
  font-weight:normal;
  padding-top: 20px;
}

.episode-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap; 
  padding-left: 20px;
  font-weight: normal;
}

@media (max-width: 480px) {
   .episode-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  p{
    font-size: 10px;
  }
}

 p{
    font-size: 17px;
  }

.name-row {
  display: flex;
  align-items: baseline; 
  gap: 15px;
}

.name-title {
  margin: 0;
}

.save-notice {
  margin: 0;
}

.form-wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.form-wrap iframe {
  width: 100%;
  height: 900px; 
  border: none;
  border-radius: 16px;
}

.site-footer {
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;

  margin: auto auto 40px;
  padding: 10px 20px;

  color: var(--footer);
  font-size: 11px;
  text-align: center;

  flex-shrink: 0;
}

.site-footer p{
  font-size: 14px;
  padding: 20px;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.footer-nav {
  display: inline-flex;
  gap: 10px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 320;
}

p a:hover, h3 a:hover, .small a:hover, 
.footer-nav a:hover, .menu a:hover, a:hover {
  opacity: 0.7;
}

.sep {
  opacity: 0.3;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter {
  animation: fadeIn .4s ease-out both;
}

a,
button,
input,
textarea,
label {
  cursor: pointer!important;
}

button, a {
  -webkit-tap-highlight-color: transparent; 
}

button:active,
a:active {
  transform: translateY(1px);
  opacity: .8;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}


p{
   margin:0;
   padding: 30px 0;
}

.card-list{
  list-style:none;
  padding-left:0;
  margin:0;
}

.card-list li{
  display:flex;
  gap:.6em;
  align-items:flex-start;
  margin:.4em 0;
}

.card-list i{
  line-height:2; 
  flex:0 0 auto;
}

.credit{
  line-height:2;  
  color: var(--muted);
   user-select: text;
  -webkit-user-select: text;
}

 .log-list {
  display: grid;
  gap: 10px;
  margin-top: 40px;
}

.log-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
/* 
.log-item:hover { opacity: .92; } */

.log-dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  width: min(720px, 92vw);
  color: var(--text);
  background: var(--bg);
  position: relative; 
  z-index: 1000;
}

.dialog-close {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  opacity: .7;
  box-shadow: none;
  border: none;
}

.log-body {
  margin-top: 12px;
  line-height: 1.8;
}
.log-body p { margin: 0 0 10px; }

.log-dialog::backdrop {
  background: rgba(0,0,0,.45);
}

#epHeading{
  font-weight:600;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

 .episode-link{
  position: relative; /* バッジの土台 */
}

.episode-link.is-bookmark::after{
  content: "\F199"; /* ← bi-bookmark-fill */
  font-family: "bootstrap-icons";
  font-size: 10px;
  position: absolute;
  top: 1px;
  right: 0px;
  color: currentColor;
}

.episode-link.is-bookmark::after{ pointer-events: none; }

.episode-link.is-bookmark::after{
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.12));
  opacity: .92;
}

.cover {
  margin: 1rem 0;
}

.cover img{
  display:block;
  margin: 1rem auto 0;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
}

.cover__btn,.ability__btn {
  cursor: pointer;
  /* display: inline-block; */
}

.cover__btn,
.ability__btn {
  cursor: pointer;
  list-style: none; /* デフォルト三角を消す */
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.cover__btn::before,
.ability__btn::before {
  content: "\f285"; /* bi-caret-right-fill */
  font-family: "bootstrap-icons";
  font-size: .7em;
  transition: transform .2s ease;
}

details[open] > .cover__btn::before,
details[open] > .ability__btn::before {
  transform: rotate(90deg);
}

#pageLabel { white-space: nowrap; }

#pageLabel .sep {
  margin: 0 0.4em;
  opacity: 0.4;
}


 html{
  scroll-behavior: smooth;
}

/* 固定ヘッダー分のオフセット（70px） */
:root{
  scroll-padding-top: 80px;
}

#name, #long, #short, #message{
  scroll-margin-top: 80px;
}

.contents{
  font-size: 0.85rem;
  opacity: .6;
  line-height: 1.8;
  margin-bottom: 24px;
   display: inline-flex;
  gap: 15px;
}

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

.contents a:hover{
  opacity: .7;
}

input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
}

.card-list a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 4px;
}

.credit{
  display: grid;
  gap: 6px;
}

.credit .row{
  display: grid;
  grid-template-columns: 5em 1fr; 
  column-gap: .5em;
}

.credit .label{
  text-align: left;
  opacity: .7;
}

.credit .value{
  text-align: left;
  word-break: break-all; /* URL対策 */
}

.tag {
  font-size: 0.6rem;
  padding: 1px 8px;
  opacity: 0.7;
  white-space: nowrap;
  font-weight:normal;
  display: inline-flex;
  gap: 7px;
}


#dlgBody a {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--muted); /* 文字色と同じ色 */
  color: inherit;  
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 999px;
  letter-spacing: 0.05em;
  transition: all .25s ease;
  margin:10px 0 10px;
}

#dlgBody a:hover {
   opacity:0.7;
}

#dlgBody p {
  padding:0;
  margin: 1em 0; 
  line-height: 1.8; 
  letter-spacing: 0;
}

.menu a {
  opacity: 0.65;
}

.menu a.active {
  opacity: 1;
}

   .novel-btn{
  display: inline-block;
  padding: 14px 18px;
  border-radius: 10px;

  border: 1px solid currentColor;
  text-decoration: none;

  transition: all .2s ease;
}

.novel-btn .title{
  display: block;
  font-weight: 600;
}

.novel-btn .tag{
  display: block;
  font-size: 11px;
  opacity: .7;
  margin-top: 4px;
}

.novel-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.02);
}

 .clap-msg {
  margin-left: 10px;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}


.clap-btn {
  background: none;
  border: none;
  font-size: 3rem;
  color: var(--text);
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
  box-shadow: none;
   text-shadow:var(--text-shadow);
}

.clap-btn:hover{
  background:none;
  transform:none;
  opacity:1;
}

.clap-btn.clicked {
  color: #ff6bb5;
  transform: scale(1.15);
}


.message-form label{
  display:block;
  margin-top:18px;
  font-size:17px;
}

.clap{
  text-align: center; 
  margin: 50px auto 20px;
}

.clap p{
  text-align:center; 
  font-size: 15px; 
  margin-top: 0; 
  padding-top: 0; 
  line-height: 2;
}

  /* =========================
   form base style
========================= */

input[type="text"],
textarea,
.reply-select {
  padding: 10px;

  border: var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;

  box-sizing: border-box;
  border-radius: 8px;

  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

input[type="text"],
textarea {
  width: 100%;
  margin-top: 6px;
}

.reply-select {
  min-width: 130px;
  cursor: pointer;
  color-scheme: dark;
}

input[type="text"]:focus,
textarea:focus,
.reply-select:focus {
  outline: none;
  border: 1px solid var(--title);
  box-shadow: 0 0 0 2px var(--hover);
}

/* button */

button, .button{
  padding:10px 18px;
  border:1px solid var(--text);
  background:transparent;
  color:inherit;
  cursor:pointer;
  border-radius:8px;
   font-family: 'Lexend Deca', sans-serif;
}

.actions{
  display:flex;
  gap:10px;
  margin-top:20px;
}

.actions button{
  flex:1;
}

.save-notice{
  font-size:12px;
  margin-left:8px;
  opacity:0.8;
}

.message-form{
  width:100%;
}

.message-form label{
  display:block;
  margin-top:18px;
  font-size:14px;
}

.message-form button{
  margin-top:30px;
  margin-bottom:10px;
}

details input[type="text"]{
  margin-top:10px;
}

details summary + br{
  display:none;
}

details[open] summary{
  margin-bottom:12px;
}

.actions button,
.message-form button{
  min-width:120px;
  max-width:180px;
  width:100%;
}

.message-form button{
  display:block;
  margin:30px auto 10px;
  width:100%;
  max-width:260px;
}

.message-form input,
.message-form textarea{
  font-size:16px;
}

.message-form textarea{
  margin-bottom:16px;
  height:300px;
  resize:vertical;
}

.message-form button{
  margin-top:10px;
}


.message-form .reply-check {
  display: inline-grid !important;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;

  margin: 0 !important;
}

.message-form .reply-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  width: 18px;
  height: 18px;
  margin: 0;

  box-sizing: border-box;
  position: relative;

  border: var(--border);
  border-radius: 5px;
  background: var(--input-bg);

  cursor: pointer;
}

.message-form .reply-check input[type="checkbox"]:checked {
  background: var(--bg);
  border-color: currentColor;
}

.message-form .reply-check input[type="checkbox"]:checked::after {
  content: "✓";

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  font-size: 12px;
  line-height: 1;
  color: var(--text);
}

.message-form .reply-check span {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
}

.clap-msg {
  display: inline;
  opacity: 1;
}

.clap-msg{
  position: relative;
  display: inline-block;
  margin-left: 10px;
  padding: 13px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: transparent;
}

/* 外側の三角 */
.clap-msg::before{
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 7px solid currentColor;
}

/* 内側をくり抜いて吹き出しっぽくする */
.clap-msg::after{
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--bg, #fff);
}

.clap-wrap{
  display: flex;
  align-items: center;     /* 縦揃え */
  gap: 10px;               /* ハートと吹き出しの間 */
}

.clap-btn{
  font-size: 4rem;
}

.clap-msg{
  position: relative;
  display: inline-block;
  margin-left: 10px;
  padding: 13px;
  border: 2px solid currentColor; /* ←ここ */
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: transparent;
}

/* 外側の三角 */
.clap-msg::before{
  content: "";
  position: absolute;
  left: -9px; /* 少し広げる */
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 9px solid currentColor; /* ←ここ */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: fadeIn .35s ease-out both;
}