:root {
  --bg: #14110f; --ink: #f6f1ea; --sub: #b9afa3; --line: #ffffff22; --accent: #e0533d; --like: #3ecf8e; --nope: #ff5a6a; --paper: #1d1916;
  --sa-top: env(safe-area-inset-top, 0px); --sa-bot: env(safe-area-inset-bottom, 0px);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--sa-top) + 20px) 24px calc(var(--sa-bot) + 20px); }

/* ホーム */
.home-head { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 28px; letter-spacing: .08em; margin: 8px 0; font-weight: 600; }
.lead { color: var(--sub); margin: 0 0 40px; }
.field { display: block; color: var(--sub); font-size: 13px; margin-bottom: 20px; }
.field input { display: block; width: 100%; margin-top: 8px; padding: 16px; font-size: 17px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.chips { display: flex; gap: 8px; margin-top: 10px; }
.chip { flex: 1; padding: 14px 0; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 15px; }
.chip.on { background: var(--ink); color: #14110f; }
.primary { margin-top: auto; padding: 18px; border-radius: 16px; background: var(--accent); font-size: 17px; font-weight: 600; letter-spacing: .05em; }
.ghost { padding: 14px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 24px; }
.icon-btn { width: 44px; height: 44px; font-size: 24px; border-radius: 50%; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.recent button { padding: 8px 14px; border-radius: 999px; background: var(--paper); font-size: 13px; color: var(--sub); }
.note { color: var(--sub); font-size: 12px; text-align: center; }

/* スワイプ */
#swipe { padding: 0; }
.topbar { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: calc(var(--sa-top) + 8px) 8px 8px; background: linear-gradient(#000a, transparent); }
.tabs { flex: 1; display: flex; justify-content: center; gap: 2px; }
.tab { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: #ffffffb0; text-shadow: 0 1px 4px #0008; }
.tab.on { background: #ffffff2e; color: #fff; backdrop-filter: blur(8px); }
.ok-btn { padding: 8px 12px; border-radius: 999px; border: 1px solid #fff6; font-size: 13px; white-space: nowrap; backdrop-filter: blur(8px); }
.stack { position: absolute; inset: 0 0 calc(var(--sa-bot) + 104px); margin: 0; }
.card { position: absolute; inset: 0; overflow: hidden; border-radius: 0 0 28px 28px; background: #000; touch-action: none; will-change: transform; }
.card.behind { transform: scale(.95); filter: brightness(.6); pointer-events: none; }
.card .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) brightness(.7); }
.card img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.card.fit img.photo { inset: 18% 5% 24%; width: 90%; height: 58%; object-fit: contain; border-radius: 16px; box-shadow: 0 12px 40px #0008; }
.card .shade { position: absolute; inset: 0; background: linear-gradient(#0000 55%, #000c); pointer-events: none; }
.bars { position: absolute; top: calc(var(--sa-top) + 58px); left: 12px; right: 12px; display: flex; gap: 4px; z-index: 5; }
.bars i { flex: 1; height: 3px; border-radius: 2px; background: #ffffff55; }
.bars i.on { background: #fff; }
.stamp { position: absolute; top: 120px; padding: 6px 14px; border: 4px solid; border-radius: 10px; font-size: 34px; font-weight: 800; letter-spacing: .1em; opacity: 0; z-index: 6; pointer-events: none; }
.stamp.like { left: 24px; color: var(--like); transform: rotate(-12deg); }
.stamp.nope { right: 24px; color: var(--nope); transform: rotate(12deg); }
.info { position: absolute; left: 20px; right: 20px; bottom: 22px; z-index: 5; pointer-events: none; text-shadow: 0 1px 8px #000a; }
.info h2 { margin: 0 0 6px; font-size: 26px; font-weight: 600; line-height: 1.25; }
.info .row { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: #ffffffd8; }
.info .tag { background: #ffffff26; padding: 2px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.info .adj { font-size: 11px; opacity: .7; }
.info .credit { margin-top: 8px; font-size: 11px; opacity: .75; pointer-events: auto; }
.info .credit a { color: inherit; }
.dbg { position: absolute; top: calc(var(--sa-top) + 70px); left: 12px; z-index: 7; font: 11px monospace; background: #000a; padding: 3px 6px; border-radius: 6px; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--sub); gap: 14px; padding: 40px; }
.empty .ghost { margin: 0; }

.actions { position: absolute; left: 0; right: 0; bottom: calc(var(--sa-bot) + 22px); display: flex; justify-content: center; align-items: center; gap: 18px; z-index: 20; }
.act { width: 72px; height: 72px; border-radius: 50%; font-size: 30px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 6px 20px #0006; }
.act.small { width: 50px; height: 50px; font-size: 22px; color: var(--sub); }
.act.like { color: var(--like); } .act.nope { color: var(--nope); }
.act:active { transform: scale(.92); }
.act:disabled { opacity: .3; }
.attrib { position: absolute; z-index: 20; left: 0; right: 0; bottom: calc(var(--sa-bot) + 4px); text-align: center; font-size: 12px; color: #fff9; pointer-events: none; }

/* シート(詳細・設定) */
.sheet { position: absolute; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-close { position: fixed; top: calc(var(--sa-top) + 10px); right: 12px; width: 44px; height: 44px; border-radius: 50%; background: #000a; font-size: 18px; backdrop-filter: blur(8px); }
.sheet-body { padding-bottom: calc(var(--sa-bot) + 40px); }
.d-hero { height: 44vh; background-size: cover; background-position: center; }
.d-main { padding: 20px 24px; }
.d-main h2 { margin: 0 0 6px; font-size: 24px; font-weight: 600; }
.d-meta { color: var(--sub); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.d-sec { margin-top: 22px; }
.d-sec h3 { margin: 0 0 8px; font-size: 13px; color: var(--sub); font-weight: 500; letter-spacing: .08em; }
.d-sec p, .d-sec li { margin: 0; font-size: 14px; line-height: 1.8; }
.d-sec ul { list-style: none; margin: 0; padding: 0; }
.d-map { width: 100%; height: 220px; border: 0; border-radius: 16px; }
.btn { display: block; width: 100%; text-align: center; text-decoration: none; color: var(--ink); padding: 15px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); margin-top: 10px; font-size: 15px; }
.btn.main { background: var(--accent); border-color: transparent; font-weight: 600; }
.settings { padding: calc(var(--sa-top) + 24px) 24px 40px; }
.settings h2 { margin: 0 0 20px; font-size: 22px; }
.set-row { margin: 18px 0; font-size: 14px; }
.set-row label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.set-row small { display: block; color: var(--sub); margin-top: 4px; line-height: 1.6; }
.set-row input[type=range] { width: 100%; accent-color: var(--accent); }
.set-row input[type=text], .set-row input[type=password], .set-row input[type=number] { width: 100%; padding: 12px; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.set-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.meter { height: 8px; background: var(--paper); border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.meter i { display: block; height: 100%; background: var(--like); }
.meter i.warn { background: #f0b429; } .meter i.over { background: var(--nope); }

.toast { position: absolute; z-index: 90; left: 50%; bottom: calc(var(--sa-bot) + 120px); transform: translateX(-50%); background: #000d; padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: 86vw; text-align: center; }
.dialog { position: absolute; inset: 0; z-index: 100; background: #000a; display: grid; place-items: center; padding: 24px; }
.dialog-box { background: var(--paper); border-radius: 20px; padding: 24px; width: 100%; max-width: 360px; line-height: 1.7; }
.dialog-btns { display: flex; gap: 10px; margin-top: 16px; }
.dialog-btns button { flex: 1; margin: 0; padding: 14px; }
.spinner { width: 32px; height: 32px; border: 3px solid #fff3; border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
