:root {
    /* 背景色 (画像を透かすために半透明の白に設定) */
    --main-bg: rgba(255, 255, 255, 0.70);
    /* 文字色 */
    --main-text: #000000;
    /* アクセントカラー（強調部分の背景色など） */
    --accent-color: #fbbf24;
    /* 枠線の太さ */
    --border-width: 4px;
    /* Safari vh対策用CSS変数 */
    --vh: 1vh;
}

/* === 基本スタイル (Base Styles) === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: -webkit-fill-available;
    /* ▼ 背景画像設定を追加 ▼ */
    background-image: url('../assets/img/goroukaranonagame.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* 背景を固定 */
}

body {
    font-family: 'Space Mono', 'Noto Sans JP', monospace;
    background-color: var(--main-bg);
    /* 半透明の背景色を適用 */
    color: var(--main-text);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* 横スクロール防止 */
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

h1,
h2 {
    font-family: 'Archivo Black', sans-serif;
    margin: 0;
    line-height: 1;
}

h3 {
    font-family: 'Space Mono', 'Noto Sans JP', monospace;
    margin: 0;
}

/* h3のスタイル定義 */
.section-subtitle {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.section-subtitle-underline {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-decoration: underline;
}

/* h4のスタイル定義 */
h4 {
    font-family: 'Space Mono', 'Noto Sans JP', monospace;
    margin: 0;
}

.track-subtitle {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 1rem;
}

/* 上部マージンが必要な場合の追加クラス */
.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-3 {
    margin-top: 3rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* === レイアウト枠 (Container) === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .container {
        padding: 3rem;
    }
}

/* === 画面外枠の装飾 (Page Frame) === */
/* PCサイズでのみ表示される黒い外枠 */
.page-frame {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border: 10px solid #000;
    pointer-events: none;
    /* クリックを邪魔しない設定 */
    z-index: 50;
    display: none;
}

@media (min-width: 768px) {
    .page-frame {
        display: block;
    }
}

/* === ヘッダー (Header) === */
header {
    min-height: 80vh;
    min-height: calc(var(--vh, 1vh) * 80);
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: center;
    -webkit-justify-content: center;
    border-bottom: var(--border-width) solid #000;
    padding-bottom: 3rem;
    margin-bottom: 6rem;
    position: relative;
}

.header-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    font-weight: bold;
    -webkit-transform: rotate(-5deg);
    transform: rotate(-5deg);
}

.role-label {
    font-size: 1.25rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background-color: #000;
    color: #fff;
    display: inline-block;
    width: -webkit-max-content;
    width: max-content;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
    margin-top: 4rem;
    /* スマホ時のバッジとの重なり防止 */
}

@media (min-width: 768px) {
    .role-label {
        margin-top: 0;
    }
}

.main-title {
    font-size: 4rem;
    text-transform: uppercase;
    margin-bottom: 2rem;
    word-break: break-word;
    line-height: 0.8;

    /* アニメーション用：初期状態 */
    opacity: 0;
    -webkit-transform: translateY(100px);
    transform: translateY(100px);
    -webkit-transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), -webkit-transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 表示時のクラス */
.main-title.is-visible {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

@media (min-width: 768px) {
    .main-title {
        font-size: 10rem;
    }
}

.header-bottom {
    display: grid;
    display: -ms-grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    border-top: var(--border-width) solid #000;
    padding-top: 2rem;
}

@media (min-width: 768px) {
    .header-bottom {
        grid-template-columns: 1fr 1fr;
    }
}

.bio-text {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    white-space: pre-wrap;
    /* 改行コードを反映 */
}

.scroll-indicator {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
}

@media (min-width: 768px) {
    .scroll-indicator {
        justify-content: flex-end;
        -webkit-justify-content: flex-end;
    }
}

.bounce-text {
    display: inline-block;
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1.4;
    padding-bottom: 1rem;
    -webkit-animation: bounce 1s infinite;
    animation: bounce 1s infinite;
}

@-webkit-keyframes bounce {

    0%,
    100% {
        -webkit-transform: translateY(-25%);
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes bounce {

    0%,
    100% {
        -webkit-transform: translateY(-25%);
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* === 共通セクション (Sections) === */
section {
    margin-bottom: 8rem;
}

/* Organizer レイアウト */
.organizer-layout {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    gap: 2rem;
    align-items: center;
    -webkit-align-items: center;
}

@media (min-width: 768px) {
    .organizer-layout {
        flex-direction: row;
        -webkit-flex-direction: row;
        align-items: flex-start;
        -webkit-align-items: flex-start;
        gap: 3rem;
    }
}

.organizer-content {
    flex: 1;
    -webkit-flex: 1;
    text-align: center;
}

@media (min-width: 768px) {
    .organizer-content {
        text-align: left;
    }
}

.organizer-logo {
    width: 250px;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
}

@media (min-width: 768px) {
    .organizer-logo {
        width: 250px;
    }
}

.organizer-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.section-header {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    border-bottom: var(--border-width) solid #000;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 3rem;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 6rem;
    }
}

.section-number {
    font-size: 1.5rem;
    font-weight: bold;
    background-color: #000;
    color: #fff;
    padding: 0.5rem 1rem;
}

/* === ギャラリーエリア (Gallery) === */
.gallery-grid {
    display: grid;
    display: -ms-grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

.gallery-item {
    border: 4px solid #000;
    background-color: #fff;
    padding: 0.5rem;
    cursor: pointer;
    position: relative;
    box-shadow: 8px 8px 0px 0px #000;
    -webkit-transition: box-shadow 0.2s, -webkit-transform 0.2s, opacity 0.6s ease-out;
    transition: box-shadow 0.2s, transform 0.2s, opacity 0.6s ease-out;

    /* スクロール出現アニメーション初期状態 */
    opacity: 0;
    -webkit-transform: translateY(50px);
    transform: translateY(50px);
}

/* aspect-ratio フォールバック（Safari旧バージョン対応） */
.gallery-item::before {
    content: "";
    display: block;
    padding-top: 100%;
    /* 1:1 アスペクト比 */
}

/* aspect-ratio対応ブラウザ用 */
@supports (aspect-ratio: 1 / 1) {
    .gallery-item {
        aspect-ratio: 1 / 1;
    }

    .gallery-item::before {
        display: none;
    }
}

/* ホバー時の挙動 */
.gallery-item:hover {
    box-shadow: 12px 12px 0px 0px #000;
}

/* 表示済みアイテムのホバー時微調整 */
.gallery-item.is-visible:hover {
    -webkit-transform: translate(-4px, -4px) !important;
    transform: translate(-4px, -4px) !important;
}

/* 表示アニメーション発火時 */
.gallery-item.is-visible {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

.gallery-image {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: calc(100% - 1rem);
    height: calc(100% - 1rem);
    -o-object-fit: cover;
    object-fit: cover;
    border: 2px solid #000;
    display: block;
    -webkit-transition: -webkit-filter 0.3s;
    transition: filter 0.3s;
}

.gallery-item:hover .gallery-image {
    -webkit-filter: grayscale(100%) contrast(120%);
    filter: grayscale(100%) contrast(120%);
}

.gallery-overlay-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    mix-blend-mode: multiply;
    opacity: 0;
    -webkit-transition: opacity 0.3s;
    transition: opacity 0.3s;
    pointer-events: none;
}

.gallery-overlay-text {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    opacity: 0;
    -webkit-transition: opacity 0.3s;
    transition: opacity 0.3s;
    z-index: 10;
}

.gallery-item:hover .gallery-overlay-bg,
.gallery-item:hover .gallery-overlay-text {
    opacity: 1;
}

.gallery-text {
    font-family: 'Archivo Black', sans-serif;
    font-size: 2.25rem;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    color: #ffffff;
    text-align: center;
    text-shadow: 2px 2px 0px #000;
}

/* === 自由テキストエリア (Free Text Section) === */
.free-text-body {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 900px;
    /* 読みやすい幅 */
    /* 必要であれば枠線など追加しても良いが、シンプルに文字のみとする */
}

/* === リンク・コンタクト (Contact) === */
.contact-section {
    border: 4px solid #000;
    padding: 2rem;
    background-color: var(--accent-color);
    text-align: center;
}

@media (min-width: 768px) {
    .contact-section {
        padding: 4rem;
    }
}

.contact-title {
    font-size: 1.75rem;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .contact-title {
        font-size: 3rem;
    }
}

.links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    align-items: center;
    -webkit-align-items: center;
    gap: 1rem;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .links-list {
        flex-direction: row;
        -webkit-flex-direction: row;
        justify-content: center;
        -webkit-justify-content: center;
        gap: 3rem;
    }
}

.link-button {
    display: inline-block;
    background-color: #fff;
    color: #000;
    border: 4px solid #000;
    padding: 1.5rem 2.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 8px 8px 0 0 #000;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    width: 100%;
    max-width: 400px;
}

@media (min-width: 768px) {
    .link-button {
        width: auto;
        min-width: 280px;
    }
}

.link-button:hover {
    background-color: var(--accent-color);
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 0 #000;
}

.register-area {
    margin-top: 3rem;
    border: 4px solid #000;
    padding: 2rem;
    background-color: var(--accent-color);
    text-align: center;
}


/* === フッター (Footer) === */
footer {
    text-align: center;
    font-weight: bold;
    font-size: 0.875rem;
    text-transform: uppercase;
    padding-bottom: 2rem;
}

/* === 画像拡大モーダル (Modal) === */
.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.9);

    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    padding: 1rem;

    visibility: hidden;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    max-width: 100%;
    max-height: 90vh;
    max-height: calc(var(--vh, 1vh) * 90);
    border: 4px solid #fff;
    box-shadow: 10px 10px 0 0 rgba(255, 255, 255, 0.5);

    -webkit-transform: scale(0.8);
    transform: scale(0.8);
    -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    -webkit-transform: scale(1);
    transform: scale(1);
}

/* === 審査&支援メンバー 4カラムレイアウト === */
.judges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.judge-card {
    border: 4px solid #000;
    background: #fff;
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.judge-card:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 0 0 #000;
}

.judge-photo {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background-color: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid #000;
}

.judge-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.judge-info {
    padding: 1.5rem;
}

.judge-name {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #000;
}

.judge-role {
    font-size: 0.95rem;
    font-weight: 700;
    color: #666;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.judge-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* タブレット対応: 2カラム */
@media (max-width: 1024px) {
    .judges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* モバイル対応: 1カラム */
@media (max-width: 640px) {
    .judges-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .judge-photo {
        height: 250px;
    }
}