* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    min-height: 100vh;
    color: #222;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        sans-serif;
    background: #eef1f4;
}

.immigration-page {
    width: min(100%, 960px);
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid #c9ced3;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .15);
}

.immigration-header {
    display: block;
    width: 100%;
    height: auto;
}

.screen-panel {
    padding: 34px;
}

.officer-area {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 24px;
    align-items: center;
}

.officer-icon {
    display: grid;
    place-items: center;
    width: 110px;
    height: 110px;
    font-size: 70px;
    background: #edf1f4;
    border: 3px solid #6b6b6b;
    border-radius: 50%;
}

.speech-area {
    position: relative;
    padding: 24px 28px;
    background: #f8f8f8;
    border: 3px solid #5f5f5f;
    border-radius: 16px;
}

.speech-area::before {
    content: "";
    position: absolute;
    top: 39px;
    left: -19px;
    width: 32px;
    height: 32px;
    background: #f8f8f8;
    border-left: 3px solid #5f5f5f;
    border-bottom: 3px solid #5f5f5f;
    transform: rotate(45deg);
}

.speaker-name {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: #666;
    font-size: 14px;
    font-weight: 700;
}

.question-text {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(22px, 4vw, 34px);
    line-height: 1.4;
}

.answer-list {
    display: grid;
    gap: 14px;
    margin-top: 32px;
}

.answer-button {
    width: 100%;
    padding: 17px 20px;
    color: #222;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    background: #fff;
    border: 2px solid #767676;
    border-radius: 10px;
    cursor: pointer;
}

.answer-button:hover,
.answer-button:focus-visible {
    background: #fff9d9;
    border-color: #d19b00;
}

.answer-button:disabled {
    cursor: default;
    opacity: .65;
}

.feedback-area {
    min-height: 28px;
    margin-top: 18px;
    font-weight: 700;
    text-align: center;
}

.result-screen {
    padding: 0 0 30px;
    text-align: center;
}

.result-image {
    display: block;
    width: 100%;
    height: auto;
}

.result-message {
    margin: 26px 24px 20px;
    font-size: 20px;
    font-weight: 700;
}

.result-message p {
    margin: 5px 0;
}

.result-title {
    font-size: clamp(25px, 4vw, 38px);
}

.denied-message {
    color: #9d1d1d;
}

.permitted-message {
    color: #17672d;
}

.action-button {
    display: inline-block;
    margin: 0 8px;
    padding: 13px 24px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.retry-button {
    background: #555;
}

.next-button {
    background: #17672d;
}

.action-button:hover,
.action-button:focus-visible {
    filter: brightness(1.08);
}

[hidden] {
    display: none !important;
}

@media (max-width: 650px) {
    body {
        padding: 8px;
    }

    .screen-panel {
        padding: 22px 16px;
    }

    .officer-area {
        grid-template-columns: 70px 1fr;
        gap: 14px;
    }

    .officer-icon {
        width: 70px;
        height: 70px;
        font-size: 43px;
        border-width: 2px;
    }

    .speech-area {
        padding: 18px;
        border-width: 2px;
    }

    .speech-area::before {
        top: 25px;
        left: -13px;
        width: 22px;
        height: 22px;
        border-width: 0 0 2px 2px;
    }

    .answer-button {
        padding: 15px;
        font-size: 16px;
    }
}

.immigration-reset-button {
    display: block;
    margin: 30px auto 10px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #b3261e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.immigration-reset-button:hover {
    opacity: 0.85;
}

.immigration-stamp-item p {
    margin: 4px 0;
}

.stamp-city {
    margin-top: 10px;
    font-size: 30px;
    font-weight: bold;
}

.stamp-airport,
.stamp-date {
    font-size: 22px;
}

/* ========================================
   入出国スタンプ帳
======================================== */

.immigration-stamp-item {
    max-width: 760px;
    margin: 0 0 32px;
    padding: 16px;
    background: #fff;
    border: 1px solid #c9ced3;
    border-radius: 10px;
}

.stamp-image-pair {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stamp-image-box {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.stamp-image-box img {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
}

.stamp-type-label {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: bold;
}

.stamp-empty {
    display: flex;
    min-height: 170px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    background: #f3f4f5;
    border: 2px dashed #aaa;
    border-radius: 8px;
}

.stamp-information {
    margin-top: 12px;
}

.stamp-information p {
    margin: 3px 0;
}

.stamp-city {
    font-size: 24px;
    font-weight: bold;
}

.stamp-airport,
.stamp-date {
    font-size: 18px;
}

@media screen and (max-width: 600px) {

    .stamp-image-pair {
        gap: 8px;
    }

    .stamp-type-label {
        font-size: 14px;
    }

    .stamp-city {
        font-size: 21px;
    }

    .stamp-airport,
    .stamp-date {
        font-size: 16px;
    }

    .stamp-empty {
        min-height: 110px;
        font-size: 13px;
    }
}