/* Swiss Ranking Front Styles */

.swiss-ranking-container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    border: 3px solid #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-family: 'Noto Sans JP', sans-serif;
    overflow: hidden;
}

/* スタート画面 */
.swiss-ranking-start {
    position: relative;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 30px;
    overflow: hidden;
    border-radius: 17px 17px 0 0;
}

/* 背景画像 */
.swiss-ranking-start::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-color: #667eea;
    z-index: 0;
}

/* オーバーレイ */
.swiss-ranking-start::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* コンテンツ */
.swiss-ranking-start-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* タイトル枠 */
.swiss-ranking-start-frame {
    display: inline-block;
    padding: 18px 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    margin-bottom: 20px;
}

/* テキスト縁取り */
.text-outline {
    color: #fff;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000;
}

.swiss-ranking-start-title {
    font-size: 1.8em;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.swiss-ranking-start-description {
    color: #fff;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    margin-bottom: 12px;
    font-size: 1em;
}

.swiss-ranking-start-message {
    font-size: 1.15em;
    font-weight: 700;
    color: #fff;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000;
    margin-bottom: 25px;
    line-height: 1.5;
}

.swiss-ranking-start-btn {
    display: inline-block;
    padding: 16px 55px;
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 5px 20px rgba(102, 126, 234, 0.5),
        0 0 0 3px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.swiss-ranking-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.6),
        0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* ====== 加工タイプ ====== */

/* ブラー */
.swiss-ranking-start.effect-blur::before {
    filter: blur(6px);
}

/* ドット */
.swiss-ranking-start.effect-dot::before {
    filter: blur(2px);
}
.swiss-ranking-start.effect-dot::after {
    background: 
        radial-gradient(circle, rgba(0,0,0,0.4) 1px, transparent 1px) !important;
    background-size: 4px 4px !important;
}

/* なし */
.swiss-ranking-start.effect-none::before {
    filter: none;
}

/* ====== オーバーレイ色 ====== */

/* 暗め */
.swiss-ranking-start.overlay-dark::after {
    background: rgba(0, 0, 0, 0.35);
}

/* 紫系 */
.swiss-ranking-start.overlay-purple::after {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
}

/* ピンク系 */
.swiss-ranking-start.overlay-pink::after {
    background: linear-gradient(135deg, rgba(232, 67, 147, 0.55) 0%, rgba(253, 121, 168, 0.5) 100%);
}
.swiss-ranking-start.overlay-pink + .swiss-ranking-main .swiss-ranking-start-btn,
.overlay-pink .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #e84393 0%, #fd79a8 100%);
    box-shadow: 0 5px 20px rgba(232, 67, 147, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ブルー系 */
.swiss-ranking-start.overlay-blue::after {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.55) 0%, rgba(41, 128, 185, 0.5) 100%);
}

/* グリーン系 */
.swiss-ranking-start.overlay-green::after {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.55) 0%, rgba(46, 204, 113, 0.5) 100%);
}

/* ネイビー系 */
.swiss-ranking-start.overlay-navy::after {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.65) 0%, rgba(52, 73, 94, 0.55) 100%);
}

/* メイン画面 */
.swiss-ranking-main {
    padding: 20px;
    background: #fafafa;
}

/* ヘッダー */
.swiss-ranking-header {
    text-align: center;
    margin-bottom: 20px;
}

.swiss-ranking-title {
    background: #303f5a;
    color: #fff;
    padding: 15px 40px;
    font-size: 1.5em;
    font-weight: bold;
    display: inline-block;
    border-radius: 0 0 30px 30px;
    position: relative;
}

.swiss-ranking-title::before,
.swiss-ranking-title::after {
    content: '';
    position: absolute;
    top: 0;
    width: 20px;
    height: 20px;
    background: #303f5a;
}

.swiss-ranking-title::before {
    left: -20px;
    border-radius: 0 20px 0 0;
}

.swiss-ranking-title::after {
    right: -20px;
    border-radius: 20px 0 0 0;
}

.swiss-ranking-description {
    margin-top: 15px;
    color: #666;
}

/* プログレスバー */
.swiss-ranking-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
}

.progress-text {
    color: #e91e63;
    font-weight: bold;
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e91e63, #f48fb1);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-percent {
    color: #666;
    white-space: nowrap;
    font-size: 0.9em;
}

/* バトルエリア */
.swiss-ranking-battle {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 20px;
}

.swiss-ranking-item-card {
    flex: 1;
    max-width: 300px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.swiss-ranking-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.swiss-ranking-item-card:active {
    transform: scale(0.98);
}

.swiss-ranking-item-card .item-image {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
}

.swiss-ranking-item-card .item-name {
    padding: 15px 10px 5px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1em;
}

.swiss-ranking-item-card .item-category {
    padding: 0 10px 15px;
    text-align: center;
    color: #888;
    font-size: 0.85em;
}

.swiss-ranking-vs {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #e91e63;
}

/* 指示テキスト */
.swiss-ranking-instruction {
    text-align: center;
    color: #666;
    font-size: 0.95em;
}

/* 結果表示 */
.swiss-ranking-result {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
}

.swiss-ranking-result h3 {
    margin: 0 0 20px;
    color: #303f5a;
    font-size: 1.4em;
}

.result-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 25px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-rank {
    font-size: 1.3em;
    font-weight: bold;
    color: #e91e63;
    min-width: 40px;
}

.result-rank.rank-1 {
    color: #ffd700;
    font-size: 1.5em;
}

.result-rank.rank-2 {
    color: #c0c0c0;
}

.result-rank.rank-3 {
    color: #cd7f32;
}

.result-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: bold;
}

.result-category {
    font-size: 0.85em;
    color: #888;
}

/* 結果ボタン */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.swiss-ranking-share-x {
    background: #000;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.swiss-ranking-share-x:hover {
    background: #333;
}

.swiss-ranking-share-fb {
    background: #1877f2;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.swiss-ranking-share-fb:hover {
    background: #166fe5;
}

.swiss-ranking-retry {
    background: #e91e63;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.swiss-ranking-retry:hover {
    background: #c2185b;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .swiss-ranking-container {
        border-radius: 15px;
        border-width: 2px;
    }
    
    .swiss-ranking-start {
        min-height: 300px;
        padding: 35px 20px;
        border-radius: 13px 13px 0 0;
    }
    
    .swiss-ranking-start-frame {
        padding: 12px 20px;
    }
    
    .swiss-ranking-start-title {
        font-size: 1.4em;
    }
    
    .swiss-ranking-start-btn {
        padding: 14px 45px;
        font-size: 1em;
    }
    
    .swiss-ranking-battle {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 10px;
    }
    
    .swiss-ranking-item-card {
        flex: 1 1 0 !important;
        max-width: 140px;
        min-width: 0;
    }
    
    .swiss-ranking-item-card .item-name {
        font-size: 0.9em;
        padding: 10px 5px 3px;
    }
    
    .swiss-ranking-item-card .item-category {
        font-size: 0.75em;
        padding: 0 5px 10px;
    }
    
    .swiss-ranking-vs {
        font-size: 1.2em;
        padding: 0 5px;
        flex-shrink: 0;
    }
    
    .swiss-ranking-progress {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .progress-bar {
        order: 3;
        width: 100%;
        flex: none;
    }
    
    .swiss-ranking-title {
        font-size: 1.2em;
        padding: 12px 25px;
    }
    
    .swiss-ranking-start {
        padding: 30px 15px;
    }
    
    .swiss-ranking-start-title {
        font-size: 1.4em;
    }
    
    .swiss-ranking-start-message {
        font-size: 1em;
    }
    
    .swiss-ranking-start-btn {
        padding: 15px 40px;
        font-size: 1.1em;
    }
}

/* ========================================
   カラーテーマ
   ======================================== */

/* スタンダード（standard）- 紫系 */
.swiss-ranking-container.theme-standard {
    background: #f8f9ff;
}
.theme-standard .swiss-ranking-start-title {
    color: #667eea;
}
.theme-standard .swiss-ranking-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.theme-standard .swiss-ranking-title::before,
.theme-standard .swiss-ranking-title::after {
    background: #667eea;
}
.theme-standard .swiss-ranking-start-message {
    color: #764ba2;
}
.theme-standard .swiss-ranking-start-btn,
.theme-standard .swiss-ranking-item-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}
.theme-standard .swiss-ranking-item-card .item-name {
    color: #fff;
}
.theme-standard .swiss-ranking-item-card .item-category {
    color: rgba(255,255,255,0.7);
}
.theme-standard .swiss-ranking-progress {
    background: #eef1ff;
}

/* ロマンティック（romantic）- ピンク系 */
.swiss-ranking-container.theme-romantic {
    background: #fff5f8;
}
.theme-romantic .swiss-ranking-start-title {
    color: #e84393;
}
.theme-romantic .swiss-ranking-title {
    background: linear-gradient(135deg, #e84393 0%, #fd79a8 100%);
    color: #fff;
}
.theme-romantic .swiss-ranking-title::before,
.theme-romantic .swiss-ranking-title::after {
    background: #e84393;
}
.theme-romantic .swiss-ranking-start-message {
    color: #fd79a8;
}
.theme-romantic .swiss-ranking-start-btn,
.theme-romantic .swiss-ranking-item-card {
    background: linear-gradient(135deg, #e84393 0%, #fd79a8 100%);
    box-shadow: 0 5px 20px rgba(232, 67, 147, 0.3);
}
.theme-romantic .swiss-ranking-item-card .item-name {
    color: #fff;
}
.theme-romantic .swiss-ranking-item-card .item-category {
    color: rgba(255,255,255,0.7);
}
.theme-romantic .swiss-ranking-progress {
    background: #ffe3ec;
}

/* ビジネス（business）- ネイビー×ゴールド */
.swiss-ranking-container.theme-business {
    background: #f8f9fa;
}
.theme-business .swiss-ranking-start-title {
    color: #2c3e50;
}
.theme-business .swiss-ranking-title {
    background: #2c3e50;
    color: #fff;
}
.theme-business .swiss-ranking-title::before,
.theme-business .swiss-ranking-title::after {
    background: #2c3e50;
}
.theme-business .swiss-ranking-start-message {
    color: #c9a227;
}
.theme-business .swiss-ranking-start-btn,
.theme-business .swiss-ranking-item-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 0 5px 20px rgba(44, 62, 80, 0.3);
}
.theme-business .swiss-ranking-item-card .item-name {
    color: #fff;
}
.theme-business .swiss-ranking-item-card .item-category {
    color: rgba(255,255,255,0.7);
}
.theme-business .swiss-ranking-progress {
    background: #eef0f2;
}

/* シンプル（simple）- モノトーン */
.swiss-ranking-container.theme-simple {
    background: #f5f5f5;
}
.theme-simple .swiss-ranking-start-title {
    color: #333333;
}
.theme-simple .swiss-ranking-title {
    background: #333333;
    color: #fff;
}
.theme-simple .swiss-ranking-title::before,
.theme-simple .swiss-ranking-title::after {
    background: #333333;
}
.theme-simple .swiss-ranking-start-message {
    color: #666666;
}
.theme-simple .swiss-ranking-start-btn,
.theme-simple .swiss-ranking-item-card {
    background: linear-gradient(135deg, #333333 0%, #666666 100%);
    box-shadow: 0 5px 20px rgba(51, 51, 51, 0.3);
}
.theme-simple .swiss-ranking-item-card .item-name {
    color: #fff;
}
.theme-simple .swiss-ranking-item-card .item-category {
    color: rgba(255,255,255,0.7);
}
.theme-simple .swiss-ranking-progress {
    background: #e8e8e8;
}

/* パステル（pastel）- 淡い紫×青 */
.swiss-ranking-container.theme-pastel {
    background: #f8f7ff;
}
.theme-pastel .swiss-ranking-start-title {
    color: #a29bfe;
}
.theme-pastel .swiss-ranking-title {
    background: linear-gradient(135deg, #a29bfe 0%, #74b9ff 100%);
    color: #fff;
}
.theme-pastel .swiss-ranking-title::before,
.theme-pastel .swiss-ranking-title::after {
    background: #a29bfe;
}
.theme-pastel .swiss-ranking-start-message {
    color: #74b9ff;
}
.theme-pastel .swiss-ranking-start-btn,
.theme-pastel .swiss-ranking-item-card {
    background: linear-gradient(135deg, #a29bfe 0%, #74b9ff 100%);
    box-shadow: 0 5px 20px rgba(162, 155, 254, 0.3);
}
.theme-pastel .swiss-ranking-item-card .item-name {
    color: #fff;
}
.theme-pastel .swiss-ranking-item-card .item-category {
    color: rgba(255,255,255,0.7);
}
.theme-pastel .swiss-ranking-progress {
    background: #f0efff;
}

/* ナチュラル（natural）- グリーン系 */
.swiss-ranking-container.theme-natural {
    background: #f5faf7;
}
.theme-natural .swiss-ranking-start-title {
    color: #27ae60;
}
.theme-natural .swiss-ranking-title {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: #fff;
}
.theme-natural .swiss-ranking-title::before,
.theme-natural .swiss-ranking-title::after {
    background: #27ae60;
}
.theme-natural .swiss-ranking-start-message {
    color: #2ecc71;
}
.theme-natural .swiss-ranking-start-btn,
.theme-natural .swiss-ranking-item-card {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.3);
}
.theme-natural .swiss-ranking-item-card .item-name {
    color: #fff;
}
.theme-natural .swiss-ranking-item-card .item-category {
    color: rgba(255,255,255,0.7);
}
.theme-natural .swiss-ranking-progress {
    background: #e8f5ec;
}

/* ====== スタートボタン テーマ別色 ====== */
.theme-standard .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.theme-romantic .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #e84393 0%, #fd79a8 100%);
    box-shadow: 0 5px 20px rgba(232, 67, 147, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.theme-business .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 0 5px 20px rgba(44, 62, 80, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.theme-simple .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #333333 0%, #666666 100%);
    box-shadow: 0 5px 20px rgba(51, 51, 51, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.theme-pastel .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #a29bfe 0%, #74b9ff 100%);
    box-shadow: 0 5px 20px rgba(162, 155, 254, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.theme-natural .swiss-ranking-start-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.3);
}
