/* 같이해요 만의 모양 (공통 모양은 base.css) */
:root { --accent: #c93a5a; }

.mt { margin-top: 14px; }
.mb { margin-bottom: 12px; }
small.count { float: right; font-weight: 600; color: var(--ink-3); }
.ok { color: var(--good); font-weight: 700; margin: 0; }
.warn-text { color: var(--warn); font-weight: 600; }
.app-header .home { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.app-header .in > .sub { margin-left: auto; }

/* ---------- 카드 만들기 ---------- */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-pick {
  -webkit-appearance: none; appearance: none;
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; text-align: center;
}
.theme-pick[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch { display: block; height: 96px; border-radius: 10px; overflow: hidden; }
.swatch svg { display: block; width: 100%; height: 100%; }
.examples { display: flex; flex-direction: column; gap: 8px; }
.example {
  -webkit-appearance: none; appearance: none; text-align: left;
  padding: 12px 14px; min-height: 48px; border-radius: 12px;
  border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: 0.95rem; line-height: 1.45; cursor: pointer;
}
.example:active { border-color: var(--accent); }
.song-ok { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.song-ok img { border-radius: 8px; flex: none; background: var(--surface-2); object-fit: cover; }
.howto { margin-top: 12px; }
.howto summary { cursor: pointer; font-weight: 700; color: var(--accent-text); min-height: 44px; display: flex; align-items: center; }
.howto ol { padding-left: 1.3em; margin: 6px 0 0; color: var(--ink-2); }
.howto li { margin-bottom: 6px; }
.preview { margin-bottom: 14px; }
.done { margin-top: 4px; }
.link-box { background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; word-break: break-all; color: var(--ink-2); }
.mt-s { margin-top: 8px; }
.center { text-align: center; }
.song-name { font-weight: 700; margin: 2px 0; color: var(--ink); }

/* 순서 안내: 적기 → 카드 만들기 → 카톡으로 보내기 */
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; counter-reset: none; }
.steps li { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 4px 6px; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); font-size: 0.86rem; font-weight: 700; text-align: center; line-height: 1.25; }
.steps li b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); font-size: 0.8rem; }
.steps li[aria-current='step'] { background: var(--accent); color: var(--accent-ink); }
.steps li[aria-current='step'] b { color: var(--accent); }
.steps li.passed { background: var(--good-soft); color: var(--good); }
.steps li.passed b { font-size: 0; }
.steps li.passed b::after { content: '✓'; font-size: 0.8rem; }

/* 카드 한 장 요약 (방금 만든 카드 · 전에 만든 카드) */
.sum { display: flex; gap: 12px; align-items: flex-start; }
.sum .thumb { flex: none; width: 96px; height: 54px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.sum .thumb.emoji { display: grid; place-items: center; font-size: 1.6rem; }
.sum-text { flex: 1 1 0; min-width: 0; }
.sum-text p { margin: 0 0 2px; }
.sum-to { font-weight: 800; }
.sum-msg { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.made { background: var(--surface); border-radius: 14px; padding: 14px; margin: 4px 0 14px; }
.sum.big .sum-to { font-size: 1.1rem; }
.sum.big .sum-msg { white-space: normal; }
.mine .sum { margin-bottom: 10px; }
.mine .btn-row > .btn { flex: 1 1 70px; }
.mine .btn-row > .btn:first-child { flex-basis: 100%; }

/* 전에 만든 카드 (접어 둬요) */
.mine-box { margin-top: 26px; }
.mine-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; font-size: 1.02rem; }
.mine-box > summary::-webkit-details-marker { display: none; }
.mine-box > summary::after { content: '▾'; color: var(--ink-3); margin-left: 4px; transition: transform 0.2s ease; }
.mine-box[open] > summary::after { transform: rotate(180deg); }
.mine-box .grow-r { margin-left: auto; font-weight: 600; }

/* 묻는 창 */
dialog.ask { border: 0; border-radius: 20px; padding: 22px 20px 18px; width: min(92vw, 420px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgb(0 0 0 / 30%); }
dialog.ask::backdrop { background: rgb(0 0 0 / 50%); }
dialog.ask h3 { font-size: 1.15rem; margin-bottom: 10px; }

/* ---------- 축하 카드 (무늬는 카드 자체 색이라 다크 모드에서도 그대로) ---------- */
.gcard {
  position: relative; overflow: hidden;
  min-height: 460px; border-radius: 22px;
  padding: 118px 22px 112px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / 14%);
  isolation: isolate;
}
.gcard-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.gcard-deco svg { display: block; width: 100%; height: 100%; }
.gcard-panel { width: 100%; border-radius: 16px; padding: 18px 18px 16px; backdrop-filter: blur(2px); }
.gcard-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin: 0 0 12px; letter-spacing: -0.02em; }
.gcard-to { font-weight: 700; margin-bottom: 8px; }
.gcard-msg { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.7; margin-bottom: 12px; }
.gcard-from { text-align: right; font-weight: 700; margin: 0; }

/* ---------- 받은 카드 페이지 ---------- */
.card-page main { padding-top: 22px; }
.envelope { display: flex; flex-direction: column; gap: 18px; align-items: stretch; }
.env-body {
  position: relative; height: 290px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, #f7d9c4, #efc2a8);
  box-shadow: 0 12px 30px rgb(0 0 0 / 15%);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 26px;
  color: #4a2a18;
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 132px;
  background: linear-gradient(180deg, #f2c7ad, #e8b294);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform 0.6s ease;
}
.env-seal {
  position: absolute; top: 98px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.9rem; box-shadow: 0 4px 10px rgb(0 0 0 / 20%);
  transition: opacity 0.3s ease;
}
.env-to { font-size: 1.4rem; font-weight: 800; margin: 0; }
.env-from { margin: 2px 0 0; font-weight: 600; opacity: 0.8; }
.envelope.opening .env-flap { transform: rotateX(180deg); }
.envelope.opening .env-seal { opacity: 0; }
.envelope.opening .env-body { animation: lift 0.6s ease forwards; }
@keyframes lift { to { transform: translateY(-8px) scale(1.02); } }
.unfold-wrap { perspective: 1200px; }
.unfold .gcard { animation: unfold 0.9s cubic-bezier(0.2, 0.8, 0.25, 1) both; transform-origin: top center; }
@keyframes unfold { from { transform: rotateX(-80deg) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.song h3 { margin-bottom: 12px; }
.yt-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 8px; }
.yt-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.empty-card { text-align: center; }
.big-emoji { font-size: 3rem; margin: 6px 0 0; }

/* ---------- 달력 ---------- */
.cal { margin: 8px 0 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head strong { font-size: 1.1rem; }
.cal-head .btn { min-width: 52px; font-size: 1.3rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cal-day {
  -webkit-appearance: none; appearance: none;
  aspect-ratio: 1; min-height: 44px; border-radius: 12px; border: 1.5px solid transparent;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.cal-day.today { border-color: var(--accent-text); }
.cal-day[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
.cal-day:disabled { opacity: 0.35; cursor: default; background: transparent; }
.sun { color: var(--bad); }
.sat { color: #2b63d9; }
@media (prefers-color-scheme: dark) { .sat { color: #8fb0ff; } }
.cal-day[aria-pressed='true'].sun, .cal-day[aria-pressed='true'].sat { color: var(--accent-ink); }
.picked .chip { min-height: 40px; font-size: 0.88rem; }

/* ---------- 모임 페이지 ---------- */
.poll-head { margin-bottom: 14px; }
.poll-head h2 { font-size: 1.5rem; margin-bottom: 6px; }
.memo { white-space: pre-wrap; color: var(--ink-2); }
.chosen-band { background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.1rem; padding: 14px 16px; border-radius: 14px; margin: 10px 0; }
.answers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ans {
  -webkit-appearance: none; appearance: none;
  display: grid; grid-template-columns: 1fr 44px 76px; align-items: center; gap: 8px;
  min-height: 58px; padding: 0 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.ans-mark { font-size: 1.6rem; text-align: center; line-height: 1; }
.ans-word { font-size: 0.88rem; text-align: right; color: var(--ink-3); }
.ans[data-a='2'] { border-color: var(--good); background: var(--good-soft); }
.ans[data-a='2'] .ans-mark, .ans[data-a='2'] .ans-word { color: var(--good); }
.ans[data-a='1'] { border-color: var(--warn); background: var(--warn-soft); }
.ans[data-a='1'] .ans-mark, .ans[data-a='1'] .ans-word { color: var(--warn); }
.ans[data-a='0'] { border-color: var(--line); background: var(--surface-2); }
.ans[data-a='0'] .ans-mark { color: var(--bad); }
.ans:disabled { opacity: 0.6; cursor: default; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.res { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.res.best { border-color: var(--good); background: var(--good-soft); }
.res.chosen { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.res-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.res-top strong { margin-right: auto; }
.res-bar { display: flex; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.b-yes { background: var(--good); }
.b-maybe { background: var(--warn); opacity: 0.7; }
.res-count { margin: 0 0 4px; font-weight: 700; }
.res .btn { margin-top: 8px; }

/* ---------- 뽑기·나누기 ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 16px; margin-bottom: 14px; }
.seg button {
  -webkit-appearance: none; appearance: none;
  min-height: 50px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; padding: 0 4px;
}
.seg button[aria-selected='true'] { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .btn { min-width: 48px; font-size: 1.3rem; }
.stepper output { min-width: 2ch; text-align: center; font-size: 1.3rem; font-weight: 800; }
.draw-stage { margin-top: 14px; text-align: center; padding: 18px 12px; border-radius: 16px; background: var(--accent-soft); }
.slot { font-size: 2rem; font-weight: 800; margin: 0; min-height: 1.5em; }
.winners { list-style: none; padding: 0; margin: 6px 0 0; font-size: 1.6rem; font-weight: 800; }
.winners li { margin: 4px 0; }
.draw-stage.pop { animation: pop 0.5s ease; }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.ladder-stage { margin-top: 16px; }
.l-row { display: grid; gap: 4px; }
.l-name, .l-res {
  -webkit-appearance: none; appearance: none;
  min-height: 46px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.86rem; font-weight: 700; padding: 2px; text-align: center;
  display: flex; align-items: center; justify-content: center; overflow: hidden; word-break: break-all; line-height: 1.2;
}
.l-name { cursor: pointer; }
.l-res.hidden { color: var(--ink-3); background: var(--surface-2); }
.ladder { display: block; width: 100%; height: auto; margin: 4px 0; }
.ladder .rail { stroke: var(--ink-3); stroke-width: 3.5; stroke-linecap: round; }
.ladder .trace { fill: none; stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; opacity: 0.9; transition: stroke-dashoffset 1.2s ease-in-out; }
.l-summary { list-style: none; padding: 0; margin: 12px 0 0; font-weight: 700; }
.l-summary li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.people { margin-top: 6px; }
.person { display: grid; grid-template-columns: 1fr 104px; gap: 6px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.person .adj-amt { grid-column: 1 / -1; }
.person select { min-height: 46px; padding: 8px 10px; }
.treasurer { display: flex; align-items: center; gap: 8px; font-weight: 700; min-height: 46px; cursor: pointer; }
.treasurer input { width: 22px; height: 22px; accent-color: var(--accent); }
table.dutch { width: 100%; border-collapse: collapse; margin: 14px 0 10px; font-size: 1.05rem; }
table.dutch th, table.dutch td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.dutch td { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
table.dutch th .badge { margin-left: 6px; }
table.dutch tfoot th, table.dutch tfoot td { border-bottom: 0; border-top: 2px solid var(--ink-3); }
#u-result .btn { margin-top: 10px; }
