hr {
    border: 0;
    /* デフォルトのボーダーを無効に */
    border-top: 2px solid var(--accent-color);
    /* 上部に太い線を追加 */
    margin: 20px 0;
    /* 上下にマージンを追加 */
}

/* パンくず */
.breadcrumb {
    font-size: 14px;
    margin-bottom: 1em;
    color: var(--main-text-color);
}

.breadcrumb a {
    text-decoration: underline;
    color: var(--main-text-color);
}

.breadcrumb span {
    color: var(--main-text-color);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* タブのスタイル */
.tabs {
    display: flex;
    border-bottom: 2px solid #ccc;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: var(--main-bg-color);
    border: 1px solid #ccc;
    border-bottom: none;
    color: var(--main-text-color);
}

.tab.active {
    background-color: var(--secondary-bg-color);
    font-weight: bold;
    color: var(--secondary-text-color);
}

.tab-container {
    display: none;
}

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

/* スレッド一覧のスタイル */
/* スレッドリスト */
.index-thread-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 各スレッド項目 */
.index-thread-item {
    display: flex;
    background-color: var(--main-bg-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    align-items: center;
    /* 中央揃え */
    gap: 15px;
    /* 項目間に間隔を追加 */
    border: 1px solid var(--accent-color);
    position: relative;
    /* カテゴリを枠上に表示するために相対位置にする */
}

.index-thread-item a {
    display: block;
    /* リストアイテム全体をリンクとして表示 */
    width: 100%;
    /* リストアイテム全体をリンク対象に */
    color: inherit;
    /* リンクの色を親要素に合わせる */
    text-decoration: none;
    /* リンク下線を消す */
}

.index-thread-item:hover {
    background-color: var(--accent-color);
}

.index-thread-item:hover h2 a {
    color: white;
}


/* カテゴリ */
.index-thread-category {
    font-weight: bold;
    color: var(--accent-color);
    position: absolute;
    /* 絶対位置 */
    top: -10px;
    /* 枠の上に配置 */
    right: 15px;
    /* 左から10px */
    background-color: var(--main-bg-color);
    /* 背景色をアイテムの背景色に合わせる */
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    /* 枠線を追加 */
    font-size: 0.9em;
}

.index-thread-expirydate {
    font-weight: bold;
    color: var(--accent-color);
    position: absolute;
    /* 絶対位置 */
    top: -10px;
    /* 枠の上に配置 */
    left: 15px;
    /* 左から10px */
    background-color: var(--main-bg-color);
    /* 背景色をアイテムの背景色に合わせる */
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    /* 枠線を追加 */
    font-size: 0.9em;
}


/* 画像 */
/* 親に固定サイズを与える */
.index-thread-image {
    max-width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
}

/* 画像を枠にフィットさせる */
.index-thread-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}


/* タイトルと本文 */
.index-thread-info {
    flex-grow: 1;
    /* 残りのスペースを使って広げる */
}

.index-thread-info h2 {
    margin: 0;
    font-size: 1.2em;
    color: var(--main-text-color);
}

@media only screen and (max-width: 768px) {
    .index-thread-info {
        font-size: 1.5rem;
    }
}

.index-thread-info h2 a {
    text-decoration: none;
    color: var(--accent-color);
}

.index-thread-info h2 a:hover {
    text-decoration: underline;
}

.index-thread-content {
    margin: 10px 0;
    color: var(--third-text-color);
    font-size: 1em;
}

/* 投稿日時のスタイル */
.index-thread-info small {
    font-size: 0.9em;
    color: var(--third-text-color);
}

.index-thread-link.expired {
    opacity: 0.5;
}

.thread-info {
    margin-bottom: 2em;
    padding: 1em;
    background-color: var(--main-bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: var(--main-text-color);
}

.thread-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0.5em;
    color: var(--main-text-color);
    border-left: 5px solid var(--accent-color);
    padding-left: 0.5em;
}

.thread-content h3 {
    font-size: 16px;
    margin-bottom: 0.5em;
    color: var(--accent-color);
}


.thread-content {
    background: var(--secondary-bg-color);
    color: var(--secondary-text-color);
    padding: 1em;
    border-radius: 6px;
    border: 1px solid var(--third-bg-color);
    line-height: 1.6;
}

@media only screen and (max-width: 768px) {
    .thread-content {
        font-size: 1.5rem;
    }
}


.baseinput {
    width: 150px;
    height: 30px;
    color: black;
    background: lightgray;
    border: none
}

/* プレイヤー名入力フォーム */
.entry-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 16px;
    max-width: 600px;
    margin: 1em auto;
    background: var(--main-bg-color);
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--accent-color);
}

@media only screen and (max-width: 768px) {
    .entry-grid {
        font-size: 1.5rem;
    }

    .comment-list {
        font-size: 1.5rem;
    }
}

.entry-label {
    font-weight: bold;
    text-align: center;
    color: var(--main-text-color);
    padding: 6px 0;
    border-bottom: 2px solid var(--accent-color);
}

#player_count {
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid var(--third-bg-color);
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
}

#players input.player_name {
    width: 100%;
    padding: 5px;
    font-size: 16px;
    border: 1px solid var(--third-bg-color);
    border-radius: 6px;
    box-sizing: border-box;
}

/* コメント表示 */
.comment-list {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

.comment-item {
    background-color: var(--main-bg-color);
    padding: 15px;
    border-bottom: 1px dotted var(--third-bg-color);
    margin: 10px 0;
    transition: all 0.3s ease;
}

.comment-media {
    max-width: 30%;
    height: auto;
    display: block;
    margin-top: 10px;
    border-radius: 8px;
}

@media only screen and (max-width: 768px) {
    .comment-media {
        max-width: 60%;
    }
}

.delete-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.delete-link:hover {
    text-decoration: underline;
}

/* トーナメント表 */

.freecontainer {
    position: relative;
    width: auto;
    margin: 0 auto;
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

select,
button {
    font-size: 16px;
}

.tournament {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.round {
    display: grid;
    position: relative;
    gap: 10px;
}

.match {
    width: 100px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: auto 0;
}

.hidden {
    visibility: hidden;
}

input,
select {
    width: 100%;
    height: 100%;
    font-size: 14px;
    text-align: center;
    color: black;
    margin-right: 0px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.player_name {
    height: auto;
    width: 100%;
    max-width: 150px;
    font-size: 16px;
    color: black;
}

svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2000px;
    pointer-events: none;
}

line {
    stroke: #333;
    stroke-width: 2;
}

line.active {
    stroke: red;
    stroke-width: 3;
}


.bye-label {
    position: absolute;
    font-size: 10px;
    color: white;
    pointer-events: none;
}

.bye {
    background-color: #999;
    color: #999;
    pointer-events: none;
    border: 1px solid #ccc;
    opacity: 1 !important;
}



@media only screen and (max-width: 768px) {
    .freecontainer {
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        padding-bottom: 20px;
    }


    .match {
        width: 80px;
        height: 26px;
    }

    input,
    select {
        font-size: 12px;
        padding: 2px;
    }

    svg {
        min-width: 500px;
    }
}

/* 総当たり表 */
.league-table {
    border-collapse: collapse;
    margin: 20px auto;
    width: 100%;
    table-layout: fixed;
    font-size: clamp(10px, 2.5vw, 14px); /* 画面に応じて文字縮小 */
}

.league-table th,
.league-table td {
    border: 1px solid #ccc;
    padding: 0.4em;
    text-align: center;
    height: 48px;
    font-size: inherit;
    word-break: break-word;
    white-space: normal; /* 折り返し有効に */
    line-height: 1.2;
}

.league-table th {
    background-color: #f7f7f7;
    font-weight: bold;
}

.league-cell {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.league-cell:hover {
    background-color: #eef;
}


/* challenger（挑戦者求ム）*/
.challenger_card {
    display: flex;
    background-color: var(--main-bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
    color: var(--main-text-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    gap: 20px;
    position: relative;
    /* 作成日時を右上に配置するために親要素を相対位置に */
}

/* 左：画像 */
.challenger_image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.challenger_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 右：テキスト情報全体 */
.challenger_text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 各情報ブロックの調整 */
.challenger_header_info,
.challenger_bottom_info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 10px;
}

/* ラベル付きの情報項目 */
.challenger_item {
    margin-bottom: 6px;
}

.challenger_label {
    font-weight: bold;
    color: var(--accent-color);
    margin-right: 6px;
}

.challenger_content {
    margin: 4px 0 0 0;
    color: var(--third-text-color);
    white-space: pre-wrap;
}

/* 作成日時を右上に配置 */
.challenger_created_at {
    position: absolute;
    top: -10px;
    right: 16px;
    font-size: 0.9em;
    color: var(--third-text-color);
    background-color: var(--main-bg-color);
    border: 1px solid var(--accent-color);
    padding: 3px;
}

@media screen and (max-width: 600px) {
    .challenger_card {
        font-size: 1.5rem;
    }
}

.copy-button {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
}

.copy-button:hover {
    background-color: var(--main-bg-color);
    color: var(--main-text-color);
    border: 1px solid var(--accent-color);
}


/* 画像UI */
.file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    text-align: center;
    width: 200px;
    transition: all 0.3s;
}

.file-upload:hover {
    background-color: #f0f0f0;
}

.file-upload i {
    font-size: 24px;
    color: #555;
}

.file-upload span {
    font-size: 14px;
    color: #555;
}

#fileInput {
    display: none;
}

.a-button {
    border: 1px solid var(--accent-color);
    padding: 5px 10px;
    background-color: var(--accent-color);
    border-radius: 5px;
    font-weight: bold;
    color: white;
    position: absolute;
    bottom: -10px;
    right: 15px;
    font-size: 0.9em;
}

/* recaptchaスタイル */
.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* SNS */
.x-share-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 4px;
    z-index: 400;
    background-color: #fff;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 600px) {
    .x-share-fixed {
        bottom: 90px;
    }
}

.x-share-fixed img {
    width: 25px;
    height: auto;
    vertical-align: middle;
}

/* スイッチボタン */
.switch-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 1em;
}

.switch-buttons label {
    flex: 1;
    text-align: center;
    background: #e0e0e0;
    cursor: pointer;
    border: 1px solid #ccc;
    font-weight: bold;
}

.switch-buttons input[type="radio"] {
    display: none;
}

.switch-buttons input[type="radio"]:checked+a {
    background: var(--accent-color);
    color: #fff;
}

.switch-buttons a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    color: #333;
    transition: 0.3s;
}

