/* ===== Chicky theme ===== */
:root {
  --bg: #FFF8E7;
  --bg-dots: rgba(255, 183, 3, .10);
  --surface: #FFFFFF;
  --surface-2: #FFF3CF;
  --text: #3D2B1F;
  --muted: #8A7560;
  --line: #F1E3C2;
  --yellow: #FFD23F;
  --yellow-deep: #FFB703;
  --orange: #F2645A;
  --orange-deep: #D4483F;
  --teal: #5BC0D6;
  --mint: #9FD5B0;
  --retro-ink: #1E1A10;
  --on-accent: #FFFFFF;
  --ok: #1F9D57;   --ok-bg: #DDF5E6;
  --warn: #B26A00; --warn-bg: #FFEFC7;
  --info: #2F6FD0; --info-bg: #E2EDFF;
  --danger: #D93A40; --danger-bg: #FDE3E4;
  --shadow: 0 6px 22px rgba(170, 115, 20, .13);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1610; --bg-dots: rgba(255, 210, 63, .05);
    --surface: #282017; --surface-2: #362A1B;
    --text: #FFF3DA; --muted: #C4B08F; --line: #43362A;
    --ok: #5BD08F; --ok-bg: #173424; --warn: #FFC857; --warn-bg: #3A2C10;
    --info: #8DB6FF; --info-bg: #1B2940; --danger: #FF8A8E; --danger-bg: #3D1C1E;
    --shadow: 0 6px 22px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1610; --bg-dots: rgba(255, 210, 63, .05);
  --surface: #282017; --surface-2: #362A1B;
  --text: #FFF3DA; --muted: #C4B08F; --line: #43362A;
  --ok: #5BD08F; --ok-bg: #173424; --warn: #FFC857; --warn-bg: #3A2C10;
  --info: #8DB6FF; --info-bg: #1B2940; --danger: #FF8A8E; --danger-bg: #3D1C1E;
  --shadow: 0 6px 22px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Prompt', system-ui, sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--bg) radial-gradient(var(--bg-dots) 2px, transparent 2.5px) 0 0 / 22px 22px;
  min-height: 100vh;
  line-height: 1.5;
}
h1, h2, h3, .display { font-family: 'Mitr', 'Prompt', sans-serif; font-weight: 500; margin: 0; line-height: 1.25; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--orange-deep); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* ----- layout ----- */
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

.hero {
  background: linear-gradient(100deg, var(--teal) 0%, var(--mint) 45%, #E6DC74 100%);
  color: #3D2B1F;
  padding: 18px 0 34px;
  position: relative;
}
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px;
  background: var(--bg);
  -webkit-mask: radial-gradient(14px 12px at 14px 0, transparent 98%, #000) 0 0 / 28px 22px repeat-x;
          mask: radial-gradient(14px 12px at 14px 0, transparent 98%, #000) 0 0 / 28px 22px repeat-x;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mascot { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.08)); }
@media (prefers-reduced-motion: no-preference) {
  .mascot { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
  @keyframes bob { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-2px); } }
}
.brand h1 {
  font-family: 'Mitr', sans-serif; font-weight: 600; font-size: 1.6rem; letter-spacing: .5px;
  color: var(--orange); -webkit-text-stroke: 1px var(--retro-ink);
  text-shadow: 1px 1px 0 var(--retro-ink), 2px 2px 0 var(--retro-ink), 3px 3px 0 var(--retro-ink);
}
.brand p { margin: 0; font-size: .85rem; opacity: .8; }
.hello { margin-top: 10px; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.hello img { width: 24px; height: 24px; border-radius: 50%; }

main { padding: 8px 0 110px; }

/* ----- cards ----- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { font-size: 1.1rem; margin-bottom: 10px; }
.section-title { font-family: 'Mitr', sans-serif; font-weight: 500; font-size: 1.05rem; margin: 18px 4px 10px; display: flex; align-items: center; gap: 6px; }

/* retro poster heading (MOVIE / LINE) */
.retro-title {
  font-family: 'Mitr', sans-serif; font-weight: 600; font-size: 1.9rem; letter-spacing: 1px; text-align: center;
  color: var(--orange); -webkit-text-stroke: 1.2px var(--retro-ink); margin: 18px 0 12px;
  text-shadow: 1px 1px 0 var(--retro-ink), 2px 2px 0 var(--retro-ink), 3px 3px 0 var(--retro-ink), 4px 4px 0 var(--retro-ink);
}

/* ----- chips ----- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 2px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-weight: 400; cursor: pointer; font-size: .9rem;
}
.chip[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow-deep); color: #3D2B1F; font-weight: 500; }

/* ----- product list ----- */
.products { display: grid; gap: 12px; }
.product {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
  transition: transform .12s ease;
}
.product:active { transform: scale(.98); }
.product.soldout { opacity: .55; cursor: not-allowed; }
.p-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem;
  background: color-mix(in srgb, var(--c, var(--yellow)) 16%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--c, var(--yellow)) 45%, transparent);
  overflow: hidden;
}
.p-icon img { width: 100%; height: 100%; object-fit: cover; }
.product > span:nth-child(2) { min-width: 0; }
.p-name { display: block; font-weight: 500; }
.p-desc { display: block; color: var(--muted); font-size: .82rem; }
.p-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.p-price { font-family: 'Mitr', sans-serif; font-weight: 500; font-size: 1.15rem; color: var(--orange-deep); white-space: nowrap; text-align: right; }
.p-price small { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); }
.badge.strike { text-decoration: line-through; opacity: .6; }

/* variant picker — graph-paper note like the menu */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.option {
  display: grid; gap: 2px; justify-items: center; padding: 12px 8px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 16px; font-weight: 400;
  background: var(--surface) linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 12px;
}
.option[aria-checked="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 25%, transparent); background-color: color-mix(in srgb, var(--orange) 8%, var(--surface)); }
.option[disabled] { opacity: .5; cursor: not-allowed; }
.o-name { font-weight: 500; }
.o-price { font-family: 'Mitr', sans-serif; font-weight: 500; color: var(--orange-deep); font-size: 1.1rem; }

/* ----- badges / pills ----- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 12px 18px; font-weight: 500; cursor: pointer;
  background: var(--surface-2); color: var(--text); text-decoration: none; min-height: 46px;
}
.btn.primary { background: linear-gradient(180deg, #F7837A, var(--orange)); color: var(--on-accent); box-shadow: 0 4px 0 var(--orange-deep); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--orange-deep); }
.btn.yellow { background: var(--yellow); color: #3D2B1F; box-shadow: 0 4px 0 var(--yellow-deep); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 6px 12px; border-radius: 12px; font-size: .85rem; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

/* ----- form ----- */
label.field { display: block; margin: 12px 0; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.input, textarea.input, select.input {
  width: 100%; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; font-weight: 400;
}
.input:focus { outline: none; border-color: var(--yellow-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 35%, transparent); }

/* ----- key/value rows with copy ----- */
.kv { display: grid; gap: 8px; }
.kv-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.kv-row .k { font-size: .78rem; color: var(--muted); }
.kv-row .v { font-weight: 500; overflow-wrap: anywhere; }
.kv-row > div { flex: 1; min-width: 0; }
.copy { border: 0; background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: .8rem; cursor: pointer; flex: none; box-shadow: 0 1px 0 var(--line); }

/* ----- payment ----- */
.amount-big { font-family: 'Mitr', sans-serif; font-size: 2.2rem; font-weight: 600; color: var(--orange-deep); text-align: center; line-height: 1.1; }
.countdown { text-align: center; font-size: .9rem; color: var(--muted); margin-top: 4px; }
.countdown b { color: var(--text); }
.qr-box { background: #fff; border-radius: 18px; padding: 14px; margin: 14px auto 6px; max-width: 280px; text-align: center; border: 3px solid var(--yellow); }
.qr-box .pp { font-family: 'Mitr', sans-serif; font-weight: 500; color: #0E3D6B; font-size: .9rem; margin-bottom: 6px; }
.qr-box img { width: 100%; image-rendering: pixelated; display: block; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); color: #3D2B1F; font-weight: 600; display: grid; place-items: center; font-size: .8rem; }

.status-hero { text-align: center; padding: 22px 16px; }
.status-hero .emoji { font-size: 3rem; line-height: 1; }
.status-hero h2 { margin: 10px 0 4px; font-size: 1.25rem; }
@media (prefers-reduced-motion: no-preference) {
  .pop { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}

/* ----- subscriptions ----- */
.sub-card .btn-row { margin-top: 12px; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.meter.warn span { background: var(--yellow-deep); }
.meter.danger span { background: var(--danger); }

/* ----- order list ----- */
.order-item { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.order-item .grow { flex: 1; min-width: 0; }
.order-item .code { font-size: .78rem; color: var(--muted); }

/* ----- tab bar ----- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 260px; text-align: center; text-decoration: none; color: var(--muted);
  padding: 8px; border-radius: 14px; font-weight: 500; font-size: .9rem;
}
.tabbar a[aria-current="page"] { background: var(--yellow); color: #3D2B1F; }

/* ----- bottom sheet ----- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(40, 25, 5, .45); }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: 26px 26px 0 0; padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
}
.sheet-panel::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
@media (prefers-reduced-motion: no-preference) {
  .sheet-panel { animation: up .25s ease-out; }
  @keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
}

/* ----- toast ----- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  background: #3D2B1F; color: #FFF3DA; padding: 10px 16px; border-radius: 14px; font-size: .9rem;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty img { width: 72px; opacity: .9; }
.skeleton { height: 80px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ===== admin ===== */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin .wrap { max-width: 1100px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 0; background: rgba(255, 255, 255, .55); color: #3D2B1F; padding: 8px 14px; border-radius: 12px; cursor: pointer; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--retro-ink); color: #FFE27A; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; color: var(--muted); }
.stat .value { font-family: 'Mitr', sans-serif; font-size: 1.6rem; font-weight: 500; }
.stat.hot { background: var(--yellow); color: #3D2B1F; }
.stat.hot .label { color: #6B5420; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 8px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { width: auto; flex: 1; min-width: 160px; }
.slip-img { max-width: 100%; border-radius: 12px; border: 2px solid var(--line); display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.admin .sheet { align-items: center; padding: 16px; }
.admin .sheet-panel { border-radius: 22px; max-width: 720px; max-height: 90vh; }
.admin .sheet-panel::before { display: none; }
@media (max-width: 640px) { .admin .table .hide-sm { display: none; } }
