:root {
  color-scheme:dark;
  --bg:#09090b;
  --surface:#15151a;
  --text:#ececf1;
  --muted:#a1a1aa;
  --amber:#f59e0b;
  --line:#2b2b32;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'Outfit','Noto Sans KR',sans-serif;
  font-size:14px;
  line-height:1.65;
}
button,input {
  font:inherit;
}
button,a,input {
  -webkit-tap-highlight-color:transparent;
}
button {
  cursor:pointer;
  border:1px solid var(--line);
  color:var(--text);
  background:transparent;
  border-radius:10px;
  padding:10px 15px;
}
button:hover {
  background:#24242c;
  border-color:#73737c;
}
button:disabled {
  cursor:default;
  opacity:.4;
}
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible {
  outline:2px solid var(--amber);
  outline-offset:4px;
}
input {
  min-width:0;
  border:1px solid #3c3c44;
  border-radius:10px;
  background:#101014;
  color:var(--text);
  padding:13px 15px;
}
input::placeholder {
  color:#90909b;
}
a {
  color:var(--amber);
}
[hidden] {
  display:none!important;
}
.page {
  max-width:1160px;
  padding:30px 32px 22px;
  margin:auto;
}
header,footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.brand {
  text-decoration:none;
  color:var(--muted);
  font-size:14px;
}
.edition {
  font-size:11px;
  letter-spacing:2px;
  color:#80808b;
}
.intro {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:62px 0 46px;
}
.eyebrow {
  font-size:11px;
  letter-spacing:1.8px;
  color:var(--amber);
  font-weight:600;
  margin:0 0 18px;
}
.dot {
  display:inline-block;
  width:7px;
  height:7px;
  background:var(--amber);
  border-radius:50%;
  margin-right:8px;
}
h1 {
  font-size:clamp(34px,5.5vw,64px);
  letter-spacing:-3px;
  line-height:1.15;
  margin:0 0 23px;
  font-weight:800;
}
h1 span {
  color:var(--amber);
}
.period {
  color:var(--text);
}
.lede {
  font-size:17px;
  line-height:1.8;
  color:var(--muted);
  margin:0;
}
.lede strong {
  font-weight:500;
  color:var(--text);
}
.workspace {
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);
  gap:32px;
  align-items:start;
}
.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:0 0 18px;
}
.section-heading h2,.section-heading h3 {
  font-size:16px;
  font-weight:600;
  margin:0;
}
.section-heading>span {
  color:var(--muted);
  font-size:12px;
}
.mode-switch {
  display:flex;
  gap:5px;
  border:1px solid var(--line);
  padding:5px;
  border-radius:12px;
  margin-bottom:16px;
  background:#111115;
}
.mode-switch button {
  flex:1;
  border:0;
  font-size:13px;
  color:var(--muted);
}
.mode-switch .selected {
  background:#29251d;
  color:#fbbf24;
}
.quiz-card {
  background:var(--surface);
  border:1px solid #3a3328;
  border-radius:20px;
  padding:28px;
  position:relative;
  overflow:hidden;
  min-height:420px;
}
.quiz-card:before {
  content:'';
  position:absolute;
  top:0;
  left:28px;
  width:42px;
  height:3px;
  background:var(--amber);
}
.card-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.pill {
  background:#f59e0b13;
  border:1px solid #f59e0b30;
  color:#fbbf24;
  border-radius:6px;
  padding:3px 9px;
  font-size:11px;
}
#progress {
  color:#a1a1aa;
  font-size:11px;
  letter-spacing:1px;
}
.question-mark {
  font-family:Outfit,sans-serif;
  color:var(--amber);
  font-size:26px;
  line-height:1;
  margin:31px 0 14px;
}
#question {
  font-size:clamp(22px,2.6vw,29px);
  line-height:1.6;
  letter-spacing:-.8px;
  word-break:keep-all;
  margin:0 0 28px;
  min-height:88px;
  outline:none;
}
.answer-row {
  display:flex;
  gap:8px;
}
.answer-row input {
  width:100%;
  font-size:13px;
}
.primary {
  background:var(--amber);
  color:#17110a;
  font-weight:700;
  border-color:var(--amber);
  white-space:nowrap;
}
.primary:hover {
  background:#fbbf24;
  border-color:#fbbf24;
}
.small-actions {
  display:flex;
  gap:13px;
  flex-wrap:wrap;
  margin:12px 0 24px;
}
.small-actions button,.card-bottom>button:first-child {
  padding:4px 0;
  border:0;
  color:var(--muted);
  font-size:12px;
  background:transparent;
}
.small-actions button[aria-pressed=true] {
  color:var(--amber);
}
.small-actions button:last-child {
  margin-left:auto;
}
.card-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  border-top:1px solid var(--line);
  padding-top:19px;
}
.next {
  background:#ececf1;
  color:#17171d;
  font-size:13px;
  font-weight:600;
  border-color:#ececf1;
}
.next:hover {
  background:#fff;
  border-color:#fff;
}
.hint {
  font-size:17px;
  color:#fbbf24;
  letter-spacing:2px;
  margin:-10px 0 18px;
}
.answer-panel {
  margin-bottom:22px;
  padding:18px;
  background:#f59e0b09;
  border:1px solid #f59e0b25;
  border-radius:12px;
}
.answer-panel p {
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.answer-panel #verdict {
  font-size:11px;
  color:#fbbf24;
  margin-bottom:6px;
}
.answer-panel strong {
  display:block;
  font-size:25px;
  color:#fbbf24;
  margin-bottom:8px;
}
.play-note {
  color:#9999a3;
  font-size:11px;
  line-height:1.7;
  margin:14px 0;
}
.status {
  font-size:12px;
  color:#fbbf24;
  min-height:20px;
  margin:0;
}
.shelf {
  background:#111114;
  border:1px solid var(--line);
  border-radius:18px;
  padding:23px;
}
.shelf .shelf-icon {
  font-size:25px;
  color:var(--amber);
}
.search-label {
  display:block;
  font-size:11px;
  color:var(--muted);
  margin:0 0 7px;
}
#search {
  width:100%;
  font-size:13px;
}
.categories {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:16px 0;
}
.categories button {
  border-radius:7px;
  padding:5px 10px;
  font-size:11px;
  color:var(--muted);
}
.categories button[aria-pressed=true] {
  color:var(--amber);
  border-color:#f59e0b70;
  background:#f59e0b0d;
}
.saved-filter {
  display:flex;
  gap:8px;
  align-items:center;
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
}
.saved-filter input {
  accent-color:var(--amber);
  width:15px;
  height:15px;
}
.saved-filter span {
  margin-left:auto;
  color:var(--amber);
  font-family:Outfit;
}
.shelf-divider {
  height:1px;
  background:var(--line);
  margin:20px 0;
}
.shelf .section-heading:has(h3) {
  margin-bottom:7px;
}
.shelf-note {
  font-size:11px;
  color:#9999a3;
  margin:0 0 13px;
}
.joke-list {
  max-height:350px;
  overflow:auto;
  scrollbar-width:thin;
}
.joke-list button {
  display:block;
  text-align:left;
  border:0;
  border-bottom:1px solid #24242b;
  border-radius:0;
  padding:13px 2px;
  width:100%;
  font-size:12px;
  line-height:1.8;
  word-break:keep-all;
}
.joke-list button small {
  display:block;
  color:#93939e;
  font-size:10px;
  margin-bottom:3px;
}
.joke-list button:hover {
  background:#1d1d23;
  color:var(--amber);
}
.load-more {
  width:100%;
  padding:7px;
  margin-top:13px;
  font-size:12px;
  color:var(--muted);
}
footer {
  border-top:1px solid var(--line);
  padding-top:20px;
  color:#90909b;
  font-size:10px;
}
#result-view {
  padding:55px 0;
  text-align:center;
}
#result-score {
  font-family:Outfit;
  font-size:65px;
  color:var(--amber);
  margin:0;
}
#result-message {
  color:var(--muted);
  margin-bottom:25px;
}
#empty-view {
  padding:60px 0;
}
#empty-view h3 {
  font-size:23px;
}
#empty-view p {
  color:var(--muted);
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
@media(max-width:760px) {
  .page {
    padding:22px 20px;
  }
  .edition {
    display:none;
  }
  .intro {
    padding:44px 0 35px;
  }
  .workspace {
    grid-template-columns:1fr;
    gap:25px;
  }
  h1 {
    letter-spacing:-1.6px;
  }
  h1>span {
    display:block;
  }
  .lede {
    font-size:14px;
  }
  .quiz-card {
    padding:23px;
  }
  .joke-list {
    max-height:280px;
  }
}
@media(max-width:380px) {
  .answer-row {
    flex-wrap:wrap;
  }
  .answer-row button {
    width:100%;
  }
  .card-bottom {
    gap:8px;
  }
  .next {
    padding:10px;
    font-size:12px;
  }
}

.hero-illustration { width: 270px; height: 270px; object-fit: contain; border-radius: 28px; margin: -20px 45px -20px 20px; }
.joke-illustration { display: block; width: 100%; max-width: 270px; height: auto; border-radius: 12px; margin: 20px auto 0; }
.loading { padding: 45px 0; color: var(--muted); }
footer a { color: var(--muted); text-underline-offset: 3px; }
@media(max-width:760px) { .hero-illustration { width: 135px; height: 160px; margin: 0 -6px 0 6px; object-fit: cover; border-radius: 18px; } }
@media(max-width:380px) { .hero-illustration { width: 110px; height: 135px; } }

/* 테마 고르기: 오른쪽 위 구석에 두면 「THE DAD JOKE CLUB」 글자와 겹쳐서 머리 줄 안에 둔다 */
.header-end { display: flex; align-items: center; gap: 14px; }
#site-theme-slot { margin: -4px 0; }   /* 알약(31px)이 머리 줄 높이를 늘리지 않게 */
#site-theme-slot .site-theme { margin: 0; padding: 3px; gap: 2px; flex-wrap: nowrap; border: 1px solid rgba(127, 127, 127, .32); border-radius: 999px; background: rgba(127, 127, 127, .1); }
#site-theme-slot .site-theme-label { display: none; }
#site-theme-slot .site-theme button { border: 0; border-radius: 999px; padding: 3px 9px; font-size: 13px; line-height: 1.3; opacity: .7; color: var(--text); }
#site-theme-slot .site-theme button:hover { background: rgba(127, 127, 127, .16); }
#site-theme-slot .site-theme button[aria-pressed="true"] { opacity: 1; background: rgba(127, 127, 127, .24); }

/* ---- 라이트 테마: 공통 팔레트(--bg, --surface, --text, --muted, --line)가 닿지 않는 곳만. 다크 값은 그대로 ---- */
:root[data-theme="light"] { --amber: #b45309; }   /* #f59e0b 는 흰 바탕 글자로 2.1 */
:root[data-theme="light"] button:hover { background: #ececf0; border-color: #a1a1aa; }
:root[data-theme="light"] input { border-color: #d4d4d8; background: #fff; }
:root[data-theme="light"] input::placeholder { color: #6b6b74; }
:root[data-theme="light"] .edition { color: #6b6b74; }
:root[data-theme="light"] .mode-switch { background: #f1f1f3; }
:root[data-theme="light"] .mode-switch .selected { background: #fff; color: #92400e; box-shadow: 0 1px 3px rgba(9, 9, 11, .12); }
:root[data-theme="light"] .quiz-card { border-color: #e7d9c2; }
:root[data-theme="light"] .pill { background: rgba(180, 83, 9, .08); border-color: rgba(180, 83, 9, .25); color: #92400e; }
:root[data-theme="light"] #progress { color: #6b6b74; }
:root[data-theme="light"] .primary { color: #fff; }
:root[data-theme="light"] .primary:hover { background: #92400e; border-color: #92400e; }
:root[data-theme="light"] .next { background: #18181b; color: #fff; border-color: #18181b; }
:root[data-theme="light"] .next:hover { background: #3f3f46; border-color: #3f3f46; }
:root[data-theme="light"] :is(.hint, .answer-panel #verdict, .answer-panel strong, .status) { color: #92400e; }
:root[data-theme="light"] .answer-panel { background: rgba(180, 83, 9, .05); border-color: rgba(180, 83, 9, .2); }
:root[data-theme="light"] :is(.play-note, .shelf-note, footer) { color: #6b6b74; }
:root[data-theme="light"] .shelf { background: var(--surface); }
:root[data-theme="light"] .categories button[aria-pressed=true] { color: #92400e; border-color: rgba(180, 83, 9, .45); background: rgba(180, 83, 9, .06); }
:root[data-theme="light"] .joke-list button { border-bottom-color: #e4e4e7; }
:root[data-theme="light"] .joke-list button small { color: #6b6b74; }
:root[data-theme="light"] .joke-list button:hover { background: #f4f4f5; color: #92400e; }
