/* ===========================================
   基本スタイル & カラーテーマ（抽選ツール向け）
   =========================================== */

:root {
    --primary-color-start: #27ae60;
    --primary-color-end: #2ecc71;
    --accent-gold-start: #ffd700;
    --accent-gold-end: #ffb347;
    --background-color: #f8f9fa;
    --text-color: #343a40;
    --card-bg-color: #ffffff;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: #1da1f2;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color-start), var(--primary-color-end));
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color-start), var(--primary-color-end));
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color-start), var(--primary-color-end));
    color: white;
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 紙吹雪のような背景パターン */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: confetti-fall 20s linear infinite;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.feature-badge:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.cta-section {
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.cta-section .btn {
    background: linear-gradient(135deg, var(--accent-gold-start), var(--accent-gold-end));
    color: #333;
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

.cta-section .btn:hover {
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.features {
    padding: 3rem 0;
}

/* 特徴セクション */
.features-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* 使い方セクション */
.how-to-section {
    padding: 4rem 0;
    background: white;
}

.usage-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-button {
    padding: 0.75rem 2rem;
    background: #f0f0f0;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #27ae60;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #e0e0e0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

.steps {
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    align-items: flex-start;
}

.step-number {
    background: #27ae60;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.2rem;
}

.step-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.step-content ul {
    margin-left: 1.5rem;
    color: #666;
}

.step-content li {
    margin: 0.25rem 0;
}

/* 下部CTAセクション */
.cta-bottom-section {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-bottom-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-bottom-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.dashboard-actions {
    margin-bottom: 2rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.checkbox-group label {
    display: block;
    margin: 0.5rem 0;
    font-weight: normal;
}

.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.campaign-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    will-change: transform;
}

.campaign-card h3 {
    margin-bottom: 1rem;
}

.campaign-stats {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.campaign-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-active {
    background: #2ecc71;
    color: white;
}

.status-finished {
    background: #95a5a6;
    color: white;
}

.status-cancelled {
    background: #e74c3c;
    color: white;
}

/* テーブルのレスポンシブ対応 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* フォームグループのレスポンシブ調整 */
.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px;
}

/* 管理画面のレスポンシブ対応 */
.manage-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.applicants-list {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.applicants-grid {
    display: grid;
    gap: 1rem;
}

.applicant-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    position: relative;
    border-left: 4px solid #ddd;
    transition: all 0.2s ease;
}

.applicant-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.applicant-card.winner {
    background: #e8f8f5;
    border-left-color: #2ecc71;
}

.applicant-card.has-message {
    border-left-color: #3498db;
}

.applicant-card.winner.has-message {
    border-left-color: #2ecc71;
}

.applicant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.applicant-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.applicant-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.applicant-info strong {
    font-size: 1rem;
    color: #2c3e50;
}

.applicant-date {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.winner-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 0.8rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-weight: bold;
}

/* 応募メッセージスタイル */
.applicant-message {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}

.applicant-message .message-label {
    font-size: 0.8rem;
    color: #3498db;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.applicant-message .message-text {
    font-size: 0.9rem;
    color: #34495e;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.lottery-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

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

.lottery-text {
    color: white;
    font-size: 4rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.winners-section {
    margin-top: 2rem;
}

.winners-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.winner-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.winner-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.redraw-logs {
    margin-top: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
}

.redraw-log {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.redraw-log:last-child {
    border-bottom: none;
}

.url-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.url-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    background: #fee;
    color: #c00;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.success {
    background: #efe;
    color: #060;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.footer-links .separator {
    color: #666;
    margin: 0 0.5rem;
}

/* ==================== レスポンシブデザイン ==================== */

/* モバイルメニュー用ハンバーガーボタン */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: transform 0.2s ease;
}

/* タブレット (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .step {
        padding: 1.5rem;
    }
    
    .campaigns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .winners-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal-content {
        width: 95%;
        margin: 3% auto;
    }
}

/* スマートフォン (768px以下) */
@media (max-width: 768px) {
    /* ナビゲーション */
    .menu-toggle {
        display: block;
    }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
    }
    
    .user-name {
        width: 100%;
        text-align: center;
        padding: 0.5rem;
    }
    
    /* ヒーローセクション */
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .hero-features {
        padding: 0 1rem;
    }

    .feature-badge {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    /* グリッドレイアウト */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 使い方セクション */
    .usage-tabs {
        flex-direction: column;
        align-items: center;
    }

    .tab-button {
        width: 100%;
        max-width: 300px;
    }

    .step {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .step-number {
        margin: 0 auto 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-bottom-section h2 {
        font-size: 2rem;
    }

    .cta-bottom-section p {
        font-size: 1rem;
    }
    
    .campaigns-grid {
        grid-template-columns: 1fr;
    }
    
    .winners-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    /* カード */
    .campaign-card {
        padding: 1rem;
    }
    
    .campaign-actions {
        flex-direction: column;
    }
    
    .campaign-actions .btn {
        width: 100%;
    }
    
    /* モーダル */
    .modal-content {
        width: 100%;
        margin: 0;
        height: 100%;
        border-radius: 0;
        overflow-y: auto;
    }
    
    /* 抽選回数表示 */
    .lottery-round {
        margin-bottom: 30px;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .lottery-round h3 {
        color: #333;
        margin-bottom: 15px;
        font-size: 1.2rem;
        font-weight: bold;
    }

    .winners-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    /* 抽選オーバーレイ */
    .lottery-text {
        font-size: 2.5rem;
    }
    
    /* フォーム */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* iOSのズーム防止 */
    }
    
    /* 応募者カード */
    .applicant-card {
        flex-direction: column;
        text-align: center;
    }
    
    .applicant-card .avatar {
        margin: 0 auto;
    }
    
    .btn-remove {
        position: static;
        margin-top: 0.5rem;
    }
    
    /* URL入力セクション */
    .url-section {
        flex-direction: column;
    }
    
    .url-input {
        width: 100%;
    }
    
    /* フッター */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer p {
        font-size: 0.9rem;
    }
}

/* 小型スマートフォン (480px以下) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn-large {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .winners-list {
        grid-template-columns: 1fr;
    }
    
    .winner-card {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }
    
    .winner-card img {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }
    
    /* ステータスバッジ */
    .status {
        font-size: 0.75rem;
    }
    
    /* キャンペーン統計 */
    .campaign-stats {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* フローティングチャット */
.chat-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-toggle-btn {
    background: #1da1f2;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle-btn:hover {
    background: #1991db;
    transform: scale(1.05);
}

.chat-unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.chat-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-window-header {
    background: #1da1f2;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.chat-close-btn:hover {
    opacity: 0.8;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.chat-message {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-message.host-message {
    background: #e3f2fd;
    border-left: 3px solid #1da1f2;
}

.chat-message.participant-message {
    background: #fff;
    border-left: 3px solid #6c757d;
}

.chat-sender {
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.chat-text {
    color: #555;
    word-wrap: break-word;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.chat-time {
    font-size: 0.7rem;
    color: #999;
    display: block;
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: none;
}

.chat-input:focus {
    outline: none;
    border-color: #1da1f2;
}

/* モバイル対応 */
@media (max-width: 480px) {
    .chat-floating {
        bottom: 10px;
        right: 10px;
    }

    .chat-window {
        width: calc(100vw - 20px);
        right: 0;
        bottom: 55px;
    }

    .chat-messages {
        height: 250px;
    }
}

/* 横向き表示対応 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* 管理画面レスポンシブ */
@media (max-width: 768px) {
    .manage-sections {
        gap: 1rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    /* テーブルをカード形式に変換 */
    table {
        border: 0;
    }
    
    table thead {
        display: none;
    }
    
    table tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 1rem;
    }
    
    table td {
        display: block;
        text-align: right;
        padding: 0.5rem;
        border: none;
        position: relative;
        padding-left: 50%;
    }
    
    table td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: bold;
    }
}

/* タッチデバイス用の調整 */
@media (hover: none) and (pointer: coarse) {
    /* ホバー効果を無効化 */
    .nav-link:hover,
    .btn:hover {
        background: inherit;
    }
    
    /* タップ範囲を広げる */
    .btn,
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* スクロール性能向上 */
    .applicants-list {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* 応募フォーム */
.entry-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.entry-form h3 {
    margin-bottom: 1rem;
    color: #333;
}

.entry-form .form-group {
    margin-bottom: 1rem;
}

.entry-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.entry-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.entry-form .note {
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* 参加者情報 */
.participant-info {
    background: #e8f5e9;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 2px solid #4caf50;
}

.participant-info h3 {
    color: #2e7d32;
    margin-bottom: 1rem;
}

.participant-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.participant-info span {
    font-weight: bold;
}

/* 抽選結果 */
.result-section {
    margin: 2rem 0;
}

.winner-result {
    background: linear-gradient(135deg, var(--accent-gold-start), var(--accent-gold-end));
    color: #333;
    padding: 3rem;
    border-radius: var(--border-radius-md);
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.winner-result::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 40%
    );
    transform: rotate(-45deg);
    pointer-events: none;
}

.winner-result .congrats {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.winner-result .congrats::before {
    content: '\\1F3C6';
    margin-right: 15px;
}

.winner-result .congrats::after {
    content: '\\1F3C6';
    margin-left: 15px;
}

.winner-code-section {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    position: relative;
    z-index: 1;
}

.winner-code-section p {
    position: relative;
    z-index: 1;
}

.winner-code-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.winner-code-input {
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    background: white;
    color: #333;
    border: none;
    border-radius: 4px;
    width: 200px;
}

.loser-result {
    background: #f5f5f5;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #ddd;
}

.loser-result h2 {
    color: #666;
    margin-bottom: 1rem;
}

/* 当選者ID検索 */
.winner-search {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
}

.winner-search .form-group {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.winner-search input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

.search-result-found {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    padding: 1rem;
    border-radius: 4px;
}

.search-result-not-found {
    background: #ffeaa7;
    border: 1px solid #fdcb6e;
    padding: 1rem;
    border-radius: 4px;
}

.winner-details p {
    margin: 0.5rem 0;
}

/* アニメーション */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification {
    animation: slideIn 0.3s ease;
}

.applicant-card {
    animation: fadeIn 0.3s ease;
}

/* 削除ボタンのスタイル */
.btn.btn-danger {
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
    transition: all 0.3s;
}

.btn.btn-danger:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.02);
}

/* 管理画面へのリンクセクション */
.manage-link-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

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

.manage-link-section p {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* 印刷用スタイル */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal {
        display: none;
    }

    .main-content {
        padding: 0;
    }

    body {
        background: white;
    }
}

/* ===========================================
   X認証・テキスト入力・セッション復元スタイル
   =========================================== */

/* X認証セクション */
.x-auth-section {
    margin-bottom: 1.5rem;
}

.auth-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.btn-x-login {
    background: #000;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 300px;
}

.btn-x-login:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    padding: 0 1rem;
    color: #888;
    font-size: 0.9rem;
}

/* X認証済み表示 */
.x-authenticated-section {
    margin-bottom: 1.5rem;
}

.x-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.x-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.x-user-details {
    flex: 1;
}

.x-user-name {
    display: block;
    font-weight: 600;
    color: #333;
}

.x-user-handle {
    display: block;
    color: #666;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* テキスト入力セクション */
.manual-entry-section {
    margin-bottom: 1rem;
}

/* 文字数カウンター */
.char-count {
    display: block;
    text-align: right;
    color: #888;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* セッション復元通知 */
.session-restored-notice {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

.session-restored-notice .notice-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-restored-notice .notice-icon {
    font-size: 1.5rem;
    color: #28a745;
}

.session-restored-notice p {
    color: #155724;
    margin: 0;
    font-weight: 500;
}

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

/* 応募フォームの注意書き */
.entry-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.note-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    color: #155724;
}

/* 参加者情報の詳細 */
.participant-details {
    margin-bottom: 1.5rem;
}

.participant-avatar-section {
    text-align: center;
    margin-bottom: 1rem;
}

.participant-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4caf50;
}

.participant-id {
    font-family: monospace;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.participant-message {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid #1da1f2;
    color: #555;
    font-style: italic;
}

/* アラート */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

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

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

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

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .x-user-info {
        flex-direction: column;
        text-align: center;
    }

    .x-user-details {
        text-align: center;
    }

    .btn-x-login {
        max-width: 100%;
    }
}
