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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Kiwi Maru', serif;
    background-image: url('assets/main-bg.jpg');
    background-size: 100% auto;
    background-repeat: repeat-y;
    background-position: center top;
    background-attachment: scroll;
    min-height: 100vh;
}

/* PC画面のみでpc-site-bgを表示 */
@media screen and (min-width: 768px) {
    body {
        background-image: url('assets/main-bg.jpg'), url('assets/pc-site-bg.png');
        background-size: 470px auto, cover;
        background-repeat: repeat-y, no-repeat;
        background-position: center top, center;
        background-attachment: scroll, fixed;
        background-color: #f5e6dc;
    }
    
    .main-visual {
        width: 100%;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .result-image-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 500px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .powered-by {
        width: 470px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: none !important;
    }
}

/* SP版のみ：サイト背景の横幅に合わせる */
@media screen and (max-width: 767px) {
    .main-visual {
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        max-width: none !important;
    }
    
    .completion-text {
        font-size: 22px;
        margin: 30px 0;
    }
    
    .result-image-container {
        margin-bottom: 30px;
    }
    
    .action-buttons {
        margin-bottom: 30px;
    }
    
    .footer {
        margin-top: 30px;
    }
    
    .footer-links a {
        font-size: 12px;
        margin: 0 8px;
    }
    
    .powered-by {
        font-size: 10px;
    }
}

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

/* ヘッダー部分 */
.header {
    text-align: center;
    margin-bottom: 0;
    margin-top: 0;
}

.main-visual {
    width: 100%;
    height: auto;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    display: block;
}

/* 完成テキスト */
.completion-text {
    font-family: 'Kiwi Maru', serif;
    font-weight: 500;
    font-size: 28px;
    color: #ff6b35;
    text-align: center;
    margin: 50px 0 40px 0;
    text-shadow: 2px 2px 0px #ffffff;
}

/* 結果画像部分 */
.result-image-container {
    text-align: center;
    margin-bottom: 40px;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    position: relative;
    padding: 12px 0;
}

.result-image-wrapper {
    width: 100%;
    aspect-ratio: 0.85;
    overflow: hidden;
    position: relative;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 80%;
    transform: scale(1.05);
    border-radius: 0;
    box-shadow: none;
    display: block;
}

.result-image-container .wave-separator {
    width: 100%;
    height: 12px;
    background-image: url("data:image/svg+xml,%3csvg width='40' height='12' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M0 6 Q2.5 2 5 6 Q7.5 10 10 6 Q12.5 2 15 6 Q17.5 10 20 6 Q22.5 2 25 6 Q27.5 10 30 6 Q32.5 2 35 6 Q37.5 10 40 6' stroke='%23ff6b35' stroke-width='3' fill='none'/%3e%3c/svg%3e");
    background-repeat: repeat-x;
    background-size: 40px 12px;
}

.result-image-container .wave-separator.top {
    position: absolute;
    top: 6px;
    left: 0;
    z-index: 3;
}

.result-image-container .wave-separator.bottom {
    position: absolute;
    bottom: 6px;
    left: 0;
    z-index: 3;
}

/* ボタン部分 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 40px auto;
    max-width: 300px;
}

.share-button,
.remake-button {
    display: block;
    text-decoration: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease;
}

.share-button img,
.remake-button img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 10px;
}

.share-button:hover,
.remake-button:hover {
    transform: translateY(-2px);
}

/* タッチデバイス向けボタン調整 */
@media (hover: none) and (pointer: coarse) {
    .share-button:hover,
    .remake-button:hover {
        transform: none;
    }
    
    .share-button:active,
    .remake-button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 利用規約リンク */
.footer-links {
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
}

.footer-links a {
    color: #000000;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
}

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

/* フッター */
.footer {
    margin-top: 0px;
    text-align: center;
}

.powered-by {
    color: #000000;
    font-size: 10px;
    margin-top: 0px;
    background-color: white;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 10px 0;
    text-align: center;
}

.powered-by a {
    color: inherit;
    text-decoration: none;
}

.powered-by a:hover {
    color: inherit;
    text-decoration: none;
}