/* Pixlmory — “hộp nhung”: nền nhung xanh cổ vịt, kim loại đồng của vành nhẫn, giấy hồng phấn.
   Vầng hào quang đồng là dấu ấn chung: có ở trang chủ và ở chính hình hiện lên khi quét. */
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-vietnamese-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; src: url("assets/fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; src: url("assets/fonts/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; src: url("assets/fonts/be-vietnam-pro-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; src: url("assets/fonts/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap;
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }

:root {
  --velvet: #0f3b3a;
  --velvet-deep: #092a29;
  --brass: #e3b34c;
  --brass-dark: #a97a1c;
  --blush: #f7e4de;
  --coral: #ff7a70;
  --ink: #0b2423;
  --text: var(--blush);
  --display: "Fraunces", "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", "Noto Serif CJK SC", "Times New Roman", serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--velvet);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-tap-highlight-color: transparent;
}
#stage, #stage a-scene { position: fixed; inset: 0; }
[hidden], .hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

/* ---------- Trang chủ ---------- */
.home {
  position: fixed; inset: 0; z-index: 20;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 14px) 22px calc(var(--safe-b) + 150px);
  background:
    radial-gradient(120% 60% at 85% 0%, #1b5553 0%, transparent 60%),
    var(--velvet);
}
.home > * { max-width: 520px; margin-left: auto; margin-right: auto; }
.home { padding-bottom: calc(var(--safe-b) + 190px); }

/* iPad và màn rộng: khung giữa rộng hơn, mặt nhẫn đứng cạnh chữ, mẫu to hơn. */
@media (min-width: 700px) {
  .home { padding-left: 40px; padding-right: 40px; }
  .home > * { max-width: 760px; }
  .hero { display: grid; grid-template-columns: 190px 1fr; column-gap: 40px; align-items: center; }
  .hero-face { grid-row: 1 / span 3; margin: 30px 0 30px 20px; width: 160px; height: 160px; }
  .hero h1 { font-size: 46px; }
  .lede { font-size: 17px; max-width: 44ch; }
  .tiles { margin: 0 -40px; padding: 6px 40px 14px; gap: 22px; }
  .tile { flex-basis: 128px; }
  .cta { max-width: 520px; }
}
.top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; min-height: 40px; }
.wordmark { font: 600 19px/1 var(--display); letter-spacing: .01em; color: var(--brass); }
.ghost {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--blush); border: 1.5px solid rgba(247, 228, 222, .45);
}

.top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lang { appearance: none; -webkit-appearance: none; background: transparent; font-family: var(--body); padding-right: 14px; }
.lang option { color: #0b2423; }
:lang(zh) .hero h1, :lang(ja) .hero h1 { font-size: clamp(28px, 8.2vw, 38px); line-height: 1.25; letter-spacing: 0; }
.hero { padding-top: 18px; }
.hero-face { position: relative; width: 148px; height: 148px; margin: 26px 0 44px 30px; }
.halo {
  position: absolute; inset: -34px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227,179,76,.55) 0%, rgba(227,179,76,.22) 48%, transparent 70%);
  box-shadow: inset 0 0 0 2px rgba(255, 240, 190, .55);
  animation: halo 3.6s ease-in-out infinite;
}
@keyframes halo { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.05); opacity: 1; } }
/* Vành nhẫn: khung đồng ôm lấy mặt pixel, như miếng nhựa nằm trong đầu nhẫn. */
.bezel {
  position: relative; width: 100%; aspect-ratio: 1; padding: 7%;
  border-radius: 16%;
  background: linear-gradient(145deg, #f4d58a, var(--brass) 45%, var(--brass-dark));
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.bezel img { display: block; width: 100%; height: 100%; border-radius: 9%; image-rendering: pixelated; background: var(--blush); }
.hero-face .bezel { transform: rotate(-6deg); }
.hero h1 { margin: 0 0 14px; font: 600 clamp(34px, 10vw, 44px)/1.08 var(--display); letter-spacing: -.01em; color: #fff7f3; }
.lede { margin: 0; max-width: 34ch; font-size: 16px; color: rgba(247, 228, 222, .86); }
.preview-note { display: none; margin: 14px 0 0; font-size: 14px; }
.preview-note a { color: var(--brass); }
body.preview .preview-note { display: block; }

.create-card { margin-top: 36px; padding: 20px; border-radius: 20px; border: 1.5px solid rgba(227, 179, 76, .45); background: rgba(9, 42, 41, .45); }
.create-card h2 { margin: 0 0 6px; font: 600 23px/1.2 var(--display); color: #fff7f3; }
.create-card p { margin: 0 0 16px; font-size: 14.5px; color: rgba(247, 228, 222, .8); max-width: 44ch; }
.create-btn { display: inline-block; text-decoration: none; padding: 11px 18px; font-size: 15px; color: var(--brass); border-color: var(--brass); }
.library { margin-top: 44px; }
.collection + .collection { margin-top: 34px; }
.collection h2, .howto h2 { margin: 0 0 4px; font: 600 23px/1.2 var(--display); color: #fff7f3; }
.collection > p { margin: 0 0 16px; font-size: 14.5px; color: rgba(247, 228, 222, .75); max-width: 40ch; }
.tiles {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -22px; padding: 6px 22px 14px; scrollbar-width: none;
}
.tiles::-webkit-scrollbar { display: none; }
.tile { flex: 0 0 104px; scroll-snap-align: start; text-align: left; padding: 0; }
.tile .bezel { transition: transform .15s ease; }
.tile:active .bezel { transform: scale(.95); }
.tile span { overflow-wrap: anywhere; display: block; margin-top: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--blush); }

.howto { margin-top: 44px; }
.howto ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: step; }
.howto li { counter-increment: step; position: relative; padding: 0 0 16px 46px; font-size: 15px; color: rgba(247, 228, 222, .86); }
.howto li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font: 600 16px/1 var(--display); color: var(--ink); background: var(--brass);
}
.howto b { color: #fff7f3; font-weight: 600; }
.ios-hint { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: rgba(247, 228, 222, .1); }

.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: none;
  padding: 18px 22px calc(var(--safe-b) + 18px);
  background: linear-gradient(to top, var(--velvet-deep) 62%, transparent);
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;
}
.pack { pointer-events: auto; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: rgba(247, 228, 222, .8); }
.pack select {
  appearance: none; -webkit-appearance: none; font: 600 13.5px/1 var(--body); color: var(--blush);
  padding: 7px 26px 7px 12px; border-radius: 999px; border: 1.5px solid rgba(247, 228, 222, .45);
  background: rgba(9, 42, 41, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f7e4de' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.pack option { color: #0b2423; }
.cta {
  pointer-events: auto; width: 100%; max-width: 476px; padding: 17px 24px; border-radius: 16px;
  font: 600 17px/1 var(--body); color: var(--ink);
  background: linear-gradient(180deg, #f1cc74, var(--brass));
  box-shadow: 0 5px 0 var(--brass-dark), 0 14px 26px rgba(0, 0, 0, .35);
}
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--brass-dark), 0 8px 16px rgba(0, 0, 0, .3); }
.cta:disabled { opacity: .55; }

/* ---------- Thẻ chi tiết mẫu ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; background: rgba(5, 22, 21, .66); }
.sheet-card {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 26px 22px calc(var(--safe-b) + 22px);
  border-radius: 26px 26px 0 0; background: var(--blush); color: var(--ink);
  animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet-close { position: absolute; top: 18px; right: 18px; color: var(--ink); border-color: rgba(11, 36, 35, .3); }
.bezel.big { width: 150px; margin: 4px 0 18px; }
.sheet-card h3 { margin: 0 0 6px; font: 600 26px/1.15 var(--display); }
.sheet-card p { margin: 0 0 10px; font-size: 15px; max-width: 38ch; }
.sheet-tip { color: rgba(11, 36, 35, .66); font-size: 14px !important; }
.sheet-card .cta { margin-top: 12px; max-width: none; }

/* ---------- Màn quét ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 22px;
  background: var(--velvet);
}
.intro-card { width: 100%; max-width: 360px; }
.intro-card h1 { margin: 0 0 10px; font: 600 28px/1.15 var(--display); color: #fff7f3; }
.intro-card p { margin: 0 0 22px; color: rgba(247, 228, 222, .86); }

/* MindAR tự bật/tắt #scanning bằng class "hidden" */
#scanning {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  pointer-events: none;
}
#scanning p {
  margin: 0; padding: 9px 16px; border-radius: 999px; max-width: 88vw; text-align: center;
  background: rgba(9, 42, 41, .78); font-size: 15px;
}
.reticle {
  position: relative; width: 42vmin; height: 42vmin;
  border: 3px solid var(--brass); border-radius: 16%;
  box-shadow: 0 0 0 100vmax rgba(9, 42, 41, .32), 0 0 26px rgba(227, 179, 76, .55);
}
.reticle span {
  position: absolute; left: 8%; right: 8%; height: 3px; border-radius: 3px;
  background: #fff3cf; box-shadow: 0 0 12px var(--brass);
  animation: scan 1.6s ease-in-out infinite alternate;
}
@keyframes scan { from { top: 8%; } to { top: 92%; } }

.pill, .back, .sound, .zoom {
  position: fixed; z-index: 15; border-radius: 999px;
  background: rgba(9, 42, 41, .8); color: var(--blush); font-size: 14px; font-weight: 600;
}
.pill {
  top: calc(var(--safe-t) + 16px); left: 50%; transform: translateX(-50%);
  padding: 8px 16px; max-width: 60vw; text-align: center; border: 1.5px solid var(--brass); overflow-wrap: anywhere;
}
.back { top: calc(var(--safe-t) + 14px); left: 14px; padding: 10px 16px; border: 1.5px solid rgba(247, 228, 222, .5); }
.sound { left: 16px; bottom: calc(var(--safe-b) + 24px); padding: 12px 18px; border: 1.5px solid rgba(247, 228, 222, .5); }
.zoom { right: 16px; bottom: calc(var(--safe-b) + 24px); width: 56px; height: 56px; border: 1.5px solid rgba(247, 228, 222, .5); }

.lowlight {
  position: fixed; z-index: 16; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 96px); display: flex; align-items: center; gap: 10px;
  max-width: 92vw; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(9, 42, 41, .88); border: 1.5px solid var(--coral); font-size: 14px; font-weight: 600; color: var(--blush);
}
.lowlight:has(#lowlight-msg[hidden]) { padding-left: 8px; border-color: rgba(247, 228, 222, .5); }
.torch { padding: 9px 14px; border-radius: 999px; background: var(--brass); color: var(--ink); font-size: 14px; font-weight: 700; }
.loading {
  position: fixed; inset: 0; z-index: 12;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(9, 42, 41, .9);
}
.loading p { margin: 0; padding: 0 22px; text-align: center; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(247, 228, 222, .22); border-top-color: var(--brass);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .halo, .reticle span, .sheet-card { animation: none; }
}

/* --- Tài khoản ------------------------------------------------------------ */
#account { position: relative; display: inline-flex; }
.acct-in { text-decoration: none; }
.acct summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding-left: 6px; }
.acct summary::-webkit-details-marker { display: none; }
.acct summary b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 13.5px/1 var(--body); background: var(--brass); color: var(--ink); }
.acct summary span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-card { position: absolute; z-index: 30; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); padding: 18px; border-radius: 18px; background: var(--blush); color: var(--ink); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.acct-name { font: 600 18px/1.25 var(--display); overflow-wrap: anywhere; }
.acct-mail { margin-top: 2px; font-size: 13.5px; color: rgba(11, 36, 35, .68); overflow-wrap: anywhere; }
.acct-plan { margin-top: 14px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: rgba(227, 179, 76, .3); }
.acct-note { margin: 12px 0 0; font-size: 13px; color: rgba(11, 36, 35, .68); }
.acct-out { margin-top: 14px; padding: 9px 16px; border-radius: 999px; font: 600 14px/1 var(--body); color: var(--ink); border: 1.5px solid rgba(11, 36, 35, .35); background: none; cursor: pointer; }
.acct-toast { position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); margin: 0; padding: 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 600; background: var(--blush); color: var(--ink); box-shadow: 0 10px 26px rgba(0, 0, 0, .4); max-width: calc(100vw - 32px); }
@media (max-width: 430px) { .acct summary span { display: none; } .acct summary { padding: 6px; } }

/* Tấm chắn đăng nhập (js/account.js): chưa đăng nhập thì không dùng được app. */
html.gated, html.gated body { overflow: hidden; }
#gate { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 50% 0%, #1d5a58 0%, #0f3b3a 55%, #0a2928 100%); color: #fff; }
.gate-card { width: min(100%, 420px); text-align: center; display: grid; gap: 16px; justify-items: center; }
.gate-brand { font: 600 18px/1 var(--display, serif); color: var(--brass, #f6c945); letter-spacing: .02em; }
.gate-card h1 { margin: 0; font: 600 clamp(28px, 7vw, 38px)/1.1 var(--display, serif); }
.gate-card p { margin: 0; font-size: 16px; line-height: 1.5; opacity: .85; }
.gate-go { display: inline-block; margin-top: 6px; padding: 15px 28px; border: 0; border-radius: 999px; font: 700 17px/1 var(--body, sans-serif); color: #1a1408; background: linear-gradient(#ffd76a, #f0b93a); box-shadow: 0 4px 0 #b98a1e; text-decoration: none; cursor: pointer; }
.gate-lang { margin-top: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; font: 500 14px/1 var(--body, sans-serif); }
.gate-lang option { color: #111; }
.acct-toast { z-index: 10001; }
.acct-link { display: block; margin-top: 12px; font: 600 14.5px/1.2 var(--body); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Mã mở khoá */
.tile .bezel { position: relative; }
.lock-tag { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; background: rgba(8, 28, 27, .82); color: #fff; font: 600 10.5px/1.2 var(--body); font-style: normal; white-space: nowrap; }
.lock-panel { position: fixed; z-index: 40; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(420px, calc(100vw - 28px)); padding: 20px; border-radius: 22px; background: var(--blush); color: var(--ink); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.lock-panel h2 { margin: 0 34px 14px 0; font: 600 20px/1.25 var(--display); }
.lock-panel form { display: grid; gap: 10px; }
.lock-panel form .cta { width: 100%; max-width: none; }
.lock-panel input { width: 100%; min-width: 0; text-align: center; padding: 15px 16px; border-radius: 12px; border: 1.5px solid rgba(11, 36, 35, .35); background: #fff; font: 600 20px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--ink); }
.lock-panel a { display: inline-block; margin-top: 12px; color: var(--ink); font: 600 14.5px/1.2 var(--body); text-underline-offset: 3px; }
.lock-msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; background: rgba(255, 122, 112, .25); }
.lock-msg.ok { background: rgba(15, 59, 58, .14); }
.lock-x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(11, 36, 35, .1); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.acct-del { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(11, 36, 35, .14); font-size: 13.5px; }
.acct-del summary { cursor: pointer; color: #9a2b1f; font-weight: 600; }
.acct-del form { display: flex; gap: 8px; margin-top: 10px; }
.acct-del input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 1.5px solid rgba(11, 36, 35, .3); font: 500 14px/1.2 var(--body); background: #fff; color: var(--ink); }
.acct-del button { padding: 9px 12px; border-radius: 10px; border: 0; background: #9a2b1f; color: #fff; font: 600 13.5px/1.1 var(--body); cursor: pointer; }
.acct-del button:disabled { opacity: .55; cursor: default; }

/* ---------- Chỉnh hiển thị cho điện thoại (nhất là Android) ---------- */
/* Android tự phóng chữ trong khối văn bản dài ("font boosting") và tự đổi màu khi máy bật giao diện tối:
   cả hai làm lệch bố cục và bảng màu nhung/đồng, nên tắt. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: only light; }
button, input, select, textarea { font-family: var(--body); }
img { max-width: 100%; }
/* Thanh nút quét: nền đặc đến hết hàng "Đang quét bộ", chỉ mờ dần ở mép trên, để chữ phía sau không lẫn vào. */
.cta-bar { padding-top: 34px; background: linear-gradient(to top, var(--velvet-deep) calc(100% - 34px), rgba(9, 42, 41, 0)); }
.pack { max-width: 100%; }
.pack select { max-width: 62vw; text-overflow: ellipsis; }
.create-btn { text-align: center; }
/* Màn hẹp (360 px trở xuống, hoặc máy đặt cỡ hiển thị lớn): thu lề và cỡ chữ tiêu đề cho khỏi chật. */
@media (max-width: 380px) {
  .home { padding-left: 18px; padding-right: 18px; }
  .tiles { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
  .hero-face { width: 124px; height: 124px; margin: 22px 0 38px 26px; }
  .hero h1 { font-size: clamp(29px, 9.2vw, 34px); }
  .create-card { margin-top: 28px; padding: 18px; }
  .cta-bar { padding-left: 18px; padding-right: 18px; }
  .sheet-card { padding-left: 18px; padding-right: 18px; }
  .lock-panel { padding: 18px; }
}
/* Hàng mẫu trượt ngang: điểm bắt dính phải tính cả lề, nếu không mẫu đầu dính sát mép màn hình. */
.tiles { scroll-padding-inline: 22px; }
@media (max-width: 380px) { .tiles { scroll-padding-inline: 18px; } .hero-face { margin-left: 36px; } }
@media (min-width: 700px) { .tiles { scroll-padding-inline: 40px; } }

/* ---------- Đặt in trên trang chủ: tờ giấy hồng duy nhất trên nền nhung, việc chính của cửa hàng ---------- */
.order-card {
  position: relative; margin-top: 34px; padding: 26px 22px 24px; border-radius: 26px 26px 26px 8px;
  background: var(--blush); color: var(--ink); box-shadow: 0 18px 34px rgba(4, 22, 21, .38);
}
.order-card h2 { margin: 0 0 10px; max-width: 13ch; font: 600 clamp(27px, 8vw, 34px)/1.1 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.order-card > p { margin: 0; max-width: 40ch; font-size: 15px; color: rgba(11, 36, 35, .78); }
/* Ba mặt nhẫn xếp chồng ở góc: gợi món đồ thật sẽ cầm trên tay. */
.order-faces { position: absolute; top: -18px; right: 18px; display: flex; }
.order-faces .bezel { width: 46px; padding: 0; border-radius: 22%; box-shadow: 0 6px 12px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .5); }
.order-faces .bezel::after { content: ""; position: absolute; inset: 14%; border-radius: 12%; background: repeating-conic-gradient(var(--velvet) 0 25%, #f1cc74 0 50%) 0 0 / 34% 34%; }
.order-faces .bezel:nth-child(1) { transform: rotate(-12deg) translate(14px, 6px); }
.order-faces .bezel:nth-child(2) { transform: rotate(5deg); z-index: 1; }
.order-faces .bezel:nth-child(3) { transform: rotate(16deg) translate(-12px, 8px); }
.order-faces .bezel:nth-child(1)::after { background-image: repeating-conic-gradient(var(--coral) 0 25%, #fff3ee 0 50%); }
.order-faces .bezel:nth-child(3)::after { background-image: repeating-conic-gradient(#1b5553 0 25%, var(--blush) 0 50%); }
.order-steps { list-style: none; counter-reset: ostep; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.order-steps li { counter-increment: ostep; display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.order-steps li::before { content: counter(ostep); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 600 14px/1 var(--display); background: var(--velvet); color: var(--blush); }
.order-cta { display: block; margin-top: 22px; max-width: none; text-align: center; text-decoration: none; box-shadow: 0 5px 0 var(--brass-dark), 0 12px 22px rgba(11, 36, 35, .22); }
.order-price { margin-top: 12px !important; text-align: center; font-size: 14px !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.create-card { margin-top: 22px; }
@media (max-width: 380px) { .order-card { padding: 24px 18px 22px; } .order-faces .bezel { width: 40px; } }
@media (min-width: 700px) {
  .order-card { display: grid; grid-template-columns: 1fr 260px; column-gap: 36px; align-items: center; padding: 34px; }
  .order-card h2, .order-card > p, .order-steps { grid-column: 1; }
  .order-card h2 { grid-row: 1; } .order-card > p:not(.order-price) { grid-row: 2; } .order-steps { grid-row: 3; }
  .order-card h2 { max-width: 16ch; font-size: 38px; }
  .order-cta { grid-column: 2; grid-row: 2; align-self: end; margin-top: 0; }
  .order-card > p.order-price { grid-column: 2; grid-row: 3; align-self: start; }
}

/* ---------- Trau chuốt sau đợt rà soát giao diện ---------- */
/* Tiêu đề không để một chữ rơi lẻ dòng cuối; đoạn văn ngắt dòng đều hơn. */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
/* Nút và mặt nhẫn phản hồi khi rê chuột và khi nhấn (trước đây chỉ nút chính có trạng thái nhấn). */
.cta, .ghost, .tile .bezel, .qty button, .chips button, .row-btns button, .row-btns a, .samples .rm, .samples .dl, .pay label, .acct-link, .create-btn { transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, filter .16s ease; }
@media (hover: hover) {
  .cta:hover:not(:disabled) { filter: brightness(1.05); }
  .ghost:hover { border-color: var(--brass); background-color: rgba(227, 179, 76, .1); }
  .tile:hover .bezel { transform: translateY(-3px) rotate(-2deg); }
  .row-btns button:hover, .row-btns a:hover, .samples .rm:hover, .samples .dl:hover, .qty button:hover { border-color: var(--ink); background-color: rgba(15, 59, 58, .08); }
  .chips button:hover { border-color: var(--brass); }
  .pay label:hover { border-color: rgba(15, 59, 58, .5); }
}
.ghost:active, .row-btns button:active, .row-btns a:active, .samples .rm:active, .samples .dl:active, .chips button:active { transform: scale(.97); }
/* Ô nhập đang chọn: viền đồng đậm thay cho viền mặc định mờ. */
.field:focus-visible, .lock-panel input:focus-visible, .acct-del input:focus-visible { border-color: var(--brass-dark); outline: 3px solid rgba(227, 179, 76, .45); outline-offset: 0; }
@media (prefers-reduced-motion: reduce) { .cta, .ghost, .tile .bezel, .qty button, .chips button, .row-btns button, .row-btns a, .pay label { transition: none; } }

/* ---------- Thư viện kỷ niệm: năm → tháng → lượt 12 ---------- */
.mem-nav { margin: -4px 0 14px; }
.mem-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -22px 8px; padding: 2px 22px 4px; scrollbar-width: none; }
.mem-row::-webkit-scrollbar { display: none; }
.mem-row button, .mem-pages button { flex: none; display: inline-flex; align-items: baseline; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid rgba(247, 228, 222, .32); background: none; color: #fff7f3; font: 600 15px/1 var(--body); cursor: pointer; }
.mem-row button small { font-size: 12px; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.mem-row.months button { min-height: 36px; font-size: 14px; text-transform: capitalize; }
.mem-row button[aria-pressed=true], .mem-pages button[aria-pressed=true] { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.mem-row button[aria-pressed=true] small { opacity: .8; }
.mem-where { margin: 6px 0 0; font-size: 13.5px; color: rgba(247, 228, 222, .72); text-transform: none; }
.mem-where::first-letter { text-transform: uppercase; }
.mem-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mem-pages button { min-width: 40px; justify-content: center; padding: 0 10px; font-variant-numeric: tabular-nums; }
.mem-status { margin: 8px 0 0; min-height: 1.2em; font-size: 13.5px; color: var(--brass); }
.mem-status:empty { display: none; }
.mem-keep { margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(227, 179, 76, .32); background: rgba(9, 42, 41, .45); }
.mem-keep label { display: flex; align-items: center; gap: 10px; font: 600 15px/1.3 var(--body); color: #fff7f3; cursor: pointer; }
.mem-keep input { width: 20px; height: 20px; accent-color: var(--brass); flex: none; }
.mem-keep p { margin: 6px 0 0 30px; font-size: 13px; line-height: 1.45; color: rgba(247, 228, 222, .72); }
@media (max-width: 380px) { .mem-row { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; } }
@media (min-width: 700px) { .mem-row { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; } }
/* Nút năm/tháng: chữ giữa nút; con số nhỏ, mờ. */
.mem-row button, .mem-pages button { align-items: center; }
/* Kỷ niệm của khách là một thư viện: lưới ba cột (bốn cột trên màn rộng) cho cả lượt 12, không trượt ngang. */
.collection.mine .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; margin: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
.collection.mine .tile { flex: none; width: auto; min-width: 0; align-self: start; display: flex; flex-direction: column; justify-content: flex-start; }
.collection.mine .tile .bezel { width: 100%; height: auto; aspect-ratio: 1; }
.collection.mine .tile span { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 520px) { .collection.mine .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; } }
@media (min-width: 700px) { .collection.mine .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
