/* ホーム列幅（ヘッダー・グリッド・下の NEWS を同じ幅にする） */
:root {
    --recholl-home-width: min(95vw, 500px);
}

/* ベーススタイル */
body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background-color: var(--recholl-page-bg);
    margin: 0;
    padding: 0;
    height: auto; 
    overflow: auto; 
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
}

/* PLAYボタン（右上・シャッターの左。間隔は .right-buttons の gap） */
.click-to-movie-btn {
    color: #fff;
    font-size: 13px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease,
        color 0.15s ease;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.click-to-movie-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--recholl-blue-soft) 0%, var(--recholl-blue) 100%);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 102, 255, 0.35);
}

.click-to-movie-btn:active {
    color: #fff;
    transform: translateY(1px);
    background: linear-gradient(135deg, var(--recholl-blue-dark) 0%, #003399 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.25),
        0 0 0 rgba(0, 0, 0, 0);
}

@keyframes play-btn-appear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes play-btn-appear-reduced {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.click-to-movie-btn.click-to-movie-btn--appear {
    animation: play-btn-appear 0.3s ease;
}

.click-to-movie-btn.click-to-movie-btn--fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .click-to-movie-btn.click-to-movie-btn--appear {
        animation: play-btn-appear-reduced 0.35s ease-out;
    }
}

/* ブランド共通: 丸ボタン（Ξ・ページ ± など） */
.recholl-round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    color: #111111;
    border: 4px solid #111111;
    border-radius: 999px;
    font-size: 15px;
    line-height: 1;
    font-weight: 600;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.recholl-round-btn:focus-visible {
    outline: 2px solid rgba(0, 102, 255, 0.65);
    outline-offset: 2px;
}

.page-nav-btn {
    font-size: 17px;
}

#prevPage.page-nav-btn {
    padding-bottom: 1px;
}

/* ヘッダー部分（マイページと同様に Zen Kaku を明示、h1 既定の太字を抑える） */
#rechollInfo {
    margin: 10px auto 0;
    z-index: 10;
    width: var(--recholl-home-width);
    max-width: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-sizing: border-box;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    padding: 0 0 10px;
}

#rechollTextBlock {
    display: flex;
    flex-direction: column;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
}

#rechollTitle {
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    color: rgb(0, 0, 0);
    margin: 0;
}

#rechollDatetime {
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    font-size: 14px;
    color: rgb(0, 0, 0);
    margin: 0 0 10px 0;
}

/* カメラとグリッド部分（8列×12行。高さは JS を待たず確保して CLS を防ぐ） */
.camera-wrapper {
    position: relative;
    width: var(--recholl-home-width);
    aspect-ratio: 8 / 12;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: none;
}

#cameraContainer {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.overlay-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0.5;
}

.grid-center-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    width: 100%;
    height: 100%;
    background-color: transparent;
    position: absolute;
    z-index: 1;
}

.grid-item {
    aspect-ratio: 1 / 1;
    background-color: rgba(0, 1, 13, 0);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-color 0.3s ease;
    box-shadow: 0 0 0 2px var(--recholl-page-bg);
    position: relative;
}

.grid-item .text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: var(--recholl-font-sans);
    font-size: 20px;
    font-weight: normal;
    z-index: 2;
    pointer-events: none;
    opacity: 1;
    will-change: transform, opacity, filter;
}

.grid-item .text-overlay.hidden {
    opacity: 0;
    transition: none;
}

/* 動画選択時: タイトル等が左上→右下へ雲のように浮かび上がる */
@keyframes grid-text-cloud-rise {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: translate(-50%, -50%) translate(-7px, 10px) scale(0.88);
        text-shadow: 0 0 14px rgba(255, 255, 255, 0.55);
    }
    55% {
        opacity: 0.92;
        filter: blur(2px);
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
        text-shadow: none;
    }
}

.grid-item .text-overlay.text-overlay--cloud-reveal {
    opacity: 0;
    transition: none;
    animation: grid-text-cloud-rise var(--cloud-duration, 320ms) ease-out forwards;
    animation-delay: var(--cloud-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
    .grid-item .text-overlay.text-overlay--cloud-reveal {
        animation: none;
        opacity: 1;
        filter: none;
        transform: translate(-50%, -50%);
        text-shadow: none;
    }
}

/* フッター部分 */
.footer {
    width: var(--recholl-home-width);
    max-width: none;
    margin: 10px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: rgb(0, 0, 0);
    box-sizing: border-box;
}

/* ページグラフ — 往年のチューナー筐体（ヘアライン＋粒子） */
#pageGraphContainer {
    --page-radio-metal-hi: #7a756c;
    --page-radio-metal-mid: #534f49;
    --page-radio-metal-lo: #3a3733;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding: 8px 16px 9px;
    border: 1px solid #1c1b18;
    border-radius: 2px;
    background-color: var(--page-radio-metal-mid);
    background-image:
        repeating-linear-gradient(
            180deg,
            rgba(255, 248, 235, 0.07) 0px,
            rgba(255, 248, 235, 0.07) 1px,
            rgba(0, 0, 0, 0.06) 1px,
            rgba(0, 0, 0, 0.06) 2px
        ),
        linear-gradient(
            155deg,
            rgba(255, 250, 240, 0.28) 0%,
            rgba(255, 250, 240, 0.05) 36%,
            rgba(0, 0, 0, 0.08) 68%,
            rgba(0, 0, 0, 0.28) 100%
        ),
        linear-gradient(180deg, var(--page-radio-metal-hi) 0%, var(--page-radio-metal-mid) 42%, var(--page-radio-metal-lo) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 248, 235, 0.38),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        inset 1px 0 0 rgba(255, 248, 235, 0.1),
        inset -1px 0 0 rgba(0, 0, 0, 0.28),
        0 1px 2px rgba(0, 0, 0, 0.22),
        0 6px 14px rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
}

#pageGraphContainer::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 5px 10px 5px;
    border-radius: 1px;
    border: 1px solid rgba(0, 0, 0, 0.42);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.42),
        0 1px 0 rgba(255, 248, 235, 0.14);
    pointer-events: none;
}

#pageGraphContainer::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.22;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 120px 120px;
}

.page-radio-tuner-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.page-radio-side-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #1f1e1b;
    border-radius: 50%;
    background-color: #5a564f;
    background-image:
        repeating-linear-gradient(
            115deg,
            rgba(255, 248, 235, 0.08) 0px,
            rgba(255, 248, 235, 0.08) 1px,
            transparent 1px,
            transparent 2px
        ),
        radial-gradient(circle at 35% 28%, rgba(255, 250, 240, 0.35) 0%, transparent 52%),
        linear-gradient(180deg, #7a756c 0%, #534f49 52%, #35332f 100%);
    color: #f3efe6;
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 248, 235, 0.32),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 1px 2px rgba(0, 0, 0, 0.32);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.page-radio-side-btn:active {
    transform: translateY(1px);
    background-image:
        repeating-linear-gradient(
            115deg,
            rgba(255, 248, 235, 0.05) 0px,
            rgba(255, 248, 235, 0.05) 1px,
            transparent 1px,
            transparent 2px
        ),
        linear-gradient(180deg, #4a4641 0%, #35332f 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.45),
        0 0 0 rgba(0, 0, 0, 0);
}

.page-radio-side-btn:focus-visible {
    outline: 2px solid rgba(212, 40, 40, 0.55);
    outline-offset: 2px;
}

#prevPage.page-nav-btn {
    padding-bottom: 1px;
}

.page-radio-display-well {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: stretch;
    padding: 2px 4px;
    border-radius: 1px;
    background: linear-gradient(180deg, #12110f 0%, #1d1c19 100%);
    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, 0.62),
        inset 0 0 0 1px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 248, 235, 0.16);
}

#pageGraph {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: 100%;
    vertical-align: top;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0.98;
    border-radius: 2px;
}

.page-radio-number {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 5px 10px 4px;
    border: none;
    border-radius: 1px;
    background: linear-gradient(180deg, #12110f 0%, #1f1e1b 100%);
    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, 0.62),
        inset 0 0 0 1px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 248, 235, 0.14);
    color: #e8e2d6;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 500;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    letter-spacing: 0.14em;
    text-align: center;
    cursor: pointer;
    transition:
        color 0.15s ease,
        box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.page-radio-number:hover {
    color: #ffffff;
}

.page-radio-number:focus-visible {
    outline: 2px solid rgba(212, 40, 40, 0.55);
    outline-offset: 2px;
}

#pageGraph.is-graph-dragging {
    cursor: grabbing;
    opacity: 1;
}

#pageGraphContainer:has(#pageGraph.is-graph-dragging) {
    box-shadow:
        inset 0 1px 0 rgba(255, 248, 235, 0.38),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(212, 40, 40, 0.28),
        0 2px 8px rgba(212, 40, 40, 0.14);
}

.page-drag-popup {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 50;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.page-drag-popup[hidden] {
    display: none;
}

.page-drag-popup__value {
    display: block;
    color: #111111;
    font-size: 104px;
    line-height: 1;
    font-weight: 700;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    letter-spacing: 0.04em;
    text-align: center;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.9),
        0 2px 8px rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
    #pageGraphContainer {
        padding: 7px 13px 8px;
        gap: 6px;
    }

    .page-radio-tuner-row {
        gap: 5px;
    }

    .page-radio-side-btn {
        width: 30px;
        height: 30px;
        font-size: 17px;
    }

    .page-radio-number {
        font-size: 17px;
        padding: 4px 8px 3px;
    }

    .page-drag-popup__value {
        font-size: 80px;
    }
}

/* ヘッダー操作用 — ラジオ筐体風ボタン */
.recholl-radio-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #2a2e34;
    border-radius: 2px;
    background: linear-gradient(180deg, #5c636d 0%, #3f454d 38%, #343a42 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -2px 4px rgba(0, 0, 0, 0.32),
        0 1px 3px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    cursor: pointer;
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.recholl-radio-btn:focus-visible {
    outline: 2px solid rgba(212, 40, 40, 0.55);
    outline-offset: 2px;
}

.recholl-radio-btn:active:not(.is-muted):not(.click-to-movie-btn) {
    transform: translateY(1px);
    background: linear-gradient(180deg, #4f5761 0%, #383f48 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.4),
        0 0 0 rgba(0, 0, 0, 0);
}

#uploadToggleBtn:active:not(.is-muted) {
    background: linear-gradient(180deg, #4f5761 0%, #383f48 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.4),
        0 0 0 rgba(0, 0, 0, 0);
}

.recholl-radio-btn.click-to-movie-btn {
    width: auto;
    min-width: 32px;
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    border-color: var(--recholl-blue-dark);
    background: linear-gradient(135deg, var(--recholl-blue) 0%, var(--recholl-blue-dark) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 1px 4px rgba(0, 102, 255, 0.3);
}

.recholl-radio-btn.click-to-movie-btn:focus-visible {
    outline: 2px solid var(--recholl-blue-soft);
    outline-offset: 2px;
}

.camera-blind-toggle {
    z-index: 1;
    color: #e9ebee;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
}

/* アップロードボタン */
#uploadToggleBtn {
    position: relative;
    font-size: 0;
    margin-top: 0;
}

.upload-toggle-icon {
    position: absolute;
    inset: 0;
    display: block;
    transform-origin: 50% 50%;
}

.upload-toggle-icon::before,
.upload-toggle-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s ease;
}

.upload-toggle-icon::before {
    width: 18px;
    height: 2.5px;
    background-color: #e8eaee;
}

.upload-toggle-icon::after {
    width: 2.5px;
    height: 18px;
    background-color: #e8eaee;
}

#uploadToggleBtn.active .upload-toggle-icon::before,
#uploadToggleBtn.active .upload-toggle-icon::after {
    background-color: var(--recholl-radio-accent);
}

#uploadToggleBtn.is-muted {
    pointer-events: none;
    opacity: 0.2;
    cursor: default;
}

.upload-plus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    pointer-events: none;
    opacity: 0;
}

@keyframes upload-plus-enter {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-90deg);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

.upload-plus.show {
    opacity: 1;
    animation: upload-plus-enter 0.1s ease-out forwards;
}

@keyframes upload-plus-exit {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(90deg);
    }
}

.upload-plus.exit {
    animation: upload-plus-exit 0.16s ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
    @keyframes upload-plus-enter {
        from {
            opacity: 0;
            transform: translate(-50%, -50%);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }

    @keyframes upload-plus-exit {
        from {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
        to {
            opacity: 0;
            transform: translate(-50%, -50%);
        }
    }
}

.overlay--transcode-failed {
    opacity: 0.45;
    filter: grayscale(0.6);
}

.overlay--transcode-processing {
    opacity: 0.7;
}

.overlay {
    pointer-events: none;
}

.grid-thumb-status {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
    font-family: var(--recholl-font-sans, "Zen Kaku Gothic New", sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.grid-thumb-status--failed {
    background: rgba(180, 40, 40, 0.72);
}

.grid-thumb-status--processing {
    background: rgba(0, 0, 0, 0.45);
}

.grid-thumb-status--admin-pending {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.3;
    text-align: right;
    background: rgba(140, 95, 0, 0.88);
}

/* 右側ボタン群 — see .right-buttons above upload section */

/* ハンバーガーメニュー */
.hamburger.recholl-radio-btn {
    width: 32px;
    height: 32px;
    padding: 8px 7px;
    flex-direction: column;
    justify-content: center;
    gap: 3.5px;
}

.hamburger span {
    display: block;
    position: relative;
    z-index: 1;
    height: 3px;
    width: 100%;
    flex-shrink: 0;
    background-color: #e8eaee;
    transform-origin: center center;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        background-color 0.2s ease,
        top 0.2s ease,
        left 0.2s ease,
        right 0.2s ease,
        margin 0.2s ease;
}

.hamburger.active span {
    background-color: var(--recholl-radio-accent);
}

.hamburger.active span:nth-child(1),
.hamburger.active span:nth-child(3) {
    position: absolute;
    left: 7px;
    right: 7px;
    top: 50%;
    width: auto;
    margin-top: -1.5px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
}

