:root {
  color-scheme: dark;
  --bg: #08060d;
  --surface: #100d16;
  --surface-2: #15111d;
  --surface-3: #1b1525;
  --line: #2a2236;
  --line-strong: #403153;
  --text: #f5f1fa;
  --muted: #a79daf;
  --accent: #a970ff;
  --accent-2: #d56bff;
  --success: #72e3a6;
  --shadow: 0 26px 80px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: #08060d; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(126, 52, 190, .22), transparent 32rem),
    radial-gradient(ellipse at 88% 38%, rgba(65, 33, 103, .19), transparent 37rem),
    linear-gradient(180deg, #09060f 0%, #07050b 56%, #0d0713 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(180deg, rgba(8, 5, 13, .84) 0%, rgba(7, 5, 11, .93) 58%, rgba(11, 6, 16, .98) 100%),
    url("assets/brand/site-background.webp") center top / cover no-repeat;
}

body::after {
  opacity: .32;
  background-image:
    linear-gradient(rgba(191, 121, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 121, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(8, 6, 13, .88);
  backdrop-filter: blur(18px);
}

.header-inner,
main {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  object-fit: cover;
}

.brand span {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: .055em;
}

.header-spacer { flex: 1; }

.social-links {
  display: flex;
  align-items: center;
  gap: 7px;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: #b9adca;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.social-links a:hover {
  color: #fff;
  border-color: #67468a;
  background: #1b1325;
  transform: translateY(-1px);
}

.social-links svg { width: 19px; height: 19px; fill: currentColor; }

.server-button {
  min-height: 45px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  padding: 7px 12px 7px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}

.server-button:hover { border-color: #5a3c76; background: var(--surface-2); }
.server-button span { grid-column: 1; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .11em; }
.server-button strong { grid-column: 1; font-size: 12px; letter-spacing: .04em; }
.server-button svg { grid-column: 2; grid-row: 1 / 3; width: 17px; fill: none; stroke: var(--accent); stroke-width: 1.8; }

main {
  flex: 1;
  min-height: calc(100svh - 76px);
  position: relative;
  z-index: 1;
  padding: 58px 0 72px;
}

.shop-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.overline {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 62px);
  line-height: .98;
  letter-spacing: -.055em;
}

.intro-copy { margin: 14px 0 0; color: var(--muted); font-size: 15px; }

.store {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #0d0a12;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.category-tab {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: color .18s ease, background .18s ease;
}

.category-tab:hover { color: var(--text); }
.category-tab.is-active { background: var(--surface-3); color: var(--text); }

.product-list {
  max-height: 592px;
  overflow-y: auto;
  padding: 8px;
  scrollbar-color: #4c3864 transparent;
  scrollbar-width: thin;
}

.product-list-item {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease;
}

.product-list-item + .product-list-item { margin-top: 3px; }
.product-list-item:hover { background: rgba(255, 255, 255, .035); }
.product-list-item.is-active { background: #191320; border-color: #3a2a4b; }

.product-list-item img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: #09070d;
}

.product-list-copy { min-width: 0; }
.product-list-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.product-list-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.list-price { color: #d7c8e5; font-size: 12px; font-weight: 750; white-space: nowrap; }
.product-list-item.is-active .list-price { color: var(--accent-2); }

.product-detail {
  min-width: 0;
  padding: 32px;
  background: radial-gradient(circle at 76% 8%, var(--product-glow, rgba(169, 112, 255, .14)), transparent 24rem), var(--surface);
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(210px, 290px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.detail-image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 17px;
  background: #09070d;
}

.detail-image-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-type { display: inline-block; margin-bottom: 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.detail-copy h2 {
  margin: 0;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -.04em;
}

.detail-description { max-width: 48ch; margin: 13px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.period-label { display: block; margin-bottom: 8px; color: #c9bdcf; font-size: 11px; font-weight: 700; }

.period-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #0b0810; }
.period-button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; }
.period-button.is-active { background: #2b1d38; color: var(--text); }

.buy-row { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.detail-price { display: flex; flex-direction: column; min-width: 96px; }
.detail-price span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.detail-price strong { margin-top: 3px; font-size: 25px; letter-spacing: -.03em; }

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.primary-button { border: 1px solid #ba78ff; background: linear-gradient(135deg, #9753e8, #bc5dea); color: white; box-shadow: 0 10px 24px rgba(159, 75, 220, .18); }
.primary-button:hover { filter: brightness(1.08); }
.secondary-button { border: 1px solid var(--line-strong); background: #1b1424; color: var(--text); }
.secondary-button:hover { border-color: #674b83; }

.detail-divider { height: 1px; margin: 30px 0 24px; background: var(--line); }
.feature-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.feature-heading h3 { margin: 0; font-size: 16px; }
.feature-heading span { color: var(--muted); font-size: 11px; }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.feature-grid li { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #261f2f; border-radius: 10px; background: rgba(255, 255, 255, .018); color: #d9d1df; font-size: 12px; line-height: 1.35; }
.feature-grid li::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(169, 112, 255, .5); }

.inherit-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; }
.case-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid #31273c; border-radius: 10px; background: rgba(169, 112, 255, .055); color: #cfc5d6; font-size: 12px; line-height: 1.5; }

.purchase-note {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.purchase-note div { display: flex; align-items: center; gap: 12px; padding: 17px 20px; background: #0e0b13; }
.purchase-note span { color: var(--accent); font-size: 11px; font-weight: 850; }
.purchase-note p { margin: 0; color: var(--muted); font-size: 12px; }
.purchase-note strong { color: var(--text); font-weight: 700; }

.order-dialog {
  width: min(470px, calc(100% - 28px));
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: #100c16;
  color: var(--text);
  box-shadow: var(--shadow);
}
.order-dialog::backdrop { background: rgba(5, 3, 8, .78); backdrop-filter: blur(5px); }
.order-dialog h2 { margin: 0 0 20px; font-size: 28px; letter-spacing: -.04em; }
.dialog-close { position: absolute; top: 14px; right: 15px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #18121f; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }
.order-summary { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 13px; margin-bottom: 20px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #0b0810; }
.order-summary img { border-radius: 9px; object-fit: cover; }
.order-summary strong, .order-summary span { display: block; }
.order-summary strong { font-size: 13px; }
.order-summary span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.order-summary b { color: var(--accent-2); font-size: 15px; white-space: nowrap; }
.field-label { display: block; margin-bottom: 8px; color: #d6ccdc; font-size: 12px; font-weight: 700; }
.nickname-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); outline: 0; border-radius: 10px; background: #0a070e; color: var(--text); }
.nickname-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(169, 112, 255, .12); }
.currency-order-fields { margin-top: 14px; }
.currency-result { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.currency-result strong { color: var(--text); }
.dialog-submit { width: 100%; margin-top: 12px; }
.dialog-hint { margin: 11px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; max-width: calc(100% - 28px); padding: 11px 15px; border: 1px solid #4c3860; border-radius: 10px; background: #171020; color: var(--text); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; box-shadow: 0 16px 44px rgba(0, 0, 0, .4); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .store { grid-template-columns: 300px minmax(0, 1fr); }
  .detail-top { grid-template-columns: 180px minmax(0, 1fr); gap: 22px; }
  .product-detail { padding: 24px; }
  .feature-grid { grid-template-columns: 1fr; }
  .brand { margin-right: auto; }
}

@media (max-width: 700px) {
  .header-inner, main { width: min(100% - 24px, 1180px); }
  .header-inner { height: 66px; }
  .header-inner { gap: 12px; }
  .brand img { width: 40px; height: 40px; }
  .brand span { font-size: 14px; }
  .server-button { min-height: 40px; padding: 6px 9px 6px 11px; }
  .server-button span { display: none; }
  .server-button strong { font-size: 10px; }
  .server-button svg { width: 15px; grid-row: 1; }
  main { padding: 36px 0 26px; }
  .shop-intro { align-items: flex-start; margin-bottom: 20px; }
  .intro-copy { max-width: 31ch; font-size: 13px; }
  .store { display: block; min-height: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .catalog-panel { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
  .product-list { display: flex; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 8px; scroll-snap-type: x proximity; }
  .product-list-item { min-width: 190px; min-height: 70px; grid-template-columns: 48px minmax(0, 1fr); scroll-snap-align: start; }
  .product-list-item img { width: 48px; height: 48px; }
  .list-price { grid-column: 2; margin-top: -14px; font-size: 10px; }
  .product-detail { margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; }
  .detail-top { grid-template-columns: 108px minmax(0, 1fr); gap: 16px; align-items: start; }
  .product-type { margin-bottom: 7px; font-size: 9px; }
  .detail-copy h2 { font-size: 24px; }
  .detail-description { margin: 8px 0 14px; font-size: 12px; line-height: 1.45; }
  .period-label { display: none; }
  .period-button { min-height: 33px; padding-inline: 10px; font-size: 10px; }
  .buy-row { grid-column: 1 / -1; margin-top: 15px; }
  .detail-price strong { font-size: 22px; }
  .primary-button, .secondary-button { min-height: 44px; padding-inline: 15px; font-size: 12px; }
  .detail-divider { margin: 22px 0 18px; }
  .feature-heading span { display: none; }
  .feature-grid li { min-height: 44px; }
  .purchase-note { grid-template-columns: 1fr; }
  .purchase-note div { padding: 13px 16px; }
}

@media (max-width: 430px) {
  .brand span { display: none; }
  .social-links a { width: 36px; height: 36px; }
  .social-links svg { width: 17px; height: 17px; }
  .shop-intro h1 { font-size: 42px; }
  .detail-top { grid-template-columns: 94px minmax(0, 1fr); gap: 13px; }
  .buy-row { align-items: stretch; flex-direction: column; gap: 10px; }
  .detail-price { flex-direction: row; align-items: baseline; gap: 8px; }
  .detail-price strong { margin-top: 0; }
  .primary-button, .secondary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
