﻿:root {
    --primary: #e75585;
    --primary-dark: #c9426e;
    --gold-red: #c85825;
    --title-green: #2f7e66;
    --secondary: #73c7c1;
    --ink: #3f3b56;
    --muted: #746f8a;
    --paper: rgba(255, 255, 255, 0.62);
    --paper-strong: rgba(255, 255, 255, 0.82);
    --line: rgba(255, 255, 255, 0.56);
    --shadow: 0 22px 70px rgba(49, 62, 58, 0.16);
    --font-title: 'Kaisei Decol', 'Noto Sans SC', serif;
    --font-cute: 'Yusei Magic', 'Noto Sans SC', sans-serif;
    --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-subtitle: Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: #f7fff8;
    overflow-x: hidden;
}

#bg-layer {
    position: fixed;
    inset: 0;
    z-index: -3;
    background: linear-gradient(135deg, #f7fff8 0%, #fff7fb 52%, #effffa 100%);
    background-size: cover;
    background-position: center;
    transition: opacity .4s;
}
#bg-layer.has-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
}
#ambient-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 78%);
}

.home-shell {
    width: min(1540px, calc(100vw - 36px));
    margin: 0 auto;
    padding: 24px 0 42px;
    transform: translateX(-28px);
}
.topbar {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.eyebrow {
    margin: 0 0 5px;
    color: var(--gold-red);
    font-family: var(--font-subtitle);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
}
h1 {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(34px, 4.8vw, 62px);
    color: var(--title-green);
    line-height: 1.02;
    letter-spacing: .01em;
}
.top-actions { display: flex; gap: 10px; }
.icon-btn,
.soft-btn,
.primary-btn {
    border: 0;
    font-family: var(--font-body);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.58);
    box-shadow: 0 8px 28px rgba(51, 69, 64, 0.12);
    font-size: 18px;
    backdrop-filter: blur(18px);
}
.icon-btn:hover,
.soft-btn:hover,
.primary-btn:hover { transform: translateY(-1px); }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: stretch;
    margin-top: 18px;
}
.profile-panel,
.gate-panel,
.music-dock {
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(1.12);
    border-radius: 8px;
}
.profile-panel {
    height: min(680px, calc(100vh - 150px));
    min-height: 500px;
    overflow-y: auto;
    padding: 30px 36px 34px;
    scrollbar-gutter: stable;
}
.profile-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.profile-mark {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px 0 18px;
    border-left: 5px solid var(--primary);
    font-family: var(--font-cute);
    color: var(--gold-red);
    font-size: 22px;
}
.soft-btn {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.62);
    color: var(--ink);
    border: 1px solid rgba(255,255,255,.78);
}
.primary-btn {
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #b4a0e5);
    box-shadow: 0 14px 26px rgba(231,85,133,.22);
    font-weight: 700;
}
.primary-btn.full { width: 100%; margin-top: 12px; }

.profile-content {
    font-size: 16px;
    line-height: 1.86;
}
.profile-greeting {
    margin: 10px 0 22px;
    font-family: var(--font-cute);
    font-size: clamp(46px, 6vw, 78px);
    line-height: 1.08;
    color: var(--gold-red);
    text-shadow: 0 10px 28px rgba(200, 88, 37, .12);
}
.profile-quote {
    margin: 0 0 26px;
    padding: 22px 24px;
    border-left: 5px solid var(--secondary);
    background: rgba(255,255,255,.38);
    color: var(--muted);
    font-family: var(--font-subtitle);
    font-size: 15px;
}
.profile-section {
    margin: 26px 0 0;
}
.profile-section h2 {
    margin: 0 0 10px;
    font-family: var(--font-subtitle);
    color: var(--title-green);
    font-size: 25px;
    line-height: 1.2;
}
.profile-section ul {
    margin: 0;
    padding-left: 26px;
}
.profile-section li {
    margin: 7px 0;
}
.profile-section strong {
    font-family: var(--font-subtitle);
    font-weight: 700;
}

.gate-panel {
    height: min(680px, calc(100vh - 150px));
    min-height: 500px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.gate-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), #ffd93d);
}
.gate-logo {
    width: min(170px, 76%);
    aspect-ratio: 1;
    object-fit: contain;
    align-self: center;
    margin-top: 24px;
    filter: drop-shadow(0 18px 24px rgba(25, 31, 45, .23));
}
.gate-copy { margin-top: auto; }
.seal {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(124,199,197,.2);
    color: #2f7e66;
    font-family: var(--font-subtitle);
    font-size: 12px;
    font-weight: 700;
}
.gate-panel h2 {
    margin: 14px 0 8px;
    font-family: var(--font-title);
    font-size: 24px;
    line-height: 1.18;
    color: var(--title-green);
}
.gate-panel p {
    margin: 0 0 6px;
    color: var(--muted);
    line-height: 1.7;
}
.locked-message,
.form-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.link-strip {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 24px 0;
}
.link-card {
    width: 112px;
    height: 112px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--ink);
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(255,255,255,.74);
    box-shadow: 0 14px 36px rgba(49, 62, 58, 0.14);
    backdrop-filter: blur(20px) saturate(1.08);
    transition: transform .2s, border-color .2s, background .2s;
}
.link-card:hover {
    transform: translateY(-4px);
    border-color: rgba(115, 199, 193, .72);
    background: rgba(255,255,255,.74);
}
.link-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--title-green);
    font-family: var(--font-subtitle);
    font-size: 24px;
    font-weight: 700;
}
.github-icon svg {
    width: 34px;
    height: 34px;
    fill: #181717;
}
.link-card strong {
    font-family: var(--font-subtitle);
    font-size: 12px;
}

.music-dock {
    padding: 18px;
}
.section-title {
    margin-bottom: 12px;
    font-family: var(--font-subtitle);
    color: var(--title-green);
    font-size: 18px;
    font-weight: 700;
}
.music-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}
.music-container iframe {
    width: 100%;
    border-radius: 8px;
}
.empty-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.modal.open { display: flex; }
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(63,59,86,.38);
    backdrop-filter: blur(5px);
}
.modal-content {
    position: relative;
    width: min(760px, 100%);
    max-height: 88vh;
    overflow: auto;
    background: var(--paper-strong);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(38, 31, 52, .26);
    backdrop-filter: blur(22px);
}
.small-modal { width: min(420px, 100%); }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.58);
}
.modal-header h2 {
    margin: 0;
    font-family: var(--font-title);
    color: var(--title-green);
    font-size: 22px;
}
.modal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.62);
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
}
.modal-body { padding: 20px; }
.settings-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.settings-block {
    border: 1px dashed rgba(255,255,255,.72);
    border-radius: 8px;
    padding: 14px;
}
.settings-block h3 {
    margin: 0 0 12px;
    font-family: var(--font-subtitle);
    color: var(--title-green);
}
.text-input {
    width: 100%;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 8px;
    color: var(--ink);
    background: rgba(255,255,255,.72);
    font-family: var(--font-body);
    font-size: 14px;
    min-height: 39px;
    padding: 9px 11px;
}
.inline-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.stretch-row { flex-wrap: nowrap; }
.stretch-row .text-input { flex: 1; }
.bg-preview-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.bg-preview-item {
    position: relative;
    width: 90px;
    height: 64px;
    overflow: hidden;
    border-radius: 8px;
    border: 3px solid transparent;
    cursor: pointer;
}
.bg-preview-item.active { border-color: var(--primary); }
.bg-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bg-preview-item button,
.music-manage-item button {
    border: 0;
    background: #e45757;
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
}
.bg-preview-item button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
}
.music-manage-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.music-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255,255,255,.48);
    font-size: 13px;
}
.music-manage-item button { width: 22px; height: 22px; }

.profile-panel::-webkit-scrollbar { width: 7px; }
.profile-panel::-webkit-scrollbar-track { background: rgba(255,255,255,.18); border-radius: 999px; }
.profile-panel::-webkit-scrollbar-thumb { background: rgba(47,126,102,.42); border-radius: 999px; }
.profile-panel::-webkit-scrollbar-thumb:hover { background: rgba(47,126,102,.62); }
.profile-panel { scrollbar-width: thin; scrollbar-color: rgba(47,126,102,.48) rgba(255,255,255,.18); }
body.bg-viewing .home-shell,
body.bg-viewing #ambient-layer { opacity: 0; pointer-events: none; }
body.bg-viewing #bg-layer.has-bg::after { background: transparent; }
.bg-view-exit {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 30;
    border: 0;
    border-radius: 999px;
    padding: 12px 24px;
    color: #fff;
    background: rgba(0,0,0,.58);
    backdrop-filter: blur(8px);
    cursor: pointer;
}
body.bg-viewing .bg-view-exit { display: block; }

@media (max-width: 940px) {
    .home-shell { width: min(100% - 22px, 720px); transform: none; padding-top: 18px; }
    .topbar { align-items: flex-start; }
    .hero-grid { grid-template-columns: 1fr; }
    .profile-panel, .gate-panel { height: auto; max-height: none; }
    .gate-panel { min-height: 300px; }
    .gate-logo { width: 160px; margin-top: 8px; }
    .link-strip { flex-wrap: wrap; gap: 14px; }
    .link-card { width: 96px; height: 96px; }
    .profile-panel { padding: 20px; min-height: auto; }
    .stretch-row { flex-wrap: wrap; }
    .stretch-row .text-input { min-width: 100%; }
}



/* 2026-07-08 polish pass: balanced columns, playful text, record-style music */
.hero-grid {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 18px;
}
.profile-panel,
.gate-panel {
    height: min(700px, calc(100vh - 138px));
    min-height: 520px;
}
.profile-panel {
    overflow-y: scroll;
    border-image: linear-gradient(135deg, #f45c9b, #7bd7cf, #ffe06b, #8ba7ff) 1;
}
.profile-panel::-webkit-scrollbar { width: 10px; }
.profile-panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,.26);
    border-radius: 999px;
    margin: 12px 0;
}
.profile-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f45c9b, #7bd7cf, #ffe06b);
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.55);
}
.profile-panel { scrollbar-width: thin; scrollbar-color: #7bd7cf rgba(255,255,255,.26); }
.gate-panel {
    justify-content: flex-start;
    gap: 16px;
    padding: 20px 18px;
}
.gate-logo {
    width: min(178px, 82%);
    margin: 12px auto 10px;
}
.gate-copy { margin-top: 0; }
.gate-panel .primary-btn { margin-top: 12px; }
.profile-quote {
    color: #c99313;
    font-weight: 700;
    border: 2px solid transparent;
    border-left: 6px solid #d6aa25;
    background:
        linear-gradient(rgba(255,255,255,.52), rgba(255,255,255,.52)) padding-box,
        linear-gradient(120deg, #f45c9b, #7bd7cf, #ffe06b, #9ea8ff) border-box;
    box-shadow: 0 14px 32px rgba(199, 147, 19, .1);
}
.profile-section {
    padding: 18px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    background:
        linear-gradient(rgba(255,255,255,.34), rgba(255,255,255,.34)) padding-box,
        linear-gradient(120deg, rgba(244,92,155,.85), rgba(123,215,207,.85), rgba(255,224,107,.85), rgba(158,168,255,.85)) border-box;
    box-shadow: 0 12px 30px rgba(49,62,58,.08);
}
.profile-section li {
    font-family: var(--font-cute), 'Noto Sans SC', sans-serif;
    font-size: 17px;
    letter-spacing: .01em;
}
.profile-section strong { font-family: var(--font-subtitle); }
.link-strip {
    justify-content: space-between;
    width: 100%;
    gap: clamp(16px, 5vw, 52px);
}
.link-card { flex: 0 0 112px; }
.music-dock { border-image: linear-gradient(90deg, #f45c9b, #7bd7cf, #ffe06b, #9ea8ff) 1; }
.music-container.record-grid { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.record-player {
    position: relative;
    min-height: 154px;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 18px;
    border-radius: 8px;
    background:
        linear-gradient(rgba(255,255,255,.42), rgba(255,255,255,.42)) padding-box,
        linear-gradient(135deg, #f45c9b, #7bd7cf, #ffe06b) border-box;
    border: 2px solid transparent;
    box-shadow: 0 16px 38px rgba(49,62,58,.14);
    overflow: hidden;
}
.record-disc {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #f8f4e7 0 8px, #d95583 9px 18px, #191923 19px 42px, #2b2d3f 43px 48px, #11131d 49px 100%);
    box-shadow: inset 0 0 0 8px rgba(255,255,255,.05), 0 12px 26px rgba(21,24,32,.24);
    animation: recordSpin 6s linear infinite;
}
.record-arm {
    position: absolute;
    left: 94px;
    top: 28px;
    width: 74px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f2dfb8, #665d76);
    transform: rotate(27deg);
    transform-origin: left center;
    box-shadow: 0 4px 12px rgba(40,34,52,.22);
}
.record-arm::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -4px;
    width: 14px;
    height: 18px;
    border-radius: 4px;
    background: #443c55;
}
.record-embed { position: relative; z-index: 1; min-width: 0; }
.record-label {
    margin: 0 0 8px;
    font-family: var(--font-subtitle);
    color: var(--title-green);
    font-weight: 700;
}
.record-embed iframe {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(49,62,58,.1);
}
@keyframes recordSpin { to { transform: rotate(360deg); } }
@media (max-width: 940px) {
    .profile-panel,
    .gate-panel { height: auto; min-height: 0; }
    .profile-panel { max-height: 68vh; }
    .link-strip { justify-content: center; }
    .record-player { grid-template-columns: 1fr; justify-items: center; }
    .record-arm { display: none; }
}

/* 2026-07-08 final viewport fit and visible record player */
.home-shell {
    width: min(1560px, calc(100vw - 40px));
    padding-top: 8px;
    transform: none;
}
.topbar {
    min-height: 96px;
    align-items: center;
}
.eyebrow {
    font-size: 12px;
    margin-left: 2px;
}
h1 {
    font-size: clamp(42px, 5vw, 78px);
    line-height: .94;
}
.hero-grid {
    margin-top: 8px;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
}
.profile-panel,
.gate-panel {
    height: min(620px, calc(100vh - 132px));
    min-height: 430px;
}
.profile-panel {
    padding: 22px 28px 26px;
    overflow-y: scroll;
}
.profile-mark {
    min-height: 28px;
    font-size: 20px;
}
.profile-greeting {
    margin: 6px 0 18px;
    font-size: clamp(42px, 5.2vw, 82px);
}
.profile-quote {
    margin-bottom: 18px;
    padding: 16px 20px;
}
.profile-section {
    margin-top: 18px;
    padding: 14px 18px;
}
.profile-section h2 {
    font-size: 24px;
}
.profile-section li {
    margin: 5px 0;
    line-height: 1.65;
}
.gate-panel {
    padding: 18px 16px;
    gap: 10px;
}
.gate-logo {
    width: min(160px, 78%);
    margin: 8px auto 8px;
}
.gate-panel h2 {
    margin-top: 10px;
    font-size: 24px;
}
.gate-panel p {
    line-height: 1.55;
}
.link-strip {
    margin: 18px 0 22px;
    padding: 0 min(8vw, 96px);
    justify-content: space-between;
}
.link-card {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
}
.music-dock {
    padding: 18px 20px 22px;
    margin-top: 0;
}
.music-container.record-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 18px;
}
.record-player {
    min-height: 178px;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
    align-items: center;
}
.record-disc {
    display: block;
    width: 132px;
    height: 132px;
    position: relative;
    z-index: 2;
    flex: none;
}
.record-arm {
    display: block;
    left: 112px;
    top: 34px;
    z-index: 3;
}
.record-embed {
    display: block;
    width: 100%;
}
.record-label {
    margin-bottom: 10px;
    font-size: 15px;
}
.record-embed iframe {
    display: block;
    height: 86px;
}
@media (max-width: 940px) {
    .topbar { min-height: 84px; }
    .hero-grid { grid-template-columns: 1fr; }
    .profile-panel { height: 64vh; min-height: 360px; }
    .gate-panel { height: auto; min-height: 340px; }
    .link-strip { padding: 0; justify-content: center; }
    .music-container.record-grid { grid-template-columns: 1fr; }
}

/* 2026-07-08 fit2: no clipping, stable hero, centered links */
.home-shell {
    width: min(1500px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 12px 0 44px;
    transform: none;
}
.topbar {
    min-height: 112px;
    align-items: center;
    overflow: visible;
}
.eyebrow {
    margin-left: 0;
}
h1 {
    font-size: clamp(44px, 4.7vw, 76px);
    line-height: 1.02;
    overflow: visible;
}
.hero-grid {
    margin-top: 10px;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: start;
}
.profile-panel,
.gate-panel {
    height: clamp(560px, calc(100vh - 172px), 760px);
    min-height: 560px;
}
.profile-panel {
    overflow-y: scroll;
    padding: 24px 30px 72px;
    scroll-padding-bottom: 72px;
    border-bottom: 3px solid rgba(123,215,207,.9);
}
.profile-content::after {
    content: '';
    display: block;
    height: 44px;
}
.profile-section:last-child {
    margin-bottom: 28px;
}
.profile-greeting {
    font-size: clamp(42px, 4.7vw, 74px);
    white-space: normal;
}
.profile-section {
    overflow: visible;
}
.profile-section li {
    word-break: normal;
    overflow-wrap: anywhere;
}
.gate-panel {
    min-height: 560px;
    padding: 18px 16px 24px;
}
.gate-logo {
    width: min(160px, 76%);
}
.gate-panel h2 {
    font-size: 23px;
}
.gate-panel .primary-btn {
    width: 100%;
    min-height: 54px;
    white-space: normal;
    line-height: 1.25;
    padding: 10px 14px;
}
.link-strip {
    width: min(760px, 100%);
    margin: 26px auto 24px;
    padding: 0;
    justify-content: space-between;
}
.link-card {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
}
.music-dock {
    width: 100%;
}
@media (max-width: 940px) {
    .home-shell { width: min(100% - 22px, 720px); padding-top: 12px; }
    .topbar { min-height: 96px; }
    .hero-grid { grid-template-columns: 1fr; }
    .profile-panel { height: 68vh; min-height: 420px; }
    .gate-panel { height: auto; min-height: 420px; }
    .link-strip { width: min(520px, 100%); flex-wrap: wrap; justify-content: center; gap: 16px 28px; }
}
