/* 색을 바꾸고 싶으면 여기 값만 고치면 돼요 */
:root {
  --bg: #0e0d12;
  --panel: #18161f;
  --panel2: #221f2b;
  --line: #34303f;
  --text: #f3f0f7;
  --muted: #a39cb0;
  --accent: #ff4f9a;   /* 메인 포인트 (핫핑크) */
  --accent-ink: #1a0711;
  --live: #c8ff4d;     /* 오늘·진행 중 표시 (라임) */
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;
  font-size: 15px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
main, .top, .foot { max-width: 720px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* 머리 */
.top { padding-top: 28px; padding-bottom: 8px; position: sticky; top: 0; background: linear-gradient(var(--bg) 85%, transparent); z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.word { font-weight: 900; font-size: 28px; letter-spacing: .06em; }
.word::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 4px; vertical-align: super; }
.sub { color: var(--muted); font-size: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; padding: 9px 0; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--text); color: var(--bg); }

/* 목록 카드 */
.mlabel { font-size: 13px; color: var(--muted); font-weight: 600; margin: 24px 2px 10px; letter-spacing: .02em; }
.card {
  width: 100%; display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); }
.card:active { transform: scale(.99); }
.datebox { flex: none; width: 52px; text-align: center; border-right: 1px solid var(--line); padding-right: 12px; }
.datebox b { display: block; font-size: 24px; line-height: 1.1; }
.datebox small { color: var(--muted); }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.info strong { font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; }
.thumb { flex: none; width: 64px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--panel2); }
.tag { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-bottom: 2px; }
.tag.live { background: var(--live); color: #111; }
.tag.off { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.empty.small { padding: 16px 0; }
details { margin-top: 28px; }
summary { color: var(--muted); cursor: pointer; padding: 8px 2px; }
#past .card { opacity: .6; }

/* 달력 */
.month-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.month-head h2 { font-size: 18px; margin: 0; }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 20px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.dow span:first-child { color: #ff8a8a; }
.day {
  min-height: 64px; min-width: 0; border: 1px solid transparent; background: var(--panel); border-radius: 10px;
  padding: 4px 3px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; overflow: hidden;
}
.day.blank { background: none; }
.day .n { font-size: 12px; color: var(--muted); padding-left: 3px; }
.day.today .n { color: var(--live); font-weight: 800; }
.day.sel { border-color: var(--text); }
.day.has .n { color: var(--text); }
.pill { font-size: 10px; line-height: 1.3; background: var(--accent); color: var(--accent-ink); font-weight: 600; border-radius: 4px; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 10px; color: var(--muted); padding-left: 3px; }
@media (max-width: 420px) { .day { min-height: 52px; } .pill { font-size: 0; height: 5px; padding: 0; } }

/* 상세 */
dialog { border: 0; padding: 0; background: none; color: inherit; max-width: 560px; width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgba(5, 4, 8, .75); backdrop-filter: blur(3px); }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: auto; max-height: calc(100dvh - 24px); position: relative; }
.close { position: sticky; top: 10px; float: right; margin: 10px 10px -50px 0; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; }
.poster { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.dpad { padding: 20px; }
.dpad h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.3; padding-right: 36px; }
.row { display: flex; gap: 8px; margin: 6px 0; color: var(--text); }
.desc { white-space: pre-wrap; margin: 16px 0; padding-top: 16px; border-top: 1px solid var(--line); color: #ddd8e4; }
.policy { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.policy::before { content: 'ⓘ '; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); flex-basis: 100%; font-size: 16px; padding: 14px; }
.btn.danger { color: #ff8080; border-color: #5a2a33; }
.btn:disabled { opacity: .5; }

.foot { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; padding-top: 40px; padding-bottom: 40px; }
.foot a { color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; transition: .2s; pointer-events: none; z-index: 99; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 관리 화면 */
.form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.form input, .form textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px;
  padding: 11px 12px; font: inherit; font-size: 16px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form textarea { min-height: 140px; resize: vertical; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form input { min-width: 0; }
#toast { max-width: calc(100% - 32px); white-space: nowrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; }
.check input { width: 20px; height: 20px; }
.poster-box { display: flex; gap: 12px; align-items: center; }
.poster-box img { width: 90px; height: 120px; object-fit: cover; border-radius: 8px; background: var(--panel2); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.err { color: #ff8080; font-size: 14px; min-height: 20px; margin-top: 10px; }
.bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
