/* assets/css/style.css */
/* VALORANT フルパトロールガチャ スタイルシート */

/* --- 基本設定とフォント --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');
/* VALORANTのフォント 'Tungsten' はライセンスが必要なため、代替フォントを使用します */
@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

:root {
    --valorant-red: #FF4655;
    --valorant-dark-navy: #0F1923;
    --background-light: #ECE8E1;
    --background-white: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #f9f9f9;
    --accent-blue: #3BCCF4;
    --rarity-normal: #6c757d;
    --rarity-rare: #0dcaf0;
    --rarity-super-rare: #6f42c1;
    --rarity-ultra-rare: #fd7e14;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-header: 'Anton', sans-serif;
}

body {
    font-family: var(--font-jp);
    background-color: var(--valorant-dark-navy);
    color: var(--text-secondary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    text-align: center;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

/* result.htmlでのみコンテナ幅を広げる */
body.result-page .container {
    max-width: 1280px;
}

/* result.htmlのヘッダーコンテナの下パディングを0に */
body.result-page header .container,
body.index-page header .container {
    padding-bottom: 0;
}

/* result.htmlのフッターコンテナの上パディングを削除 */
body.result-page footer .container {
    padding-top: 0;
}

/* index.htmlのmy-5の上マージンを調整 */
body.index-page .my-5 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

main.container {
    flex: 1; /* フッターを一番下に押しやる */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* main内のスクロールを禁止 */
    padding-top: 0;
    padding-bottom: 0;
}

#result-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-top: 0; /* 余白を0に */
    padding-bottom: 0; /* 余白を0に */
}

#result-title {
    margin: 0.5rem 0; /* 上下のマージンを最小限に */
}

#player-cards-container {
    flex: 1;
    overflow-x: auto; /* 横スクロールを許可 */
    overflow-y: hidden;
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start; /* 左寄せにする */
    align-items: center;
    padding: 1.5rem 1.5rem 0; /* 下パディングを削除 */
}

#result-actions {
    margin-top: 0.5rem; /* ボタンの上のマージンを詰める */
    padding: 1.5rem 0; /* 上下のパディングを追加 */
}

/* --- ヘッダーとフッター --- */
header, footer {
    background-color: rgba(15, 25, 35, 0.8);
    padding: 1rem 0;
    width: 100%;
}

header .container {
    padding-top: 0;
}

header h1 {
    font-family: var(--font-header);
    color: var(--valorant-red);
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
}

footer {
    margin-top: auto;
    font-size: 0.9rem;
}

/* フッターの上下パディングを0にする */
footer.py-3 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* --- ボタン --- */
.btn-valorant {
    background-color: var(--valorant-red);
    color: var(--background-white);
    border: none;
    padding: 0.8rem 2rem;
    font-family: var(--font-header);
    text-transform: uppercase;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
}

.btn-valorant.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    clip-path: polygon(8% 0%, 100% 0%, 92% 100%, 0% 100%);
}

.btn-valorant.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--valorant-red);
    color: var(--valorant-red);
    clip-path: none;
}

.btn-valorant:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 70, 85, 0.4);
    color: var(--background-white);
}

.btn-valorant.btn-secondary:hover {
    background-color: var(--valorant-red);
    color: var(--background-white);
}

.btn-valorant:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- フォーム要素 --- */
.form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--valorant-red);
    color: var(--text-secondary);
    border-radius: 0;
}
.form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(59, 204, 244, 0.5);
    color: var(--text-secondary);
}

/* --- Player Name Input (name_input.html) --- */
#playerInputs {
    max-width: 600px;
    margin: 0 auto;
}

.options-toggle-section {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

#optionsToggleBtn {
    min-width: 180px;
    position: relative;
}

#optionsToggleIcon {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

#optionsToggleBtn.expanded #optionsToggleIcon {
    transform: rotate(180deg);
}

.options-container {
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    max-height: 0;
}

.options-container.show {
    opacity: 1;
    max-height: 1000px;
}

.rarity-filter-section,
.bind-count-section {
    max-width: 600px;
    margin: 0 auto 2rem auto;
    background-color: rgba(15, 25, 35, 0.7);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 1.5rem;
}

.filter-title {
    font-family: var(--font-jp);
    color: var(--accent-blue);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.filter-options,
.count-options {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.filter-option,
.count-option {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.filter-option input[type="radio"],
.count-option input[type="radio"] {
    display: none;
}

.filter-option label,
.count-option label {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-jp);
    font-weight: 500;
    text-align: center;
    min-width: 120px;
}

.count-option label {
    min-width: 80px;
}

.filter-option label:hover,
.count-option label:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--valorant-red);
}

.filter-option input[type="radio"]:checked + label,
.count-option input[type="radio"]:checked + label {
    background-color: var(--valorant-red);
    border-color: var(--valorant-red);
    color: white;
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.5);
}

@media (max-width: 576px) {
    .filter-options,
    .count-options {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-option label,
    .count-option label {
        width: 100%;
        max-width: 200px;
    }
}

.player-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(15, 25, 35, 0.7);
    border: 1px solid #444;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.player-input-wrapper:not(:last-child) {
    margin-bottom: 1rem !important;
}

.player-input-wrapper:focus-within {
    border-color: var(--valorant-red);
    box-shadow: 0 0 15px rgba(255, 70, 85, 0.3);
}

.player-input-label {
    display: flex;
    align-items: baseline;
    padding: 0 1rem;
    border-right: 1px solid #444;
}

.player-number {
    font-family: var(--font-header);
    font-size: 1.8rem;
    color: var(--valorant-red);
    line-height: 1;
    margin-right: 0.5rem;
}

.player-label-text {
    font-size: 0.8rem;
    color: #a0a0a0;
    font-weight: bold;
    text-transform: uppercase;
}

.player-input-wrapper .form-control {
    background-color: transparent;
    border: none;
    flex-grow: 1;
    padding: 1rem;
    font-size: 1.1rem;
}

.player-input-wrapper .form-control:focus {
    box-shadow: none;
}


/* --- プレイヤーカード --- */
.player-card {
    background-color: var(--valorant-dark-navy);
    border: 1px solid var(--valorant-red);
    padding: 1.5rem; /* パディングを増やして内側の余白を確保 */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: calc((100% - 6rem) / 5); /* (コンテナ幅 - gap合計) / カード数 */
    height: 400px; /* 固定高さに変更 */
    opacity: 0;
    overflow: hidden; /* オーバーフローを隠す */
    /* transition: opacity 1s ease-out, transform 1s ease-out; */ /* 古いアニメーションはコメントアウト */
}

/* 3Dアニメーションのためのキーフレーム */
@keyframes card-intro-animation {
    from {
        opacity: 0;
        transform: perspective(1000px) rotateY(-60deg) scale(0.8) translateX(-100px);
    }
    to {
        opacity: 1;
        transform: perspective(1000px) rotateY(0) scale(1) translateX(0);
    }
}

.player-card.visible {
    opacity: 1;
    transform: none; /* アニメーション後はtransformをリセット */
    animation: card-intro-animation 1s ease-out forwards;
}

/* スクリーンショット撮影時にアニメーションを無効化するヘルパークラス */
.player-card.no-animation {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.agent-image {
    width: 100px; /* 少し大きく */
    height: 100px; /* 少し大きく */
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--valorant-red);
    margin-bottom: 1rem; /* 下の余白を調整 */
}

.player-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 上下に要素を配置 */
    width: 100%;
}

.player-info h3 {
    font-family: var(--font-jp); /* フォントをNoto Sans JPに統一 */
    color: var(--accent-blue);
    margin: 0.5rem 0;
    font-size: 1.4rem;
    word-break: break-word;
    /* 長い名前を「...」で省略するためのスタイル */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* 省略を正しく機能させるために幅を指定 */
}

.player-info .agent-name-container {
    /* このコンテナはエージェント名を囲むために追加 */
}

.player-info .agent-name {
    font-weight: bold;
    font-size: 1.1rem; /* 少し大きくしてバランスをとる */
}
.player-info .agent-role {
    display: none; /* ロールを非表示に */
}

/* --- 縛りプレイ & レア度 --- */
.bind-play-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--valorant-red);
    word-break: break-word; /* 縛り内容も折り返すように */
    height: 7.8em; /* 高さを30%増加 (6em × 1.3) */
    max-height: 7.8em; /* 最大高さも制限 */
    overflow: hidden; /* オーバーフローを隠す */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.bind-play-text {
    font-size: 1rem;
    line-height: 1.4;
    margin-top: 0.4rem;
    transition: font-size 0.2s ease;
}

/* 文字サイズ調整用のクラス */
.bind-play-text.text-small {
    font-size: 0.85rem;
    line-height: 1.2;
}

.bind-play-text.text-smaller {
    font-size: 0.75rem;
    line-height: 1.1;
}

.rarity-badge {
    display: inline-block;
    padding: 0.3em 0.6em;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    border-radius: 4px;
    margin-right: 0.5em;
}

.rarity-ノーマル { background-color: var(--rarity-normal); }
.rarity-レア { background-color: var(--rarity-rare); }
.rarity-スーパーレア { background-color: var(--rarity-super-rare); }
.rarity-ウルトラレア { background-color: var(--rarity-ultra-rare); }
.rarity-ウルトラレア {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(253, 126, 20, 0); }
    100% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0); }
}

/* --- 管理画面スタイル --- */
#admin-login, #admin-dashboard {
    background-color: #fff;
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 8px;
}

/* 管理画面のフォーム要素の文字色を修正 */
#admin-login .form-control,
#admin-dashboard .form-control {
    color: var(--text-primary) !important;
}

#admin-login .form-control:focus,
#admin-dashboard .form-control:focus {
    color: var(--text-primary) !important;
}

#admin-dashboard table {
    color: var(--text-primary);
}

/* --- 排出トロール一覧ページ --- */
.troll-list-header {
    text-align: left;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--valorant-red);
    padding-bottom: 0.5rem;
}

.troll-list-group .list-group-item {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* --- レスポンシブ --- */
@media (max-width: 1200px) {
    .player-card {
        flex-basis: calc(33.33% - 1rem);
    }
}

@media (max-width: 768px) {
    #player-cards-container {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: center;
        overflow-y: auto; /* スマホでは縦スクロールを許可 */
        padding-right: 15px;
    }
    .player-card {
        flex-basis: auto;
        width: 80%; /* スマホでは画面幅の80% */
        max-width: 300px;
        aspect-ratio: 89 / 51; /* 横長に戻す */
        flex-direction: row; /* 横並びに戻す */
        text-align: left;
    }
    .agent-image {
        width: 100px;
        height: 100px;
    }
    .player-info .agent-name {
        font-size: 1rem;
    }
}

/* --- 縛りプレイ案募集ページ (submission-page) --- */
.submission-page .container {
    max-width: 800px;
}

.submission-container {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.submission-card {
    background-color: rgba(15, 25, 35, 0.9);
    border: 1px solid var(--valorant-red);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.submission-card .card-header {
    background-color: var(--valorant-red);
    padding: 1.5rem;
    text-align: center;
}

.submission-card .card-title {
    font-family: var(--font-header);
    color: white;
    font-size: 2rem;
    margin: 0;
    text-transform: uppercase;
}

.submission-card .card-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 0.25rem 0 0;
    font-size: 1rem;
}

.submission-card .card-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: bold;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
    text-align: left;
}

.form-label .required,
.form-label .optional {
    font-size: 0.9rem;
    font-weight: normal;
}

.form-label .required {
    color: var(--valorant-red);
}

.form-label .optional {
    color: #a0a0a0;
}

.submission-page .form-control {
    background-color: var(--valorant-dark-navy);
    border: 1px solid #444;
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.submission-page .form-control:focus {
    background-color: var(--valorant-dark-navy);
    border-color: var(--valorant-red);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.5);
}

.submission-page .form-control.is-invalid {
    border-color: #dc3545;
    background-image: none; /* Bootstrapのデフォルトアイコンを無効化 */
}

.submission-page .form-control.is-valid {
    border-color: #198754;
    background-image: none; /* Bootstrapのデフォルトアイコンを無効化 */
}

.invalid-feedback {
    text-align: left;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.char-counter {
    font-size: 0.875rem;
    color: #a0a0a0;
    margin-top: 0.25rem;
}

.submit-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.9rem;
    clip-path: none;
    border-radius: 4px;
}

.alert-message {
    padding: 1rem;
    margin-top: 1.5rem;
    border-left: 5px solid;
    border-radius: 4px;
    text-align: left;
}

.alert-message.success {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: #198754;
    color: #d1e7dd;
}

.alert-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #f8d7da;
}

.alert-message h5 {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.submission-card .card-footer {
    background-color: rgba(15, 25, 35, 0.5);
    padding: 1rem;
    border-top: 1px solid #444;
}

.footer-note {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin: 0;
}

.navigation-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.nav-link {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.2s;
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link:hover {
    color: var(--valorant-red);
}

@media (max-width: 576px) {
    .submission-card .card-body {
        padding: 1.5rem;
    }
    .submission-card .card-title {
        font-size: 1.8rem;
    }
}

/* --- How To Play Page --- */
.how-to-play-container {
    max-width: 800px;
    margin: 0 auto;
}

.step-card, .notice-card {
    background-color: rgba(15, 25, 35, 0.9);
    border: 1px solid #444;
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.step-header {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
}

.step-number {
    font-family: var(--font-header);
    color: var(--valorant-red);
    font-size: 1.2rem;
    margin-right: 1rem;
    background-color: rgba(255, 70, 85, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.step-title {
    font-family: var(--font-jp);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0;
}

.step-body {
    padding: 1.5rem;
}

.step-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.step-image-placeholder {
    background-color: rgba(0, 0, 0, 0.2);
    border: 2px dashed #444;
    border-radius: 4px;
    padding: 3rem;
    text-align: center;
    color: #a0a0a0;
}

.step-image {
    text-align: center;
    margin-bottom: 1rem;
}

.step-image img {
    border-radius: 8px;
    border: 3px solid var(--valorant-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto;
}

.image-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #a0a0a0;
    font-style: italic;
}

.notice-card {
    border-left: 5px solid var(--valorant-red);
}

.notice-header {
    padding: 1rem 1.5rem;
}

.notice-title {
    font-family: var(--font-jp);
    font-size: 1.3rem;
    color: var(--valorant-red);
    margin: 0;
}

.notice-body {
    padding: 0 1.5rem 1.5rem;
    font-size: 1.1rem;
}

.notice-body p {
    margin: 0;
} 