/* レスポンシブデザイン - タブレット */
@media (max-width: 1024px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero h2 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .grid.md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.md\:grid-cols-3 > div:last-child {
        grid-column: span 2;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* レスポンシブデザイン - スマートフォン */
@media (max-width: 768px) {
    /* ヘッダー */
    header nav {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    /* ヒーローセクション */
    .hero {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .hero h2 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero .flex {
        flex-direction: column;
        align-items: center;
    }
    
    .hero button {
        width: 100%;
        max-width: 280px;
        margin-bottom: 1rem;
    }
    
    /* モバイルメニュー */
    #mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 50;
    }
    
    #mobile-menu:not(.hidden) {
        display: block;
    }
    
    #mobile-menu-button {
        display: block;
    }
    
    #mobile-menu a {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    #mobile-menu a:last-child {
        border-bottom: none;
    }
    
    /* グリッドレイアウト */
    .grid.md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid.md\:grid-cols-3 > div:last-child {
        grid-column: span 1;
        max-width: 100%;
    }
    
    /* セクションレイアウト */
    section {
        padding: 3rem 0;
    }
    
    section h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    /* カードレイアウト */
    .bg-white.p-8 {
        padding: 1.5rem;
    }
    
    /* くじ引きエリア */
    #lottery-box {
        margin: 0 1rem;
        padding: 1.5rem;
    }
    
    .lottery-result .result-icon {
        font-size: 3rem;
    }
    
    .lottery-result .result-title {
        font-size: 1.25rem;
    }
    
    .lottery-result .result-description {
        font-size: 0.9rem;
    }
    
    /* フッター */
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    footer h4 {
        font-size: 1.1rem;
    }
    
    /* モーダル */
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    /* 通知バー */
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* タイポグラフィー */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* ボタンサイズ */
    button {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* アイコンサイズ */
    .text-6xl {
        font-size: 3rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
}

/* 小さなスマートフォン */
@media (max-width: 480px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero {
        padding: 1.5rem 0;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .bg-white.p-8 {
        padding: 1rem;
    }
    
    #lottery-box {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .text-6xl {
        font-size: 2.5rem;
    }
    
    .text-5xl {
        font-size: 2rem;
    }
    
    .text-4xl {
        font-size: 1.75rem;
    }
    
    .text-3xl {
        font-size: 1.25rem;
    }
    
    .text-2xl {
        font-size: 1.1rem;
    }
}

/* 横向きモード */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 80vh;
        padding: 1rem 0;
    }
    
    .hero h2 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    section {
        padding: 1.5rem 0;
    }
}

/* 高解像度ディスプレイ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 高解像度用の画像やアイコンを最適化 */
    .hero::before {
        background-size: 20px 20px;
    }
}

/* プリファンス設定の尊重 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    
    .bg-white {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .bg-gray-50 {
        background-color: #2d3748;
    }
    
    .text-gray-800 {
        color: #e2e8f0;
    }
    
    .text-gray-600 {
        color: #a0aec0;
    }
    
    .text-gray-500 {
        color: #718096;
    }
}

/* タッチデバイス用の最適化 */
@media (hover: none) and (pointer: coarse) {
    button:hover {
        transform: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    /* タッチ用の大きなタップ領域 */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}