/* ケーキの層スタイリング */
.cake-tier-1, .cake-tier-2, .cake-tier-3 {
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1));
}

.cake-tier-1 path:first-child,
.cake-tier-2 path:first-child,
.cake-tier-3 path:first-child {
    fill: #fce4c0;
    stroke: #e6b17d;
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cake-tier-1 path:nth-child(2),
.cake-tier-2 path:nth-child(2),
.cake-tier-3 path:nth-child(2) {
    fill: #ffffff;
    stroke: #f0f0f0;
    stroke-width: 1;
    filter: drop-shadow(0 -1px 2px rgba(255, 255, 255, 0.5));
}

/* 星の装飾 */
.cake-tier-3 .star {
    fill: #ffd700;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.7));
    animation: starTwinkle 1.5s infinite alternate;
}

@keyframes starTwinkle {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ロウソクスタイリング */
.candles rect {
    fill: #ffffff;
    stroke: #ffb3b3;
    stroke-width: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.flame {
    opacity: 1;
    transition: opacity 0.5s;
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, 0.9));
}

.flame path {
    fill: #ff6b6b;
    animation: flameFlicker 0.5s infinite alternate;
}

@keyframes flameFlicker {
    0% { 
        transform: scale(0.9) translate(0, 2px);
        opacity: 0.8;
        fill: #ff6b6b;
    }
    100% { 
        transform: scale(1.1) translate(0, -2px);
        opacity: 1;
        fill: #ff8c8c;
    }
}

.candle {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 30px;
    background: linear-gradient(to right, #E8B780, #D4956A);
    border-radius: 4px;
    z-index: 25;
    animation: candleFlicker 0.5s ease-in-out infinite alternate;
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.sparkles::before,
.sparkles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: sparkle 2s infinite;
}

.sparkles::before {
    top: 20%;
    left: 30%;
    animation-delay: 0.5s;
}

.sparkles::after {
    top: 40%;
    right: 30%;
    animation-delay: 1s;
}

@keyframes sparkle {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* ボタンスタイル */
#blowButton {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    background: linear-gradient(to bottom right, #ff4081, #c51162);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 1.3em;
    border-radius: 50px;
    margin: 20px auto;
    display: block;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(197, 17, 98, 0.4);
}

#blowButton:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 7px 20px rgba(197, 17, 98, 0.5);
}

#blowButton:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(197, 17, 98, 0.3);
}

#blowButton::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

#blowButton:hover::after {
    left: 100%;
}

#micPermissionBtn {
    padding: 12px 25px;
    background: #854D27;
    color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    margin-top: 30px;
    display: none;
    transition: all 0.3s;
    box-shadow: 4px 4px 0 #D4B08C;
    font-weight: 600;
    position: relative;
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#micPermissionBtn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

.feature-button {
    padding: 12px 25px;
    margin: 10px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    background: #854D27;
    color: #FFF9F3;
    cursor: pointer;
    transition: transform 0.3s;
    font-size: 1.1em;
    box-shadow: 4px 4px 0 #D4B08C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

/* 音声フィードバックとプログレスバー */
#audioFeedback {
    width: 300px;
    height: 60px;
    margin: 30px auto;
    display: none;
    border: 2px solid #D4B08C;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 4px 4px 0 #D4B08C;
    position: relative;
    z-index: 20;
}

.progress-container {
    width: 80%;
    max-width: 500px;
    margin: 20px auto;
    background-color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 3px;
    display: none;
    position: relative;
    z-index: 20;
}

#blowProgress {
    width: 0%;
    height: 25px;
    background: #854D27;
    border-radius: 0;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF9F3;
    font-size: 14px;
    font-weight: bold;
}

/* 風船スタイル */
.balloon {
    position: absolute;
    width: 70px;
    height: 85px;
    background-color: transparent;
    opacity: 0;
    z-index: 1;
}

.balloon-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* 紙吹雪 */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        top: -10px;
        transform: rotateZ(0deg);
    }
    100% {
        opacity: 0;
        top: 100vh;
        transform: rotateZ(360deg);
    }
}

/* アルバムとメモリーウォール */
.memory-wall {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 20px;
    display: none;
    z-index: 2000;
    overflow-y: auto;
    box-shadow: 8px 8px 0 #D4B08C;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid #D4B08C;
    border-radius: 5px;
    box-shadow: 4px 4px 10px rgba(139, 69, 19, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    filter: sepia(20%);
    cursor: pointer;
    background: #FFF9F3;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 6px 6px 15px rgba(139, 69, 19, 0.5);
    filter: sepia(0%) brightness(1.1);
}

.photo-item img, .photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.photo-item:hover img, .photo-item:hover video {
    opacity: 0.9;
}

/* スライドショースタイル */
.swiper-container {
    width: 100%;
    height: 100%;
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    box-shadow: 6px 6px 0 #D4B08C;
    display: none;
    margin: 0 auto;
    position: relative;
    z-index: 2001;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.swiper-slide img, .swiper-slide video {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 2px solid #D4B08C;
    box-shadow: 4px 4px 0 #D4B08C;
}

.swiper-button-next, .swiper-button-prev {
    color: #854D27;
    background: rgba(255, 249, 243, 0.8);
    border: 2px solid #D4B08C;
    border-radius: 0;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 0 #D4B08C;
    transition: all 0.3s;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    transform: scale(1.1);
    box-shadow: 3px 3px 0 #D4B08C;
}

.swiper-pagination-bullet {
    background: #D4B08C;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: #854D27;
    opacity: 1;
}

.slideshow-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2002;
}

.slideshow-controls button {
    padding: 8px 15px;
    background: #854D27;
    color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 3px 3px 0 #D4B08C;
    font-size: 0.9em;
    text-transform: uppercase;
}

.slideshow-controls button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #D4B08C;
}

/* ゲームコンテナ */
.games-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.game-button {
    padding: 10px 20px;
    margin: 5px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    background: #854D27;
    color: #FFF9F3;
    cursor: pointer;
    transition: transform 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0 #D4B08C;
}

.game-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

/* ソーシャルシェア */
.social-share {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.share-button {
    width: 40px;
    height: 40px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    background: #FFF9F3;
    box-shadow: 4px 4px 0 #D4B08C;
    cursor: pointer;
    transition: transform 0.3s;
}

.share-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

/* 音楽プレーヤー */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 4px 4px 0 #D4B08C;
    z-index: 1000;
}

.music-control {
    width: 40px;
    height: 40px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    background: #854D27;
    color: #FFF9F3;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 2px 2px 0 #D4B08C;
}

.music-control:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #D4B08C;
}

/* 言語セレクター */
.language-selector {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.language-selector select {
    padding: 8px 15px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    background: #854D27;
    color: #FFF9F3;
    cursor: pointer;
    font-family: 'Playfair Display', serif;
    box-shadow: 2px 2px 0 #D4B08C;
    transition: transform 0.3s;
}

.language-selector select:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #D4B08C;
}

/* カスタムメッセージ */
.custom-message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bulletin-board-modal {
    display: none; /* デフォルトで非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.bulletin-board-modal .modal-content {
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0 #D4B08C;
    position: relative;
    text-align: center;
}

.bulletin-board-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #854D27;
}

.bulletin-board-modal h2 {
    color: #854D27;
    margin-bottom: 20px;
    font-family: 'DM Serif Display', serif;
}

.bulletin-posts {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    border: 2px solid #D4B08C;
    background: rgba(255, 249, 243, 0.3);
}

.bulletin-post {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 249, 243, 0.5);
    border: 1px solid #D4B08C;
    text-align: left;
}

.bulletin-post strong {
    color: #854D27;
}

.bulletin-post small {
    color: #666;
}

.bulletin-post p {
    margin: 5px 0;
}

.bulletin-post .like-btn, .bulletin-post .reply-btn {
    padding: 5px 10px;
    background: #854D27;
    color: #FFF9F3;
    border: 1px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 #D4B08C;
}

.bulletin-post .like-btn:hover, .bulletin-post .reply-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #D4B08C;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-form input, .post-form textarea {
    padding: 10px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    font-family: 'Old Standard TT', serif;
    font-size: 16px;
    background: #FFF9F3;
    color: #2C1810;
}

.post-form textarea {
    height: 100px;
    resize: none;
}

.post-form button {
    padding: 10px 20px;
    background: #854D27;
    color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    box-shadow: 4px 4px 0 #D4B08C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-form button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

.post-form .gift-select-btn {
    background: #854D27;
    color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    box-shadow: 4px 4px 0 #D4B08C;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    margin: 0 auto;
}

.post-form .gift-select-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
    background: #9b5c2f;
}

.gift-icon {
    margin-top: 5px;
    font-size: 1.2em;
    color: #854D27;
    display: inline-block;
    vertical-align: middle;
}

.reply-form input, .reply-form textarea {
    padding: 5px;
    border: 1px solid #D4B08C;
    border-radius: 0;
    font-family: 'Old Standard TT', serif;
    background: #FFF9F3;
    color: #2C1810;
}

.reply-form textarea {
    height: 60px;
    resize: none;
}

.reply-form button {
    padding: 5px 10px;
    background: #854D27;
    color: #FFF9F3;
    border: 1px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 #D4B08C;
}

.reply-form button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #D4B08C;
}

/* バーチャルギフトモーダル */
.virtual-gift-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.virtual-gift-modal .modal-content {
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0 #D4B08C;
    position: relative;
    text-align: center;
}

.virtual-gift-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #854D27;
}

.virtual-gift-modal h2 {
    color: #854D27;
    margin-bottom: 20px;
    font-family: 'DM Serif Display', serif;
}

.gift-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    border: 2px solid #D4B08C;
    background: rgba(255, 249, 243, 0.3);
    max-height: 400px;
    overflow-y: auto;
}

.gift-item {
    padding: 10px;
    margin: 5px;
    border: 1px solid #D4B08C;
    background: rgba(255, 249, 243, 0.5);
    cursor: pointer;
    text-align: center;
    display: inline-block;
    width: calc(33.33% - 10px);
    box-sizing: border-box;
    transition: background 0.3s;
}

.gift-item:hover {
    background: rgba(133, 77, 39, 0.2);
}

.gift-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gift-form input {
    padding: 10px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    font-family: 'Old Standard TT', serif;
    font-size: 16px;
    background: #FFF9F3;
    color: #2C1810;
}

.gift-form button {
    padding: 10px 20px;
    background: #854D27;
    color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    box-shadow: 4px 4px 0 #D4B08C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gift-form button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

/* バーチャルギフト表示モーダル */
.virtual-gifts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.virtual-gifts-modal .modal-content {
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0 #D4B08C;
    position: relative;
    text-align: center;
}

.virtual-gifts-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #854D27;
}

.virtual-gifts-modal h2 {
    color: #854D27;
    margin-bottom: 20px;
    font-family: 'DM Serif Display', serif;
}

.virtual-gifts-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    border: 2px solid #D4B08C;
    background: rgba(255, 249, 243, 0.3);
    text-align: left;
}

.custom-message-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.custom-message-modal .modal-content {
    background: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    box-shadow: 8px 8px 0 #D4B08C;
    position: relative;
    text-align: center;
}

.custom-message-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #854D27;
}

.custom-message-modal h2 {
    color: #854D27;
    margin-bottom: 20px;
    font-family: 'DM Serif Display', serif;
}

.custom-message-modal textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 2px solid #D4B08C;
    border-radius: 0;
    margin-bottom: 20px;
    font-family: 'Old Standard TT', serif;
    font-size: 16px;
    resize: none;
    background: #FFF9F3;
    color: #2C1810;
}

.custom-message-modal textarea:focus {
    outline: none;
    border-color: #854D27;
    box-shadow: 2px 2px 0 #854D27;
}

.custom-message-modal button {
    padding: 10px 20px;
    background: #854D27;
    color: #FFF9F3;
    border: 2px solid #D4B08C;
    border-radius: 0;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    box-shadow: 4px 4px 0 #D4B08C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.custom-message-modal button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #D4B08C;
}

/* .showクラス使用時のセンタリング修正 */
.custom-message-modal.show {
    display: flex !important;
}

.bulletin-board-modal.show {
    display: flex !important;
}

.custom-message-display {
    margin-top: 20px;
    font-size: 1.5em;
    line-height: 1.6;
    color: #854D27;
    background: #FFF9F3;
    padding: 15px;
    border: 2px solid #D4B08C;
    box-shadow: 6px 6px 0 #D4B08C;
    display: none;
    opacity: 0;
    animation: writeText 3s forwards;
}

/* コンポーネントのレスポンシブスタイル */
@media screen and (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .memory-wall {
        width: 95%;
        height: 90%;
    }

    /* モバイル用ゲームコンテナの調整 */
    .games-container {
        position: fixed;
        bottom: 70px; /* ミュージックプレイヤーとの重なりを避けるために上に移動 */
        left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 10px;
    }

    .game-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    /* ソーシャルシェアボタンの調整 */
    .social-share {
        right: 10px;
        top: auto;
        bottom: 120px;
        transform: none;
    }

    /* 音楽プレーヤーの調整 */
    .music-player {
        padding: 5px 10px;
    }

    .music-control {
        width: 30px;
        height: 30px;
    }

    /* 機能ボタンの調整 */
    .feature-button {
        padding: 8px 15px;
        margin: 5px;
        font-size: 0.9em;
    }

    /* 掲示板モーダルの調整 */
    .bulletin-board-modal .modal-content {
        width: 95%;
        max-width: 350px;
        max-height: 85vh;
        padding: 15px;
    }

    .bulletin-posts {
        max-height: 350px;
        padding: 5px;
    }

    .bulletin-post {
        margin-bottom: 10px;
        padding: 8px;
        font-size: 0.9em;
    }

    .bulletin-post .like-btn, .bulletin-post .reply-btn {
        padding: 3px 8px;
        font-size: 0.8em;
        margin-right: 5px;
    }

    .post-form input, .post-form textarea {
        padding: 8px;
        font-size: 0.9em;
    }

    .post-form textarea {
        height: 80px;
    }

    .post-form button {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .post-form .gift-select-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .reply-form input, .reply-form textarea {
        padding: 5px;
        font-size: 0.85em;
    }

    .reply-form textarea {
        height: 50px;
    }

    .reply-form button {
        padding: 5px 10px;
        font-size: 0.85em;
    }

    /* カスタムメッセージコンテナの調整 */
    .custom-message-container {
        top: 10px;
        right: 10px;
        width: auto;
        max-width: 200px;
    }

    /* バーチャルギフトモーダルの調整 */
    .virtual-gift-modal .modal-content {
        width: 95%;
        max-width: 350px;
        max-height: 85vh;
        padding: 15px;
    }

    .gift-list {
        max-height: 350px;
        padding: 5px;
    }

    .gift-item {
        width: calc(50% - 10px);
        padding: 8px;
        font-size: 0.9em;
    }

    /* Virtual gifts view modal adjustments */
    .virtual-gifts-modal .modal-content {
        width: 95%;
        max-width: 350px;
        max-height: 85vh;
        padding: 15px;
    }

    .virtual-gifts-list {
        max-height: 350px;
        padding: 5px;
    }
}

@media screen and (max-width: 480px) {
    .bulletin-board-modal .modal-content {
        width: 98%;
        max-width: 300px;
        padding: 10px;
    }

    .bulletin-posts {
        max-height: 300px;
    }

    .bulletin-post {
        padding: 5px;
        font-size: 0.85em;
    }

    .post-form input, .post-form textarea {
        padding: 5px;
        font-size: 0.85em;
    }

    .post-form textarea {
        height: 70px;
    }

    .post-form button {
        padding: 5px 10px;
        font-size: 0.85em;
    }

    /* バーチャルギフトモーダルの調整 */
    .virtual-gift-modal .modal-content {
        width: 98%;
        max-width: 300px;
        padding: 10px;
    }

    .gift-list {
        max-height: 300px;
        padding: 5px;
    }

    .gift-item {
        width: calc(50% - 10px);
        padding: 5px;
        font-size: 0.85em;
    }

    .gift-form input {
        padding: 5px;
        font-size: 0.85em;
    }

    .gift-form button {
        padding: 5px 10px;
        font-size: 0.85em;
    }

    /* Virtual gifts view modal adjustments */
    .virtual-gifts-modal .modal-content {
        width: 98%;
        max-width: 300px;
        padding: 10px;
    }

    .virtual-gifts-list {
        max-height: 300px;
        padding: 5px;
    }
}

/* ケーキコンテナの改善 */
.cake-container {
    width: 100%;
    height: 300px;
    position: relative;
    margin: 20px auto;
    cursor: grab;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: linear-gradient(to bottom, rgba(255, 253, 250, 0.6) 0%, rgba(255, 253, 250, 0.3) 100%);
    perspective: 1000px;
    overflow: hidden;
}

.cake-container:active {
    cursor: grabbing;
}

.cake-container:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.cake-container canvas {
    border-radius: 8px;
}

.cake-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 60%, rgba(255, 249, 243, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

/* 誕生日コンテンツの脈動発光エフェクト */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#birthdayMessage {
    margin: 20px auto;
    max-width: 80%;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    transition: all 0.5s ease;
}

#birthdayMessage.celebrating {
    animation: pulse 2s infinite;
    color: #ff4081;
    text-shadow: 0 0 10px rgba(255, 64, 129, 0.3);
}

/* ロウソク用の煙アニメーション */
@keyframes smoke {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-20px) scale(2);
        opacity: 0;
    }
}

.smoke-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(200, 200, 200, 0.5);
    border-radius: 50%;
    animation: smoke 2s ease-out forwards;
}

/* 誕生日コンテンツラッパーの改善 */
#birthdayContent {
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    transform: translateY(0);
    opacity: 1;
}

#birthdayContent.hidden {
    transform: translateY(20px);
    opacity: 0;
}

#birthdayContent.appearing {
    animation: contentAppear 1s ease forwards;
}

@keyframes contentAppear {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 2D誕生日ケーキ */
.cake-2d-container {
    width: 100%;
    height: 300px;
    position: relative;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    z-index: 10;
}

.cake-2d {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    transform-style: preserve-3d;
    animation: float 3s ease-in-out infinite;
}

.cake-tier {
    position: absolute;
    left: 50%;
    border-radius: 15px;
    transform: translateX(-50%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.cake-tier-1 {
    width: 280px;
    height: 80px;
    bottom: 0;
    background: linear-gradient(to right, #ff3366, #ff6699);
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.6), inset 0 -5px 10px rgba(0, 0, 0, 0.3), inset 0 5px 10px rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.cake-tier-2 {
    width: 220px;
    height: 70px;
    bottom: 80px;
    background: linear-gradient(to right, #33ccff, #66ddff);
    box-shadow: 0 8px 25px rgba(51, 204, 255, 0.6), inset 0 -5px 10px rgba(0, 0, 0, 0.3), inset 0 5px 10px rgba(255, 255, 255, 0.7);
    z-index: 2;
}

.cake-tier-3 {
    width: 160px;
    height: 60px;
    bottom: 150px;
    background: linear-gradient(to right, #ffcc00, #ffdd55);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.6), inset 0 -5px 10px rgba(0, 0, 0, 0.3), inset 0 5px 10px rgba(255, 255, 255, 0.7);
    z-index: 3;
}

.cake-decoration {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    animation: twinkle 1.5s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.8; box-shadow: 0 0 8px currentColor; }
    100% { opacity: 1; box-shadow: 0 0 20px currentColor, 0 0 30px white; }
}

.cake-decoration-1 {
    background-color: #ff0000;
    top: -8px;
    left: 40px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.9);
}

.cake-decoration-2 {
    background-color: #00ff00;
    top: -8px;
    left: 90px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.9);
    animation-delay: 0.3s;
}

.cake-decoration-3 {
    background-color: #0000ff;
    top: -8px;
    left: 140px;
    box-shadow: 0 0 15px rgba(0, 0, 255, 0.9);
    animation-delay: 0.6s;
}

.cake-decoration-4 {
    background-color: #ffff00;
    top: -8px;
    right: 90px;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.9);
    animation-delay: 0.9s;
}

.cake-decoration-5 {
    background-color: #ff00ff;
    top: -8px;
    right: 40px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.9);
    animation-delay: 1.2s;
}

.candle {
    position: absolute;
    width: 15px;
    height: 40px;
    bottom: 100%;
    border-radius: 5px;
    z-index: 5;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.candle-1 {
    background: linear-gradient(to top, #ff0000, #ff6666);
    left: 30px;
}

.candle-2 {
    background: linear-gradient(to top, #00ff00, #66ff66);
    left: 60px;
}

.candle-3 {
    background: linear-gradient(to top, #0000ff, #6666ff);
    left: 50%;
    transform: translateX(-50%);
}

.candle-4 {
    background: linear-gradient(to top, #ffff00, #ffff66);
    right: 60px;
}

.candle-5 {
    background: linear-gradient(to top, #ff00ff, #ff66ff);
    right: 30px;
}

.flame {
    position: absolute;
    width: 15px;
    height: 30px;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, #ffff00 0%, #ff6600 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.5s infinite alternate;
    box-shadow: 0 0 20px #ff6600, 0 0 30px #ff9900, 0 0 40px #ffcc00;
    z-index: 6;
}

@keyframes flicker {
    0% {
        transform: translateX(-50%) scale(0.9);
        opacity: 0.8;
        box-shadow: 0 0 10px #ff6600, 0 0 20px #ff9900;
    }
    100% {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
        box-shadow: 0 0 20px #ff6600, 0 0 30px #ff9900, 0 0 40px #ffcc00;
    }
}

.cake-text {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 120%;
    font-family: 'Dancing Script', cursive;
    font-size: 28px;
    font-weight: bold;
    color: #ff3366;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.7);
    animation: pulse 2s infinite;
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 255, 255, 0.9);
    }
    100% {
        transform: scale(1);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.7);
    }
}

/* ケーキの浮き上がりエフェクト */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(1deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes shake {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-8px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* 煙エフェクト */
@keyframes smoke {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-30px) scale(3);
        opacity: 0;
    }
}

.smoke-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(220, 220, 220, 0.8);
    border-radius: 50%;
    animation: smoke 2s ease-out forwards;
}

/* 誕生日おめでとうテキストエフェクト */
.birthday-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5em;
    color: #ff6b81;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.1);
    margin: 0;
    padding: 20px;
    animation: birthdayPop 1.5s ease-out;
}

@keyframes birthdayPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.album-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #D4B08C;
}

.search-box {
    flex: 1;
    margin-right: 15px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #D4B08C;
    background: #FFF9F3;
    font-family: 'Old Standard TT', serif;
    color: #2C1810;
}

.close-album-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    padding: 10px 15px !important;
    background: #854D27 !important;
    color: #FFF9F3 !important;
    border: 2px solid #D4B08C !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    font-weight: bold;
    box-shadow: 3px 3px 0 #D4B08C;
    transition: all 0.3s;
}

.close-album-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #D4B08C;
}

.tag-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(133, 77, 39, 0.7);
    color: #FFF9F3;
    border: 1px solid #D4B08C;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.photo-item:hover .tag-button {
    opacity: 1;
}

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

.tags-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: calc(100% - 50px);
}

.tag {
    background: rgba(133, 77, 39, 0.7);
    color: #FFF9F3;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.upload-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.upload-item .photo-item-media {
    background: #f5f5f5 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    border: 2px dashed #D4B08C;
}

.upload-item:hover .photo-item-media {
    background: #fcf8f3 !important;
}

.upload-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 20px;
    z-index: 10000;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border-radius: 5px;
    font-family: 'Old Standard TT', serif;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
}