* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; background: #1b1b1f; color: #f2f2f4; display: flex; flex-direction: column; overscroll-behavior: none; }
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 8px; }
h1 { white-space: nowrap; font-size: 20px; margin: 0; color: #ff6b6b; letter-spacing: 0.3px; }
nav { display: flex; gap: 6px; align-items: center; }
button { font: inherit; color: inherit; cursor: pointer; }
.tab { background: #2a2a31; border: 0; border-radius: 999px; padding: 6px 12px; }
.tab.active { background: #f2f2f4; color: #1b1b1f; }
.link { background: none; border: 0; color: #9a9aa6; padding: 6px; white-space: nowrap; }
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 16px 16px; max-width: 520px; width: 100%; margin: 0 auto; }
.view[hidden] { display: none; }

.auth { margin-top: 24px; }
.lead { color: #c9c9d1; }
.authtabs { display: flex; gap: 6px; margin: 16px 0; }
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; color: #c9c9d1; font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input[type=text], input:not([type]), input[type=password] { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid #3a3a44; background: #24242a; color: #f2f2f4; }
.primary { background: #ff6b6b; color: #1b1b1f; border: 0; border-radius: 10px; padding: 12px; font-weight: 600; }
.error { color: #ff8a8a; min-height: 1.4em; margin: 0; }

.meta { display: flex; justify-content: space-between; font-size: 13px; color: #9a9aa6; padding: 2px 2px 8px; gap: 8px; }
#deck { position: relative; flex: 1; min-height: 320px; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: #9a9aa6; margin: 0; }
.card { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; background: #2a2a31 center/cover no-repeat; box-shadow: 0 8px 24px rgba(0,0,0,.4); touch-action: none; user-select: none; will-change: transform; }
.card .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.35) 38%, rgba(0,0,0,0) 60%); }
.card .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; }
.card h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.15; }
.card .sub { color: #d8d8de; font-size: 14px; }
.card .why { margin-top: 8px; font-size: 14px; color: #ffd27a; }
.card .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.14); }
.stamp { position: absolute; top: 24px; padding: 4px 12px; border: 4px solid; border-radius: 8px; font-size: 30px; font-weight: 800; opacity: 0; transform: rotate(-14deg); }
.stamp.like { left: 20px; color: #4cd48a; border-color: #4cd48a; }
.stamp.nope { right: 20px; color: #ff6b6b; border-color: #ff6b6b; transform: rotate(14deg); }
.card.gone { transition: transform .3s ease-out, opacity .3s; }
.card.back { transition: transform .2s ease-out; }

.actions { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 12px; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 0; background: #2a2a31; font-size: 28px; }
.round.small { width: 44px; height: 44px; font-size: 20px; color: #9a9aa6; }
.round.skip { color: #ff6b6b; }
.round.like { color: #4cd48a; }
.pill-unknown { align-self: center; margin-top: 10px; background: #2a2a31; color: #ffd27a; border: 0; border-radius: 999px; padding: 8px 16px; font-size: 15px; }
.pill-unknown:disabled { opacity: .4; }
.stamp.unk { left: 50%; top: 40%; color: #ffd27a; border-color: #ffd27a; transform: translateX(-50%); font-size: 22px; white-space: nowrap; }
.round:disabled { opacity: .4; }

#profile { overflow-y: auto; padding-bottom: 24px; }
#profile h3 { margin: 20px 0 8px; font-size: 16px; color: #c9c9d1; }
.stats { display: flex; gap: 8px; }
.stat { flex: 1; background: #24242a; border-radius: 12px; padding: 10px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: #9a9aa6; }
.summary { background: #24242a; border-radius: 12px; padding: 12px; }
.summary p { margin: 0 0 8px; }
.summary ul { margin: 4px 0 8px; padding-left: 18px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; }
.bar .track { height: 8px; border-radius: 4px; background: #33333b; overflow: hidden; }
.bar .fill { height: 100%; background: #4cd48a; }
.bar.low .fill { background: #ff6b6b; }
.bar.unseen { color: #6d6d78; }
.bar .n { color: #9a9aa6; text-align: right; }
.dishlist { display: flex; flex-direction: column; gap: 6px; }
.dishrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #24242a; border: 0; border-radius: 10px; padding: 6px; }
.dishrow img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: #2a2a31; }
.dishrow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dishrow::after { content: "›"; color: #6d6d78; padding: 0 6px; }
.more { background: none; border: 0; color: #9a9aa6; font-size: 13px; padding: 6px 0; }
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: #1f1f24; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; }
.sheet-x { position: absolute; top: 10px; right: 10px; background: #2a2a31; border: 0; border-radius: 50%; width: 32px; height: 32px; }
.sheet-body h2 { margin: 0 40px 4px 0; font-size: 22px; }
.sheet-body .hero { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; margin: 8px 0; background: #2a2a31; }
.sheet-body h4 { margin: 14px 0 6px; font-size: 14px; color: #c9c9d1; }
.sheet-body ul.ing { margin: 0; padding-left: 18px; font-size: 14px; }
.sheet-body ul.ing em { color: #9a9aa6; font-style: normal; }
.sheet-body .links { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-body .links a { color: #1b1b1f; background: #ffd27a; border-radius: 999px; padding: 6px 12px; text-decoration: none; font-size: 14px; }
.sheet-body details { font-size: 14px; color: #c9c9d1; }
.sheet-body details p { white-space: pre-line; }
.explain { background: #2a2a31; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.explain p { margin: 0 0 6px; }
.decide { display: flex; gap: 8px; margin-top: 14px; }
.decide button { flex: 1; border: 0; border-radius: 10px; padding: 10px 6px; background: #2a2a31; font-size: 14px; }
.decide button.on { outline: 2px solid #f2f2f4; }
.decide .d-like { color: #4cd48a; } .decide .d-skip { color: #ff6b6b; } .decide .d-unknown { color: #ffd27a; }
.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.history div { aspect-ratio: 1; border-radius: 8px; background: #2a2a31 center/cover; position: relative; border: 2px solid; }
.history div.like { border-color: #4cd48a; }
.history div.skip { border-color: #ff6b6b; opacity: .6; }
.muted { color: #9a9aa6; font-size: 13px; }
.seed { font-size: 14px; color: #c9c9d1; }
.refresh { background: #2a2a31; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
