/* 角丸なし：枠・カード・ボタン・フォーム要素は border-radius: 0 で統一 */
:root {
    /* SVGを使わないCSSのみの装飾枠 */
    --frame-color: #dca072;
    --frame-color-soft: rgba(220, 160, 114, .62);
    --frame-edge: clamp(8px, 1.4vw, 14px);
    --frame-inner-edge: clamp(22px, 3.2vw, 38px);
    --frame-radius: clamp(30px, 5vw, 58px);
    --frame-inner-radius: clamp(22px, 4vw, 44px);
    --frame-ornament-size: clamp(22px, 3vw, 32px);
    --frame-padding-x: clamp(18px, 5vw, 58px);
    --frame-padding-y: clamp(34px, 6vw, 72px);

    --page-bg: #070b2b;
    --panel-bg: rgba(6, 10, 47, .42);
    --panel-bg-strong: rgba(9, 14, 60, .72);
    --panel-bg-light: rgba(255, 255, 255, .08);
    --text: #fff;
    --muted: rgba(255, 255, 255, .72);
    --line: rgba(231, 180, 142, .42);
    --line-weak: rgba(255, 255, 255, .18);
    --accent: #dfa9d9;
    --accent-2: #e7b48e;
    --accent-contrast: #0d1550;
    --danger: #ffb6ad;
    --radius: 0;
    --shadow: 0 18px 60px rgba(0, 0, 0, .24);
    --content-width: 900px;
}

* {
    box-sizing: border-box;
}

img{
    width: 100%;
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background-color: #050828;
    background-image: url("../images/main-bg.jpg");
    background-repeat: repeat-y;
    background-position: center top;
    background-size: 100% auto;
    font-family: "Noto Sans JP", "Noto Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
        "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
    font-weight: 500;
    line-height: 1.85;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    /* 背景画像は body に設定：横100% / 縦リピート */
    border-left: 5px solid #030657;
    border-right: 5px solid #030657;
    box-shadow: 0 0 4.5rem #010338;
}

.logo{
    padding: 7% 0 6%;
    width: 60%;
    margin: 0 auto;
}
.logo img{
    width: 100%;
    max-width: 100%;
    height: auto;
}

.main {
    position: relative;
    isolation: isolate;
    width: min(calc(100% - 24px), var(--content-width));
    margin: 12px auto 0;
    padding: calc(var(--frame-padding-y) + var(--frame-inner-edge)) calc(var(--frame-padding-x) + var(--frame-inner-edge) * .7);
    border: 0;
}

/* 外枠：CSS border のみ。縦に伸びても崩れません */
.main::before,
.main::after {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.main::before {
    inset: var(--frame-edge);
    border: 3px solid var(--frame-color);
    border-radius: 0;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .24),
        0 0 0 1px rgba(255, 255, 255, .08);
}

/* 内枠＋四隅の飾り。画像/SVGは使わずグラデーションだけで描画 */
.main::after {
    inset: var(--frame-inner-edge);
    border: 1px solid var(--frame-color-soft);
    border-radius: 0;
    background: #040721ad;
}

.main > * {
    position: relative;
    z-index: 1;
    width: 100%;
}

.main--compact {
    display: grid;
    place-items: center;
}

.hero {
    text-align: center;
    margin-bottom: 28px;
}

.hero h1,
.message-card h1 {
    margin: 24px 0 14px;
    color: var(--accent-2);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: .08em;
}

.hero p {
    margin: 0;
    color: var(--accent-2);
    font-size: clamp(16px, 2.3vw, 21px);
    font-weight: 500;
    line-height: 2;
}

.hero__image-placeholder {
    width: min(100%, 760px);
    margin: 0 auto 22px;
    border-radius: 0;
    color: rgba(231, 180, 142, .76);
    font-weight: 700;
}

.hero__image-placeholder--small {
    max-width: 520px;
    margin-bottom: 28px;
}

.card,
.song-category {
    /*background: var(--panel-bg);*/
    /*border: 1px solid var(--line);*/
    border-radius: 0;
    /*box-shadow: var(--shadow);*/
    /*backdrop-filter: blur(6px);*/
}

.card {
    padding: clamp(20px, 4vw, 36px);
    margin-bottom: 26px;
}

.card h2 {
    margin: 0 0 8px;
    color: var(--accent-2);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .06em;
}

.card h2:not(:first-child) {
    margin-top: 24px;
}

.period {
    margin: 0;
    color: var(--accent-2);
    font-weight: 700;
}

.notes p {
    margin: 10px 0;
}

.auth-card {
    max-width: 760px;
    margin-inline: auto;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.auth-form label {
    color: var(--accent-2);
    font-weight: 700;
}

.auth-form input,
.other-song input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, .94);
    padding: 14px 16px;
    color: #0d1550;
    outline: none;
}

.auth-form input:focus,
.other-song input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(223, 169, 217, .22);
}

.button {
    display: inline-flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    padding: 16px 28px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: clamp(18px, 3.5vw, 30px);
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.button:disabled {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.button--secondary {
    background: rgba(255, 255, 255, .94);
    color: #0d1550;
}

.alert {
    width: min(100%, var(--content-width));
    margin: 0 auto 24px;
    padding: 16px 18px;
    border-radius: 0;
}

.alert p {
    margin: 4px 0;
}

.alert--error {
    background: rgba(179, 38, 30, .16);
    color: #ffe6e2;
    border: 1px solid rgba(255, 182, 173, .6);
}

.verified-email {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: .92rem;
}

.song-category {
    margin: 28px 0;
    overflow: hidden;
}

.song-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(16px, 4vw, 30px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(6, 10, 47, .94);
    backdrop-filter: blur(8px);
}

.song-category__header h2,
.song-category__header p {
    margin: 0;
}

.song-category__header h2 {
    color: var(--accent-2);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: .06em;
}

.song-category__header p {
    color: var(--accent-2);
    font-size: .95rem;
    font-weight: 700;
}

.song-category.is-complete .song-category__header {
    box-shadow: inset 5px 0 0 var(--accent);
}

.song-category.is-over .song-category__header p {
    color: var(--danger);
}

.song-section,
.other-song {
    padding: 22px clamp(16px, 4vw, 30px);
}

.song-section + .song-section,
.other-song {
    border-top: 1px solid var(--line-weak);
}

.song-section h3,
.other-song h3 {
    margin: 0 0 14px;
    color: var(--accent-2);
    font-size: 1.05rem;
    font-weight: 700;
}

.song-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.song-option {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid rgba(231, 180, 142, .38);
    border-radius: 0;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.song-option:has(input:checked) {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
    background: rgba(223, 169, 217, .20);
}

.song-option:has(input:disabled:not(:checked)) {
    opacity: .42;
    cursor: not-allowed;
}

.song-option input {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.other-song p {
    color: var(--muted);
    font-size: .92rem;
}

.submit-area {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    width: min(720px, 100%);
    margin: 36px auto 0;
    padding: 14px;
    background: rgba(6, 10, 47, .94);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    text-align: center;
}

.submit-area p {
    margin: 0 0 10px;
    color: var(--accent-2);
    font-size: .92rem;
    font-weight: 700;
}

.submit-area .button {
    width: 100%;
}

.message-card {
    width: min(100%, 760px);
    text-align: center;
    margin: 0;
}

.message-card h1 {
    margin-top: 0;
}

.message-card .small {
    color: var(--muted);
    font-size: .9rem;
}

.status-message {
    margin: 0;
    text-align: center;
    font-weight: 700;
}

.site-footer {
    padding: 18px 16px 30px;
    text-align: center;
    font-size: .8rem;
    color: rgba(231, 180, 142, .78);
}

.site-footer p {
    margin: 0;
}

.nopc {
    display: none;
}
.nosp{
    display: inline;
}

@media (max-width: 800px) {
    :root {
        --content-width: 760px;
    }

    .main {
        width: min(calc(100% - 16px), var(--content-width));
        margin-top: 8px;
        padding-top: calc(clamp(28px, 7vw, 52px) + var(--frame-inner-edge) * .6);
    }

    .song-category__header {
        position: static;
    }
}

@media (max-width: 520px) {


    .site-shell {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        /* 背景画像は body に設定：横100% / 縦リピート */
        border: none;
        box-shadow: none;
    }


    .nopc {
        display: inline;
    }
    .nosp{
        display: none;
    }

    :root {
        --frame-edge: 5px;
        --frame-inner-edge: 15px;
        --frame-radius: 26px;
        --frame-inner-radius: 18px;
        --frame-ornament-size: 18px;
        --frame-padding-x: 22px;
        --frame-padding-y: 28px;
    }

    body {
        font-size: 14px;
    }

    .main {
        width: calc(100% - 14px);
        margin-top: 4px;
        padding-top: calc(var(--frame-padding-y) + 20px);
    }

    .hero h1,
    .message-card h1 {
        font-size: 25px;
    }

    .hero p {
        font-size: 15px;
        line-height: 1.8;
    }

    .card {
        padding: 18px 12px;
    }

    .song-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .song-option {
        display: flex;
        align-items: center;
        min-height: 42px;
        gap: 5px;
        padding: 7px 6px;
        font-size: 12px;
        line-height: 1.35;
        letter-spacing: 0;
    }

    .song-option input {
        width: 14px;
        height: 14px;
        margin-top: 1px;
    }

    .song-option span {
        flex: 1 1 auto;
        min-width: 0;
    }

    .song-category__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding: 16px 12px;
    }

    .song-section,
    .other-song {
        padding: 18px 10px;
    }

    .button {
        min-height: 54px;
        padding: 14px 20px;
    }
}


.vote-confirm {
    text-align: left;
}

.vote-confirm__category {
    padding: 18px 0;
    border-top: 1px solid var(--line-weak);
}

.vote-confirm__category:first-child {
    padding-top: 0;
    border-top: 0;
}

.vote-confirm__category h2,
.vote-confirm__category h3 {
    margin: 0 0 14px;
    color: var(--accent-2);
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
    letter-spacing: .06em;
}

.vote-confirm__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vote-confirm__list li {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(231, 180, 142, .38);
    background: rgba(255, 255, 255, .08);
}

.vote-confirm__section {
    color: var(--accent-2);
    font-size: .76rem;
    line-height: 1.35;
}

.vote-confirm__title {
    color: #fff;
    font-weight: 700;
    line-height: 1.5;
}

.confirm-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 14px;
    width: min(760px, 100%);
    margin: 36px auto 0;
}

.confirm-actions form {
    margin: 0;
}

.confirm-actions .button {
    width: 100%;
}

@media (max-width: 520px) {
    .vote-confirm__list {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .vote-confirm__list li {
        padding: 9px 10px;
        font-size: 13px;
    }

    .confirm-actions {
        grid-template-columns: 1fr;
    }
}
