@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&display=swap");


html{
    height: 100%; /* HTMLとBODYの高さを100%にする */
    margin: 0; /* 余白をなくす */
    padding: 0; /* パディングもなくす */
    font-size: min(62.5%, 10px); /* ブラウザデフォルトフォントサイズを仮に16pxとして × 0.625 = 10px(基準値を10pxに)さらに最大値を10pxに */
}

* {
    box-sizing: border-box;
}

body{
	width:100%;
	height:100%;
	padding:0;
	margin:0;
    line-height: 1.75rem;
    font-size: 1.35rem;
    font-weight: 400;
	background:url(../img/background.png)center center / cover no-repeat fixed;
    height: 100vh;
    background-position:center bottom;
    font-family: "Noto Sans JP", sans-serif;
    text-size-adjust: 100%; /* ブラウザの文字サイズ自動調整無効化 */
    -webkit-text-size-adjust: 100%; /* Safari */
}

/* ヘッダー・フッター共通 */
nav ul.headfoot{
    display:flex;
    height: 100%;
    width:100%;   
    margin:0;
    padding:0;
    gap: 0.3rem;
    list-style:none;
}
nav ul li:hover{
    color:darkgoldenrod;
}
nav ul.headfoot a{
    height: 100%;
    max-width: calc(100% / var(--items));
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal; /* 通常の折り返しを許可 */
    word-wrap: break-word; /* 単語内の途中でも折り返しを許可 */
    overflow-wrap: anywhere; /* テキストが長くなったとき確実に折り返す */
}


/* ヘッダー */
header {
    position: fixed;
    font-size: 1.3rem;
    font-weight: 600;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.8);
    left: 0;
    top: 0;
    width: 100%;
    border-bottom: solid 3px black;
    z-index: 100;
    overflow: hidden;
}
header nav{
    height:100%;
}
header#dynamic-header{
    /* 初期状態(アニメーション前) */
    opacity: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}
header#dynamic-header.show {
    /* アニメーション用(js生成後に付与) */
    opacity: 1;
    transform: translateY(0);
}
.scroll-down header {
    margin-top: -90px;
}
.scroll-up header {
    margin-top: 0px;
}
p.head{
    text-align: center;
    font-weight: 900;
    color:rgb(0, 0, 0);
}
a.head{
    font-weight: 900;
    background-color: rgba(255, 255, 255, 0.3);
    color:rgb(0, 0, 0);
}
a.headN{
    font-weight: 900;
    background-color: #333333;
    color:rgb(255, 255, 255);
    cursor: default;
}

/* フッター */
footer{
    display:flex;
    font-weight: 600;
    height:50px;
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;

    display:flex;
    border-top:solid 3px white;
    z-index: 100;
}
a.foot, a.footN {
    width: 20%; /* 幅は固定(5つのボタンで均等割り) */
    font-weight: 600;
    text-decoration: none;
    color: white;
    
    /* 初期状態は透明 */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.foot-visible a.foot,
.foot-visible a.footN {
    opacity: 1;
}
a.foot{
    background-color: rgba(0, 0, 0, 0.3);
}
a.footN {
    font-weight: 900;
    background-color: rgb(228, 228, 228);
    color: #333333;
}

.wrapper {
    display: flex;
}
main {
    position: relative;
    flex: 1;
    max-width: 960px;
    min-width: 480px;
    min-height: 100vh; /* ビューポート全体に広げる */
    background-color: rgba(255, 255, 255, 0.8);
    margin: 0 auto;
    box-shadow: 0 0 20px black;
    box-sizing: border-box;
}

aside {
    width: 220px;
    font-weight: 600;
    max-height:590px;
    min-width: 0;
    background-color: rgba(78, 78, 78, 0);
    margin-left: 20px;
    position: sticky;
    top:50px;
}

/* サイドバー(章見出しリンク) */
p.side{
    padding:0;
    margin: 1rem 0 0.5rem 0;
    text-align: center;
    font-weight: 900;
    color:#fff;

    /* 初期状態(透明) */
    opacity: 0;
    transform: translateX(-10px); /* 左から滑らかに出現 */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
p.side.show { /* JSで追加されるクラス */
    opacity: 1;
    transform: translateX(0);
}

nav ul.side{
    display:flex;
    flex-flow: column;
    list-style:none;

    margin:0;
    padding:0;
}
a.side{
    color:white;
}
a.side li {
    margin: 0.2rem;
    padding: 0.9rem;
    text-align: left;
    color: white;
    box-shadow: 0 0 0.2rem black;

    /* 初期状態(透明) */
    opacity: 0;
    transform: translateX(-1rem); /* 左から滑らかに出現 */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
a.side li.show { /* JSで追加されるクラス */
    opacity: 1;
    transform: translateX(0);
}

a.side li.side{
    background-color: #252525;
}
a.side li.sideB{
    background-color: #3b3b3b;
}
a.side li.active, a.side.active {
    color: yellow;
    box-shadow: 0 0 0 2px yellow;
}

/* サイドバー広告 */
li.lucky{
    margin-bottom: 50px;
    position: fixed;
    bottom: 0;
    width:220px;
    z-index: -100;
}
img#luckyImage {
    max-width: 100%; /* 親要素であるasideの幅に収める */
    object-fit: contain;
    height: auto;
}

/* セクション */
section{
    padding: 1rem;
}
section.chapter, section.general {
    margin-top: 2rem;
    border-top: 2px solid #00000018;
}

section.chapter.last-of-type,
section.chapter:last-of-type,
section.general:last-of-type {
    border-bottom: 2px solid #00000018;
}


h1{
    line-height:4.5rem;
    height: 4.5rem;
	font-size:3rem;
	font-weight:900;
}
h1.title{
	margin:55px 0 0.5rem 0;
	padding:0 0 0 1.3rem;
	background: linear-gradient(to right, rgba(0, 0, 0, 1.0), rgba(0, 0, 0, 0.3));
	color:white;
	text-align:left;
	border-left: 0.8rem solid #4e4e4e;
}
h1.info{
	margin:0.5rem 0;
	padding:0 0 0 1.3rem;
	background: linear-gradient(to right, rgba(0, 0, 0, 1.0), rgba(0, 0, 0, 0.3));
	color:white;
	text-align:left;
	border-left: 0.8rem solid #4e4e4e;
}
h1.info2{
	margin:0.5rem -1rem;
	padding:0 0 0 1.3rem;
	background: linear-gradient(to right, rgba(0, 0, 0, 1.0), rgba(0, 0, 0, 0.3));
	color:white;
	text-align:left;
	border-left: 0.8rem solid #4e4e4e;
}

h2{
    height:3rem;
    line-height:3rem;
	font-size:2.0rem;
	font-weight:900;
    padding: 0;
}

/* 章タイトル(章番号自動補完) */
h2.info{
    display: flex;
    align-items: center;
    color: #000;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.05));
    margin:0 -0.4rem 0.5rem -0.4rem;
}
h2.info .now {
    background: #000;
    margin-right: 0.5rem;
    color: #fff;
    padding: 0 1.5rem 0 0.7rem;
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
    
    /* 初期状態(縮んでいる) */
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.4s ease-out, padding 0.4s ease-out;
    padding-left: 0;
    padding-right: 0;
}
h2.info .now.show { /* JSで追加されるクラス */
    max-width: 100px; /* 適切なサイズに調整 */
    padding-left: 0.7rem;
    padding-right: 1.5rem;
}

/* 汎用章タイトル */
h2.info2{
    display: flex;
    align-items: center;
    color: #000;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.05));
    margin:0 -0.4rem 1.0rem -0.4rem;
}
h2.info2::before{
    content: "";
    width: 0.5rem; /* 台形の幅 */
    height: 100%; /* h2の高さに合わせる */
    background: #000;
    margin-right: 0.5rem;
    color: #fff;
    padding: 0 1.5rem 0 0.7rem;
    clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%);
}
h2.info.red,h2.info2.red{
    background: linear-gradient(to right, rgba(151, 39, 39, 0.3), rgba(151, 39, 39, 0.05));
    color:#5c0f0f;;
}
h2.info.red span,h2.info2.red span{
    background: #5c0f0f;
}
h2.info.blue,h2.info2.blue{
    background: linear-gradient(to right, rgba(39, 41, 151, 0.3), rgba(39, 41, 151, 0.05));
    color:#0f105c;
}
h2.info.blue span,h2.info2.blue span{
    background: #0f105c;
}

h2.sub{ /* 章内見出し */
    height:2.2rem;
    line-height:2.2rem;
	font-size:1.75rem;
    margin: 0.5rem 0;
    padding-left: 0.5rem;;
    border-left: 6px solid #000;
}
h2.sub.red{
    border-left: 6px solid #721c1c;
    color:#721c1c;
}
h2.sub.blue{
    border-left: 6px solid #1c1d72;
    color:#1c1d72;
}
h2 ruby {
    display: ruby;
    white-space: nowrap;
    text-align: center;
    ruby-position: over;
    line-height: 1;
}
h2 rt {
    line-height: 0rem;
    font-size: 0.8rem;
    margin-top: -1rem;
}



h3{
    line-height:1.5rem;
	font-size:1.35rem;
	font-weight:500;
    width: fit-content;
}

h4{
    line-height:1.5rem;
	font-size:1.35rem;
	font-weight:900;
    margin: 0.5rem 0;
    width: fit-content;
}
h4.line{
    border-bottom: 2px solid #575757;
}
h4.line.red{
    color:#721c1c;
    border-color: #721c1c;;
}
h4.semi{
    background-color: #00000030;
}

/* KP向け注釈用デザイン */
div.alert{
    background-color: rgba(228, 135, 135, 0.527);
    padding: 0.8rem;
    margin: 1rem 0;
    border-radius: 1rem;
    outline: 2px solid rgb(126, 0, 0); /* `border` ではなく `outline` を使う */
    outline-offset: -5px; /* `outline` を内側にずらす */
    box-shadow: 0 0 3px rgba(151, 0, 0, 0.8);
}
div.alert h3{
    margin: 0.2rem 0 0.4rem 0;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    color:rgb(255, 68, 68);
    background:rgba(75, 0, 0, 0.856);
    border-radius: 100px;
}
div.alert h3 span{
    display: inline-block;
    background-color: rgb(255, 0, 0);
    color: #631a1a;
    font-weight: 900;
    border-radius: 2rem;
    padding: 0 0.5rem;
    margin-right: 0.5rem;
}

/* KP向け注釈用デザイン */
div.kp{
    background-color: rgba(255, 245, 159, 0.3);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 1rem;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}
div.kp h3{
    margin: 0.2rem 0 0.4rem 0;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    color:rgb(255, 230, 0);
    background:rgba(75, 64, 0, 0.7);
    border-radius: 100px;
}
div.kp h3 span{
    display: inline-block;
    background-color: rgb(255, 230, 0);
    color: #63581A;
    font-weight: 900;
    border-radius: 2rem;
    padding: 0 0.5rem;
    margin-right: 0.5rem;
}

/* 行動分岐用の注釈デザイン */
div.case{
    background-color: rgba(84, 66, 129, 0.2);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 1rem;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}
div.case h3{
    margin: 0.2rem 0 0.4rem 0;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    color:white;
    background:rgba(29, 22, 46, 0.5);
    border-radius: 100px;
}
div.case h3 span{
    display: inline-block;
    background-color: rgb(72, 65, 175);
    color: #ffffff;
    font-weight: 900;
    border-radius: 2rem;
    padding: 0 0.5rem;
    margin-right: 0.5rem;
}

/* ルール説明 */
div.rule{
    background-color: rgba(66, 129, 94, 0.3);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 1rem;
    box-shadow: 0 0 3px black;
}
div.rule h3{
    margin: 0.2rem 0 0.4rem 0;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    color:white;
    background:rgba(22, 46, 37, 0.7);
    border-radius: 100px;
}
div.rule h3 span{
    display: inline-block;
    background-color: rgb(65, 175, 133);
    color: #ffffff;
    font-weight: 900;
    border-radius: 2rem;
    padding: 0 0.5rem;
    margin-right: 0.5rem;
}

/* 汎用白背景デザイン */
div.general{
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 1rem;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}
div.general h3{
    margin: 0.2rem 0 0.4rem 0;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    color:white;
    background:rgba(0, 0, 0, 0.6);
    border-radius: 100px;
}
div.general h3 span{
    display: inline-block;
    background-color: white;
    color: #454343;
    font-weight: 900;
    border-radius: 2rem;
    padding: 0 0.5rem;
    margin-right: 0.5rem;
}

/* 汎用黒背景デザイン */
div.general2{
    background-color: rgba(54, 54, 54, 0.3);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 1rem;
    box-shadow: 0 0 3px black;
}
div.general2 h3{
    margin: 0.2rem 0 0.4rem 0;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    color:white;
    background:rgba(0, 0, 0, 0.6);
    border-radius: 100px;
}
div.general2 h3 span{
    display: inline-block;
    background-color: rgb(177, 177, 177);
    color: #1a1a1a;
    font-weight: 900;
    border-radius: 2rem;
    padding: 0 0.5rem;
    margin-right: 0.5rem;
}

/* イントロダクション用デザイン */
div.intro{
    margin: 1rem 0 1.5rem 0;
    font-weight: 500;
    padding: 0.5rem 1rem 0.5rem 1rem;
    border-top: #818181 double 4px;
    border-bottom: #818181 double 4px;
}

/* セリフ表示 */
div.serifLeft {
    display: flex;
    background-color: #ffffff4b;
    border-radius: 4rem;
    margin: 0.5rem 0;
    width: fit-content;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    align-items: center;
    padding: 0.3rem;
}
div.serifLeft + div.serifLeft {
    margin-top: 0.5rem !important; /* **前の要素が `serifLeft` だったら `margin-top` を短縮** */
}
div.serifLeft:has(+ div.serifLeft) {
    margin-bottom: 0.5rem !important; /* **後ろの要素が `serifLeft` だったら `margin-bottom` を短縮** */
}
div.serifLeft img {
    max-width: 7.5rem;
    padding-left: 0.5rem;
}
div.serifLeft p {
    margin: auto 2.5rem auto 0.5rem;
}

/* 判定の表示 */
div.jadge{
    background-color: #000000;
    border-radius: 10px;

    line-height: 3rem;
    height: 3rem;
    font-size: 1.7rem;

    padding-left: 1rem;
    padding-right:1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    
    font-weight: 700;
    color:rgb(251, 255, 39);
    width: fit-content;
}

/* 判定【成功時】の表示 */
details.success {
    margin: 0 0 0.5rem 1rem;
    width: fit-content;
    border-radius: 1rem;
}
details.success[open] {
    background-color: rgba(0, 32, 90, 0.3);
    padding: 0.5rem;
}
details.success summary {
    background: rgb(0, 32, 90);
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 700;
    border-radius: 1rem;
}
details.success[open] summary {
    margin: -0.5rem -0.5rem 0.5rem -0.5rem;
    border-radius: 1rem 1rem 0 0; /* open`時に上だけ角丸 */
}

/* 判定【失敗時】の表示 */
details.fail {
    margin: 0 0 0.5rem 1rem;
    width: fit-content;
    border-radius: 1rem;
}
details.fail[open] {
    background-color: rgba(66, 66, 66, 0.3);
    padding: 0.5rem;
}
details.fail summary {
    background: rgb(66, 66, 66);
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 700;
    border-radius: 1rem;
}
details.fail[open] summary {
    margin: -0.5rem -0.5rem 0.5rem -0.5rem;
    border-radius: 1rem 1rem 0 0; /* open`時に上だけ角丸 */
}

/* 判定【クリティカル時】の表示 */
details.critical {
    margin: 0 0 0.5rem 1rem;
    width: fit-content;
    border-radius: 1rem;
}
details.critical[open] {
    background-color: rgba(0, 0, 150, 0.3);
    padding: 0.5rem;
}
details.critical summary {
    background: rgb(28, 28, 255);
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 700;
    border-radius: 1rem;
}
details.critical[open] summary {
    margin: -0.5rem -0.5rem 0.5rem -0.5rem;
    border-radius: 1rem 1rem 0 0; /* open`時に上だけ角丸 */
}

/* 描写・セリフ例を見るのデザイン(アコーディオン) */
details.more {
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem;
    border-top: 1px solid #b6b6b6;
    border-bottom: 1px solid #b6b6b6;
    overflow: hidden; /* アニメーション時のちらつきを防ぐ */
    transition: height 0.3s ease-out;
}
details.more[open] {
    padding-bottom: 1rem;
    border-left: 0.3rem solid #75757527;
    border-right: 0.3rem solid #75757527;
    cursor: pointer;
}
details.more > summary {
    list-style: none;
    padding-left: 0.3rem;
    font-weight: 700;
    cursor: pointer;
}
details.more[open] > summary {
    margin: 0 -0.5rem 1rem -0.5rem;
    padding: 0 0 0.5rem 0.5rem;
    border-bottom: 1px solid #b6b6b6;
}
details.more > summary::before {
    content: "[＋]";
    display: inline-block;
    margin-right: 0.5rem;
}
details.more[open] > summary::before {
    content: "[ー]";
}

/* 全部開けるチェックボックス */
label#open {
    top: 60px;
    right: 10px;
    padding: 0.3rem;
    display: flex; /* フレックスボックスを使う */
    align-items: center; /* 高さを揃える */
    width: fit-content; /* テキストの幅に合わせる */
    margin: 0 1rem 0 auto;
    background-color: #000;
    font-weight: 700;
    color: white;
}
label#open p{
    display: inline-block;
    margin: 0;
    padding: 0;
}
label#open input[type="checkbox"] {
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* 次ページ遷移用の領域 */
div#next {
    margin: 5rem 0 10rem 0;
    text-align: center;
    border-top: 3px solid;
    border-bottom: 3px solid;
    border-image: linear-gradient(to right, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 70%);
    border-image-slice: 1;
}
div#next p {
    margin: 0;
    padding: 0;
    line-height: 4.5rem;
    height: 4.5rem;
    font-size: 3.0rem;
    font-weight: 900;

}

/* PLのセリフ表示 */
div.SerifPL {
    display:flex;
    background-color: #00000062;
    border-radius: 100px;
    margin: 1rem 4rem 0 0;
    padding:0.3rem 1rem 0.2rem 0.5rem;
    width: fit-content;
}
div.SerifPL span{
    background-color: rgba(0, 0, 0, 0.541);
    color:#fff;
    font-weight: 900;
    padding:0 0.5rem 0 0.5rem;
    border-radius: 100px;
    margin: auto 0.5rem auto 0;
}

div.character {
    display: flex; /*横並び*/
    align-items: center;
}

/* 広告表示 */
div.lucky {
    display: flex; /*横並び*/
    align-items: center;
}
img.lucky2 {
    margin: auto 2rem auto 0;
    max-width: 20rem;
    object-fit: contain;
    height: auto;
}

/* ラスト宣伝リンク */
div.lastLink {
    display: flex;
    justify-content: center;
    gap: 2rem;
}
div.lastLink img {
    width: 20%;
    border-radius: 5px;
    min-width: 150px;
    cursor: pointer;
}

/* 画像系 */
img.character{
    margin:auto 2rem auto 0;
    height:30rem;
    max-width: 20rem;
    object-fit: cover;
}
img.title{
    width:100%;
}

/* 画像の拡大表示周り */
img.expand{
    width:75%;
    margin: auto;
    display: block;
    cursor:  pointer;
}
.modal {
    display: none; /* デフォルトで非表示 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* 背景の半透明黒 */
    display: grid;
    place-items: center;
    visibility: hidden; /* visibilityを初期状態でhiddenに */
}
.modal.show {
    visibility: visible; /* 表示される時だけvisibleにする */
    display: grid;
}
.modal-content {
    max-width: 100%; /* 横幅を画面に合わせる */
    max-height: 100%; /* 縦幅も画面に収まるように */
    object-fit: contain; /* アスペクト比を保つ */
}
.close {
    position: absolute;
    top: 10px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* テキストエリア */
div.textarea {
    display: flex;
    flex-direction: column; /* 縦並びにする */
    align-items: center; /* 縦方向の中央揃え */
    width: 85%;
    margin: 1rem auto;
}
textarea.temp {
    width: 100%; /* 横幅いっぱい */
    height: 15rem;
    white-space: pre-wrap;
    overflow-y: auto;
    resize: vertical;
    text-indent: 0;
    margin-bottom: 0.3rem;
    display: block;
}
div.textarea-footer {
    display: flex;
    position: relative; /* **親要素を基準にする** */
    width: 100%;
    align-items: center;
}
a.temp {
    position: absolute; /* **絶対配置にする** */
    left: 50%; /* **親要素(textarea-footer)の中央に配置** */
    transform: translateX(-50%); /* **中央揃えを確実にする** */
    text-align: center;
    font-weight: 900;
}
a.temp[href=""],
a.temp[href="#"] {
    pointer-events: none; /* クリック無効化 */
    color: inherit;
}
.copyButton {
    margin-left: auto;
    border: none; /* デフォルトのボーダーを消す */
    background-color: #ffffff; /* 通常時の背景色 */
    color: rgb(0, 0, 0);
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem; /* 角を丸くする */
    border: 2px solid #c2c2c2;
    transition: background-color 0.3s, transform 0.1s;
    box-sizing: border-box;
}
.copyButton:active {
    transform: scale(0.95); /* クリック時に少し縮む */
}
.copyButton.copied {
    background-color: #838383;
    color: rgb(255, 255, 255);
    font-weight: 600;
    border: 2px solid #838383;
    box-shadow: none; /* 立体的な影をなくす */
    outline: none; /* 一部のブラウザで枠が残るのを防ぐ */
    box-sizing: border-box;
}

/* テーブル系 */
table{
    margin: 0.5rem 0;
}
table.maxWidth{
    width: 100%; /* これでテーブルが親要素の幅に合わせて広がる */
    max-width: 100%; /* 親要素の幅を超えないようにする */
    table-layout: fixed; /* 自動的に列の幅を調整する */
    border-collapse:separate;
    border-spacing: 3px;
}
table.minWidth{
    border-collapse:separate;
    border-spacing: 3px;
}

th{
    padding:0.1rem 0.7rem;
    text-align: center;
    font-weight: 900;
}
th.dark {
    background-color: rgba(0, 0, 0, 0.5); /* 少し暗く */
    color: white;
}

td{
    padding:0.1rem 0.7rem;
    text-align: center;
    font-weight: 500;
}
td.l{
    text-align: left;
    font-weight: 500;
}

tr.b{
    background-color: #000000b0;
    color: #fff;
}
tr.w{
    background-color: #ffffff83;
}
tr.y{
    background-color: #fffd8b83;
}

tr.r{
    background-color: #ff8b8b83;
}


a{
    text-decoration: none;   /*下線削除*/
}
a.current{
    background-color: #fff;
    color: #000;
}


/* 汎用li */
nav{
    width:100%;
    margin:0 auto 0 auto;
}
li.kome{
    list-style-type: "※";
    margin-left: 1.1em;
	text-indent: -1.1em;
    margin-top: 3px;
}
li.ten{
    list-style-type: "・";
    margin-left: 1.0em;
	text-indent: -1.0em;
    margin-top: 3px;
}


/* 汎用罫線 */
hr.min {
    border: none; /* デフォルトのボーダーを削除 */
    height: 2px; /* 1px だと見えにくいので 2px に調整 */
    min-height: 1px; /* 一部環境で消える問題を回避 */
    background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
}
hr.info{
	height:4px;
	border:0;
	background:linear-gradient(left, rgb(54, 54, 54), rgba(54,54,54), rgba(167,214,248,0));
	margin:0px 0px 10px 0px;
}
hr.DotW{
	border-width: 3px 0 0 0;
	border-style: dashed;
	border-color: #ffffff;
}
hr.DotB{
	border-width: 3px 0 0 0;
	border-style: dashed;
	border-color: #000000;
}
hr.Gra{
	position: relative;
	height: 3px;
	border-width: 0;
	background-image: linear-gradient(left, rgb(54, 54, 54,0),rgb(54, 54, 54,0.2), rgba(54,54,54,1),rgb(54, 54, 54,0.2), rgba(54,54,54,0));
}

/* 汎用span */
span.yellow{
    color:rgb(255, 183, 0);
}
span.yellowB{
    color:rgb(242, 255, 63);
    font-weight: 900;
}
span.gray{
    color:#4e4e4e;
}
span.white{
    color:#ffffff;
}
span.whiteB{
    color:#ffffff;
    font-weight: 900;
}
span.red{
    color:rgb(168, 0, 0);
}
span.redB{
    color:rgb(168, 0, 0);
    font-weight: 900;
}
span.B{
    font-weight: 900;
}

/* SAN値表示 */
span.san{
    display: inline-block;
    color:rgb(255, 255, 255);
    font-weight: 600;
    background-color: rgb(139, 0, 0);
    border-radius: 0.5rem;
    padding: 0 0.7rem;
    margin: 0.2rem 0;
}
span.sanR{
    display: inline-block;
    color:rgb(255, 255, 255);
    font-weight: 600;
    background-color: rgb(5, 139, 0);
    border-radius: 0.5rem;
    padding: 0 0.7rem;
    margin: 0.2rem 0;
}

/* 左側のボタン(ツイート/サイトトップ) */
.fixed-buttons {
    position: fixed;
    bottom: 50px;
    left: -60px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 10px 10px 10px;
    transition: transform 0.3s ease;
    transform: translateX(0);
    z-index: 100;
}
.fixed-buttons.hidden {
    transform: translateX(-100%);
}
.fixed-buttons.slide-in {
    transform: translateX(60px);
}
.button-image {
    width: 75px;
    height: auto;
    cursor: pointer;
    border-radius: 100%;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.6); /* 黒影を追加 */
    animation: smoothRotate 2s infinite ease-in-out; /* スムーズなアニメーションを追加 */
}
@keyframes smoothRotate {
    0% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(0deg);
    }
    40% {
        transform: rotate(4deg);
    }
    80% {
        transform: rotate(-4deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* レイアウト調整用 */
p.space{
    height: 0.5rem;
    padding: 0;
    margin: 0;
}
div.space{
    padding: 0.5rem;
    margin: 0;
}
div.besideSpace{
    padding: 0 0.5rem;
    margin: 0;
}
div.verticalSpace{
    padding: 0.5rem 0;
    margin: 0;
}

/* 各種アイコン用 */
span.icon {
    display: inline-block;
    height: 1em; /* 現状の行の高さ(フォントサイズ基準) */
    width: auto;
    aspect-ratio: 1 / 1;
    line-height: 1;
    margin: -0.2em 0.2em 0 0.2em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

@media screen and (max-width: 720px) {
    .wrapper {
     display: block;
     margin: 0;
     padding: 0;
     max-width: 100%;
     min-width: initial;
    }
    body{
        line-height: 1.6rem;
        font-size: 1.2rem;
    }
    header{
        font-size: 1.1rem;
    }
    main {
        margin: 0;
        min-width: 100%;
    }
    /* aside {
        display: none !important;
    } */
    /* 携帯表示で最下部の次章リンクの下marginがなくなるのの代わり */
    main::after {
        content: "";
        display: block;
        height: 5rem;
    }
    /* 携帯表示のセリフの改行時のインデント対応 */
    div.serifLeft .serifWrapper {
        display: flex;
        flex-direction: column;
        padding-right: 1rem;
        gap: 0;
    }
    div.serifLeft p.indent {
        text-indent: -1em; /* 2行目の行頭のみ1文字分ずらす */
        padding: 0 0 0 1em; /* 1文字分のスペースを確保 */
        display: block; /* 横並びを防ぐ */
        margin: 0; /* 余計な余白を消す */
    }
    div.jadge{
        font-size: 1.4rem;
    }
    div.character{
        flex-flow: column;
    }
    div.textarea-footer {
        transform: none;
        flex-direction:column;
        justify-content: center;
    }
    textarea{
        font-size: 1.1rem;
    }
    a.temp {
        position:relative;
        display: block;
        left:auto;
        transform: none;
    }
    .copyButton {
        margin: 0 auto;
    }
    h2{
        height:2.7rem;
        line-height:2.7rem;
        font-size:1.6rem;
    }
    h2 rt {
        display: inline; /* `rt` を通常のテキストにする */
        vertical-align: baseline; /* ベースラインに揃える */
        font-size: 0.8em;
    }
    h2 rt::before {
        content: "("; /* 括弧の開始 */
    }

    h2 rt::after {
        content: ")"; /* 括弧の終了 */
    }
    h3{
        font-size: 1.25rem;
        display: flex;
    }
    h3 span{
        display: flex !important;
        align-items: center;
    }
    h4{
        font-size: 1.2rem;
    }
    h4.line {
        position: relative;
        text-indent: -1em; /* 改行時に一文字インデント */
        padding-left: 1em;
    }
    img.lucky2 {
        max-width: 10rem;
        margin: auto 1rem auto 0;
    }

    .button-image {
        width: 60px;
        height: auto;
    }

    /* スマホ表示用のハンバーガーメニュー */
    #hamburger-menu {
        position: fixed;
        bottom: 60px; /* フッターの上 */
        right: 5px;
        width: 5rem;
        height: 5rem;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2.5rem;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        z-index: 101;
    }
    /* aside をオーバーレイ表示用に変更 */
    aside {
        position: fixed;
        top: 0;
        right: -100%; /* 最初は画面外に隠す */
        width: 100%;
        height: 100%;
        transition: right 0.2s ease-in-out;
        overflow-y: auto;
        z-index: 200;
        max-height: 100vh !important;
    }
    /* aside を表示するとき */
    aside.active {
        right: 0; /* 画面内にスライドイン */
    }
    /* aside 背景のオーバーレイ */
    #aside-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        display: none;
        z-index: 150;
    }

    /* オーバーレイがアクティブになったとき */
    #aside-overlay.active {
        display: block;
    }
}