:root {
    --purple: #4f3677;
    --purple-dark: #332252;
    --paper: rgba(255, 255, 255, .94);
    --shadow: 0 18px 50px rgba(65, 44, 87, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: #34264f;
    background:
        radial-gradient(circle at 15% 5%, rgba(196, 255, 209, .68), transparent 32%),
        radial-gradient(circle at 90% 10%, rgba(255, 181, 222, .62), transparent 34%),
        radial-gradient(circle at 85% 85%, rgba(255, 244, 157, .58), transparent 36%),
        linear-gradient(180deg, #fff8fd 0%, #fffdf2 48%, #f9fff6 100%);
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    font-size: clamp(13px, 2.5vw, 18px);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.site-wrap { min-height: 100vh; }
.main { width: 100%; }

/* ---------- email auth ---------- */
.auth-page {
    width: 100%;
    min-height: 100vh;
    padding: clamp(18px, 3vw, 36px) 12px clamp(48px, 8vw, 84px);
    background-image: url('https://d20dfxyuz7q532.cloudfront.net/usss2026/halloweeeen/request/bg.jpg');
    background-position: top center;
    background-repeat: repeat-y;
    background-size: min(729px, 100%) auto;
}
.auth-page__inner {
    width: min(729px, 100%);
    margin: 0 auto;
}
.auth-page__logo {
    width: 110%;
    max-width: 110%;
    height: auto;
    margin: -5% auto clamp(10px, 2.5vw, 18px);
    margin-left: -5%;



}
.auth-page__info {
    width: min(760px, 100%);
    height: auto;
    margin: 0 auto clamp(18px, 3vw, 28px);
}
.auth-card {
    width: min(620px, calc(100% - 28px));
    margin: 0 auto;
    padding: clamp(24px, 5vw, 42px);
    text-align: center;
    background: rgba(255, 255, 255, .92);
    border: 2px solid rgba(85, 55, 121, .25);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(3px);
}
.auth-card h1,
.simple-card h1 {
    text-align: center;
    margin: 0 0 14px;
    font-size: clamp(24px, 4.5vw, 34px);
    line-height: 1.35;
    color: var(--purple);
    font-weight: 900;
}
.auth-card p { margin: 0 0 18px; }
.auth-email {
    display: inline-block;
    margin: 4px 0 22px !important;
    padding: 7px 14px;
    border-radius: 999px;
    background: #f2ecfb;
    font-weight: 700;
    word-break: break-all;
}
.email-auth-form {
    display: grid;
    gap: 12px;
    max-width: 520px;
    margin: 24px auto 0;
    text-align: left;
}
.email-auth-form label { font-weight: 800; }
.email-auth-form input[type="email"] {
    width: 100%;
    min-height: 52px;
    padding: 12px 15px;
    border: 2px solid #cdbce0;
    border-radius: 12px;
    outline: none;
    background: #fff;
    font-size: 16px;
}
.email-auth-form input[type="email"]:focus {
    border-color: #7e5ba4;
    box-shadow: 0 0 0 4px rgba(126, 91, 164, .12);
}
.auth-note, .small-note {
    margin-top: 24px !important;
    color: #6d6280;
    font-size: 12px;
    text-align: left;
}
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 28px;
    border: 0;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
}
.primary-button {
    color: #fff;
    background: linear-gradient(135deg, #7854a3, #4e3374);
    box-shadow: 0 8px 22px rgba(78, 51, 116, .24);
}
.secondary-button {
    color: #513c72;
    background: #eee7f5;
}
.email-auth-form .primary-button { width: 100%; margin-top: 4px; }

/* ---------- alerts ---------- */
.alert {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

.alert--error {
    color: #a52a45;
    background: #fff0f4;
    border: 1px solid #f2b9c8;
}

.alert--success {
    color: #2f6c51;
    background: #effbf4;
    border: 1px solid #bce4cd;
}

.auth-page .alert {
    width: min(620px, calc(100% - 28px));
    margin: 0 auto 18px;
}

/* ---------- design / selection ---------- */
.request-page {
    position: relative;
    width: min(729px, 100%);
    min-height: 100vh;
    margin: 0 auto;
}
.request-page--parts {
    overflow: hidden;
    /*background: url("https://d20dfxyuz7q532.cloudfront.net/usss2026/halloweeeen/request/bg.jpg") center top / 100% 100% no-repeat;*/
    /*box-shadow: 0 0 44px rgba(86, 62, 120, .08);*/
}
.request-page > .alert {
    position: fixed;
    z-index: 30;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, calc(100% - 24px));
}
.request-composition {
    position: relative;
    width: 100%;
    padding: 1.5% 0 2.5%;
}
.request-main-logo {
    position: relative;
    z-index: 2;
    width: 110%;
    max-width: 110%;
    height: auto;
    margin: -5% auto -23px;
    margin-left: -5%;
    user-select: none;
    pointer-events: none;

}
.top-frame-stage {
    position: relative;
    width: 100%;
    margin-top: -1.5%;
    aspect-ratio: 854 / 2048;
}
.top-frame-stage__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    pointer-events: none;
}
.request-box-grid {
    position: absolute;
    z-index: 2;
    top: 44%;
    left: 13%;
    right: 13%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 4%;
    row-gap: clamp(8px, 1.55vw, 14px);
}
.member-request-box {
    position: relative;
    width: 100%;
}
.member-request-box__image {
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}
.choice-slot {
    position: absolute;
    z-index: 2;
    left: 5.7%;
    width: 88.6%;
    height: 19.5%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.choice-slot--row-1 { top: 26.35%; }
.choice-slot--row-2 { top: 51.95%; }
.choice-slot--row-3 { top: 77.55%; }
.choice-slot::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 45%;
    bottom: 0;
    border-radius: 5px;
    transition: box-shadow .15s ease, background .15s ease;
}
.choice-slot:hover::after {
    background: rgba(255,255,255,.10);
}
.choice-slot:focus-visible {
    outline: none;
}
.choice-slot:focus-visible::after {
    box-shadow: 0 0 0 3px rgba(84, 52, 124, .68) inset;
}
.choice-display {
    position: absolute;
    z-index: 1;
    left: 1.5%;
    right: 1.5%;
    top: 45%;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4%;
    color: #4b3a65;
    font-size: clamp(7px, 1.55vw, 12px);
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(255,255,255,.9);
    pointer-events: none;
}
.vote-image-button {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 3.7%;
    transform: translateX(-50%);
    width: 24%;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 0;
    opacity: .34;
    cursor: not-allowed;
    transition: opacity .2s ease, transform .15s ease, filter .15s ease;
}
.vote-image-button img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}
.vote-image-button:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}
.vote-image-button:not(:disabled):hover {
    transform: translateX(-50%) scale(1.025);
    filter: brightness(1.03);
}
.vote-image-button:not(:disabled):focus-visible {
    outline: 3px solid rgba(79, 54, 119, .7);
    outline-offset: 3px;
    border-radius: 50%;
}

/* ---------- song modal ---------- */
body.is-modal-open { overflow: hidden; }
.song-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
}
.song-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(42, 27, 60, .55);
    backdrop-filter: blur(5px);
}
.song-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(600px, 100%);
    max-height: min(760px, calc(100dvh - 36px));
    display: flex;
    flex-direction: column;
    padding: 26px 22px 22px;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 24px;
    background:
        radial-gradient(circle at 10% 0%, rgba(188, 255, 209, .58), transparent 34%),
        radial-gradient(circle at 100% 0%, rgba(255, 193, 228, .58), transparent 34%),
        linear-gradient(180deg, #fffdfd, #fffaf5);
    box-shadow: 0 24px 70px rgba(39, 23, 56, .35);
}
.song-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #5b407d;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.song-modal__eyebrow {
    margin: 0 42px 2px 0;
    color: #765796;
    font-size: 13px;
    font-weight: 900;
}
.song-modal h2 {
    margin: 0 40px 16px 0;
    color: #402b61;
    font-size: clamp(21px, 5vw, 28px);
    line-height: 1.35;
}
.song-modal__search {
    flex: 0 0 auto;
    width: 100%;
    min-height: 46px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 2px solid #d5c6e5;
    border-radius: 12px;
    outline: none;
    background: #fff;
    font-size: 16px;
}
.song-modal__search:focus { border-color: #765796; }
.song-modal__list {
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e4dbe9;
    border-radius: 14px;
    background: rgba(255,255,255,.82);
}

.song-group-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 14px;
    color: #513c72;
    background: #eee7f5;
    border-top: 1px solid #ded2e8;
    border-bottom: 1px solid #d7c9e2;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
}
.song-group-heading:first-child {
    border-top: 0;
}

.song-item {
    display: block;
    width: 100%;
    padding: 13px 15px;
    border: 0;
    border-bottom: 1px solid #eee7f2;
    text-align: left;
    color: #35234e;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}
.song-item:last-child { border-bottom: 0; }
.song-item:hover,
.song-item:focus-visible { background: #f3ecfa; outline: none; }
.song-item.is-selected { background: #eadcf7; color: #4b2a72; }
.song-empty { padding: 24px; text-align: center; color: #7a6d87; }

/* ---------- confirm / complete ---------- */
.simple-page {
    width: min(780px, calc(100% - 24px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 42px 0 70px;
}
.simple-card {
    padding: clamp(24px, 5vw, 44px);
    border: 2px solid rgba(85, 55, 121, .22);
    border-radius: 26px;
    background: rgba(255,255,255,.77);
    box-shadow: var(--shadow);
    max-width: 650px;
    margin: 0 auto;
}
.simple-card > p { text-align: center; }
.confirm-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}
.confirm-group {
    padding: 18px;
    border-radius: 18px;
    background: #f8f5fb;
}
.confirm-group--uratanuki { background: #eef8e6; }
.confirm-group--shima { background: #f1eafa; }
.confirm-group--sakata { background: #fff0f3; }
.confirm-group--senra { background: #fff7d9; }
.confirm-group h2 {
    margin: 0 0 14px;
    color: #332552;
    font-size: 17px;
    line-height: 1.45;
}
.confirm-row {
    padding: 10px 0;
    border-top: 1px solid rgba(70, 49, 100, .12);
}
.confirm-source {
    display: block;
    color: #7a6b8d;
    font-size: 11px;
    font-weight: 700;
}
.confirm-row strong { display: block; margin-top: 2px; font-size: 14px; }
.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}
.confirm-actions form { margin: 0; }
.complete-card { text-align: center; margin-top: 8vh; }
.complete-heart {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #9de6b2, #f8a8d4 50%, #ffd66a);
    font-size: 48px;
}

.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid #e7e1ec; text-align: left; vertical-align: top; }
.admin-table th { background: #f3eef8; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-row input { width: 100%; max-width: 460px; padding: 12px; border: 1px solid #cfc5d9; border-radius: 8px; font-size: 16px; }

.br-sp { display: none; }
@media (max-width: 640px) {
    .verified-badge { top: 7px; font-size: 9px; }
    .auth-page { padding-left: 8px; padding-right: 8px; }
    .auth-card { width: min(620px, calc(100% - 8px)); padding: 20px 16px 24px; }
    .song-modal { padding: 10px; }
    .song-modal__dialog { max-height: calc(100dvh - 20px); padding: 22px 14px 14px; border-radius: 18px; }
    .confirm-groups { grid-template-columns: 1fr; }
    .confirm-actions { flex-direction: column; }
    .confirm-actions > *, .confirm-actions form, .confirm-actions button { width: 100%; }
    .br-sp { display: inline; }
}


/* ---------- result pages ---------- */
.result-page {
    width: 100%;
    min-height: 100vh;
    padding: clamp(18px, 3vw, 36px) 12px clamp(56px, 8vw, 90px);
    background-image: url('https://d20dfxyuz7q532.cloudfront.net/usss2026/halloweeeen/request/confirm-bg.jpg');
    background-position: top center;
    background-repeat: repeat-y;
    background-size: min(729px, 100%) auto;
}
.result-page__inner {
    width: min(729px, 100%);
    margin: 0 auto;
}
.result-page__logo {
    width: 110%;
    max-width: 110%;
    height: auto;
    margin: -5% auto -23px;
    margin-left: -5%;
    user-select: none;
    pointer-events: none;


}
.result-box {
    position: relative;
    width: min(700px, 100%);
    margin: 0 auto;
}
.result-box__image {
    display: block;
    width: 100%;
    height: auto;
}
.result-box__top-button {
    position: absolute;
    left: 50%;
    bottom: 21.5%;
    transform: translateX(-50%);
    display: block;
    width: 47%;
    line-height: 0;
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease;
}
.result-box__top-button img {
    display: block;
    width: 100%;
    height: auto;
}
.result-box__top-button:hover,
.result-box__top-button:focus-visible {
    filter: brightness(1.04);
    transform: translateX(-50%) translateY(-1px);
    outline: none;
}

.site-footer.result{
    display: none;
}

/* ---------- confirm page background / logo ---------- */
.confirm-page {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: clamp(24px, 4vw, 48px) 12px 70px;
    background-image: url('https://d20dfxyuz7q532.cloudfront.net/usss2026/halloweeeen/request/confirm-bg.jpg');
    background-position: top center;
    background-repeat: repeat-y;
    background-size: min(729px, 100%) auto;
}
.confirm-page__inner {
    width: min(780px, 100%);
    margin: 0 auto;
}
.confirm-page__logo {
    width: 110%;
    max-width: 110%;
    height: auto;
    margin: -5% auto -23px;
    margin-left: -5%;
    user-select: none;
    pointer-events: none;
}
.confirm-card {
    background: rgba(255, 255, 255, .77);
    backdrop-filter: blur(3px);
    max-width: 650px;
    margin: 0 auto;
}


/* ---------- common footer ---------- */
.site-footer {
    margin-top: -65px;
    width: 100%;
    padding: 18px 12px 22px;
    text-align: center;
}
.site-footer p {
    margin: 0;
    color: #2f2440;
    font-size: clamp(11px, 1.8vw, 14px);
    font-weight: 500;
    letter-spacing: .04em;
}


/* ---------- footer background continuation ---------- */
.main:has(> .auth-page),
.main:has(> .request-page),
.main:has(> .confirm-page),
.main:has(> .result-page) {
    background-image: url('https://d20dfxyuz7q532.cloudfront.net/usss2026/halloweeeen/request/bg.jpg');
    background-position: top center;
    background-repeat: no-repeat;
    background-size: cover;
}

.main > .site-footer {
    position: relative;
    z-index: 1;
    background: transparent;
}


/* ---------- admin member aggregation tabs ---------- */
.admin-section-note {
    margin: -4px 0 16px;
    color: #766b83;
    font-size: 13px;
}
.admin-member-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 20px;
}
.admin-member-tab {
    min-height: 46px;
    padding: 9px 10px;
    border: 1px solid #d8cfdf;
    border-radius: 10px;
    color: #604d74;
    background: #f7f3fa;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.admin-member-tab:hover {
    background: #efe7f6;
}
.admin-member-tab.is-active {
    color: #fff;
    border-color: #62447f;
    background: #62447f;
    box-shadow: 0 5px 14px rgba(79, 54, 119, .18);
}
.admin-member-tab:focus-visible {
    outline: 3px solid rgba(98, 68, 127, .25);
    outline-offset: 2px;
}
.admin-member-panel[hidden] {
    display: none !important;
}
.admin-member-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.admin-member-heading h3 {
    margin: 0;
    color: #4a365f;
    font-size: 20px;
}
.admin-member-heading span {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    color: #6d5a80;
    background: #f2edf6;
    font-size: 12px;
    font-weight: 700;
}
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-count-cell {
    width: 90px;
    text-align: right !important;
    font-weight: 800;
    white-space: nowrap;
}
.admin-table-empty {
    padding: 24px 12px !important;
    text-align: center !important;
    color: #8a7e93;
}
@media (max-width: 640px) {
    .admin-member-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-member-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
