/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    /* タッチイベントを無効化 */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Main container */
.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #FFF100;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* iframe組み込み時の境界を自然にするインナーシャドウ */
    box-shadow: inset 0 20px 40px -20px rgba(0, 0, 0, 0.3),
                inset 0 -20px 40px -20px rgba(0, 0, 0, 0.3);
    z-index: 1;
    /* タッチイベントを無効化 */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* 右側パネル表示時のレイアウト調整 */
    transition: all 0.5s ease-in-out;
}

/* 640px以上での中央配置を確実にする */
@media (min-width: 641px) {
    .container {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 右側パネル表示時のメインコンテナ */
.container.right-panel-open {
    width: 70%;
    justify-content: center;
    padding-left: 0;
}

/* Animated background circles */
.background-circles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse 3s ease-in-out infinite;
}

.circle-1 {
    top: 2.5rem;
    left: 2.5rem;
    width: 18rem;
    height: 18rem;
    background-color: #fff8a3;
}

.circle-2 {
    top: 25%;
    right: 5rem;
    width: 24rem;
    height: 24rem;
    background-color: #fff8a3;
    animation-delay: 1s;
}

.circle-3 {
    bottom: 5rem;
    left: 25%;
    width: 20rem;
    height: 20rem;
    background-color: #ffed4a;
    animation-delay: 2s;
}

.circle-4 {
    bottom: 33.333333%;
    right: 33.333333%;
    width: 16rem;
    height: 16rem;
    background-color: #fecaca;
    animation-delay: 0.5s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.4;
    }
}

/* Decorative dots pattern */
.dots-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
}

.dots-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    padding: 2rem;
    height: 100%;
}

.dots-grid > div {
    width: 0.75rem;
    height: 0.75rem;
    background-color: #fff8a3;
    border-radius: 50%;
}

/* Loading indicator */
.loading-indicator {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 91.666667%;
    max-width: 72rem;
    background-color: white;
    border-radius: 1.5rem;
    padding: 4rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.loading-spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

.loading-text {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

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

/* Main content */
.main-content {
    position: relative;
    z-index: 10;
    width: 91.666667%;
    max-width: 72rem;
    transition: all 0.7s ease;
}

.main-content.animating {
    opacity: 1;
    transform: scale(1);
}

.main-content.not-animating {
    opacity: 0;
    transform: scale(0.95);
}

/* フェードアウトアニメーション */
.main-content.fade-out {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s ease-out;
}

/* フェードインアニメーション */
.main-content.fade-in {
    opacity: 0;
    transform: scale(1.05) translateY(-20px);
    transition: all 0.3s ease-out;
}

/* Message card */
.message-card {
    background-color: white;
    border-radius: 1.5rem;
    padding: 4rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
    /* 右側パネル表示時の縮小アニメーション */
    transition: all 0.5s ease-in-out;
    /* 80%固定幅でパネル表示時も考慮 */
    width: 80%;
    max-width: 80%;
    max-height: 90vh;
    box-sizing: border-box;
    transform-origin: center;
    /* 中央配置を確実にする */
    margin: 0 auto;
}

/* 右側パネル表示時のメッセージカードはメインコンテナの幅制限により自動的に70%になる */

/* Heart icon */
.heart-container {
    display: none;
}

.heart-icon {
    background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
    padding: 1.5rem;
    border-radius: 50%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.heart-svg {
    width: 3.5rem;
    height: 3.5rem;
    color: white;
    fill: white;
}

/* To section */
.to-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.to-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4A90E2;
    padding: 1.25rem 3rem;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.to-text {
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-break: keep-all;
}

/* Message section */
.message-section {
    margin-bottom: 3rem;
    margin-top: 0;
    padding: 0 2rem;
    position: relative;
}

.message-text {
    color: #1f2937;
    font-size: 3rem;
    line-height: 1.625;
    text-align: center;
    font-weight: 700;
    margin: 0;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 0 2rem;
    border-top: 4px solid #fed7aa;
}

.nickname-section {
    position: relative;
}

.nickname-text {
    color: #1f2937;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.date-section {
    text-align: right;
}

.date-text {
    color: #4b5563;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

/* Cursor animation */
.cursor {
    display: inline-block;
    width: 0.25rem;
    background-color: white;
    margin-left: 0.25rem;
    animation: blink 1s infinite;
}

.message-section .cursor,
.nickname-section .cursor {
    background-color: #1f2937;
    height: 2.5rem;
}

.to-section .cursor {
    height: 3rem;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Progress indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.progress-dot {
    height: 0.75rem;
    border-radius: 9999px;
    transition: all 0.5s ease;
}

.progress-dot.active {
    width: 4rem;
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.progress-dot.inactive {
    width: 0.75rem;
    background-color: rgba(255, 255, 255, 0.6);
}

/* Mode containers */
.mode-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.mode-container.active {
    opacity: 1;
}

/* List Mode Styles */
.list-container {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    /* 右側パネル表示時のレイアウト調整 */
    transition: all 0.5s ease-in-out;
}

/* 右側パネル表示時のリストコンテナはメインコンテナの幅制限により自動的に70%になる */

/* パネル表示時のリストカラム調整は641px以上のメディアクエリで管理 */

.list-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    align-content: start;
    /* スクロールバーを非表示 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 768px以上で3カラム */
@media (min-width: 768px) {
    .list-scroll {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* パネル表示時は2カラム */
    .list-container.right-panel-open .list-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 641px-767pxで2カラム */
@media (max-width: 767px) and (min-width: 641px) {
    .list-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* パネル表示時は1カラム */
    .list-container.right-panel-open .list-scroll {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* 401px-640pxで2カラム */
@media (max-width: 640px) and (min-width: 401px) {
    .list-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* パネル表示時は1カラム */
    .list-container.right-panel-open .list-scroll {
        grid-template-columns: repeat(1, 1fr);
    }
}


.list-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.list-card {
    background-color: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 10;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.list-card .heart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.list-card .heart-icon {
    display: none;
}

.list-card .heart-svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
    fill: white;
}

.list-card .to-section {
    text-align: center;
    margin-bottom: 1rem;
}

.list-card .to-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4A90E2;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.1);
}

.list-card .to-text {
    color: white;
    font-size: clamp(0.4rem, 2vw, 1rem);
    font-weight: 700;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-break: keep-all;
}

.list-card .message-section {
    margin-bottom: 1rem;
}

.list-card .message-text {
    color: #1f2937;
    font-size: clamp(1rem, 3vw, 1.5rem);
    line-height: 1.5;
    text-align: center;
    font-weight: 600;
    margin: 0;
}

.list-card .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 2px solid #fed7aa;
}

.list-card .nickname-text {
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
}

.list-card .date-text {
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
}

/* Mode indicator */
.mode-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    max-height: 90vh;
    overflow-y: auto;
}

.mode-info {
    text-align: center;
    margin-bottom: 0.5rem;
}

.mode-text {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mode-keys {
    font-size: 0.75rem;
    opacity: 0.8;
}

.filter-info {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.5rem;
}

.filter-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-right: 0.25rem;
}

.filter-text {
    font-weight: 600;
    color: #fbbf24;
    margin-right: 0.5rem;
}

.filter-keys {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.key {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 600;
    margin: 0 0.125rem;
}

/* Message Button */
.message-button-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.message-button-box {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    min-width: 200px;
}

.message-button {
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.message-button:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.message-button-content {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.message-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.message-button .message-text {
    color: white;
    font-size: 0.875rem;
    line-height: 1.3;
    margin: 0;
}

/* QR Code */
.qr-code-container {
    margin-top: 1rem;
    text-align: center;
}

.qr-code-label {
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.qr-code {
    background: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: inline-block;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.2);
}

.qr-code-image {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Right Panel Styles */
.right-panel {
    position: fixed;
    top: 0;
    right: -30%; /* 初期状態では画面外（30%幅） */
    width: 30%;
    height: 100vh;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    z-index: 1000;
    transition: right 0.5s ease-in-out;
    overflow-y: auto;
}


/* 640x360低解像度用の最適化 */
@media (max-width: 640px) {
    /* メインコンテナの高さ制限 */
    .container {
        max-height: 100vh;
        overflow: hidden;
        /* 中央配置を確実にする */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* bodyのoverflowも確実にhidden */
    body {
        overflow: hidden !important;
    }
    
    /* パネルを表示（400px以下は上記のメディアクエリで非表示に上書き） */
    .right-panel {
        display: block;
        width: 30%;
    }
    
    /* メインコンテナの幅制限（400px以下は上記のメディアクエリで100%に上書き） */
    .container.right-panel-open {
        width: 70%;
    }
    
    /* リスト表示を2カラムに調整（400px以下は上記のメディアクエリで1カラムに上書き） */
    .list-scroll {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.5rem;
    }
    
    /* リストカードのサイズ調整 */
    .list-card {
        padding: 0.6rem;
        border-radius: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .list-card .to-text {
        font-size: clamp(0.5rem, 2vw, 0.8rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .list-card .message-text {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .list-card .nickname-text {
        font-size: 0.6rem;
    }
    
    .list-card .date-text {
        font-size: 0.55rem;
    }
    
    /* フルスクリーンモードのメッセージカード - 640x360用（80%固定幅） */
    .message-card {
        padding: 0.6rem;
        border-radius: 0.8rem;
        width: 80%;
        max-width: 80%;
        max-height: 80vh;
        /* スケールを削除して1カラム表示と同じサイズ感に */
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .to-badge {
        padding: 0.5rem 1rem;
        border-radius: 9999px;
        box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.1);
    }
    
    .to-text {
        font-size: clamp(0.5rem, 2vw, 0.8rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .message-text {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .nickname-text {
        font-size: 0.6rem;
    }
    
    .date-text {
        font-size: 0.55rem;
    }
    
    .footer {
        padding-top: 0.75rem;
        border-top: 2px solid #fed7aa;
    }
    
    /* フルスクリーンモードの間隔調整 */
    .to-section {
        margin-bottom: 1rem;
    }
    
    .message-section {
        margin-top: 0;
        margin-bottom: 2rem;
    }
    
    /* モードインジケーターの調整 */
    .mode-indicator {
        padding: 0.3rem 0.6rem;
        font-size: 0.5rem;
        max-height: 75vh;
        overflow-y: auto;
    }
    
    .mode-keys {
        font-size: 0.4rem;
    }
    
    .key {
        padding: 0.1rem 0.2rem;
        font-size: 0.35rem;
    }
    
    /* QRモードの調整 */
    .qr-mode-title {
        font-size: 1rem;
    }
    
    .qr-mode-question {
        font-size: 1.2rem;
    }
    
    .qr-mode-image {
        width: 120px;
        height: 120px;
    }
    
    .qr-mode-banner {
        font-size: 0.7rem;
        padding: 0.5rem 0.8rem;
    }
    
    .qr-message {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* パネル内の調整 - 360px高さに最適化 */
    .right-panel-content {
        padding: 0.5rem;
        gap: 0.3rem;
    }
    
    .right-panel .qr-mode-header {
        padding: 0.2rem 0;
    }
    
    .right-panel .qr-mode-title {
        font-size: 0.6rem;
        margin-bottom: 0.3rem;
    }
    
    .right-panel .qr-mode-question {
        font-size: 0.5rem;
        white-space: nowrap;
    }
    
    .right-panel .qr-mode-banner {
        font-size: 0.4rem;
        padding: 0.2rem 0.4rem;
    }
    
    .right-panel .qr-code-section {
        padding: 0.2rem 0;
    }
    
    .right-panel .qr-code-frame {
        max-width: 80px;
        padding: 0.2rem;
    }
    
    .qr-mascot-section {
        padding: 0.2rem 0;
    }
    
    .qr-mascot-image {
        max-width: 60px;
    }
}

/* 16:9画面用の調整（640px以上の場合のみ） */
@media (min-width: 641px) and (max-height: 600px) and (min-height: 400px) {
    .message-card {
        padding: 1.5rem;
        width: 80%;
        max-width: 80%;
        max-height: 85vh;
        transform: scale(0.7);
    }
    
    .to-text {
        font-size: 1.5rem;
    }
    
    .message-text {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .nickname-text {
        font-size: 1rem;
    }
    
    .date-text {
        font-size: 0.9rem;
    }
}

/* より低い画面高さ用の調整（640px以上の場合のみ） */
@media (min-width: 641px) and (max-height: 400px) {
    .message-card {
        padding: 1rem;
        width: 80%;
        max-width: 80%;
        max-height: 90vh;
        transform: scale(0.6);
    }
    
    .to-text {
        font-size: 1.2rem;
    }
    
    .message-text {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .nickname-text {
        font-size: 0.9rem;
    }
    
    .date-text {
        font-size: 0.8rem;
    }
}

/* スマホサイズではパネルを非表示 */
@media (max-width: 768px) and (min-width: 641px) {
    .right-panel {
        display: none;
    }
    
    /* スマホサイズではメインコンテナの幅制限を解除 */
    .container.right-panel-open {
        width: 100%;
    }
}

.right-panel.open {
    right: 0;
}

.right-panel-content {
    padding: clamp(0.8rem, 2vw, 1.5rem);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    box-sizing: border-box;
    position: relative;
    overflow-y: auto;
}

/* パネル内のヘッダーセクション */
.right-panel .qr-mode-header {
    flex-shrink: 0;
    text-align: center;
    margin-bottom: 0;
    margin-top: 0;
    padding: 0.3rem 0;
}

.right-panel .qr-mode-title {
    font-size: clamp(0.8rem, 2.5vw, 1.8rem);
    margin-bottom: 0.8rem;
}

.right-panel .qr-mode-question {
    font-size: clamp(1rem, 3vw, 2.2rem);
    white-space: nowrap;
}

/* 右パネルの装飾線の位置調整（文字を離す） */
.right-panel .qr-mode-question-line::before {
    left: clamp(-1rem, -3vw, -1.8rem);
}

.right-panel .qr-mode-question-line::after {
    right: clamp(-1rem, -3vw, -1.8rem);
}

/* パネル内のバナーセクション */
.right-panel .qr-mode-banner {
    flex-shrink: 0;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    padding: clamp(0.6rem, 1.5vw, 1.2rem) clamp(1rem, 2.5vw, 2rem);
    margin-top: 1.2rem;
}

/* パネル内のQRコードセクション */
.right-panel .qr-code-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0.5rem 0;
}

.right-panel .qr-code-frame {
    width: 100%;
    max-width: clamp(150px, 25vw, 250px);
    aspect-ratio: 1;
    background: #FFF100;
    border-radius: 0.6rem;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.right-panel .qr-mode-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* パネル内のマスコット画像 */
.qr-mascot-section {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0;
    padding: 0.3rem 0;
}

.qr-mascot-image {
    width: 100%;
    max-width: clamp(80px, 15vw, 150px);
    height: auto;
    object-fit: contain;
}

/* QR Mode */
.qr-mode-content {
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: clamp(0.5rem, 3vw, 2rem);
    box-sizing: border-box;
}

.qr-mode-header {
    text-align: center;
    margin-bottom: clamp(0.5rem, 3vh, 2rem);
}

.qr-mode-title {
    color: white;
    font-size: clamp(1.2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: clamp(0.5rem, 3vh, 2rem);
}


.qr-mode-question {
    color: white;
    font-size: clamp(1.5rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    position: relative;
}


.qr-mode-question-line {
    display: block;
    position: relative;
}

.qr-mode-question-line::before,
.qr-mode-question-line::after {
    content: '';
    position: absolute;
    width: clamp(2px, 0.5vw, 3px);
    height: clamp(1.5rem, 5vh, 3rem);
    background: white;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.qr-mode-question-line::before {
    left: clamp(-0.6rem, -2vw, -1.2rem);
    transform: translateY(-50%) rotate(-45deg);
}

.qr-mode-question-line::after {
    right: clamp(-0.6rem, -2vw, -1.2rem);
    transform: translateY(-50%) rotate(45deg);
}

.qr-code-section {
    margin-bottom: clamp(0.5rem, 3vh, 2rem);
}

.qr-code-frame {
    background: #FFF100;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    border-radius: clamp(0.5rem, 2vw, 1rem);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

@keyframes qrFrameGlow {
    0%, 100% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    25% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.5);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.7);
        transform: scale(1.05);
    }
    75% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.5);
        transform: scale(1.02);
    }
}

.qr-mode-image {
    width: 100%;
    max-width: clamp(150px, 30vw, 350px);
    height: auto;
    aspect-ratio: 1;
    display: block;
    animation: none;
}

.qr-mode-banner {
    background: white;
    color: #333;
    padding: clamp(0.75rem, 2vh, 1.5rem) clamp(1.25rem, 4vw, 2.5rem);
    border-radius: clamp(1rem, 3vw, 2rem);
    font-size: clamp(0.9rem, 3.5vw, 1.8rem);
    font-weight: 600;
    margin-bottom: clamp(0.5rem, 3vh, 2rem);
    box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.2);
    animation: bannerBounce 2s ease-in-out infinite;
}

@keyframes bannerBounce {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
    }
}

.banner-char {
    display: inline-block;
    animation: charGrow 0.6s ease-out forwards;
    opacity: 0;
    transform: scale(0.5);
}

@keyframes charGrow {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}


.qr-mode-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.qr-message {
    position: absolute;
    color: white;
    font-size: clamp(0.7rem, 3vw, 1.5rem);
    font-weight: 600;
    white-space: nowrap;
    animation: messageFloat 4s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes messageFloat {
    0%, 100% {
        transform: translateY(0px) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: translateY(-15px) scale(1.15) rotate(2deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    75% {
        transform: translateY(-15px) scale(1.15) rotate(-2deg);
        opacity: 1;
    }
}

.qr-message.top-left {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.qr-message.bottom-left {
    bottom: 20%;
    left: 10%;
    animation-delay: 1s;
}

.qr-message.top-right {
    top: 20%;
    right: 10%;
    animation-delay: 2s;
}

.qr-message.bottom-right {
    bottom: 20%;
    right: 10%;
    animation-delay: 3s;
}

/* 641px-767pxの範囲での調整 */
@media (max-width: 767px) and (min-width: 641px) {
    .message-card {
        padding: 2rem;
        width: 80%;
        max-width: 80%;
    }
    
    .to-text {
        font-size: 2rem;
    }
    
    .message-text {
        font-size: 1.5rem;
    }
    
    .nickname-text {
        font-size: 1.5rem;
    }
    
    .date-text {
        font-size: 1.25rem;
    }
    
    .heart-svg {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .list-scroll {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
        gap: 1rem;
    }
    
    /* パネル表示時は1カラム */
    .list-container.right-panel-open .list-scroll {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .list-card {
        padding: 1rem;
    }
    
    .mode-indicator {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .message-button-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .message-button-box {
        padding: 0.75rem;
        min-width: 160px;
    }
    
    .message-button .message-text {
        font-size: 0.75rem;
    }
    
    .message-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .qr-code-container {
        margin-top: 0.75rem;
    }
    
    .qr-code {
        padding: 0.5rem;
    }
    
    .qr-code-label {
        font-size: 0.625rem;
    }
    
    .qr-mode-title {
        font-size: 2.2rem;
    }
    
    .qr-mode-question {
        font-size: 2.5rem;
    }
    
    .qr-mode-image {
        width: 250px;
        height: 250px;
    }
    
    .qr-mode-banner {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
    }
    
    .qr-message {
        font-size: 1rem;
    }
}

/* Empty state styles */
.empty-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.empty-content {
    text-align: center;
    padding: 2rem;
}

.empty-mascot {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.empty-message {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
    .empty-mascot {
        max-width: 150px;
        margin-bottom: 1rem;
    }
    
    .empty-message {
        font-size: 1.2rem;
    }
}

/* QRコード画像はJavaScriptで制御 */

/* 400px以下またはスマホのUAで1カラム、パネル完全非表示（最後に配置して優先度を最高にする） */
@media (max-width: 400px), (pointer: coarse) {
    /* リスト表示を1カラムに強制 */
    .list-scroll {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    /* パネルを完全に非表示 */
    .right-panel {
        display: none !important;
        right: -100% !important;
    }
    
    /* メインコンテナの幅制限を解除 */
    .container.right-panel-open {
        width: 100% !important;
    }
    
    /* パネル表示時のリストカラムも1カラムに強制 */
    .list-container.right-panel-open .list-scroll {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    /* フルスクリーンモードの調整 */
    .message-card {
        width: 95%;
        max-width: 95%;
        padding: 0.5rem;
    }
    
    .to-text {
        font-size: 0.8rem;
    }
    
    .message-text {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .nickname-text {
        font-size: 0.5rem;
    }
    
    .date-text {
        font-size: 0.45rem;
    }
}

