/* BREWOAK — 툼카드와 같은 다크 배경 + 금색 포인트, 따뜻한 오크나무 느낌 */
:root {
  --bg: #0a0a07;
  --bg2: #12110b;
  --surface: rgba(255, 236, 190, 0.05);
  --surface-hover: rgba(255, 236, 190, 0.09);
  --border: rgba(255, 236, 190, 0.12);
  --text: #fff7e6;
  --muted: rgba(255, 247, 230, 0.66);
  --subtle: rgba(255, 247, 230, 0.4);
  --gold: #ffd978;
  --gold-strong: #f59e0b;
  --gold-soft: rgba(255, 217, 120, 0.12);
  --leaf: #7fbf5a;
  --danger: #f87171;
  --radius: 18px;
  --font: 'Pretendard Variable', 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
  background-image: radial-gradient(900px 520px at 78% -140px, rgba(255, 190, 70, 0.13), transparent 70%), radial-gradient(700px 400px at -10% 30%, rgba(122, 74, 34, 0.14), transparent 70%); background-attachment: fixed; }
main { flex: 1; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }

/* 헤더 */
.top { position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, rgba(14, 12, 7, .92), rgba(10, 10, 7, .78)); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--border); box-shadow: inset 0 -1px 0 rgba(255, 217, 120, .06); }
.topin { display: flex; align-items: center; gap: 14px; min-height: 60px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .14em; font-size: 15px; color: var(--text); }
.brand img { height: 34px; width: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55)); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.nav a.on, .nav a:hover { color: var(--gold); background: var(--gold-soft); text-decoration: none; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.chip:empty { display: none; }
.chip b { color: var(--gold); font-variant-numeric: tabular-nums; }
select, input, textarea { font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; }
select { padding: 7px 10px; border-radius: 999px; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
option { color: #111; }

/* 버튼 */
.btn { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 999px; padding: 11px 20px; color: #2a1a00; background: linear-gradient(180deg, #ffe48f, #f5b52e); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(160, 90, 0, .25), 0 8px 22px rgba(245, 158, 11, 0.24); transition: transform .12s, filter .12s, box-shadow .12s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--gold); box-shadow: none; border: 1px solid rgba(255, 217, 120, 0.4); }
.btn.kakao { background: #fee500; color: #191919; box-shadow: none; }
.btn.wide { width: 100%; }
.btn.on { background: var(--gold-soft); color: var(--gold); box-shadow: none; border: 1px solid rgba(255, 217, 120, 0.4); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 8px; }

/* 히어로 */
.hero { padding: 44px 0 20px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: center; }
.hero h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: var(--muted); margin: 0 0 22px; max-width: 46ch; }
.tree { width: 100%; max-width: 360px; justify-self: center; overflow: visible; }
.tree .bean { animation: bob 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.tree .bean:nth-child(2n) { animation-delay: -1.2s; }
.tree .bean:nth-child(3n) { animation-delay: -2.4s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.tree .fall { animation: fall 5s ease-in infinite; transform-box: fill-box; }
@keyframes fall { 0% { transform: translateY(-10px); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(120px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tree .bean, .tree .fall { animation: none; } }

/* 탭 · 카드 그리드 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 16px; }
.tabs button { font: inherit; font-weight: 600; cursor: pointer; padding: 8px 16px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.tabs button.on { color: var(--gold); border-color: rgba(255, 217, 120, 0.5); background: var(--gold-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding-bottom: 48px; }
.item { background: linear-gradient(180deg, rgba(255, 236, 190, .07), rgba(255, 236, 190, .025)); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .08); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.item:hover { border-color: rgba(255, 217, 120, 0.4); transform: translateY(-2px); }
.item .pv { height: 150px; position: relative; display: grid; place-items: center; overflow: hidden; }
.item .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item .kind { font-size: 12px; color: var(--subtle); letter-spacing: .04em; }
.item h3 { margin: 0; font-size: 17px; }
.item .desc { color: var(--muted); font-size: 14px; flex: 1; }
.item .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.price { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--gold); font-size: 17px; font-variant-numeric: tabular-nums; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }

/* 미리보기: 스킨 · 뒷면 · 음악 · 골드 아이디 */
.pv-skin .mini { width: 70%; padding: 10px 12px; border-radius: 12px; background: var(--kong-panel, rgba(255, 255, 255, .08)); font-size: 12px; color: var(--kong-ink, #fff); text-align: left; }
.pv-skin .mini i { display: block; height: 6px; border-radius: 3px; background: var(--kong-accent, #ffd978); width: 40%; margin-bottom: 7px; }
.pv-skin .mini s { display: block; height: 5px; border-radius: 3px; background: currentColor; opacity: .35; margin-top: 5px; text-decoration: none; }
.pv-back .cardback { width: 150px; height: 94px; border-radius: 10px; border: 1px solid rgba(255, 217, 120, .35); display: grid; place-items: center; font-weight: 800; letter-spacing: .12em; font-size: 11px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
.pv-bgm { background: radial-gradient(circle at 50% 50%, rgba(255, 217, 120, .14), transparent 65%); }
.pv-bgm button { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255, 217, 120, .5); background: var(--gold-soft); color: var(--gold); font-size: 22px; cursor: pointer; }
.pv-bgm.playing button { background: var(--gold); color: #2a1a00; }
.pv-bgm .bars { position: absolute; bottom: 14px; display: flex; gap: 4px; align-items: flex-end; height: 22px; }
.pv-bgm .bars b { width: 4px; background: var(--gold); border-radius: 2px; height: 5px; opacity: .6; }
.pv-bgm.playing .bars b { animation: eq .8s ease-in-out infinite; }
.pv-bgm.playing .bars b:nth-child(2) { animation-delay: -.2s; } .pv-bgm.playing .bars b:nth-child(3) { animation-delay: -.45s; } .pv-bgm.playing .bars b:nth-child(4) { animation-delay: -.65s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 22px; } }
.pv-gold { background: linear-gradient(160deg, #2b2108, #12100a); }
.pv-gold .url { font-family: ui-monospace, Menlo, monospace; font-size: 14px; color: var(--subtle); }
.pv-gold .url b { color: var(--gold); font-size: 24px; display: block; text-align: center; text-shadow: 0 0 18px rgba(255, 217, 120, .45); }

/* 지갑 */
.page-title { font-size: 28px; margin: 34px 0 6px; }
.balance { display: flex; align-items: center; gap: 14px; padding: 22px 24px; border-radius: var(--radius); border: 1px solid rgba(255, 217, 120, .35); background: linear-gradient(135deg, rgba(255, 217, 120, .14), rgba(255, 217, 120, .03)); margin: 14px 0 22px; }
.balance .num { font-size: 42px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1; }
.balance .lbl { color: var(--muted); font-size: 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: linear-gradient(180deg, rgba(255, 236, 190, .07), rgba(255, 236, 190, .025)); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .08); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.panel h3 { margin: 0; font-size: 16px; }
.earn { padding: 14px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.earn:first-of-type { border-top: 0; padding-top: 0; }
.earn p { margin: 0; color: var(--muted); font-size: 14px; }
.earn .row { display: flex; gap: 8px; flex-wrap: wrap; }
.earn input, .earn textarea { width: 100%; }
.stack { display: grid; gap: 8px; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.pack { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: rgba(255, 255, 255, .03); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pack .amt { font-size: 22px; font-weight: 800; color: var(--gold); display: flex; gap: 6px; align-items: center; }
.pack .won { color: var(--muted); font-size: 14px; }
.ledger { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow: auto; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.ledger li:first-child { border-top: 0; }
.ledger .when { color: var(--subtle); font-size: 12px; }
.plus { color: var(--leaf); font-weight: 700; } .minus { color: var(--danger); font-weight: 700; }
.note { color: var(--muted); font-size: 14px; margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.gate { text-align: center; padding: 56px 0; display: grid; gap: 14px; justify-items: center; }

/* 로그인 창 · 알림 */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.on { display: grid; }
.sheet { width: min(400px, 100%); background: #17150d; border: 1px solid var(--border); border-radius: 22px; padding: 24px; display: grid; gap: 10px; }
.sheet h2 { margin: 0; font-size: 20px; }
.sheet .row { display: flex; gap: 8px; }
.grow { flex: 1; }
.sep { text-align: center; color: var(--subtle); font-size: 13px; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100% - 32px)); }
.toast { background: #221e10; border: 1px solid var(--border); padding: 12px 16px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); transition: opacity .3s; }
.toast.ok { border-color: rgba(127, 191, 90, .6); } .toast.err { border-color: rgba(248, 113, 113, .6); }
.toast.out { opacity: 0; }

.foot { border-top: 1px solid var(--border); padding: 36px 0 30px; color: var(--subtle); font-size: 13px; margin-top: 40px; background: linear-gradient(180deg, transparent, rgba(255, 217, 120, .035)); }
.foot .footgrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px 32px; align-items: start; }
.footbrand { display: flex; gap: 12px; align-items: center; }
.footbrand img { height: 52px; width: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.footbrand b { display: block; color: var(--text); letter-spacing: .14em; font-size: 14px; margin-bottom: 2px; }
.footnav { display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: flex-end; }
.foot .ga { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--border); }
.foot a { color: var(--muted); }

@media (max-width: 760px) {
  .foot .footgrid { grid-template-columns: 1fr; }
  .footnav { justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .tree { max-width: 240px; order: -1; }
  .cols { grid-template-columns: 1fr; }
  .topright { width: 100%; margin-left: 0; justify-content: flex-end; }
  .balance .num { font-size: 34px; }
}

/* 브루 마스코트 */
.hero-art { position: relative; justify-self: center; width: 100%; max-width: 360px; }
.hero-art .tree { display: block; margin: 0 auto; }
.hero-brew { position: absolute; left: -4%; bottom: 2%; z-index: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.brew-bob { animation: brewbob 3s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
@keyframes brewbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.brew-bubble { animation: brewbub 2.4s ease-in infinite; }
@keyframes brewbub { 0% { transform: translateY(6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-8px); opacity: 0; } }
.empty { display: grid; justify-items: center; gap: 4px; grid-column: 1 / -1; }
.empty p { margin: 0; }
.brew-say { display: flex; align-items: center; gap: 10px; background: var(--gold-soft); border: 1px solid rgba(255, 217, 120, .3); border-radius: 16px; padding: 6px 14px 6px 8px; }
.brew-say p { margin: 0; font-weight: 700; color: var(--gold); }
.ledger .empty-li { display: block; }
.foot .ga { width: 100%; }
@media (prefers-reduced-motion: reduce) { .brew-bob, .brew-bubble { animation: none; } }
@media (max-width: 760px) { .hero-art { max-width: 280px; } .hero-brew svg { width: 72px; height: auto; } }

.who { font-size: 13px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:empty { display: none; }
@media (max-width: 760px) { .who { max-width: 100%; flex-basis: 100%; text-align: right; } }

/* 캐릭터(오크통) 표정 */
.brew-img { display: block; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.brew-img.b-excited { animation: brewbob 3s ease-in-out infinite; }
.brew-img.b-sad { filter: grayscale(.4) brightness(.88) drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); transform: rotate(-4deg); }
.brew-img.b-brewing { opacity: .9; }
@media (prefers-reduced-motion: reduce) { .brew-img.b-excited { animation: none; } }

/* 폰 머리줄: 로고 + 언어·로그인을 한 줄에, 메뉴는 아래 한 줄 (세 줄이던 것을 두 줄로) */
@media (max-width: 760px) {
  .topin { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 8px 0 6px; min-height: 0; }
  .brand { grid-column: 1; grid-row: 1; }
  .topright { grid-column: 2; grid-row: 1; width: auto; margin: 0; justify-content: flex-end; gap: 6px; }
  .nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 7px 12px; }
  .who { display: none; }
  .topright select { max-width: 92px; }
}

/* 콩 상점·지갑 화면은 머리줄에 칩·버튼이 더 있어서 세 번째 줄로 내린다 */
@media (max-width: 760px) { .kongtop .topright { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; flex-wrap: wrap; } .kongtop .nav { grid-row: 2; } }

/* 상점: 무료 선물(오크팟 글에 넣는 셋업팟 선물) */
.freegifts { margin: 8px 0 26px; }
.fg-h { display: grid; gap: 6px; justify-items: start; margin-bottom: 12px; }
.fg-h h2 { margin: 0; font-size: 22px; }
.fg-h p { margin: 0; color: var(--muted, #a9a49a); font-size: 14px; max-width: 60ch; }
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fg-card { display: grid; gap: 6px; align-content: start; padding: 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); color: inherit; text-decoration: none; }
.fg-card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; }
.fg-ph { display: grid; place-items: center; aspect-ratio: 1200 / 630; border-radius: 10px; background: rgba(233, 196, 106, .1); color: #e9c46a; font-weight: 700; font-size: 13px; }
.fg-card b { font-size: 14px; }
.fg-card small { color: var(--muted, #a9a49a); font-size: 12px; line-height: 1.45; }
