/* 宝箱ボタンのスタイル */
.tnb-button {
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 50px;
    height: 50px;
}

@media (max-width: 768px) {
    .tnb-button {
        width: 70px;
        height: 70px;
        padding: 10px;
        background-color: rgba(255,255,255,0.1);
        border-radius: 10px;
    }
}

.tnb-button:hover {
    transform: scale(1.1);
}

/* 配置クラス */
.tnb-align-left { text-align: left; }
.tnb-align-center { text-align: center; }
.tnb-align-right { text-align: right; }

/* モーダルスタイル */
.tnb-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
    text-align: left;
    animation: modal-pop 0.3s ease;
}

@keyframes modal-pop {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* クローズボタン */
.tnb-modal-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 5px 10px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
}

.tnb-modal-close:hover {
    background-color: #f0f0f0;
}

/* タイマースタイル */
.tnb-timer {
    margin-top: 10px;
    font-weight: bold;
    color: #e74c3c;
}

/* 成功メッセージ */
.tnb-success {
    text-align: left;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.tnb-success p {
    margin-bottom: 15px;
}

/* ギフトコードコンテナ */
.gift-code-container {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.gift-code-container code {
    font-family: monospace;
    font-size: 18px;
    color: #2c3e50;
    background: none;
    padding: 0;
    margin: 0;
}

/* ツイートコンテナ */
.tweet-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.tweet-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    margin-bottom: 10px;
    box-sizing: border-box;
    height: 80px;
}

/* ボタンスタイル */
.tnb-copy-code,
.tnb-tweet {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    margin: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tnb-copy-code:hover,
.tnb-tweet:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.tnb-tweet {
    background-color: #1da1f2;
}

.tnb-tweet:hover {
    background-color: #0c85d0;
}

/* ラジオボタンとラベル（クイズ用） */
.tnb-quiz-form label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tnb-quiz-form label:hover {
    background-color: #f5f5f5;
    border-color: #c8c8c8;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tnb-quiz-form input[type="radio"] {
    margin-right: 8px;
}

.tnb-quiz-form input[type="submit"] {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tnb-quiz-form input[type="submit"]:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* メッセージスタイル */
.tnb-message {
    text-align: center;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: bold;
}

.tnb-message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.tnb-message-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.tnb-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.tnb-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ヘッダー統計 */
#treasure-header-stats {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.tnb-count {
    font-weight: bold;
    color: #e74c3c;
    font-size: 18px;
}

.tnb-button-stats {
    padding: 6px 12px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    margin-left: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tnb-button-stats:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 発見スタンプ */
#tnb-stamp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 25px;
    border: 1px solid #e9ecef;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    z-index: 9999;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    animation: stamp-modal-fade 0.3s ease;
}

@keyframes stamp-modal-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.tnb-stamp-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 15px;
}

.tnb-stamp-list li {
    padding: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
    border-radius: 6px;
}

.tnb-stamp-list li:hover {
    background-color: #f8f9fa;
}

/* 発見スタンプ2段表示 */
.stamp-date {
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

.stamp-quiz {
    font-size: 0.95em;
    padding-left: 10px;
    color: #333;
}

.tnb-stamp-time {
    display: inline-block;
    min-width: 180px;
    color: #666;
    font-size: 0.9em;
}

.tnb-button-close {
    padding: 10px 15px;
    cursor: pointer;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 16px;
    display: block;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tnb-button-close:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 管理画面用：ボタン画像選択（ラジオボタン形式・小サイズ・横並び） */
.admin-image-options-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.admin-image-options-row .tnb-button-image-option {
    margin: 0 !important;
    width: 50px !important;
    height: 50px !important;
}

.admin-image-options-row .tnb-button-image-option input[type="radio"] {
    display: none !important;
}

.admin-image-options-row .tnb-button-image-option input[type="radio"]:checked + label {
    border: 2px solid #2ecc71 !important;
    background-color: rgba(46, 204, 113, 0.2) !important;
    transform: scale(1.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5) !important;
}

.admin-image-options-row .tnb-button-image-option label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
}

.admin-image-options-row .tnb-button-image-option img {
    width: 35px !important;
    height: 35px !important;
    object-fit: contain !important;
}

/* 不正解済み宝箱のスタイル */
.tnb-button.failed {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

/* ショートコードコピーボタン */
.tnb-copy-shortcode {
    display: inline-block;
    margin-left: 5px;
    padding: 3px 8px;
    font-size: 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tnb-copy-shortcode:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* 選択肢の行 */
.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.option-row input[type="radio"] {
    margin-right: 10px;
}

.option-row input[type="text"] {
    flex-grow: 1;
    margin-right: 10px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.option-row .remove-option {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#add-option {
    margin-top: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .tnb-button {
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 5px;
    }
    
    .tnb-modal {
        background: #333;
        color: #fff;
        box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    }
    
    .tnb-modal-close {
        color: #fff;
    }
    
    .tnb-quiz-form label {
        border-color: #555;
        color: #fff;
        background-color: #444;
    }
    
    .tnb-quiz-form label:hover {
        background-color: #555;
    }
    
    .tnb-success {
        background-color: #2c3e50;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .gift-code-container {
        background-color: #444;
        border-color: #555;
    }
    
    .gift-code-container code {
        color: #ecf0f1;
    }
    
    .tweet-container textarea {
        background-color: #444;
        border-color: #555;
        color: #ecf0f1;
    }
    
    #treasure-header-stats {
        background: #333;
        color: #fff;
        border-color: #555;
    }
    
    #tnb-stamp-modal {
        background: #333;
        color: #fff;
        border-color: #555;
    }
    
    .tnb-stamp-list li {
        border-color: #444;
    }
    
    .tnb-stamp-list li:hover {
        background-color: #444;
    }
    
    .admin-image-options-row .tnb-button-image-option input[type="radio"]:checked + label {
        border-color: #2ecc71 !important;
        background-color: rgba(46, 204, 113, 0.2) !important;
    }
    
    .option-row {
        background-color: #444;
        border-color: #555;
    }
    
    .option-row input[type="text"] {
        background-color: #333;
        border-color: #555;
        color: #ecf0f1;
    }
    
    .tnb-copy-shortcode {
        background-color: #444;
        border-color: #555;
        color: #ecf0f1;
    }
    
    .tnb-copy-shortcode:hover {
        background-color: #555;
    }
}
