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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif;
    background: linear-gradient(270deg,
        rgba(255, 107, 107, 0.2), rgba(78, 205, 196, 0.2), rgba(69, 183, 209, 0.2),
        rgba(150, 206, 180, 0.2), rgba(255, 234, 167, 0.2), rgba(253, 121, 168, 0.2),
        rgba(225, 112, 85, 0.2), rgba(108, 92, 231, 0.2));
    background-size: 1600% 1600%;
    animation-name: rainbowShift;
    animation-duration: 6s;
    animation-timing-function: ease;
    animation-iteration-count: infinite;
    animation-play-state: paused; /* デフォルトで停止 */
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

/* マウス操作時に背景アニメーションを開始 */
body.mouse-active {
    animation-play-state: running;
}

body.mouse-active .background-pattern {
    animation-play-state: running;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 180, 210, 0.15) 0%, transparent 70%),
        radial-gradient(circle at 80% 20%, rgba(180, 210, 255, 0.15) 0%, transparent 70%),
        radial-gradient(circle at 40% 80%, rgba(210, 255, 180, 0.15) 0%, transparent 70%),
        radial-gradient(circle at 60% 40%, rgba(255, 215, 0, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 10% 90%, rgba(255, 20, 147, 0.12) 0%, transparent 60%);
    animation-name: patternPulse;
    animation-duration: 5s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-play-state: paused; /* デフォルトで停止 */
    z-index: -1;
}

@keyframes patternPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 20px 10px;
    position: relative;
    z-index: 1;
    overflow-x: auto;
}

.search-section {
    max-width: 1200px;
    margin: 0 auto;
}

.results-section {
    max-width: 100%;
    margin: 0;
    padding: 0 5px;
    overflow-x: auto;
}

.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 1s ease-out;
}

/* ロゴ画像対応 - テキストとロゴ画像両方に対応 */
.logo {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, 
        #ff6b6b 0%, 
        #4ecdc4 25%, 
        #45b7d1 50%, 
        #96ceb4 75%, 
        #ffeaa7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    display: inline-block;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

/* ロゴ画像が含まれる場合は画像のスタイル優先 */
.logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 25px rgba(0,0,0,0.15));
    transition: all 0.3s ease;
    /* テキストのグラデーション効果を無効化 */
    -webkit-text-fill-color: initial;
    background: none;
}

.logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 12px 35px rgba(0,0,0,0.2)) brightness(1.1);
}

/* ロゴ画像がない場合のテキストスタイル */
.logo:not(:has(img))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 107, 107, 0.1) 0%, 
        rgba(78, 205, 196, 0.1) 25%, 
        rgba(69, 183, 209, 0.1) 50%, 
        rgba(150, 206, 180, 0.1) 75%, 
        rgba(255, 234, 167, 0.1) 100%);
    border-radius: 15px;
    z-index: -1;
    transform: scale(1.1);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.5),
                    0 0 50px rgba(78, 205, 196, 0.4),
                    0 0 80px rgba(69, 183, 209, 0.3);
    }
    to {
        box-shadow: 0 0 50px rgba(255, 107, 107, 0.6),
                    0 0 80px rgba(78, 205, 196, 0.5),
                    0 0 120px rgba(69, 183, 209, 0.4);
    }
}

.logo a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.subtitle {
    color: rgba(100, 100, 100, 0.8);
    font-size: 1.2rem;
    font-weight: 300;
}

.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.1),
        0 0 0 1px rgba(255,255,255,0.2);
    margin-bottom: 40px;
    animation: slideIn 0.8s ease-out 0.3s both;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-input-container {
    position: relative;
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    font-size: 1.1rem;
    background: rgba(240, 244, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.search-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #5B6FE8 0%, #4254D9 50%, #3443C6 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(91, 111, 232, 0.6),
                0 0 30px rgba(91, 111, 232, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.search-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(91, 111, 232, 0.7),
                0 0 50px rgba(91, 111, 232, 0.6);
    background: linear-gradient(135deg, #6B7FF3 0%, #5264E4 50%, #4353D1 100%);
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(91, 111, 232, 0.4);
}


.search-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.platform-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.platform-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
}

.platform-checkbox:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.platform-checkbox.checked {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.platform-checkbox input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #667eea;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.platform-checkbox input[type="checkbox"]:checked {
    background: #667eea;
}

.platform-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.platform-icon-img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    margin-right: 5px;
    background: #f0f0f0;
}

.platform-checkbox-label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

@media (min-width: 1200px) {
    .platform-checkbox-label.short { display: none; }
    .platform-checkbox-label.medium { display: none; }
    .platform-checkbox-label.full { display: inline; }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .platform-checkbox-label.short { display: none; }
    .platform-checkbox-label.medium { display: inline; }
    .platform-checkbox-label.full { display: none; }
}

@media (min-width: 481px) and (max-width: 767px) {
    .platform-checkbox-label.short { display: inline; }
    .platform-checkbox-label.medium { display: none; }
    .platform-checkbox-label.full { display: none; }
}

@media (max-width: 480px) {
    .platform-checkbox-label { display: none; }
    .platform-checkbox {
        min-width: 40px;
        padding: 8px 10px;
    }
    .platform-links {
        gap: 8px;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .platform-checkbox {
        min-width: 35px;
        padding: 6px 8px;
    }
    .platform-links {
        gap: 6px;
    }
}

.other-options {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-checkbox:checked {
    background: #667eea;
}

.sort-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.sort-label {
    font-weight: 500;
    color: #667eea;
    cursor: pointer;
}

/* 最低価格入力フィールド */
.min-price-option {
    gap: 6px;
}

.min-price-input {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    background: rgba(240, 244, 255, 0.9);
    transition: all 0.3s ease;
    text-align: right;
}

.min-price-input:focus {
    outline: none;
    border-color: #764ba2;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.min-price-input::placeholder {
    color: #adb5bd;
}

.min-price-unit {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
}

.min-price-note {
    font-size: 0.7rem;
    color: #999;
    margin-left: 4px;
}

/* ジャンルサジェスト */
.genre-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.genre-label {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
}

.genre-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.genre-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* レスポンシブ対応 - ジャンル */
@media (max-width: 768px) {
    .genre-suggestions {
        gap: 6px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .genre-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* レスポンシブ対応 - 最低価格 */
@media (max-width: 768px) {
    .min-price-input {
        width: 70px;
        padding: 5px 8px;
        font-size: 0.85rem;
    }

    .min-price-unit {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .min-price-option {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .min-price-input {
        width: 65px;
        padding: 4px 6px;
        font-size: 0.8rem;
    }
}

/* 4列固定グリッド設定（スマートフォン対応） */
.results-container {
    display: grid;
    gap: 8px;
    margin-top: 40px;
    width: 100%;
    transition: all 0.3s ease;
    
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    overflow-x: auto;
    min-width: 720px;
}

.results-container.platforms-1 {
    grid-template-columns: 1fr !important;
    min-width: 100% !important;
}

.results-container.platforms-2 {
    grid-template-columns: repeat(2, 1fr) !important;
    min-width: 100% !important;
}

.results-container.platforms-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    min-width: 100% !important;
}

.results-container.platforms-4 {
    grid-template-columns: repeat(4, minmax(90px, 1fr)) !important;
    min-width: 360px !important;
}

.platform-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    min-width: 80px;
}

.platform-section.visible {
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp 0.6s ease-out;
}

.platform-section:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.platform-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.platform-logo .platform-icon {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    display: inline-block;
}

.platform-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loading-text {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
}

/* No Image表示用のスタイル（画像と同じサイズに統一） */
.no-image-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ced4da;
    border-radius: 6px;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    object-fit: contain;
    box-sizing: border-box;
}

.no-image-placeholder:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
}

.no-image-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    opacity: 0.6;
    flex-shrink: 0;
}

.no-image-text {
    line-height: 1.2;
    flex-shrink: 0;
}

.product-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 15px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.8)),
        linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    margin-bottom: 8px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: cardFloat 6s ease-in-out infinite;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg);
    }
    50% {
        transform: translateY(-2px) rotateX(1deg);
    }
}

.product-item:hover {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(248, 250, 255, 0.95)),
        linear-gradient(45deg, rgba(255, 107, 107, 0.3), rgba(78, 205, 196, 0.3), rgba(69, 183, 209, 0.3));
    transform: translateY(-20px) scale(1.15) rotateX(8deg) rotateY(3deg);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 107, 107, 0.6),
        0 0 80px rgba(78, 205, 196, 0.5),
        0 0 100px rgba(69, 183, 209, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding-bottom: 60px;
    animation: cardHover 0.6s ease-out;
    border: 2px solid rgba(255, 107, 107, 0.5);
}

@keyframes cardHover {
    0% {
        transform: translateY(0) scale(1) rotateX(0deg) rotateY(0deg);
    }
    50% {
        transform: translateY(-20px) scale(1.12) rotateX(8deg) rotateY(3deg);
    }
    100% {
        transform: translateY(-15px) scale(1.1) rotateX(5deg) rotateY(2deg);
    }
}

.product-item:hover .product-image {
    transform: scale(1.3) rotateZ(5deg);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 107, 107, 0.7),
        0 0 50px rgba(78, 205, 196, 0.5);
    filter: brightness(1.15) contrast(1.15) saturate(1.3);
    border-radius: 15px;
    animation: imageGlow 1s ease infinite alternate;
}

@keyframes imageGlow {
    0% {
        box-shadow:
            0 20px 45px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(255, 107, 107, 0.7),
            0 0 50px rgba(78, 205, 196, 0.5);
    }
    100% {
        box-shadow:
            0 20px 45px rgba(0, 0, 0, 0.5),
            0 0 50px rgba(78, 205, 196, 0.9),
            0 0 70px rgba(69, 183, 209, 0.7);
    }
}

.product-item:hover .product-title {
    -webkit-line-clamp: unset;
    overflow: visible;
    height: auto;
    font-weight: 600;
    color: #2c3e50;
    white-space: normal;
    max-height: none;
    font-size: 0.8rem;
    background: none;
    padding: 0;
    border-radius: 0;
    margin: 8px 0 0 0;
    box-shadow: none;
    border: none;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    color: #1a202c;
    text-shadow: none;
    position: relative;
    top: 20px;
}

.product-item:hover .product-price {
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    top: 20px;
}

.product-item.compact:hover {
    padding-bottom: 40px;
}

.product-item.compact:hover .product-title {
    display: block;
    -webkit-line-clamp: unset;
    height: auto;
    font-size: 0.75rem;
    position: absolute;
    top: calc(100% + 25px);
    left: 0;
    right: 0;
    background: none;
    padding: 4px 0;
    border-radius: 0;
    margin: 4px 0 0 0;
    box-shadow: none;
    border: none;
    z-index: 1001;
    box-sizing: border-box;
    width: 100%;
    white-space: normal;
    color: #1a202c;
    font-weight: 600;
    text-shadow: none;
}

.product-item.compact {
    position: relative;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 60px;
}

.product-title {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    color: #333;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    transition: all 0.3s ease;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e74c3c;
    text-align: center;
    margin-top: auto;
}

.product-item.compact {
    padding: 6px;
    gap: 4px;
    min-height: 100px;
}

.product-item.compact .product-title {
    display: none;
}

.product-item.compact .product-price {
    font-size: 1rem;
    margin-top: 4px;
}

.product-item.compact .product-image {
    margin-bottom: 4px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 45px;
    text-align: center;
}

.page-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.error-message {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    color: #495057;
    border-radius: 8px;
    margin: 10px;
    border-left: 4px solid #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: break-word;
}

@media (max-width: 480px) {
    .no-results {
        padding: 12px 8px;
        margin: 8px 5px;
        font-size: 0.85rem;
        border-left-width: 3px;
    }
}

@media (max-width: 360px) {
    .no-results {
        padding: 10px 6px;
        margin: 6px 3px;
        font-size: 0.8rem;
        border-radius: 6px;
    }
}

.product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.product-popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.product-popup.show .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    transition: all 0.2s ease;
    z-index: 1;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
    transform: scale(1.1);
}

.popup-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.popup-image-container {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.popup-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ced4da;
    border-radius: 12px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.popup-title-container {
    flex: 1;
    min-width: 0;
}

.popup-title {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    color: #2980b9;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    word-wrap: break-word;
}

.popup-title:hover {
    text-decoration: underline;
    color: #3498db;
}

.popup-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.popup-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e74c3c;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: right;
}

.popup-platform {
    background: #f8f9fa;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e9ecef;
}

.popup-description-container {
    margin-bottom: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    transition: all 0.3s ease;
}

.popup-description-container[style*="display: none"] {
    margin-bottom: 0;
    padding-top: 0;
    border-top: none;
}

.popup-description-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.popup-description {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 10px;
}

.popup-description::-webkit-scrollbar {
    width: 4px;
}

.popup-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.popup-description::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.popup-description::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.popup-action {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s ease;
}

.popup-content:has(.popup-description-container[style*="display: none"]) .popup-action {
    border-top: 2px solid #eee;
    margin-top: 25px;
    padding-top: 20px;
}

.sticky-platform-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    padding: 12px 0;
    transform: translateY(-100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.sticky-platform-header.visible {
    transform: translateY(0);
}

.sticky-platform-list {
    display: grid;
    gap: 0;
    align-items: center;
    max-width: 100%;
    margin: 0;
    padding: 0 10px;
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(80px, 1fr));
}

.sticky-platform-list.platforms-1 {
    grid-template-columns: 1fr !important;
}

.sticky-platform-list.platforms-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.sticky-platform-list.platforms-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.sticky-platform-list.platforms-4 {
    grid-template-columns: repeat(4, minmax(80px, 1fr)) !important;
}

.sticky-platform-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 6px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    opacity: 0.7;
    margin: 0 1px;
    color: #333;
}

.sticky-platform-item.active {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.4);
}

.sticky-platform-item:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sticky-platform-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

.sticky-platform-name {
    font-size: 0.6rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* 横スクロールバーのスタイリング */
.results-container::-webkit-scrollbar,
.results-section::-webkit-scrollbar,
.sticky-platform-list::-webkit-scrollbar {
    height: 8px;
}

.results-container::-webkit-scrollbar-track,
.results-section::-webkit-scrollbar-track,
.sticky-platform-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb,
.results-section::-webkit-scrollbar-thumb,
.sticky-platform-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover,
.results-section::-webkit-scrollbar-thumb:hover,
.sticky-platform-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

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

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

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* レスポンシブ対応（4列固定を維持） */
@media (max-width: 1200px) {
    .results-container { 
        gap: 6px; 
        grid-template-columns: repeat(4, minmax(100px, 1fr));
        min-width: 400px;
    }
    .platform-section {
        padding: 8px;
        min-width: 90px;
    }
    .sticky-platform-list {
        grid-template-columns: repeat(4, minmax(90px, 1fr));
    }
    
    /* ロゴ画像レスポンシブ対応 */
    .logo img {
        max-width: 90%;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 15px 8px;
    }
    .results-section { 
        padding: 0 2px; 
    }
    .search-container { 
        padding: 20px; 
        border-radius: 20px; 
        margin-bottom: 20px;
    }
    .search-input-container { 
        flex-direction: column; 
    }
    .search-input, .search-btn { 
        width: 100%; 
    }
    .logo { 
        font-size: 2rem; 
    }
    
    .logo img {
        max-width: 85%;
    }
    
    .platform-links {
        gap: 8px;
    }
    
    .platform-checkbox {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .results-container {
        gap: 4px;
        grid-template-columns: repeat(4, minmax(80px, 1fr));
        min-width: 320px;
    }
    
    .platform-section {
        padding: 5px;
        border-radius: 12px;
        min-width: 75px;
    }
    
    .platform-name {
        font-size: 0.65rem;
    }
    
    .sticky-platform-list {
        grid-template-columns: repeat(4, minmax(75px, 1fr));
        padding: 0 5px;
    }
    
    .sticky-platform-name {
        font-size: 0.55rem;
    }
    
    .popup-content { 
        padding: 25px; 
        max-width: 95%;
    }
    .popup-image { 
        max-width: 180px; 
        height: 180px; 
    }
    .popup-title { 
        font-size: 1.3rem; 
    }
    .popup-price { 
        font-size: 1.6rem; 
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px 2px;
    }
    .results-section {
        padding: 0 1px;
    }
    .results-container {
        gap: 3px;
        grid-template-columns: repeat(4, minmax(75px, 1fr));
        min-width: 300px;
    }
    .platform-section {
        padding: 4px;
        border-radius: 10px;
        min-width: 70px;
    }
    .platform-name {
        font-size: 0.6rem;
    }
    .product-title {
        font-size: 0.6rem;
    }
    .product-price {
        font-size: 0.9rem;
    }
    .sticky-platform-list {
        grid-template-columns: repeat(4, minmax(70px, 1fr));
        padding: 0 3px;
    }
    .sticky-platform-item {
        padding: 4px 4px;
        margin: 0 1px;
    }
    .sticky-platform-name {
        font-size: 0.5rem;
    }
    
    .logo img {
        max-width: 80%;
    }
}

@media (max-width: 390px) {
    .results-container {
        gap: 2px;
        grid-template-columns: repeat(4, minmax(70px, 1fr));
        min-width: 280px;
    }
    .platform-section {
        padding: 3px;
        min-width: 65px;
    }
    .platform-name {
        font-size: 0.55rem;
    }
    .sticky-platform-list {
        grid-template-columns: repeat(4, minmax(65px, 1fr));
        padding: 0 2px;
    }
    .sticky-platform-item {
        padding: 3px 3px;
        margin: 0;
    }
    .sticky-platform-name {
        font-size: 0.45rem;
    }
    
    .logo img {
        max-width: 75%;
    }
}

/* レート制限情報表示 */
.rate-limit-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

/* デバッグモードでない場合は非表示 */
body:not([data-debug="true"]) .rate-limit-info {
    display: none !important;
}

.rate-limit-info.warning {
    color: #f39c12;
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.rate-limit-info.danger {
    color: #e74c3c;
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    animation: pulse 2s infinite;
}

/* セキュリティ警告ポップアップ */
.security-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideInRight 0.5s ease-out;
}

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    position: relative;
}

.warning-icon {
    font-size: 2rem;
    color: #f39c12;
    flex-shrink: 0;
}

.warning-message {
    flex: 1;
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
}

.warning-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    transition: all 0.2s ease;
}

.warning-close:hover {
    background: rgba(0,0,0,0.2);
    transform: scale(1.1);
}

/* 検索ボタンの無効化状態 */
.search-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.search-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* アニメーション */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    .popup-content {
        padding: 20px;
        max-width: 95%;
        margin: 10px;
    }
    
    .popup-header {
        flex-direction: column;
        gap: 20px; /* ギャップを増やして重なりを防ぐ */
        align-items: center; /* 中央揃えに変更 */
    }
    
    .popup-image-container {
        width: 150px;
        height: 150px;
        align-self: center;
        flex-shrink: 0; /* サイズを固定 */
    }
    
    .popup-title-container {
        width: 100%; /* 全幅を使用 */
        min-height: 60px; /* 最小高さを確保 */
        display: flex;
        align-items: flex-start; /* 上端に配置 */
        justify-content: center;
    }
    
    .popup-title {
        font-size: 1.2rem;
        text-align: center;
        line-height: 1.4;
        margin-top: 10px; /* 上部にマージンを追加 */
        word-break: break-word; /* 長い単語も折り返し */
        hyphens: auto; /* 自動ハイフネーション */
    }
    
    .popup-middle {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px; /* ギャップを増やす */
        margin-top: 20px; /* 上部マージンを追加 */
    }
    
    .popup-price {
        font-size: 1.5rem;
        text-align: center;
        margin-top: 10px; /* 上部マージンを追加 */
    }
    
    .popup-platform {
        margin-top: 10px; /* プラットフォーム情報にもマージン追加 */
    }

    /* モバイル画面での検索ボタン */
    .search-btn {
        background: linear-gradient(135deg, #5B6FE8 0%, #4254D9 50%, #3443C6 100%);
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 15px;
        margin: 5px;
    }
    
    .popup-header {
        gap: 25px; /* さらにギャップを増やす */
    }
    
    .popup-image-container {
        width: 120px;
        height: 120px;
        margin-bottom: 15px; /* 下部マージンを追加 */
    }
    
    .popup-title-container {
        min-height: 80px; /* より多くの高さを確保 */
        padding-top: 10px; /* パディングを追加 */
    }
    
    .popup-title {
        font-size: 1.1rem;
        margin-top: 15px; /* より大きなマージン */
        padding: 0 10px; /* 左右にパディング追加 */
    }
    
    .popup-middle {
        margin-top: 25px; /* より大きな上部マージン */
        gap: 20px;
    }
    
    .popup-price {
        font-size: 1.3rem;
        margin-top: 15px;
    }
    
    .popup-description-title {
        font-size: 1rem;
        margin-top: 20px; /* 説明セクションにもマージン */
    }
    
    .popup-description {
        font-size: 0.9rem;
        max-height: 120px;
        margin-top: 10px;
    }
    
    .popup-description-container {
        margin-top: 25px; /* 説明コンテナの上部マージン増加 */
    }

    /* 小画面での検索ボタン */
    .search-btn {
        background: linear-gradient(135deg, #5B6FE8 0%, #4254D9 50%, #3443C6 100%);
    }
}

/* 超小型画面（360px以下）の追加対応 */
@media (max-width: 360px) {
    .popup-header {
        gap: 30px; /* 最大ギャップ */
    }
    
    .popup-image-container {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }
    
    .popup-title-container {
        min-height: 90px; /* さらに高さを確保 */
        padding-top: 15px;
    }
    
    .popup-title {
        font-size: 1rem;
        margin-top: 20px; /* 最大マージン */
        line-height: 1.3;
    }
    
    .popup-middle {
        margin-top: 30px; /* 最大上部マージン */
    }
    
    .popup-price {
        font-size: 1.2rem;
        margin-top: 20px;
    }

    /* 超小画面での検索ボタン */
    .search-btn {
        background: linear-gradient(135deg, #5B6FE8 0%, #4254D9 50%, #3443C6 100%);
    }
}

@supports not selector(:has(*)) {
    .popup-action {
        border-top: 2px solid #eee;
        margin-top: 25px;
        padding-top: 20px;
    }
}

/* パーティクル効果とキラキラエフェクト */
.sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkleFloat 3s linear infinite;
    opacity: 0;
}

.sparkle:nth-child(odd) {
    background: radial-gradient(circle, #ff6b6b 0%, transparent 70%);
    animation-duration: 4s;
}

.sparkle:nth-child(3n) {
    background: radial-gradient(circle, #4ecdc4 0%, transparent 70%);
    animation-duration: 5s;
}

.sparkle:nth-child(4n) {
    background: radial-gradient(circle, #ffd700 0%, transparent 70%);
    animation-duration: 3.5s;
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 1;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }
    100% {
        transform: translateY(-10vh) scale(0);
        opacity: 0;
    }
}

/* ページ読み込み時のキラキラ効果 */
@keyframes pageLoadSparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.page-load-sparkle {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    animation: pageLoadSparkle 2s ease-out;
}

/* ホバー時のマジカルエフェクト */
.product-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 107, 107, 0.1) 60deg,
        rgba(78, 205, 196, 0.1) 120deg,
        rgba(69, 183, 209, 0.1) 180deg,
        rgba(150, 206, 180, 0.1) 240deg,
        rgba(255, 234, 167, 0.1) 300deg,
        transparent 360deg
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 50%;
    animation: magicRotate 4s linear infinite;
}

.product-item:hover::after {
    opacity: 1;
}

@keyframes magicRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* シンプル表示モード時のスタイル */
body.simple-mode {
    /* 背景アニメーションを停止 */
    background: #f5f5f5 !important;
    animation: none !important;
}

body.simple-mode .background-pattern {
    display: none;
}

body.simple-mode .sparkle-container {
    display: none;
}

body.simple-mode .page-load-sparkle {
    display: none;
}

/* シンプルモード: ヘッダーアニメーション無効化 */
body.simple-mode .header {
    animation: none;
}

body.simple-mode .logo::before {
    animation: none;
}

/* シンプルモード: 検索コンテナ */
body.simple-mode .search-container {
    animation: none;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* シンプルモード: 検索ボタン */
body.simple-mode .search-btn {
    background: #667eea;
    box-shadow: none;
}

body.simple-mode .search-btn::before {
    display: none;
}

body.simple-mode .search-btn:hover {
    transform: none;
    box-shadow: none;
    background: #5568d3;
}

/* シンプルモード: 商品カード */
body.simple-mode .product-item {
    animation: none !important;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

body.simple-mode .product-item::after {
    display: none;
}

body.simple-mode .product-item:hover {
    transform: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    animation: none !important;
    padding-bottom: 8px !important;
    background: white !important;
    border: 1px solid #ccc !important;
    z-index: auto !important;
    scale: 1 !important;
}

body.simple-mode .product-item:hover .product-image {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
    animation: none !important;
    scale: 1 !important;
}

body.simple-mode .product-item:hover .product-title {
    top: 0 !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    height: auto !important;
    font-weight: 500 !important;
    font-size: 0.7rem !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    max-height: none !important;
    position: relative !important;
}

body.simple-mode .product-item:hover .product-price {
    top: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    background: none !important;
    -webkit-text-fill-color: #e74c3c !important;
    position: relative !important;
}

body.simple-mode .product-item.compact:hover {
    padding-bottom: 8px !important;
}

body.simple-mode .product-item.compact:hover .product-title {
    display: none !important;
}

/* シンプルモード: プラットフォームセクション */
body.simple-mode .platform-section {
    animation: none;
    backdrop-filter: none;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.simple-mode .platform-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* シンプルモード: スティッキーヘッダー */
body.simple-mode .sticky-platform-header {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 検索ボタンのマジカルパーティクル（無効化） */

/* 商品ホバー時のエネルギー波エフェクト */
@keyframes energyWave {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        width: 80px;
        height: 80px;
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* ==============================
   バーコードスキャン機能
   ============================== */

/* バーコードスキャンボタン */
.barcode-btn {
    display: none; /* デフォルトで非表示（JSで制御） */
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 50%, #ff4757 100%);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow:
        0 4px 15px rgba(255, 107, 107, 0.5),
        0 0 20px rgba(255, 71, 87, 0.3);
    position: relative;
    animation: barcodeBtnPulse 2s ease-in-out infinite;
}

/* パルスアニメーション */
@keyframes barcodeBtnPulse {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(255, 107, 107, 0.5),
            0 0 20px rgba(255, 71, 87, 0.3);
    }
    50% {
        box-shadow:
            0 4px 20px rgba(255, 107, 107, 0.7),
            0 0 30px rgba(255, 71, 87, 0.5),
            0 0 40px rgba(255, 107, 107, 0.3);
    }
}

/* リングエフェクト */
.barcode-btn::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 50%;
    animation: barcodeRing 2s ease-in-out infinite;
}

@keyframes barcodeRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.barcode-btn:hover {
    transform: scale(1.15);
    background: linear-gradient(135deg, #ff5252 0%, #ff1744 100%);
    box-shadow:
        0 6px 25px rgba(255, 107, 107, 0.7),
        0 0 35px rgba(255, 71, 87, 0.5);
    animation: none;
}

.barcode-btn:hover::before {
    animation: none;
    opacity: 0;
}

.barcode-btn:active {
    transform: scale(0.95);
}

.barcode-btn svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* バーコードスキャナーモーダル */
.barcode-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.barcode-scanner-modal.show {
    opacity: 1;
    visibility: visible;
}

.barcode-scanner-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.barcode-scanner-modal.show .barcode-scanner-content {
    transform: scale(1) translateY(0);
}

.barcode-scanner-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    transition: all 0.2s ease;
    z-index: 1;
}

.barcode-scanner-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
    transform: scale(1.1);
}

.barcode-scanner-header {
    text-align: center;
    margin-bottom: 20px;
}

.barcode-scanner-header h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 8px;
}

.barcode-scanner-header p {
    font-size: 0.9rem;
    color: #666;
}

/* スキャナー表示エリア */
.barcode-scanner-reader {
    width: 100%;
    min-height: 300px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.barcode-scanner-reader video {
    width: 100%;
    height: auto;
    display: block;
}

/* html5-qrcodeのスタイル上書き */
#barcodeScannerReader {
    border: none !important;
}

#barcodeScannerReader > div {
    border: none !important;
}

#barcodeScannerReader img {
    display: none !important;
}

/* 結果表示エリア */
.barcode-scanner-result {
    min-height: 50px;
    margin-bottom: 15px;
}

.barcode-scanner-result.success {
    animation: resultFadeIn 0.3s ease;
}

.barcode-scanner-result.error {
    animation: resultFadeIn 0.3s ease;
}

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

.barcode-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    color: #155724;
    font-weight: 500;
}

.barcode-success-icon {
    font-size: 1.5rem;
    color: #28a745;
}

.barcode-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-radius: 10px;
    color: #721c24;
    font-weight: 500;
}

.barcode-error-icon {
    font-size: 1.5rem;
}

/* スキャンのヒント表示 */
.barcode-scanner-tips {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.barcode-scanner-tips ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.barcode-scanner-tips li {
    margin-bottom: 4px;
}

.barcode-scanner-tips li:last-child {
    margin-bottom: 0;
}

/* アクションボタン */
.barcode-scanner-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.barcode-cancel-btn {
    padding: 12px 30px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.barcode-cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .barcode-btn {
        width: 50px;
        height: 50px;
    }

    .barcode-btn svg {
        width: 24px;
        height: 24px;
    }

    .barcode-btn::before {
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
    }

    .barcode-scanner-content {
        padding: 20px;
        margin: 10px;
    }

    .barcode-scanner-header h3 {
        font-size: 1.2rem;
    }

    .barcode-scanner-reader {
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .barcode-btn {
        width: 48px;
        height: 48px;
    }

    .barcode-btn svg {
        width: 22px;
        height: 22px;
    }

    .barcode-btn::before {
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
    }

    .barcode-scanner-content {
        padding: 15px;
        margin: 5px;
    }

    .barcode-scanner-header h3 {
        font-size: 1.1rem;
    }

    .barcode-scanner-reader {
        min-height: 220px;
    }

    .barcode-cancel-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .barcode-scanner-tips {
        padding: 10px 12px;
    }

    .barcode-scanner-tips ul {
        font-size: 0.8rem;
        padding-left: 16px;
    }
}

/* 検索入力コンテナの調整（バーコードボタン追加対応） */
@media (max-width: 900px) {
    .search-input-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .search-input-container .search-input {
        flex: 1;
        min-width: 0;
    }

    .search-input-container .barcode-btn {
        order: 2;
    }

    .search-input-container .search-btn {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .search-input-container {
        gap: 8px;
    }

    .search-input-container .search-btn {
        margin-top: 8px;
    }
}
