@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Inter:wght@300;400;500;600&display=swap");

:root {
  color-scheme: dark;
  --bg: #13110d;
  --bg-soft: #1a1812;
  --bg-2: #1f1c16;
  --bg-3: #2a2620;
  --line: rgba(216, 195, 142, 0.08);
  --line-2: rgba(216, 195, 142, 0.16);
  --ink: #f1ead8;
  --ink-2: #ada593;
  --ink-3: #6f6757;
  --gold: #d8c38e;
  --gold-2: #ecd9a3;
  --gold-dim: #8a7547;
  --rose: #d27e63;
  --danger: #cf6e6e;
  --success: #8fc08a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --radius: 6px;
  --radius-sm: 3px;
  --serif: "Fraunces", "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Inter", system-ui, "Hiragino Kaku Gothic ProN", sans-serif;
}

* {
  box-sizing: border-box;
}

*:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 12% 6%, rgba(216, 195, 142, 0.05), transparent 60%),
    radial-gradient(ellipse 40% 50% at 90% 92%, rgba(210, 126, 99, 0.04), transparent 60%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 0.9rem max(1.6rem, calc((100% - 1180px) / 2 + 1.6rem));
  background: rgba(19, 17, 13, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 36px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.brand-beta {
  display: inline-block;
  padding: 0.12rem 0.42rem;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  background: rgba(216, 195, 142, 0.06);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-title {
  min-width: 0;
  margin-left: auto;
  text-align: right;
}

.login-panel {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.login-status {
  max-width: 260px;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: right;
}

.header-login-button {
  min-height: 38px;
  white-space: nowrap;
  border-color: var(--gold-dim);
  color: var(--gold-2);
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
}

.header-login-button:hover {
  background: rgba(216, 195, 142, 0.08);
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-variation-settings: "opsz" 144;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  font-variation-settings: "opsz" 144;
}

main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 2.4rem auto 4rem;
}

.store-intro {
  margin-bottom: 1.35rem;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.store-intro h2 {
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
  font-variation-settings: "opsz" 144;
}

.store-intro p {
  margin-bottom: 0;
  color: var(--ink-3);
}

.result-panel,
.notice-panel {
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.result-panel {
  max-width: 680px;
  margin: 0 auto;
}

.result-panel h2,
.notice-panel h2 {
  margin-bottom: 0.6rem;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0;
  font-variation-settings: "opsz" 144;
}

.result-panel p,
.notice-panel p {
  margin-bottom: 0;
  color: var(--ink-2);
}

.result-panel p + p {
  margin-top: 0.75rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 0;
}

.product-card {
  position: relative;
  display: flex;
  min-height: 232px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  animation: rise 0.7s var(--ease) both;
  transition:
    transform 0.32s var(--ease),
    border-color 0.28s var(--ease),
    box-shadow 0.32s var(--ease);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}

.product-card-muted {
  min-height: 140px;
  opacity: 0.72;
}

.product-card-limited {
  background:
    linear-gradient(145deg, rgba(210, 126, 99, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(216, 195, 142, 0.08), transparent 34%),
    var(--bg-soft);
  border-color: rgba(210, 126, 99, 0.72);
  box-shadow:
    0 0 0 1px rgba(216, 195, 142, 0.18) inset,
    0 16px 42px rgba(0, 0, 0, 0.32);
}

.product-card-limited::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--rose), var(--gold-2));
}

.product-card-limited:hover {
  border-color: rgba(236, 217, 163, 0.82);
  box-shadow:
    0 0 0 1px rgba(236, 217, 163, 0.22) inset,
    0 22px 56px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(210, 126, 99, 0.18);
}

.product-kicker {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.25rem 0.62rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--rose), var(--gold));
  color: var(--bg);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(210, 126, 99, 0.24);
}

.product-card h3 {
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  font-variation-settings: "opsz" 36;
}

.product-description {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.6;
}

.product-detail-list {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0 0;
}

.product-detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.product-detail-row dt {
  color: var(--ink-3);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.product-detail-row dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.sale-countdown {
  color: var(--gold-2);
}

.product-actions {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 0.9rem;
}

.price-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.1rem;
}

.price {
  display: block;
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.benefit {
  color: var(--ink-3);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.product-actions button {
  width: 100%;
}

.store-secondary-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.35rem;
}

.store-secondary-actions .manage-button {
  min-width: min(100%, 280px);
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 1.25rem;
  color: var(--ink-3);
  font-size: 0.82rem;
}

.store-links a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.store-links a:hover {
  color: var(--gold-2);
}

.contact-link {
  cursor: pointer;
}

button,
.link-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0.72rem 1.25rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

button:hover,
.link-button:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.buy-button,
.subscribe-button,
.confirm-button,
.link-button {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
  font-weight: 600;
}

.confirm-button:disabled {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}

.buy-button:hover,
.subscribe-button:hover,
.confirm-button:hover,
.link-button:hover {
  background: var(--gold-2);
  border-color: var(--gold-2);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(216, 195, 142, 0.25);
}

button:disabled:hover {
  border-color: var(--line-2);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.secondary-button {
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover {
  background: rgba(216, 195, 142, 0.06);
}

.result-panel .link-button {
  margin-top: 1.25rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s var(--ease);
}

.modal-backdrop[hidden] {
  display: none;
}

.purchase-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 1.8rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.purchase-modal h2 {
  margin-bottom: 1rem;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  font-variation-settings: "opsz" 144;
}

.terms-dialog {
  width: min(600px, 100%);
}

.policy-only-mode .terms-dialog {
  width: min(820px, 100%);
}

.policy-only-mode .terms-check-row,
.policy-only-mode .modal-actions {
  display: none;
}

.policy-only-mode .policy-detail {
  margin-top: 0;
}

.terms-check-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.terms-check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.policy-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.policy-link:hover {
  color: var(--gold-2);
}

.policy-detail {
  margin: 1rem auto 0;
  width: min(100%, 720px);
  max-width: 500px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  text-align: left;
}

.policy-only-mode .policy-detail {
  max-width: 720px;
}

.policy-detail[hidden] {
  display: none;
}

.policy-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line-2);
  background: rgba(216, 195, 142, 0.04);
}

.policy-detail h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 500;
}

.policy-close-button {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0.2rem 0.6rem;
  border-color: transparent;
  color: var(--ink-3);
  font-size: 0.78rem;
}

.policy-close-button:hover {
  background: rgba(216, 195, 142, 0.06);
  color: var(--gold);
}

.policy-detail-body {
  max-height: 300px;
  overflow: auto;
  padding: 0.8rem;
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.policy-detail-body-html {
  white-space: normal;
}

.legal-document {
  color: var(--ink-2);
}

.legal-document-title {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.legal-info-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid var(--line-2);
  background: rgba(19, 17, 13, 0.34);
}

.legal-info-table th,
.legal-info-table td {
  border: 1px solid var(--line-2);
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.legal-info-table th {
  width: 32%;
  background: rgba(216, 195, 142, 0.07);
  color: var(--gold-2);
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
}

.legal-info-table td {
  color: var(--ink-2);
  line-height: 1.65;
}

.legal-info-table p {
  margin: 0;
}

.legal-info-table p + p {
  margin-top: 0.35rem;
}

.legal-info-table a {
  color: var(--gold);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.confirm-button {
  min-width: 148px;
}

.account-dialog {
  width: min(500px, 100%);
}

.account-note {
  margin-bottom: 1.4rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
}

.account-buttons {
  display: grid;
  gap: 0.75rem;
  width: min(300px, 100%);
  margin: 0 auto;
}

.steam-account-button {
  min-height: 58px;
  width: 100%;
  font-size: 1rem;
  line-height: 1.2;
}

.steam-account-button {
  background: rgba(216, 195, 142, 0.08);
  border-color: var(--gold-dim);
  color: var(--gold-2);
}

.steam-account-button:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.text-cancel-button {
  min-height: auto;
  margin-top: 0.9rem;
  border-color: transparent;
  color: var(--ink-3);
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
}

.text-cancel-button:hover {
  background: transparent;
  color: var(--gold);
  transform: none;
}

.notice-panel {
  margin-top: 1.25rem;
  background: rgba(207, 110, 110, 0.1);
  border-color: rgba(207, 110, 110, 0.45);
}

.notice-panel h2 {
  color: var(--danger);
}

footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  color: var(--ink-3);
  font-size: 0.74rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 641px) and (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
  }

  .brand-logo {
    height: 28px;
  }

  .brand-beta {
    display: none;
  }

  .site-title {
    text-align: right;
  }

  .login-panel {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 0.65rem;
  }

  .login-status {
    max-width: none;
    text-align: left;
  }

  .header-login-button {
    width: auto;
    min-width: 132px;
  }

  .eyebrow {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.15rem;
  }

  main {
    width: min(100% - 28px, 1180px);
    margin-top: 1.4rem;
  }

  button,
  .link-button {
    width: 100%;
  }

  .login-panel .header-login-button {
    width: auto;
  }

  .policy-close-button {
    width: auto;
  }

  .store-secondary-actions {
    justify-content: stretch;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .purchase-modal {
    padding: 1.35rem 1rem;
  }

  .terms-check-row {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .legal-info-table,
  .legal-info-table tbody,
  .legal-info-table tr,
  .legal-info-table th,
  .legal-info-table td {
    display: block;
    width: 100%;
  }

  .legal-info-table th {
    border-bottom: 0;
  }
}
