:root {
    /* チェス盤 */
    --color-board-light: #f0d9b5;
    --color-board-dark: #b58863;

    /* ブランドカラー */
    --color-white: #fffeff;

    --color-blue-light: #c8ece6;
    --color-blue: #67bbcb;
    --color-blue-dark: #4c6895;

    --color-orange-light: #f3ae72;
    --color-orange: #e98613;

    --color-pink: #fff0ef;
    --color-red: #e28165;
    --color-red-dark: #dc6661;

    --color-yellow: #ffd572;

    /* 現在未使用 */
    --color-green-light: #8c9f64;
    --color-green: #728f2f;

    --color-beige-bright: #f3ebe2;
    --color-beige-light: #eedcc7;
    --color-beige-medium: #c1a46d;
    --color-beige-dark: #6b5833;
    --color-beige-deep: #3e2d1d;

    --color-gray: #afbdbe;

    /* 丸みのある書体(ロゴ・タグライン・トップの紹介の見出しだけ。base.html で読み込むのは太さ700だけ) */
    --font-rounded: "M PLUS Rounded 1c", "Meiryo", sans-serif;
}

/* --------------- */
/* 全体            */
/* --------------- */
html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Noto Sans JP", "Meiryo", sans-serif;
    background: var(--color-white);
    color: var(--color-beige-deep);
}

/* button/input/textarea/selectはブラウザ標準スタイルシートで独自フォントが
   指定されており、bodyのfont-familyを自動では継承しないため明示的に継承させる */
button,
input,
textarea,
select {
    font-family: inherit;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}


/* --------------- */
/* header          */
/* --------------- */
.site-header {
    position: relative;
    text-align: center;
    padding: 16px;
    background: var(--color-beige-light);
}

.site-header h1 {
    margin-bottom: 0;
    font-size: 1.8rem;
    /* M PLUS Rounded 1c は既定(normal)の行の高さが大きく、タグラインとの間が空くため詰める */
    line-height: 1.1;
    font-family: var(--font-rounded);
    font-weight: bold;
}

.site-header h1 a {
    text-decoration: none;
    color: var(--color-beige-dark);
}

.site-tagline {
    margin: 0 0 8px;
    font-family: var(--font-rounded);
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--color-orange);
}

/* 見出しはメニューの下にある(2026-10-22)。上の 12px はメニューとの間 */
.site-header h2 {
    margin: 24px auto 0;
    color: var(--color-beige-dark);
    font-size: 1.2rem;
}

.site-header h2 a {
    text-decoration: none;
}

/* --------------- */
/* Footer          */
/* --------------- */
.site-footer {
    position: static;
    text-align: center;
    padding: 16px;
    background: var(--color-beige-light);
    font-size: 0.8rem;
}

.site-footer p {
    color: var(--color-beige-dark);
}

/* --------------- */
/* Contents        */
/* --------------- */
.content {
    width: min(80vw, 480px);
    flex: 1;
    margin: 24px auto;
    padding: 0 16px;
}

.lead {
    font-size: 0.9rem;
    margin-bottom: 16px;
}



/* --------------- */
/* margin            */
/* --------------- */
.margin-bottom-0 {
    margin-bottom: 0;
}

/* --------------- */
/* Form            */
/* --------------- */
.input-form {
    margin: 10px auto;
}

.input-form input,
.input-form textarea {
    width: 100%;
    padding: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.login-checkbox {
    width: fit-content;
    margin: 5px auto 15px;
}

.alert-message {
    font-size: 0.8rem;
    color: var(--color-red-dark);
}

input,
textarea,
select {
    border: 1px solid var(--color-beige-medium);
    border-radius: 6px;
    background-color: var(--color-white);
    color: var(--color-beige-deep)
}

input::placeholder,
textarea::placeholder {
    color: var(--color-beige-medium);
}

input:focus,
textarea:focus {
    outline: none;
    border: 2px solid var(--color-beige-dark);
}

input:disabled,
select:disabled {
    color: var(--color-gray);
}

/* --------------- */
/* div             */
/* --------------- */
/* 縦並び */
.column-div {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 横並び */
.row-div {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 2px;
}

/* --------------- */
/* Text            */
/* --------------- */
.orange-text {
    color: var(--color-orange);
}

.dark-blue-text {
    color: var(--color-blue-dark);
}

.red-text {
    color: var(--color-red-dark);
}

.text-medium {
    font-size: 0.85rem;
}

.text-small {
    font-size: 0.7rem;
}

.bold-text {
    font-weight: bold;
}

.label-end {
    text-align: end;
}

/* --------------- */
/* Link            */
/* --------------- */
.blue-link {
    color: var(--color-blue-dark);
    text-decoration: none;
    white-space: nowrap;
}

.red-link {
    color: var(--color-red);
    text-decoration: none;
    white-space: nowrap;
    font-weight: bold;
}


/* --------------- */
/* Buttons　　　　  */
/* --------------- */

.no-deco-btn {
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
    cursor: pointer;
}

.submit-btn {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    background: transparent;
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.submit-btn.blue {
    background: var(--color-blue);
}

.submit-btn.orange {
    background: var(--color-orange);
}

.submit-btn.gray {
    background: var(--color-gray);
}

.submit-btn.red {
    background: var(--color-red-dark);
}

/* --------------- */
/* Brand Icon Buttons     */
/* --------------- */
.brand-icon-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.brand-icon-btn {
    padding: 10px;
    width: 8px;
    height: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.brand-icon-btn i {
    font-size: 22px;
    color: var(--color-white);
}

/* 未使用 */
.brand-icon-btn.google {
    background: transparent;
}

.brand-icon-btn.google i {
    color: var(--color-red);
    ;
}

/* 使用中 */
.brand-icon-btn.x {
    background: #000;
}

.brand-icon-btn.facebook {
    background: #1877f2;
}

.brand-icon-btn.whatsapp {
    background: #06c755;
}

.brand-icon-btn.line {
    background: #06c755;
}


/* --------------- */
/* Messages　      */
/* --------------- */
#message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
}

.message {
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 16px;
    text-align: center;

    opacity: 1;
    transition: opacity 0.5s ease;
}

.message.success,
.message.info {
    background: var(--color-blue);
    color: var(--color-white);
    border: none;
}

.message.error {
    background: var(--color-pink);
    color: var(--color-red-dark);
    border: none;
}

.message.warning {
    background: var(--color-yellow);
    color: var(--color-beige-dark);
    border: none;
}

.message.fade-out {
    opacity: 0;
}


/* --------------- */
/* Table           */
/* --------------- */

table {
    font-size: 0.9rem;
    text-align: center;
    width: min(80%, 300px);
    margin: 20px auto;
    /* 1. 重ね合わせを解除し、隙間を0にする */
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--color-beige-dark);
    /* theadにつけるのでtopは消す */
    border-top: none;
    border-radius: 6px;
}

table thead th {
    background-color: var(--color-beige-light);
    border-top: 1px solid var(--color-beige-dark);
    border-bottom: 1px solid var(--color-beige-dark);
}

table th,
table td {
    padding: 4px;
}

table th:first-child {
    border-right: 1px solid var(--color-beige-dark);
}

/* 表の角丸(2026-10-21)。表の外枠(border-radius: 6px)だけでは、見出しのセルの背景色と上の線が
   角を四角く隠すので、四隅のセルも外枠の線1px分を引いた 5px で丸める。
   border-collapse: collapse の表には border-radius が効かないので、表は separate にしておくこと。
   :has() を使う規則は別に分ける(:has() に未対応のブラウザは、それを含む規則を丸ごと捨てるため) */
table>thead>tr:first-child> :first-child {
    border-top-left-radius: 5px;
}

table>thead>tr:first-child> :last-child {
    border-top-right-radius: 5px;
}

table> :is(tbody, tfoot):last-child>tr:last-child> :first-child {
    border-bottom-left-radius: 5px;
}

table> :is(tbody, tfoot):last-child>tr:last-child> :last-child {
    border-bottom-right-radius: 5px;
}

/* 見出しの無い表(ブログ本文の表など)の上の角 */
table:not(:has(> thead))>tbody:first-of-type>tr:first-child> :first-child {
    border-top-left-radius: 5px;
}

table:not(:has(> thead))>tbody:first-of-type>tr:first-child> :last-child {
    border-top-right-radius: 5px;
}

/* 行が1つも無い表(始めたばかりの対局の棋譜など)は、見出しの最後の行が下の角になる */
table:not(:has(> tbody > tr))>thead>tr:last-child> :first-child {
    border-bottom-left-radius: 5px;
}

table:not(:has(> tbody > tr))>thead>tr:last-child> :last-child {
    border-bottom-right-radius: 5px;
}

table td:first-child {
    border-right: 1px solid var(--color-beige-dark);
}

.border-right {
    border-right: 1px solid var(--color-beige-dark);
}

.border-top {
    border-top: 1px solid var(--color-beige-dark);
}

/* --------------- */
/* Tab          */
/* --------------- */
.tab-menu {
    display: flex;
    justify-content: center;
}

.tab-btn {
    width: 50%;
    padding: 10px 20px;
    border: 1px solid var(--color-beige-bright);
    background: var(--color-beige-bright);
    cursor: pointer;
    font-size: 16px;
}

.tab-btn.active {
    border: 1px solid var(--color-orange);
    background: var(--color-orange);
    color: var(--color-white);
}

.tab-btn.blue.active {
    border: 1px solid var(--color-beige-deep);
    background: var(--color-beige-deep);
    color: var(--color-white);
}

.tab-content {
    display: none;
    border-style: solid;
    border-width: 1px;
}

.tab-content.active {
    display: block;
}

/* --------------- */
/* Scroll          */
/* --------------- */
.scroll-y {
    overflow-x: hidden;
    overflow-y: auto;
}

.scroll-x {
    overflow-x: auto;
    overflow-y: hidden;
}

.scroll-xy {
    overflow-x: auto;
    overflow-y: auto;
}

.scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.scroll::-webkit-scrollbar-track {
    background-color: var(--color-beige-bright);
    border-radius: 100px;
}

.scroll::-webkit-scrollbar-thumb {
    background-color: var(--color-orange-light);
    border-radius: 100px;
}


/* --------------- */
/* Toggle Button   */
/* --------------- */
.toggle-button {
    display: inline-block;
    position: relative;
    width: 50px;
    height: 25px;
    border-radius: 50px;
    border: 2px solid var(--color-beige-light);
    box-sizing: content-box;
    cursor: pointer;
}

.toggle-button:has(:checked) {
    border-color: var(--color-orange-light);
    background-color: var(--color-pink);
}

.toggle-button::after {
    position: absolute;
    top: 25%;
    left: 3px;
    transform: translateY(-21%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--color-beige-light);
    content: '';
}

.toggle-button:has(:checked)::after {
    left: 25px;
    background-color: var(--color-orange);
}

.toggle-button input {
    display: none;
}


/* --------------- */
/* Tool Tip        */
/* --------------- */
.tooltip-container {
    position: relative;
}

.tooltip-text {
    visibility: hidden;
    width: 150px;
    background-color: var(--color-blue-dark);
    color: var(--color-white);
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    bottom: 110%;
    /* 要素の上に表示 */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

/* マウスのある端末だけ。タッチ端末ではタップで:hoverが残り説明が消えなくなるため、
   game-menuのinfo-btn(btn_info.js)で表示する */
@media (hover: hover) {
    .tooltip-container:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
}


/* ---------------- */
/* Read More Button */
/* ---------------- */
.readmore-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--color-red-dark);
}

.readmore-arrow {
    display: inline-block;
    transition: transform 0.2s;
}