/* 개냥이 — 기본 디자인 (칠판 & 머스터드 손그림 메뉴). 개냥이 전용 화면 스타일은 gaenyangi.css */
:root {
  --board: #1C1C1A;
  --board-deep: #0F0F0E;
  --chalk: #F4F1EA;
  --chalk-dim: #CFCBC0;
  --chalk-line: #F4F1EA88;
  --mustard: #F2B630;
  --mustard-hi: #FFD15C;
  --paper: #F4F1EA;
  --ink: #1C1C1A;
  --ink-dim: #5A564D;
  --ink-line: #1C1C1A88;
  --warn: #B3261E;
  --f-title: 'Black Han Sans', 'Noto Sans KR', sans-serif;
  --f-label: 'Oswald', 'Noto Sans KR', sans-serif;
  --f-script: 'Kaushan Script', cursive;
  --f-pen: 'Nanum Pen Script', cursive;
  --f-body: 'Noto Sans KR', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #000; color: var(--chalk); font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }

.app { max-width: 460px; min-height: 100vh; margin: 0 auto; background: var(--board); position: relative; display: flex; flex-direction: column; padding-bottom: 66px; overflow-x: hidden; }
.doodles { position: absolute; inset: 0; pointer-events: none; opacity: .1; }
.page { position: relative; flex: 1; display: flex; flex-direction: column; }

/* ---------- top bars ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 34px; height: 34px; object-fit: cover; border-radius: 17px; border: 1px solid #F4F1EA55; }
.brand span { font-family: var(--f-label); font-weight: 700; font-size: 15px; letter-spacing: 3px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1.5px dashed #F4F1EA99; background: transparent; color: var(--chalk); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.back { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.topbar .script { font-family: var(--f-script); font-size: 20px; color: var(--mustard); }
.topbar .crumb { font-family: var(--f-title); font-size: 15px; flex: 1; }

/* ---------- panels ---------- */
.panel-yellow { margin: 0 16px; background: var(--mustard); color: var(--ink); padding: 14px 16px 12px; position: relative; display: flex; align-items: center; gap: 6px; }
.paper { margin: 0 14px; background: var(--paper); color: var(--ink); padding: 10px 12px 14px; position: relative; }
.paper .bar { margin: 0 -2px 0; }
.bar { background: var(--ink); color: var(--mustard); padding: 6px 10px; display: flex; justify-content: space-between; align-items: center; font-family: var(--f-label); font-weight: 700; letter-spacing: 3px; font-size: 17px; }
.bar small { font-weight: 500; letter-spacing: 1px; font-size: 12px; color: var(--chalk); }
.tag-bar { display: inline-block; font-family: var(--f-label); font-weight: 700; font-size: 15px; letter-spacing: 2px; padding: 3px 9px; margin: 0; }
.tag-bar.white { background: var(--chalk); color: var(--ink); }
.tag-bar.yellow { background: var(--mustard); color: var(--ink); }
.tag-bar.black { background: var(--ink); color: var(--chalk); }

.title-xl { font-family: var(--f-title); font-weight: 400; font-size: 46px; line-height: 1; margin: 0; }
.title-l { font-family: var(--f-title); font-weight: 400; font-size: 36px; line-height: 1.05; margin: 0; }
.script { font-family: var(--f-script); }
.pen { font-family: var(--f-pen); font-size: 19px; line-height: 1.15; }
.label { font-family: var(--f-label); font-weight: 700; letter-spacing: 3px; font-size: 13px; }
.dim { color: var(--chalk-dim); }
.paper .dim, .panel-yellow .dim { color: var(--ink-dim); }

/* ---------- dotted menu rows ---------- */
.menu-list { display: flex; flex-direction: column; gap: 9px; }
.row { display: flex; flex-direction: column; gap: 1px; }
.row-main { display: flex; align-items: baseline; gap: 5px; }
.row-name { font-family: var(--f-title); font-size: 16px; overflow-wrap: anywhere; }
.row-lead { flex: 1; border-bottom: 1.5px dotted var(--chalk-line); transform: translateY(-4px); min-width: 12px; }
.paper .row-lead, .on-paper .row-lead { border-color: var(--ink-line); }
.on-paper .row-val { color: var(--ink); font-size: 13px; }
.row-val { font-family: var(--f-label); font-size: 15px; color: var(--mustard); white-space: nowrap; }
.paper .row-val { color: var(--ink); font-size: 13px; }
.row-sub { font-size: 12px; color: var(--chalk-dim); }
.paper .row-sub { color: var(--ink-dim); }
a.row:hover .row-name { text-decoration: underline; text-decoration-color: var(--mustard); text-underline-offset: 4px; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- home big menu ---------- */
.big-menu { display: flex; align-items: stretch; background: var(--paper); color: var(--ink); min-height: 104px; position: relative; overflow: hidden; }
.bm-num { width: 46px; flex-shrink: 0; background: var(--ink); color: var(--mustard); display: flex; align-items: center; justify-content: center; font-family: var(--f-label); font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.bm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 6px 12px 14px; }
.bm-name { font-family: var(--f-title); font-size: 30px; line-height: 1.05; white-space: nowrap; }
.bm-name.bm-long { font-size: 24px; }
.bm-en { font-family: var(--f-script); font-size: 17px; color: var(--ink-dim); margin-top: 2px; }
.bm-note { font-size: 18px; margin-top: 2px; }
.bm-art { width: 88px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding-right: 6px; }
.bm-art svg { width: 82px; height: auto; }
.big-menu:hover .bm-name, .big-menu:focus-visible .bm-name { text-decoration: underline; text-decoration-color: var(--mustard); text-decoration-thickness: 3px; text-underline-offset: 5px; }

/* ---------- species intro ---------- */
.hero-photo.tall { height: 250px; }
.trait { display: flex; align-items: baseline; gap: 6px; }
.trait-k { font-family: var(--f-title); font-size: 15px; white-space: nowrap; }
.trait-v { font-size: 13px; text-align: right; max-width: 62%; }
.door { margin: 16px 14px 0; background: var(--mustard); color: var(--ink); padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.door-head { display: flex; justify-content: space-between; align-items: flex-start; }
.door .door-stamp { position: static; width: 58px; height: 58px; transform: rotate(10deg); margin: -6px -2px -10px 0; }
.door-title { font-family: var(--f-title); font-size: 34px; line-height: 1.1; }
.door-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.door-tile { position: relative; height: 104px; background: var(--ink); overflow: hidden; display: flex; align-items: flex-end; }
.door-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.door-tile > span { position: relative; width: 100%; background: #1C1C1AD9; color: var(--chalk); font-family: var(--f-title); font-size: 14px; padding: 4px 8px; }
.door-tile.door-name { height: 64px; background: var(--paper); border: 2px solid var(--ink); align-items: center; }
.door-tile.door-name > span { background: transparent; color: var(--ink); font-size: 16px; text-align: center; }
.door-go { margin-top: 12px; height: 50px; background: var(--ink); color: var(--mustard); display: flex; align-items: center; justify-content: center; font-family: var(--f-title); font-size: 18px; }
.door:hover .door-go { background: #000; }
.link-cards { margin: 12px 14px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.link-cards a { border: 1.5px dashed #F4F1EA99; padding: 12px; display: flex; flex-direction: column; gap: 3px; color: var(--chalk); }
.link-cards .label { color: var(--mustard); font-size: 11px; }
.link-cards a:hover { border-style: solid; }

/* ---------- stamp ---------- */
.stamp { position: absolute; width: 62px; height: 62px; border-radius: 31px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: var(--f-label); font-weight: 700; font-size: 11px; line-height: 1.1; border: 2px dashed currentColor; }
.stamp.dark { background: var(--ink); color: var(--mustard); }
.stamp.yellow { background: var(--mustard); color: var(--ink); border-color: var(--ink); }
.stamp.paper-s { background: var(--paper); color: var(--ink); border-color: var(--ink); }

/* ---------- tabs & chips ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { height: 38px; padding: 0 14px; display: inline-flex; align-items: center; font-family: var(--f-title); font-size: 14px; border: 2px solid var(--ink); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--mustard); border-color: var(--mustard); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--mustard); }

/* ---------- search ---------- */
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border: 2px solid var(--ink); background: #fff8; }
.search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; min-width: 0; }
.search.dark { border: 1.5px dashed #F4F1EA99; background: transparent; }
.search.dark input { color: var(--chalk); }
.search.dark input::placeholder { color: #CFCBC0AA; }

/* ---------- buttons ---------- */
.btn { height: 50px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-title); font-size: 16px; padding: 0 16px; cursor: pointer; }
.btn-dark { background: var(--ink); color: var(--mustard); border: 0; }
.btn-line { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-more { width: 100%; height: 46px; margin-top: 12px; background: transparent; border: 1.5px dashed var(--ink); color: var(--ink); font-family: var(--f-pen); font-size: 20px; cursor: pointer; }
.coupang { height: 34px; padding: 0 10px; background: var(--ink); color: var(--mustard); display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.coupang[aria-disabled="true"] { background: transparent; color: var(--ink-dim); border: 1.5px dashed #1C1C1A66; font-weight: 500; }

/* ---------- kit ---------- */
.kit-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1.5px dashed #1C1C1A55; }
.kit-item:last-child { border-bottom: 0; }
.kit-num { width: 26px; height: 26px; border-radius: 13px; background: var(--mustard); display: flex; align-items: center; justify-content: center; font-family: var(--f-label); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.kit-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kit-thumb { width: 40px; height: 40px; object-fit: cover; border: 1px solid #1C1C1A44; flex-shrink: 0; }

/* ---------- care ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { border: 1.5px solid var(--chalk); display: flex; flex-direction: column; }
.metric b { background: var(--mustard); color: var(--ink); font-family: var(--f-label); font-size: 12px; letter-spacing: 1px; text-align: center; padding: 2px 0; }
.metric span { font-family: var(--f-label); font-size: 17px; text-align: center; padding: 7px 2px; }
.note-y { background: var(--mustard); color: var(--ink); padding: 9px 12px; transform: rotate(-1.2deg); }

/* ---------- morph ---------- */
.morph-page { background: var(--mustard); color: var(--ink); flex: 1; }
.photo-box { height: 160px; background: var(--ink); position: relative; display: flex; align-items: center; justify-content: center; color: #8A867C; font-family: var(--f-label); letter-spacing: 5px; font-size: 13px; }
.photo-box.has-photo { background: #000; }
.photo-box img, .hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo { position: relative; height: 170px; margin: 10px -2px 0; background: #000; overflow: hidden; }
.credit { margin: 6px 0 0; font-size: 10px; line-height: 1.4; color: var(--ink-dim); }
.credit a { text-decoration: underline; text-underline-offset: 2px; }
.tape { position: absolute; top: -8px; width: 60px; height: 18px; background: #F4F1EAD9; }
.ribbon { display: inline-block; background: var(--ink); color: var(--mustard); font-family: var(--f-label); font-weight: 700; font-size: 15px; letter-spacing: 3px; padding: 4px 20px; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); }
.gene-box { border: 2px solid var(--ink); padding: 6px 10px; display: inline-flex; flex-direction: column; align-items: center; }
.gene-box.result { background: var(--ink); color: var(--chalk); border-color: var(--ink); }
.grid16 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; width: 116px; flex-shrink: 0; }
.grid16 i { height: 26px; border: 1.5px solid var(--ink); }
.grid16 i.a { background: #8A6A1A; border-color: #8A6A1A; }
.grid16 i.b { background: var(--paper); }
.grid16 i.c { background: var(--ink); }
.facts { display: flex; flex-direction: column; gap: 7px; }
.warn-box { border: 2px solid var(--warn); background: #FFF4F2; color: var(--warn); padding: 8px 12px; font-size: 13px; font-weight: 700; line-height: 1.5; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 460px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 64px; background: var(--board-deep); border-top: 2px solid var(--mustard); z-index: 10; }
.nav a { display: flex; align-items: center; justify-content: center; font-family: var(--f-title); font-size: 15px; color: var(--chalk-dim); }
.nav a[aria-current="page"] { background: var(--mustard); color: var(--ink); }

.disclosure { margin: 10px 16px 0; font-size: 11px; line-height: 1.5; color: var(--chalk-dim); }
.empty { padding: 24px 0; text-align: center; font-family: var(--f-pen); font-size: 21px; color: var(--ink-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { height: 16px; }
