/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Cookie同意バナー */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-text a {
    color: #3498db;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .cookie-buttons {
        justify-content: center;
    }
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-consent-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cookie-consent-accept {
    background: #27ae60;
    color: white;
}

.cookie-consent-accept:hover {
    background: #219a52;
}

.cookie-consent-reject {
    background: #e74c3c;
    color: white;
}

.cookie-consent-reject:hover {
    background: #c0392b;
}

.cookie-consent-settings {
    background: #95a5a6;
    color: white;
}

.cookie-consent-settings:hover {
    background: #7f8c8d;
}

/* Cookie設定モーダル */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cookie-settings-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 5px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-category-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #27ae60;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(26px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.cookie-category-description {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.5;
}

.cookie-settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-consent-text {
        min-width: auto;
    }
    
    .cookie-consent-buttons {
        justify-content: center;
    }
    
    .cookie-settings-content {
        padding: 20px;
    }
    
    .cookie-settings-actions {
        flex-direction: column;
    }
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

header p {
    font-size: 1.3em;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* ナビゲーション */
nav {
    background-color: #ff8e8e;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 15px 25px;
    display: block;
    transition: all 0.3s;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: white;
    transition: all 0.3s;
    transform: translateX(-50%);
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

nav ul li a:hover::after {
    width: 80%;
}

/* メインコンテンツ */
main {
    padding: 30px 0;
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    min-height: 48px;
    transition: all 0.3s;
    background-color: white;
    /* スマホでのズーム防止 */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* タッチ操作の改善 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.form-control:focus {
    border-color: #ff6b6b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-control:hover {
    border-color: #d0d0d0;
}

.form-check {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.form-check input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* テキストエリア */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* セレクトボックス */
select.form-control {
    cursor: pointer;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 天気ウィジェット専用スタイル */
.weather-input-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 15px;
}

.weather-location-input {
    flex: 1;
    min-width: 0;
}

.weather-search-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 120px;
    padding: 14px 18px;
}

.btn:hover {
    background-color: #ff5252;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* 小さいボタン */
.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* カード */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background-color: #ff6b6b;
    color: white;
    padding: 18px 20px;
    font-weight: 600;
    font-size: 1.1em;
    letter-spacing: 0.3px;
}

.card-body {
    padding: 25px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 18px 20px;
    border-top: 1px solid #e0e0e0;
}

/* テーブル */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: #ff6b6b;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #fff5f5;
    transition: background-color 0.2s;
}

table td img {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* テーブルレスポンシブコンテナ */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* アラート */
.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 8px 0 0 8px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    position: relative;
    padding-left: 24px;
}

.alert-success::before {
    background-color: #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    position: relative;
    padding-left: 24px;
}

.alert-danger::before {
    background-color: #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    position: relative;
    padding-left: 24px;
}

.alert-warning::before {
    background-color: #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    position: relative;
    padding-left: 24px;
}

.alert-info::before {
    background-color: #17a2b8;
}

/* フッター */
footer {
    margin-top: 50px;
    padding: 30px 0;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 5px 0;
    opacity: 0.9;
}

footer a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

footer a:hover {
    color: #ff8e8e;
    text-decoration: underline;
}

/* 確率情報 */
.probability-total, .probability-info {
    margin: 10px 0;
    padding: 10px 20px;
    background-color: white;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
    font-size: 14px;
}

/* 確率情報のホバー効果 */
.probability-total:hover, .probability-info:hover {
    background-color: #ff6b6b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    border: none;
    width: 95%;
    max-width: 700px;
    max-height: 96vh;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.modal-body {
    padding: 30px;
    max-height: calc(96vh - 180px);
    overflow-y: auto;
    background-color: #ffffff;
    position: relative;
}

/* スクロールバーのカスタマイズ */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 5px;
    border: 2px solid #f5f5f5;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #ff5252;
}

.modal-footer {
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-top: 2px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.close {
    color: white;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
}

.close:hover,
.close:focus {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
    text-decoration: none;
}

/* ガチャ関連 */
.gacha-container {
    text-align: center;
    margin: 30px auto;
    max-width: 800px;
}

.gacha-machine {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto 20px;
    background-color: #e63b2e; /* 赤色のガチャマシン */
    border-radius: 10px 10px 20px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ガチャマシンの上部（赤い帯） */
.gacha-machine:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: #d62d20;
    z-index: 1;
}

/* ガチャマシンの側面（金属の柱） */
.gacha-machine:after {
    content: '';
    position: absolute;
    top: 30px;
    left: 10px;
    width: 10px;
    height: calc(100% - 30px);
    background: linear-gradient(to right, #a0a0a0, #d0d0d0, #a0a0a0);
    z-index: 1;
    box-shadow: 280px 0 0 0 #a0a0a0;
}

/* ガチャマシンの中央部（カプセル表示部） */
.gacha-display {
    position: relative;
    width: 220px;
    height: 250px;
    margin: 30px auto 20px;
    background-color: rgba(255, 255, 255, 0.2); /* 透明な表示部分 */
    border: 5px solid #a0a0a0; /* 金属風の枠 */
    border-radius: 5px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    /* 透明感を出す */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* カプセルコンテナ */
.capsule-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* カプセル（複数） */
.gacha-capsule {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
    /* 透明感のあるカプセル */
    background-color: rgba(255, 255, 255, 0.7);
}

/* カプセルの中央線 */
.gacha-capsule:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 3;
}

/* 各カプセルの位置と色 */
.gacha-capsule:nth-child(1) { 
    top: 70%; 
    left: 30%; 
    background-color: rgba(255, 204, 41, 0.7); /* 黄色 */
}
.gacha-capsule:nth-child(2) { 
    top: 50%; 
    left: 20%; 
    background-color: rgba(100, 181, 246, 0.7); /* 青色 */
}
.gacha-capsule:nth-child(3) { 
    top: 60%; 
    left: 40%; 
    background-color: rgba(255, 138, 128, 0.7); /* ピンク */
}
.gacha-capsule:nth-child(4) { 
    top: 30%; 
    left: 60%; 
    background-color: rgba(174, 213, 129, 0.7); /* 緑色 */
}
.gacha-capsule:nth-child(5) { 
    top: 45%; 
    left: 70%; 
    background-color: rgba(255, 204, 41, 0.7); /* 黄色 */
}
.gacha-capsule:nth-child(6) { 
    top: 40%; 
    left: 50%; 
    background-color: rgba(100, 181, 246, 0.7); /* 青色 */
}
.gacha-capsule:nth-child(7) { 
    top: 65%; 
    left: 60%; 
    background-color: rgba(255, 138, 128, 0.7); /* ピンク */
}
.gacha-capsule:nth-child(8) { 
    top: 55%; 
    left: 35%; 
    background-color: rgba(174, 213, 129, 0.7); /* 緑色 */
}
.gacha-capsule:nth-child(9) { 
    top: 75%; 
    left: 50%; 
    background-color: rgba(255, 204, 41, 0.7); /* 黄色 */
}
.gacha-capsule:nth-child(10) { 
    top: 35%; 
    left: 40%; 
    background-color: rgba(100, 181, 246, 0.7); /* 青色 */
}
.gacha-capsule:nth-child(11) { 
    top: 25%; 
    left: 30%; 
    background-color: rgba(255, 138, 128, 0.7); /* ピンク */
}
.gacha-capsule:nth-child(12) { 
    top: 20%; 
    left: 50%; 
    background-color: rgba(174, 213, 129, 0.7); /* 緑色 */
}

/* 選ばれたカプセル */
.selected-capsule {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 204, 41, 0.9); /* 黄色のカプセル */
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 4;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 選ばれたカプセルの中央線 */
.selected-capsule:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 5;
}


/* ガチャのハンドル */
.gacha-handle {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #ffcc29;
    border-radius: 50%;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.5s;
}

.gacha-handle:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background-color: #ff6b6b;
    border-radius: 50%;
}

.gacha-handle:after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 30px;
    background-color: #ffcc29;
    border-radius: 5px;
}

/* ガチャの出口 */
.gacha-exit {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background-color: #333;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
}

/* ガチャの出口のフラップ */
.gacha-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #222;
    transform-origin: top;
    transition: transform 0.5s;
}

/* ガチャを回すアニメーション */
@keyframes rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes drop {
    0% { transform: translateY(-100px); opacity: 0; }
    70% { transform: translateY(10px); opacity: 1; }
    85% { transform: translateY(-5px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes turnHandle {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

@keyframes openFlap {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(70deg); }
    100% { transform: rotateX(0deg); }
}

@keyframes moveToExit {
    0% { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    100% { top: 100%; left: 50%; transform: translate(-50%, 0); }
}

/* カプセルの動きアニメーション（複数のカプセル用） */
@keyframes capsuleMove1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(3px, 2px) rotate(45deg); }
}

@keyframes capsuleMove2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-4px, 3px) rotate(90deg); }
}

@keyframes capsuleMove3 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2px, -3px) rotate(135deg); }
}

@keyframes capsuleMove4 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3px, -2px) rotate(180deg); }
}

@keyframes capsuleMove5 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(4px, -1px) rotate(225deg); }
}

@keyframes capsuleMove6 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2px, 4px) rotate(270deg); }
}

@keyframes capsuleMove7 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(3px, 3px) rotate(315deg); }
}

@keyframes capsuleMove8 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3px, 1px) rotate(360deg); }
}

/* カプセルが出口から出てくるアニメーション */
@keyframes capsuleExit {
    0% { 
        bottom: 50px;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% { 
        bottom: -100px;
    }
}

/* カプセルが割れるアニメーション */
@keyframes capsuleSplit {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(-30deg) translateY(-20px);
    }
}

/* 出てきたカプセル */
.exit-capsule {
    position: absolute;
    width: 60px;
    height: 60px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 50px;
    z-index: 200;
    opacity: 0;
}

.exit-capsule-top,
.exit-capsule-bottom {
    position: absolute;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #ffcc29 0%, #ffd54f 50%, #ffcc29 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.exit-capsule-top {
    top: 0;
    border-radius: 30px 30px 0 0;
    transform-origin: bottom center;
    z-index: 202;
}

.exit-capsule-bottom {
    bottom: 0;
    border-radius: 0 0 30px 30px;
    z-index: 201;
}

/* カプセルの中央線 */
.exit-capsule-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 203;
}

/* 景品コンテナ */
.prize-container {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 199;
}

/* ガチャを引くときのアニメーション */
.gacha-machine.drawing .capsule-container {
    animation: shake 0.5s linear infinite;
}

.gacha-machine.drawing .gacha-capsule:nth-child(1) {
    animation: capsuleMove1 0.8s 0.1s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(2) {
    animation: capsuleMove2 0.7s 0.2s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(3) {
    animation: capsuleMove3 0.9s 0.0s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(4) {
    animation: capsuleMove4 0.6s 0.3s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(5) {
    animation: capsuleMove5 0.8s 0.2s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(6) {
    animation: capsuleMove6 0.7s 0.1s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(7) {
    animation: capsuleMove7 0.9s 0.3s infinite alternate;
}

.gacha-machine.drawing .gacha-capsule:nth-child(8) {
    animation: capsuleMove8 0.6s 0.0s infinite alternate;
}

.gacha-machine.drawing .gacha-handle {
    animation: turnHandle 1s ease-in-out;
}

.gacha-machine.drawing .gacha-flap {
    animation: openFlap 1s ease-in-out 1s;
}

.gacha-result {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    animation: drop 1.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.prize-name {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b6b;
    margin: 10px 0;
}

.draw-button {
    background-color: #ffcc29;
    color: #333;
    font-size: 20px;
    font-weight: bold;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #e6b800;
    margin: 10px 5px;
    display: inline-block;
    min-width: 150px;
}

.draw-button:hover {
    background-color: #ffd54f;
    transform: translateY(-2px);
}

.draw-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #e6b800;
}

/* 5連ガチャボタン */
.draw-button-5 {
    background-color: #4ecdc4;
    box-shadow: 0 4px 0 #3ba59d;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.draw-button-5:hover {
    background-color: #5ed9d0;
    transform: translateY(-2px);
}

.draw-button-5:active {
    box-shadow: 0 2px 0 #3ba59d;
    transform: translateY(2px);
}

/* 10連ガチャボタン */
.draw-button-10 {
    background-color: #ff6b6b;
    box-shadow: 0 4px 0 #e55555;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.draw-button-10:hover {
    background-color: #ff7d7d;
    transform: translateY(-2px);
}

.draw-button-10:active {
    box-shadow: 0 2px 0 #e55555;
    transform: translateY(2px);
}

/* 景品追加フォーム */
.prize-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.add-prize-btn {
    margin-bottom: 20px;
}

/* テキスト配置ヘルパー */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

/* 景品タイプ選択 */
.prize-type-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.form-check-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
}

.form-check-inline input[type="radio"] {
    margin-right: 5px;
}

.form-check-inline label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

/* 画像プレビュー関連 */
.image-preview-container {
    display: flex;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.delete-image-btn {
    margin-left: 15px;
    padding: 8px 16px;
    font-size: 14px;
}

.image-input-container {
    margin-bottom: 15px;
}

/* 画像なしの場合のプレースホルダー */
.no-image-placeholder {
    width: 200px;
    height: 200px;
    background-color: #f0f0f0;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* 景品ラインアップ */
.prize-lineup {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.prize-item {
    text-align: center;
    width: 120px;
}

.prize-lineup-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
    margin-bottom: 8px;
}

.no-image {
    width: 100px;
    height: 100px;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    margin: 0 auto 8px;
}

.secret-prize {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.secret-prize::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.secret-icon {
    font-size: 48px;
    color: white;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.prize-lineup-name {
    font-size: 14px;
    color: #333;
    margin: 0;
    word-break: break-word;
}

/* スマートフォン専用修正 */
@media (max-width: 768px) {
    /* レイアウトシフトとリペイント問題を根本解決 */
    * {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        perspective: 1000px;
        -webkit-perspective: 1000px;
    }
    
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
        height: 100%;
        overflow-x: hidden;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        min-height: 100%;
        overflow-x: hidden;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        position: relative;
        width: 100%;
    }
    
    /* 固定配置要素の問題を解決 */
    .probability-total, 
    .probability-info {
        position: static;
        margin: 15px auto;
        display: block;
        text-align: center;
        width: 90%;
        font-size: 16px;
        padding: 12px 20px;
    }
    
    /* Cookie バナーの配置を修正 */
    .cookie-consent {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .cookie-consent.show {
        transform: translateY(0);
    }
    
    /* Cookie設定モーダルのスマホ対応 */
    .cookie-settings-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10001;
        display: none;
    }
    
    .cookie-settings-modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .cookie-settings-content {
        width: 95%;
        max-width: 500px;
        max-height: 90vh;
        overflow-y: auto;
        margin: 5% auto;
    }
    
    /* コンテナの安定化 */
    .container {
        width: 100%;
        max-width: 100%;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* ヘッダーの安定化 */
    header {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        width: 100%;
        overflow: hidden;
    }
    
    /* フッターの安定化 */
    footer {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        width: 100%;
        position: relative;
    }
}

/* スマートフォン用スタイル（576px以下） */
@media (max-width: 576px) {
    /* ヘッダー */
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 2em;
        line-height: 1.2;
    }
    
    header p {
        font-size: 1.1em;
        margin-top: 5px;
    }
    
    /* ナビゲーション */
    nav {
        position: static;
    }
    
    nav ul {
        flex-direction: column;
        align-items: stretch;
    }
    
    nav ul li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    nav ul li a {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* コンテナ */
    .container {
        padding: 15px;
    }
    
    /* カード */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 15px;
        font-size: 1.1em;
    }
    
    .card-body {
        padding: 20px 15px;
    }
    
    /* ボタン */
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        margin-bottom: 10px;
        min-height: 52px;
    }
    
    /* 天気ウィジェット（スマホ） */
    .weather-input-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .weather-search-btn {
        width: 100%;
        min-width: auto;
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .btn-sm {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* ガチャボタン */
    .draw-button,
    .draw-button-5,
    .draw-button-10 {
        width: 90%;
        padding: 18px 25px;
        font-size: 18px;
        margin: 8px auto;
        display: block;
    }
    
    /* テーブル */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    table {
        font-size: 12px;
        min-width: 1200px; /* iPhoneでも確実に全列が表示されるよう最小幅を設定 */
        width: max-content;
        border-collapse: separate;
        border-spacing: 0;
    }
    
    /* ガチャ情報テーブル（基本情報）の特別対応 */
    .card-body > table:not(.table-responsive table) {
        min-width: auto;
        width: 100%;
        font-size: 14px;
        table-layout: fixed;
        border-collapse: collapse;
    }
    
    .card-body > table:not(.table-responsive table) th {
        width: 30%;
        min-width: 80px;
        word-wrap: break-word;
        white-space: normal;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .card-body > table:not(.table-responsive table) td {
        width: 70%;
        word-wrap: break-word;
        white-space: normal;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .card-body > table:not(.table-responsive table) td img {
        max-width: 80px;
        height: auto;
        border-radius: 4px;
    }
    
    /* ガチャ履歴テーブルの特別対応 */
    #history-section .table-responsive table {
        min-width: 600px;
        font-size: 13px;
    }
    
    #history-section .table-responsive table th:nth-child(1),
    #history-section .table-responsive table td:nth-child(1) {
        min-width: 120px;
        max-width: 150px;
        word-wrap: break-word;
        white-space: normal;
    }
    
    #history-section .table-responsive table th:nth-child(2),
    #history-section .table-responsive table td:nth-child(2) {
        min-width: 120px;
        max-width: 150px;
        word-wrap: break-word;
        white-space: normal;
    }
    
    #history-section .table-responsive table th:nth-child(3),
    #history-section .table-responsive table td:nth-child(3) {
        min-width: 100px;
        text-align: center;
        white-space: nowrap;
    }
    
    /* 発行済みチケット一覧テーブルの特別対応 */
    .card:last-of-type .table-responsive table {
        min-width: 700px;
        font-size: 13px;
    }
    
    .card:last-of-type .table-responsive table th:nth-child(1),
    .card:last-of-type .table-responsive table td:nth-child(1) {
        min-width: 100px;
        max-width: 120px;
        word-wrap: break-word;
        white-space: normal;
    }
    
    .card:last-of-type .table-responsive table th:nth-child(2),
    .card:last-of-type .table-responsive table td:nth-child(2) {
        min-width: 80px;
        text-align: center;
        white-space: nowrap;
    }
    
    .card:last-of-type .table-responsive table th:nth-child(3),
    .card:last-of-type .table-responsive table td:nth-child(3) {
        min-width: 100px;
        text-align: center;
        white-space: nowrap;
    }
    
    .card:last-of-type .table-responsive table th:nth-child(4),
    .card:last-of-type .table-responsive table td:nth-child(4) {
        min-width: 300px;
        max-width: 350px;
    }
    
    .card:last-of-type .table-responsive table td:nth-child(4) input {
        width: 100%;
        font-size: 11px;
        padding: 4px 6px;
        border: 1px solid #ddd;
        border-radius: 3px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
        white-space: nowrap;
        vertical-align: middle;
        border-right: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
        min-width: fit-content;
    }
    
    /* 最後の列（操作列）の右境界線を削除 */
    table th:last-child,
    table td:last-child {
        border-right: none;
    }
    
    /* チェックボックス列 */
    table td:nth-child(1),
    table th:nth-child(1) {
        min-width: 40px;
        text-align: center;
        padding: 8px 4px;
    }
    
    /* 景品名の列 */
    table td:nth-child(2) {
        min-width: 100px;
        max-width: 120px;
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }
    
    /* 画像の列 */
    table td:nth-child(3) {
        min-width: 60px;
        text-align: center;
    }
    
    table td:nth-child(3) img {
        width: 35px;
        height: 35px;
        object-fit: cover;
        border-radius: 4px;
    }
    
    /* 個数、確率、残りの列 */
    table td:nth-child(4),
    table td:nth-child(5),
    table td:nth-child(6) {
        min-width: 50px;
        text-align: center;
    }
    
    /* タイプの列 */
    table td:nth-child(7) {
        min-width: 80px;
        text-align: center;
    }
    
    /* 公開状態の列 */
    table td:nth-child(8) {
        min-width: 70px;
        text-align: center;
    }
    
    /* 操作の列 */
    table td:last-child {
        min-width: 180px;
        text-align: center;
        padding: 8px 10px;
    }
    
    /* 操作列のボタン */
    table td:last-child .btn {
        padding: 4px 8px;
        font-size: 11px;
        margin: 1px;
        border-radius: 4px;
        min-width: 40px;
        white-space: nowrap;
        display: inline-block;
        width: auto;
    }
    
    /* 操作列のフォーム */
    table td:last-child form {
        display: inline-block;
        margin: 1px;
    }
    
    /* テーブルヘッダーの調整 */
    table th {
        font-size: 11px;
        font-weight: 600;
        text-align: center;
        padding: 10px 6px;
        background-color: #ff6b6b;
        color: white;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* スクロールバーのスタイル改善 */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: #ff6b6b;
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #ff5252;
    }
    
    /* ガチャマシン */
    .gacha-machine {
        width: 280px;
        height: 380px;
        margin: 0 auto 20px;
    }
    
    .gacha-display {
        width: 200px;
        height: 230px;
    }
    
    /* 景品名 */
    .prize-name {
        font-size: 22px;
        line-height: 1.3;
        padding: 0 10px;
    }
    
    /* フォーム要素 */
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 16px 18px;
        font-size: 18px;
        min-height: 52px;
        -webkit-appearance: none;
        -webkit-border-radius: 8px;
        border-radius: 8px;
    }
    
    textarea.form-control {
        min-height: 120px;
    }
    
    /* チェックボックス・ラジオボタン */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }
    
    /* 景品タイプ選択 */
    .prize-type-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-check-inline {
        width: 100%;
        margin-right: 0;
    }
    
    /* 確率情報 */
    .probability-total, 
    .probability-info {
        position: static;
        margin: 15px auto;
        display: block;
        text-align: center;
        width: 90%;
        font-size: 16px;
        padding: 12px 20px;
    }
    
    /* モーダル */
    .modal {
        padding: 20px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        width: 95%;
        height: auto;
        max-height: none;
        margin: 0 auto;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        position: relative;
        top: 20px;
        margin-bottom: 40px;
    }
    
    .modal-header {
        border-radius: 12px 12px 0 0;
        padding: 15px 20px;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .modal-header h2,
    .modal-header h3 {
        font-size: 1.2em;
        margin: 0;
        padding-right: 40px;
        flex: 1;
    }
    
    .close {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 35px;
        height: 35px;
        font-size: 28px;
    }
    
    .modal-body {
        padding: 20px;
        overflow-y: visible;
        flex: 1;
        max-height: none;
    }
    
    .modal-footer {
        border-radius: 0 0 12px 12px;
        padding: 15px 20px;
        background-color: #f8f9fa;
        border-top: 2px solid #e0e0e0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 0;
        padding: 12px 16px;
        font-size: 14px;
        width: auto;
        margin-bottom: 0;
    }
    
    /* 画像プレビュー */
    .image-preview-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .image-preview {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .delete-image-btn {
        margin-left: 0;
        width: 100%;
    }
    
    /* フッター */
    footer {
        padding: 25px 15px;
        font-size: 14px;
    }
    
    /* 景品ラインアップ */
    .prize-lineup {
        gap: 10px;
    }
    
    .prize-item {
        width: 80px;
    }
    
    .prize-lineup-image,
    .no-image,
    .secret-prize {
        width: 70px;
        height: 70px;
    }
    
    .secret-icon {
        font-size: 32px;
    }
    
    .prize-lineup-name {
        font-size: 12px;
    }
}

/* タブレット用スタイル（577px〜991px） */
@media (min-width: 577px) and (max-width: 991px) {
    /* コンテナ */
    .container {
        padding: 20px;
        max-width: 768px;
    }
    
    /* ヘッダー */
    header {
        padding: 25px 20px;
    }
    
    header h1 {
        font-size: 2.4em;
    }
    
    header p {
        font-size: 1.2em;
    }
    
    /* カード */
    .card-header {
        padding: 16px 20px;
        font-size: 1.15em;
    }
    
    .card-body {
        padding: 22px;
    }
    
    /* ボタン */
    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    /* ガチャボタン */
    .draw-button,
    .draw-button-5,
    .draw-button-10 {
        padding: 16px 30px;
        font-size: 19px;
        min-width: 180px;
    }
    
    /* ナビゲーション */
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li a {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* テーブル */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 14px;
        min-width: 900px;
    }
    
    table th,
    table td {
        padding: 10px 12px;
    }
    
    table td img {
        width: 45px;
        height: 45px;
    }
    
    /* ガチャマシン */
    .gacha-machine {
        width: 320px;
        height: 420px;
    }
    
    .gacha-display {
        width: 240px;
        height: 270px;
    }
    
    /* フォーム要素 */
    .form-control {
        padding: 15px 20px;
        font-size: 17px;
        min-height: 50px;
    }
    
    /* 確率情報 */
    .probability-total,
    .probability-info {
        top: 15px;
        right: 15px;
        font-size: 15px;
    }
    
    /* モーダル */
    .modal-content {
        width: 85%;
        max-width: 600px;
    }
    
    .modal-header {
        padding: 18px 20px;
    }
    
    .modal-body {
        padding: 22px;
    }
    
    /* 画像プレビュー */
    .image-preview {
        max-width: 180px;
        max-height: 180px;
    }
    
    /* フッター */
    footer {
        padding: 30px 20px;
        font-size: 15px;
    }
}

/* パソコン用スタイル（992px以上） */
@media (min-width: 992px) {
    /* コンテナ */
    .container {
        padding: 30px;
        max-width: 1200px;
    }
    
    /* ヘッダー */
    header h1 {
        font-size: 3em;
    }
    
    header p {
        font-size: 1.4em;
    }
    
    /* メインコンテンツ */
    main {
        padding: 40px 0;
    }
    
    /* カード */
    .card {
        margin-bottom: 30px;
    }
    
    .card-header {
        padding: 20px 25px;
        font-size: 1.2em;
    }
    
    .card-body {
        padding: 30px;
    }
    
    /* ボタン */
    .btn {
        padding: 12px 28px;
        font-size: 17px;
    }
    
    /* ホバーエフェクト */
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }
    
    .card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
    
    table tr:hover {
        background-color: #fff5f5;
        transform: scale(1.01);
    }
    
    /* ガチャボタン */
    .draw-button,
    .draw-button-5,
    .draw-button-10 {
        padding: 18px 40px;
        font-size: 22px;
        min-width: 200px;
        margin: 10px;
    }
    
    /* テーブル */
    table {
        font-size: 16px;
    }
    
    table th,
    table td {
        padding: 15px 20px;
    }
    
    table td img {
        width: 60px;
        height: 60px;
        transition: transform 0.3s;
    }
    
    table td img:hover {
        transform: scale(1.5);
        z-index: 10;
        position: relative;
    }
    
    /* ガチャマシン */
    .gacha-container {
        max-width: 1000px;
        margin: 40px auto;
    }
    
    .gacha-machine {
        width: 350px;
        height: 450px;
        margin: 0 auto 30px;
    }
    
    .gacha-display {
        width: 260px;
        height: 300px;
    }
    
    /* フォーム要素 */
    .form-group {
        margin-bottom: 25px;
    }
    
    .form-group label {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .form-control {
        padding: 18px 22px;
        font-size: 18px;
        min-height: 56px;
    }
    
    textarea.form-control {
        min-height: 150px;
    }
    
    /* 景品タイプ選択 */
    .prize-type-container {
        gap: 25px;
    }
    
    .form-check-inline {
        padding: 12px 20px;
    }
    
    /* 確率情報 */
    .probability-total,
    .probability-info {
        top: 25px;
        right: 25px;
        font-size: 16px;
        padding: 12px 25px;
    }
    
    /* モーダル */
    .modal-content {
        max-width: 800px;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 25px 30px;
    }
    
    .modal-header h2,
    .modal-header h3 {
        font-size: 1.6em;
    }
    
    .modal-body {
        padding: 30px;
        max-height: calc(90vh - 160px);
    }
    
    /* 画像プレビュー */
    .image-preview-container {
        padding: 20px;
    }
    
    .image-preview {
        max-width: 250px;
        max-height: 250px;
    }
    
    /* フッター */
    footer {
        margin-top: 60px;
        padding: 40px 0;
        font-size: 16px;
    }
    
    /* 景品ラインアップ */
    .prize-lineup {
        gap: 20px;
        margin: 30px 0;
    }
    
    .prize-item {
        width: 140px;
    }
    
    .prize-lineup-image,
    .no-image,
    .secret-prize {
        width: 120px;
        height: 120px;
    }
    
    .prize-lineup-name {
        font-size: 15px;
    }
}

/* 印刷用スタイル */
@media print {
    body {
        background-color: white;
    }
    
    .no-print {
        display: none;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    header, nav, footer {
        display: none;
    }
}

/* 画面の向き（縦向き）に対応 */
@media (orientation: portrait) {
    .gacha-result {
        max-width: 90%;
    }
}

/* 画面の向き（横向き）に対応 */
@media (orientation: landscape) and (max-width: 991px) {
    .gacha-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .gacha-machine {
        width: 48%;
    }
    
    .gacha-result {
        width: 48%;
    }
}

/* より小さい画面（iPhone SE等）用の追加調整 */
@media (max-width: 400px) {
    table {
        font-size: 11px;
        min-width: 1100px;
    }
    
    table th,
    table td {
        padding: 6px 4px;
    }
    
    /* チェックボックス列 */
    table td:nth-child(1),
    table th:nth-child(1) {
        min-width: 35px;
        padding: 6px 2px;
    }
    
    /* 景品名の列をさらに調整 */
    table td:nth-child(2) {
        min-width: 80px;
        max-width: 100px;
    }
    
    /* 画像をさらに小さく */
    table td:nth-child(3) img {
        width: 30px;
        height: 30px;
    }
    
    /* 操作列の幅を少し縮小 */
    table td:last-child {
        min-width: 160px;
    }
    
    table th:last-child {
        min-width: 160px;
    }
    
    /* ボタンをさらに小さく */
    table td:last-child .btn {
        padding: 3px 6px;
        font-size: 10px;
        margin: 1px 0;
        min-width: 35px;
    }
}

/* 非常に狭い画面用（360px以下） */
@media (max-width: 360px) {
    table {
        min-width: 1000px;
    }
    
    table td:last-child {
        min-width: 140px;
        white-space: normal;
    }
    
    table th:last-child {
        min-width: 140px;
    }
    
    table td:last-child .btn,
    table td:last-child form {
        display: block;
        width: 100%;
        margin: 2px 0;
    }
    
    table td:last-child .btn {
        padding: 6px 4px;
        font-size: 11px;
        min-width: auto;
    }
}
