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

body {
    font-family: 'Electrolize', 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    visibility: hidden;
}

body.loaded {
    visibility: visible;
}

/* Guide page container */
.guide-page {
    min-height: 100vh;
    width: 100%;
    background-image: url('../images/background.png');
    background-repeat: repeat;
    background-size: 50px 50px;
    background-position: 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 46px 18px 56px;
    gap: 54px;
    position: relative;
    animation: backgroundFlow 10s linear infinite;
}

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

/* Head section */
.head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    max-width: 700px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.2s forwards;
}

/* Back button */
.back-button {
    background: transparent;
    border: none;
    padding: 0;
    width: 43px;
    height: 43px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

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

.back-button:active {
    transform: scale(0.95);
}

.back-icon {
    width: 100%;
    height: 100%;
}

/* Guide header */
.guide-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Guide data card */
.guide-data {
    background-color: white;
    border: 2px solid black;
    border-radius: 13px;
    box-shadow: 3px 3px 0px 0px black;
    padding: 26px 7px;
    width: 100%;
    min-height: 357px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.guide-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Guide number */
.guide-number {
    font-family: 'Electrolize', sans-serif;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 4px;
    color: white;
    line-height: 106.285%;
    text-align: center;
    -webkit-text-stroke: 5px black;
    text-stroke: 5px black;
    paint-order: stroke fill;
}

/* Guide title */
.guide-title {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: black;
    text-align: center;
    line-height: normal;
}

/* Guide description */
.guide-description {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #686868;
    text-align: center;
    line-height: normal;
}

/* YouTube container */
.youtube-container {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Paragraph section */
.paragraph-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 700px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.4s forwards;
}

/* Paragraph header with highlight */
.paragraph-header-wrapper {
    margin-bottom: 6px;
}

.paragraph-header {
    display: inline-block;
    position: relative;
}

.paragraph-title {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: 19px;
    color: black;
    text-align: left;
    line-height: 1.55;
    position: relative;
    z-index: 2;
    display: inline;
    background: linear-gradient(
        transparent calc(100% - 0.75em),
        #7fff00 calc(100% - 0.75em)
    );
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.paragraph-title-label {
    display: inline;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 17px;
    line-height: 1.6;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
    text-decoration-color: #000;
}

.paragraph-highlight {
    display: none;
}

/* Paragraph text */
.paragraph-text {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: black;
    line-height: 1.85;
    text-align: left;
}

.paragraph-text img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
    border-radius: 14px;
}

.store-badge-link {
    display: inline-block;
    line-height: 0;
}

.paragraph-text img.store-badge {
    width: 201px;
    max-width: 100%;
    cursor: pointer;
    border-radius: 0;
}

.paragraph-text img.is-zoomable:focus-visible {
    outline: 3px solid #7fff00;
    outline-offset: 4px;
}

.guide-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 33px;
}

.guide-popup-overlay.active {
    display: flex;
}

.guide-popup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    gap: 28px;
}

.guide-popup-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    width: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    z-index: 1;
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.guide-popup-image {
    display: block;
    max-width: 100%;
    max-height: calc(82vh - 120px);
    width: auto;
    height: auto;
    border-radius: 18px;
}

.guide-popup-close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 4px 12px;
    cursor: pointer;
    opacity: 0;
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
    transition: opacity 0.2s ease;
}

.guide-popup-close-button:hover {
    opacity: 0.7;
}

.guide-popup-close-button:active {
    opacity: 0.5;
}

.guide-popup-close-text {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: white;
    white-space: nowrap;
}

@keyframes closeButtonIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Keyframe animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .guide-page {
        padding: 40px 16px 48px;
        gap: 48px;
    }

    .guide-number {
        font-size: 36px;
        -webkit-text-stroke: 4px black;
        text-stroke: 4px black;
    }

    .guide-title {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .guide-page {
        padding: 32px 12px 40px;
        gap: 40px;
    }

    .head {
        gap: 12px;
    }

    .back-button {
        width: 36px;
        height: 36px;
    }

    .guide-data {
        height: auto;
        min-height: 357px;
        padding: 20px 7px;
    }

    .guide-number {
        font-size: 32px;
        letter-spacing: 3px;
    }

    .guide-title {
        font-size: 24px;
    }

    .guide-description {
        font-size: 12px;
    }

    .youtube-container {
        width: 100%;
        max-width: 306px;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .paragraph-title {
        font-size: 18px;
    }

    .paragraph-title-label {
        font-size: 16px;
    }

    .paragraph-text {
        font-size: 15px;
    }

    .guide-popup-overlay {
        padding: 20px 16px;
        padding-top: 20px;
        align-items: center;
    }

    .guide-popup-container {
        gap: 0;
    }

    .guide-popup-card {
        min-height: 0;
        padding: 0;
    }

    .guide-popup-image {
        max-height: calc(100vh - 120px);
    }

    .guide-popup-close-button {
        position: absolute;
        bottom: -52px;
        left: 50%;
        transform: translateX(-50%);
        animation: closeButtonIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
    }

    .guide-popup-close-text {
        font-size: 14px;
    }
}
