body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid #343026; background: #15130ff5; backdrop-filter: blur(16px); }
.bar-inner { min-height: 72px; }
.topbar nav { gap: 14px; width: auto; }
.topbar .button { min-height: 38px; font-size: .8rem; box-shadow: none; }
.brand-mark { width: 44px; height: 44px; }
.brand-name { font-size: .85rem; }
.icon-button, .profile-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 50%; }
.icon-button { font-size: 1.35rem; border: 0; background: transparent; }
.profile-button { overflow: hidden; color: var(--accent); font-weight: 800; }
.profile-button img { width: 100%; height: 100%; object-fit: cover; }
.notification-dot { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.notification-dot[hidden] { display: none; }
.bottom-nav { position: fixed; z-index: 35; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 5px max(16px, calc((100vw - 640px)/2)) calc(5px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: #191710f5; backdrop-filter: blur(18px); }
.bottom-nav button { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 58px; padding: 4px; border: 0; border-radius: 10px; background: transparent; color: #b8b2a6; font-size: .74rem; }
.bottom-nav button.active { color: #ffc928; background: #ffc9280b; font-weight: 800; }
.tab-icon { font-size: 1.5rem; line-height: 1.3; }
.tab-heading { margin: 34px 0 24px; }
.tab-heading h1 { font-size: clamp(1.65rem, 3vw, 2.3rem); letter-spacing: -.05em; }
.tab-heading p { margin-top: 7px; color: var(--muted); font-size: .9rem; }
.browse-page { padding-bottom: 35px; }
.browse-page .case-grid, body[data-page-tab=records] .case-grid { gap: 30px 20px; }
.browse-page .case-card, body[data-page-tab=records] .case-card { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.browse-page .cover, body[data-page-tab=records] .cover { min-height: 0; aspect-ratio: 16/10; border: 1px solid #3e372b; border-radius: 10px; }
.browse-page .card-body, body[data-page-tab=records] .card-body { position: relative; padding: 12px 0 0; }
.browse-page .card-body h3, body[data-page-tab=records] .card-body h3 { padding-right: 35px; font-size: 1.05rem; margin: 6px 0; }
.browse-page .card-body p, body[data-page-tab=records] .card-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .78rem; margin-bottom: 8px; }
.genre { background: transparent; border: 0; padding: 0; color: #d9b65d; font-weight: 500; }
.card-link { border: 0; padding: 5px 0; margin-top: 5px; min-height: 30px; font-size: .78rem; }
.save-button { position: absolute; top: 28px; right: 0; width: 34px; height: 34px; border: 0; background: transparent; color: #b8b2a6; font-size: 1.45rem; }
.save-button[aria-pressed=true] { color: var(--accent); }
.search-large { padding: 8px 16px; margin-bottom: 22px; border-radius: 12px; max-width: 720px; }
.search-large input { width: 100%; }
.browse-page .filters { max-height: none; overflow: visible; margin-bottom: 18px; }
.browse-page .chip { border-radius: 7px; }
.list-title { font-size: 1.2rem; margin: 30px 0 18px; }
.history-list, .friend-list { list-style: none; padding: 0; margin: 0; }
.history-list li, .friend-row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.history-list li>div, .friend-row>div:first-of-type { flex: 1; min-width: 0; }
.history-list small, .friend-row small { display: block; color: var(--muted); margin-top: 4px; font-size: .78rem; }
.friend-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #ffc92819; color: var(--accent); }
.friend-actions { display: flex; gap: 8px; }
.social-invite { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.social-invite form { margin: 0; }
.social-invite form>div { display: flex; gap: 8px; margin-top: 8px; }
.social-invite input { min-width: 0; width: 190px; }
.friend-code { display: inline-block; margin: 8px 12px 0 0; font-family: var(--mono); color: var(--accent); }
.account-page { text-align: center; max-width: 520px; margin: 45px auto; }
.account-page img { width: 150px; height: 150px; object-fit: contain; margin-bottom: 20px; }
.account-page p { color: var(--muted); margin: 14px 0 24px; }
.in-game .dock { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
.in-game .sheet { z-index: 41; }
.toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.site-footer { border-color: var(--border); margin-top: 32px; }
@media(max-width:700px) {
  .bar-inner { flex-wrap: nowrap; padding-block: 9px; gap: 8px; }
  .brand-name { display: none; }
  .brand-mark { width: 42px; height: 42px; }
  .topbar nav { gap: 9px; }
  .topbar .button { padding-inline: 12px; }
  .tab-heading { margin-top: 24px; }
  .browse-page .case-grid, body[data-page-tab=records] .case-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 12px; }
  .card-body h3 { font-size: .95rem; }
  .social-invite { padding: 16px; }
  .social-invite form { width: 100%; }
  .social-invite input { flex: 1; width: 100px; }
  .friend-row { flex-wrap: wrap; }
  .in-game .sheet { bottom: calc(var(--dock-h) + 94px + env(safe-area-inset-bottom,0px)); }
}

.nav-drawing { display:block; width:25px; height:25px; flex-shrink:0; }
.icon-wash { fill:currentColor; fill-opacity:.09; stroke:none; }
.tab-icon { display:grid; place-items:center; width:48px; height:33px; border-radius:12px; transition:background .18s ease; }
.bottom-nav button { gap:3px; background:transparent; }
.bottom-nav button.active { background:transparent; }
.bottom-nav button.active .tab-icon { background:#ffc92818; }
.bottom-nav button.active .icon-wash { fill-opacity:.2; }
.topbar .button .nav-drawing { width:19px; height:19px; }
.icon-button,.profile-button { border:1px solid #ffffff0c; background:#ffffff04; color:#ded8ca; }
.icon-button:hover,.profile-button:hover { background:#ffc92812; color:var(--accent); }
#saved-button[aria-pressed=true] { color:var(--accent); background:#ffc92818; }
@media(max-width:360px) {
  .topbar nav { gap:5px; }
  .topbar .button { padding-inline:8px; font-size:.72rem; }
  .topbar .button .nav-drawing { display:none; }
  .topbar .icon-button,.topbar .profile-button { width:36px; height:36px; }
}
.profile-button .nav-drawing { width:27px; height:27px; }
@media(prefers-reduced-motion:reduce){.tab-icon{transition:none}}

.social-mark img { width:22px; height:22px; display:block; object-fit:contain; }
#email-fields[hidden] { display:none; }
.email-toggle { justify-content:space-between; min-height:46px; }
#account .social { min-height:48px; border-radius:9px; }

/* 계정 탭 맨 아래의 쿠폰 입력란. 모서리를 깎은 모양은 frame.css와 같은 방식이다. */
.coupon-box { max-width: 520px; margin: 0 auto 60px; padding: 22px 20px; box-sizing: border-box; text-align: left; background: #211d19; --k: 12px; clip-path: polygon(var(--k) 0, calc(100% - var(--k)) 0, 100% var(--k), 100% calc(100% - var(--k)), calc(100% - var(--k)) 100%, var(--k) 100%, 0 calc(100% - var(--k)), 0 var(--k)); box-shadow: inset 0 0 0 1px #75614a, inset 0 3px 0 #ffc92880; }
.coupon-box .eyebrow { margin: 0 0 4px; }
.coupon-box h2 { margin: 0 0 8px; font-size: 1.15rem; }
.coupon-box p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.coupon-box form { display: flex; gap: 8px; }
.coupon-field { flex: 1; min-width: 0; }
.coupon-field input { width: 100%; box-sizing: border-box; height: 100%; min-height: 46px; padding: 0 14px; border: 0; background: #15130f; color: #f2e7d7; font: inherit; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; box-shadow: inset 0 0 0 1px #75614a; }
.coupon-field input::placeholder { letter-spacing: 0; color: #8d8272; }
.coupon-field input:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #ffc928; }
.coupon-box .button { flex: none; }
.coupon-box .coupon-result { margin: 12px 0 0; min-height: 1.4em; font-size: .86rem; }
.coupon-box .coupon-result:empty { display: none; }
.coupon-box .coupon-result.ok { color: #ffda77; }
.coupon-box .coupon-result.error { color: #ff9a80; }
.coupon-box .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* 작품 슬롯 가격표: 표지 왼쪽 위에 붙는다. */
.case-card { position: relative; }
.price-tag { position: absolute; top: 8px; left: 8px; z-index: 3; padding: 3px 9px; background: #15130fe6; color: #ffdc70; border: 1px solid #d9b65d; font-size: .74rem; font-weight: 750; letter-spacing: .01em; line-height: 1.3; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); pointer-events: none; }
.price-tag.free { color: #b1e2ca; border-color: #6fae93; }
.price-note { display: grid; gap: 8px; margin: 12px 0; padding: 10px 12px; border: 1px solid #d9b65d66; background: #d9b65d12; font-size: .82rem; line-height: 1.5; }
.price-note p { margin: 0; }
.price-note b { color: #ffdc70; }
.price-note.free { border-color: #6fae9366; background: #6fae9312; }
.price-note.free b { color: #b1e2ca; }
.price-note .button { justify-self: start; }

/* Profile photos fill a true circle, independent of decorative button frames. */
:root #profile-button { padding:0; border-radius:50%; clip-path:none; overflow:hidden; aspect-ratio:1; box-sizing:border-box; }
:root #profile-button::before,:root #profile-button::after { content:none; display:none; }
:root #profile-button img { display:block; width:100%; height:100%; max-width:none; object-fit:cover; border-radius:50%; clip-path:none; }

/* Generated heart artwork: fixed visual box avoids font baseline and native padding. */
:root .case-card .save-button[data-save] {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid #e9c77840;
  border-radius: 50%;
  background: #100e13e6;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  isolation: isolate;
}
:root .case-card .save-button[data-save]::before {
  content: "";
  grid-area: 1 / 1;
  display: block;
  width: 26px;
  height: 26px;
  background: url('/assets/story-heart-gold-v1.png') center / contain no-repeat;
  filter: grayscale(1) brightness(1.15);
  opacity: .72;
  pointer-events: none;
  transition: filter .16s ease, opacity .16s ease;
}
:root .case-card .save-button[data-save][aria-pressed="true"] { border-color: #f8c85c99; }
:root .case-card .save-button[data-save][aria-pressed="true"]::before { filter: none; opacity: 1; }
:root .case-card .save-button[data-save]:focus-visible { outline: 2px solid #ffda77; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  :root .case-card .save-button[data-save]::before { transition: none; }
}

/* Generated heart artwork: fixed visual box avoids font baseline and native padding. */
:root .case-card .save-button[data-save] {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid #e9c77840;
  border-radius: 50%;
  background: #100e13e6;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  isolation: isolate;
}
:root .case-card .save-button[data-save]::before {
  content: "";
  grid-area: 1 / 1;
  display: block;
  width: 26px;
  height: 26px;
  background: #c9c4bb;
  -webkit-mask: url('/assets/story-heart-flat-v2.png') center / contain no-repeat;
  mask: url('/assets/story-heart-flat-v2.png') center / contain no-repeat;
  opacity: .72;
  pointer-events: none;
  transition: filter .16s ease, opacity .16s ease;
}
:root .case-card .save-button[data-save][aria-pressed="true"] { border-color: #f8c85c99; }
:root .case-card .save-button[data-save][aria-pressed="true"]::before { background-color: #ffc928; filter: none; opacity: 1; }
:root .case-card .save-button[data-save]:focus-visible { outline: 2px solid #ffda77; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  :root .case-card .save-button[data-save]::before { transition: none; }
}

/* User-provided heart artwork: outline off, filled on. */
:root .case-card .save-button[data-save]::before {
  width: 23px; height: 23px;
  -webkit-mask: none; mask: none;
  background: url('/assets/story-heart-outline-user-v3.png') center / contain no-repeat;
  filter: none; opacity: 1;
}
:root .case-card .save-button[data-save][aria-pressed="true"]::before {
  background: url('/assets/story-heart-filled-user-v3.png') center / contain no-repeat;
  filter: none; opacity: 1;
}

/* heart-emoji-20261123: 찜 버튼은 노란 하트 이모지 하나만 보인다.
   동그라미 배경·테두리, 그림 하트(::before 이미지), 글자 하트(♡/♥, design-options.css의 font-size 때문에 겹쳐 보이던 것)를 모두 지운다.
   찜 안 함: 흐린 노란 하트 / 찜함: 선명하고 조금 큰 노란 하트. html:root로 design-options.css(같은 우선순위, 나중에 로드)보다 앞선다. */
html:root .case-card .save-button[data-save] {
  display: grid; place-items: center; box-sizing: border-box; padding: 0;
  width: 34px; height: 34px; min-width: 34px;
  border: 0; border-radius: 0; background: none; box-shadow: none; outline-offset: 2px;
  color: transparent; font-size: 0; line-height: 0; overflow: visible; -webkit-tap-highlight-color: transparent;
}
html:root .case-card .save-button[data-save]::before {
  content: "\1F49B"; grid-area: 1 / 1; display: block; width: auto; height: auto;
  background: none; -webkit-mask: none; mask: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 22px; line-height: 1;
  opacity: .55; filter: drop-shadow(0 1px 2px #000000b3);
  transition: opacity .16s ease, transform .16s ease;
}
html:root .case-card .save-button[data-save][aria-pressed="true"]::before { opacity: 1; transform: scale(1.12); }
html:root .case-card .save-button[data-save]:focus-visible { outline: 2px solid #ffda77; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { html:root .case-card .save-button[data-save]::before { transition: none; } }

/* User supplied heart1 / heart2, 20261123. */
html:root .case-card .save-button[data-save] {
 display:grid; place-items:center; box-sizing:border-box; padding:0;
 width:34px; height:34px; min-width:34px;
 border:1px solid #e9c77840; border-radius:50%; background:#100e13e6;
 color:transparent; font-size:0!important; line-height:0; overflow:hidden;
}
html:root .case-card .save-button[data-save]::before {
 content:""; position:absolute; inset:0; margin:auto; display:block; width:23px; height:23px;
 background:url('/assets/heart-user-off-affe55c5dee5.png') center / contain no-repeat;
 -webkit-mask:none; mask:none; filter:none; opacity:1; transform:none;
 font-size:0; line-height:0; pointer-events:none;
}
html:root .case-card .save-button[data-save][aria-pressed="true"]::before {
 background:url('/assets/heart-user-20261123-on.png') center / contain no-repeat;
 filter:none; opacity:1; transform:none;
}
html:root .case-card .save-button[data-save]::after {content:none;display:none;}

/* Heart artwork only; preserve the full clickable area. */
html:root .case-card .save-button[data-save],
html:root .case-card .save-button[data-save]:hover,
html:root .case-card .save-button[data-save]:active,
html:root .case-card .save-button[data-save][aria-pressed="true"] {
  background:transparent; border:0; box-shadow:none; border-radius:0;
}

/* Reveal unsaved hearts only in their top-right hit area. */
html:root .case-card .save-button[data-save] { overflow:visible; }
html:root .case-card .save-button[data-save]::before {
 opacity:0; filter:none;
 transition:opacity .18s ease, filter .18s ease;
}
html:root .case-card .save-button[data-save]:hover::before,
html:root .case-card .save-button[data-save]:focus-visible::before {
 opacity:1;
 filter:drop-shadow(0 0 3px #ffd66bb3) drop-shadow(0 0 8px #ffbc384d);
}
html:root .case-card .save-button[data-save][aria-pressed="true"]::before { opacity:1; }
html:root .case-card .save-button[data-save][aria-pressed="true"]:hover::before,
html:root .case-card .save-button[data-save][aria-pressed="true"]:focus-visible::before {
 filter:drop-shadow(0 0 3px #ffd66bb3) drop-shadow(0 0 8px #ffbc384d);
}
/* Touch users have no hover; keep the action discoverable. */
@media (hover:none) {
 html:root .case-card .save-button[data-save]::before { opacity:1; }
}
@media (prefers-reduced-motion:reduce) {
 html:root .case-card .save-button[data-save]::before { transition:none; }
}

/* rail-outline-20261123: 홈 작품 줄·대표작 배너의 노란 포커스 테두리는 키보드로 옮겨 왔을 때만 보인다.
   손가락(터치 전용 기기)에서는 아예 그리지 않는다. html:root로 나중에 불러오는 home-discovery.css보다 앞선다. */
html:root .home-rail:focus:not(:focus-visible), html:root .home-feature-track:focus:not(:focus-visible) { outline: none; }
@media (hover: none) and (pointer: coarse) {
  html:root .home-rail:focus, html:root .home-rail:focus-visible,
  html:root .home-feature-track:focus, html:root .home-feature-track:focus-visible { outline: none; }
}
html:root .home-rail, html:root .home-feature-track { -webkit-tap-highlight-color: transparent; }
