:root {
  color-scheme: dark;
  --canvas: #060e18;
  --surface: #0c1929;
  --line: #2a4053;
  --cyan: #41eff3;
  --text: #f0f7fa;
  --muted: #afc0d0;
  --display: "Bahnschrift Condensed", "Arial Narrow", "Franklin Gothic Medium", system-ui, sans-serif;
  --foil: var(--foil-grain) center / cover no-repeat, linear-gradient(120deg, #a5b6d5, #f8f2ea 35%, #b9dbe5 66%, #ddd9e8);
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 83% 0, #12293b 0, transparent 38rem), var(--canvas);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button {
  padding: .6rem 1rem;
  border: 1px solid #456274;
  border-radius: .45rem;
  background: #152938;
  color: var(--text);
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.25;
}
button:hover { border-color: var(--cyan); background: #193b48; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
button:disabled { opacity: .6; cursor: default; }
::selection { color: #042128; background: var(--cyan); }

header, main {
  width: min(100% - clamp(2rem, 8vw, 8rem), 76rem);
  margin-inline: auto;
}
header {
  display: flex;
  align-items: center;
  gap: clamp(.85rem, 2.4vw, 2.2rem);
  min-height: 4.9rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  flex: none;
  width: 8.6rem;
  height: 2.75rem;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--brand-logo) center left / contain no-repeat;
  mix-blend-mode: screen;
  filter: contrast(1.13);
  text-indent: 110%;
  white-space: nowrap;
}
.brand:hover { background: var(--brand-logo) center left / contain no-repeat; filter: brightness(1.15) contrast(1.13); }
.site-nav { display: flex; flex: 1; align-items: center; flex-wrap: wrap; column-gap: .15rem; }
.site-nav button {
  position: relative;
  min-height: 2.75rem;
  padding-inline: clamp(.5rem, 1vw, 1rem);
  border: 0;
  background: transparent;
  color: #c1cdd7;
}
.site-nav button:hover, .site-nav button.active { background: #112a38; color: var(--cyan); }
.site-nav button.active::after, .header-tools button.active::after {
  position: absolute;
  right: .65rem;
  bottom: .17rem;
  left: .65rem;
  height: 2px;
  background: var(--cyan);
  content: "";
}
.header-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: clamp(.2rem, .8vw, .65rem);
}
.header-tools button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2.9rem;
  min-height: 3.2rem;
  padding: .25rem;
  border: 0;
  background: transparent;
}
.header-tools button:is(:hover, .active), .language-picker:hover { background-color: #132d3d; }
.header-tools .basket-link { width: 4.25rem; }
.scan-page {
  max-width: 39rem;
  margin: clamp(1rem, 5vw, 3rem) auto;
  padding: clamp(1.2rem, 4vw, 2.4rem);
  border: 1px solid #345365;
  border-radius: .85rem;
  background: linear-gradient(150deg, #10293a, var(--surface) 62%);
}
.scan-page h1 { margin: 0; font: italic 800 clamp(2rem, 6vw, 3rem)/1.1 var(--display); }
.scan-page p { color: var(--muted); }
.scan-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1.5rem; }
.scan-text-form { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.scan-text-form input { width: 100%; }
.scan-text-form button { margin-top: .6rem; }
.scan-phone span, .scan-phone a { display: block; }
.scan-phone a { color: var(--cyan); overflow-wrap: anywhere; user-select: all; }
#scan-enable-phone { margin-top: 1.5rem; }
.scan-page .notice { color: var(--text); }
.basket-icon {
  width: 3.5rem;
  height: 2.8rem;
  margin-inline-end: .38rem;
  background: var(--cart-empty-art) center / contain no-repeat;
}
.basket-link[data-basket="full"] .basket-icon { background-image: var(--cart-full-art); }
.basket-count {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  min-width: 1.24rem;
  padding: 0 .24rem;
  border: 1px solid #6f8998;
  border-radius: 2rem;
  background: #112434;
  color: #f0f8fc;
  font: 700 .72rem/1.1rem "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.basket-link[data-basket="full"] .basket-count { border-color: #b6fcff; background: var(--cyan); color: #04252c; }
.account-icon {
  --medal-highlight: #c45059;
  --medal-top: #9e2036;
  --medal-base: #470d1d;
  position: relative;
  display: block;
  width: 2.38rem;
  height: 2.38rem;
  border: 2px solid transparent;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 32% 14%, var(--medal-highlight), transparent 55%) padding-box,
    linear-gradient(148deg, var(--medal-top), var(--medal-base)) padding-box,
    linear-gradient(140deg, #fff5c9, #be842f 32%, #ffe9a4 55%, #a56723 87%) border-box;
  box-shadow: inset 0 0 0 1px #0005, 0 2px 6px #0005;
}
.account-link[data-session="member"] .account-icon {
  --medal-highlight: #4a9f6b;
  --medal-top: #147047;
  --medal-base: #073820;
}
.account-link[data-session="loading"] .account-icon {
  --medal-highlight: #728396;
  --medal-top: #516371;
  --medal-base: #263545;
}
.account-icon::after {
  content: "";
  position: absolute;
  inset: 12%;
  background: linear-gradient(130deg, #fff6cf, #ffe2a3 51%, #dbab50);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='black' stroke-width='2.35' stroke-linejoin='round'%3E%3Ccircle cx='16' cy='10' r='6.3'/%3E%3Cpath d='M4.6 27.1c.8-6.1 5.1-9.4 11.4-9.4s10.6 3.3 11.4 9.4c-6-2-8.3 2-11.4 2s-5.4-4-11.4-2Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.account-link[data-session="member"] .account-icon::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: -.22rem;
  bottom: -.1rem;
  width: .84rem;
  height: .84rem;
  border: 1px solid #efdda7;
  border-radius: 50%;
  background: #124a32 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='m3 7 2.5 2.5L11 4' fill='none' stroke='%23fff2c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.language-picker {
  position: relative;
  display: grid;
  flex: none;
  align-items: center;
  margin: 0;
  border-radius: .45rem;
}
.language-picker .language-globe {
  position: absolute;
  inset-inline-start: .45rem;
  width: 1.85rem;
  height: 1.85rem;
  pointer-events: none;
  background: var(--globe-art) center / contain no-repeat;
}
.language-picker select {
  appearance: none;
  width: 4.55rem;
  min-height: 2.9rem;
  padding: .4rem .3rem .4rem 2.7rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  font-size: .94rem;
  font-weight: 700;
}
.language-picker option { background: var(--surface); color: var(--text); }
main { padding-block: 1.6rem 5rem; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); }
h2 {
  margin-block: 2.2rem 1rem;
  font-size: clamp(1.3rem, 2.7vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.18;
}
main > p, .box p { margin-block: .6rem .9rem; color: var(--muted); }
small { color: var(--muted); line-height: 1.45; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 9.5rem;
  margin-block: 0 1.6rem;
  padding: clamp(1.25rem, 3.9vw, 3.1rem);
  border: 1px solid #355165;
  border-radius: .8rem;
  background:
    linear-gradient(123deg, transparent 61%, #12d6f719 61% 64%, transparent 64% 69%, #277aa927 69% 81%, transparent 81%),
    radial-gradient(ellipse at 70% 70%, #10516d, transparent 54%),
    linear-gradient(110deg, #0c1a28, #0b2a40 73%, #091d2d);
}
.hero::before {
  position: absolute;
  inset: auto auto 0 0;
  width: 23%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  content: "";
}
.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 100%;
  color: #fbffff;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-style: italic;
  font-weight: 850;
  letter-spacing: -.05em;
  line-height: 1;
  overflow-wrap: break-word;
  text-transform: uppercase;
}
.hero p {
  position: relative;
  z-index: 1;
  margin-top: .85rem;
  color: #c5dce7;
  font-size: clamp(.96rem, 1.6vw, 1.1rem);
}
.hero-shop {
  min-height: clamp(16rem, 25vw, 20.5rem);
  background:
    linear-gradient(125deg, transparent 50%, #006b9322 50% 62%, transparent 62%),
    linear-gradient(125deg, transparent 67%, #3ad8fa52 67.1% 67.2%, transparent 67.3%),
    radial-gradient(ellipse at 80% 47%, #1674a4, transparent 50%),
    linear-gradient(111deg, #0b1825 14%, #0b293e 60%, #092031);
}
.hero-shop::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .5;
  background: radial-gradient(#4adef995 1px, transparent 1.6px) 0 0 / 8px 8px;
  mask-image: linear-gradient(115deg, transparent 53%, #000 100%);
  pointer-events: none;
  content: "";
}
.hero-shop h1 {
  width: 57%;
  font-size: clamp(3rem, 6vw, 5.2rem);
  text-wrap: balance;
}
.hero-shop p { width: 55%; }
.hero-deck {
  position: absolute;
  inset: 0 0 0 auto;
  width: 42%;
  overflow: hidden;
  pointer-events: none;
}
.hero-deck span {
  position: absolute;
  width: clamp(7.5rem, 13.8vw, 11.6rem);
  aspect-ratio: 1064/1478;
  top: 50%;
  left: 44%;
  border: 3px solid #c0d0de;
  border-radius: 7%;
  background:
    var(--card-top) center top / 100% auto no-repeat,
    linear-gradient(125deg, transparent 38%, #005783 58%, #32ebff 59%, #004369 62%, transparent 72%),
    #031925;
  box-shadow: inset 0 0 0 2px #16202b, 0 .7rem 1rem #020710a9;
}
.hero-deck span::after {
  position: absolute;
  inset: 38% 8% 19%;
  border: 1px solid #f1f7fe;
  border-radius: 7%;
  background: var(--foil);
  box-shadow: 0 2px 3px #010811;
  content: "";
}
.hero-deck span:nth-child(1) { transform: translate(-87%, -41%) rotate(-23deg); filter: brightness(.67); }
.hero-deck span:nth-child(2) { transform: translate(-55%, -47%) rotate(-7deg); filter: brightness(.86); }
.hero-deck span:nth-child(3) { transform: translate(-15%, -48%) rotate(13deg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); gap: clamp(.75rem, 1.5vw, 1.2rem); }
.box, .line { border: 1px solid var(--line); background: var(--surface); }
.box {
  min-width: 0;
  padding: 1rem;
  border-radius: .7rem;
  overflow-wrap: anywhere;
}
.box > strong { display: block; font-size: 1.08rem; line-height: 1.25; }
.box h2 { margin-block: 0 .7rem; }
.box small { display: block; }
section.box { margin-block: 1rem; }
.box img { display: block; max-width: 100%; height: 15rem; margin: 0 auto 1rem; object-fit: contain; }
.pack-box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .75rem .45rem;
  padding: .7rem;
  box-shadow: 0 4px 16px #0002;
}
.pack {
  position: relative;
  isolation: isolate;
  grid-column: 1/-1;
  overflow: hidden;
  display: grid;
  place-items: center;
  height: 10.1rem;
  border-radius: .4rem;
  background:
    linear-gradient(126deg, transparent 0 22%, #568aa114 22% 23%, transparent 23% 76%, #49aace1f 76% 88%, transparent 88%),
    radial-gradient(ellipse at 53% 62%, #24516c, #10293d 51%, #0b1c2c);
}
.pack::before, .pack::after {
  position: absolute;
  width: 5.7rem;
  height: 7.9rem;
  border: 1px solid #68b7c9;
  border-radius: 2%;
  background:
    repeating-linear-gradient(90deg, #dcecf2ad 0 1px, #324c5bad 1px 3px) center top / 100% 5% no-repeat,
    repeating-linear-gradient(90deg, #c0dde6bf 0 1px, #425b74ab 1px 3px) center bottom / 100% 5% no-repeat,
    linear-gradient(116deg, transparent 30%, #53dcec25 51%, transparent 58%),
    var(--brand-logo) center 51% / 86% auto no-repeat,
    linear-gradient(123deg, #0d425e 10%, #071b2c 19% 34%, #136b89 35%, #041622 38% 63%, #008cb4 69%, #03506e 71% 75%, #061927 75%);
  box-shadow: inset 2px 0 2px #dfeced60, inset -2px 0 2px #bde6e84a, 0 7px 10px #020911a0;
  content: "";
}
.pack::before { transform: translate(-18%, 3%) rotate(-13deg); filter: brightness(.72); }
.pack::after { transform: translate(11%, -2%) rotate(8deg); }
.pack-box > strong { padding-inline-start: .2rem; font-size: .99rem; }
.pack-box > p { margin: 0; padding-inline-end: .2rem; color: #c7e9ef; font-size: .94rem; font-weight: 700; }
.pack-box > button { grid-column: 1/-1; }
.pack-box > button, .primary { border-color: #45d6dc; background: #42dce2; color: #05212b; }
.pack-box > button:hover, .primary:hover { background: #90ffff; color: #042129; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-block: 1.2rem; }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-block: .65rem; padding: .65rem .85rem; border-radius: .45rem; }
.line > span:first-child { flex: 1; min-width: min(100%, 9rem); overflow-wrap: anywhere; }
label { display: flex; flex-direction: column; gap: .3rem; max-width: 35rem; margin: .9rem 0; }
label span { color: #ccdae4; font-size: .9rem; font-weight: 600; }
input, select {
  max-width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  padding: .5rem .7rem;
  border: 1px solid #496377;
  border-radius: .42rem;
  background: #0a1623;
  color: var(--text);
}
select[multiple] { min-height: 8rem; }
main > button { margin: 0 .45rem .45rem 0; }
.notice { padding: .7rem 1rem; border-inline-start: 3px solid var(--cyan); border-radius: .3rem; background: #153341; }
main > .notice { margin: 0 0 1rem; color: #d3f7f8; }
.scratch {
  width: 100%;
  margin-top: .75rem;
  border: 2px solid #dfeaf3;
  background: var(--foil);
  color: #05131e;
  font-weight: 850;
  touch-action: none;
}
.scratch:hover { border-color: var(--cyan); background: var(--foil); color: #05131e; }

.card-detail .stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .3rem;
  padding: .5rem;
  border: 1px solid #b7c5d0;
  border-radius: .4rem;
  background: linear-gradient(135deg, #302919, #443c29 42%, #26251f 75%, #514636);
}
.stats abbr {
  overflow: hidden;
  border-radius: .25rem;
  background: #e8f4fa;
  color: #0c1722;
  font-family: var(--display);
  text-align: center;
  text-decoration: none;
}
.stats abbr span {
  display: block;
  background: #080f18;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
}
.stats abbr b { display: block; font-size: 1rem; line-height: 1.4; }
.stats abbr:nth-last-child(2) span { background: #8d2530; }
.stats abbr:last-child span { background: #19518b; }

@media (max-width: 62rem) {
  header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem 1rem; padding-top: .6rem; }
  .header-tools { grid-column: 2; grid-row: 1; }
  .site-nav { grid-column: 1/-1; grid-row: 2; margin-bottom: .35rem; }
  .hero-shop h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
}
@media (max-width: 40rem) {
  header, main { width: calc(100% - 1.5rem); }
  header { column-gap: .4rem; }
  .brand { width: min(7.5rem, 100%); }
  .header-tools { gap: .15rem; }
  .header-tools .basket-link { width: 3.65rem; }
  .basket-icon { width: 3.15rem; }
  .site-nav { justify-content: flex-start; gap: .15rem; }
  .site-nav button { padding: .35rem .45rem; font-size: .87rem; }
  main { padding-top: .85rem; }
  .hero { border-radius: .6rem; padding: 1.2rem; }
  .hero-shop { min-height: 12.5rem; }
  .hero-shop h1 { width: 60%; font-size: clamp(2rem, 7.5vw, 3.3rem); }
  .hero-shop p { width: 58%; font-size: .92rem; }
  .hero-deck { width: 38%; }
  .hero-deck span { left: 45%; width: clamp(4.5rem, 17vw, 7rem); border-width: 2px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pack-box { grid-template-columns: 1fr; gap: .4rem; padding: .5rem; }
  .pack-box > strong, .pack-box > p { padding: 0; }
  .pack-box > button { min-height: 2.65rem; margin-top: .2rem; padding-inline: .35rem; }
  .pack { height: 7.2rem; margin-bottom: .25rem; }
  .pack::before, .pack::after { width: 3.9rem; height: 5.45rem; }
  .box img { height: auto; max-height: 13rem; }
}
@media (max-width: 23rem) {
  .grid { grid-template-columns: 1fr; }
  .hero-shop { min-height: 10rem; }
}
@media (forced-colors: active) {
  .brand { width: auto; background: none; text-indent: 0; mix-blend-mode: normal; }
  .site-nav button.active { outline: 1px solid; }
  .account-icon, .basket-icon, .language-globe { forced-color-adjust: none; }
  .header-tools .active { outline: 1px solid ButtonText; }
  .language-picker select { border: 1px solid ButtonText; }
  .scratch { background: ButtonFace; color: ButtonText; }
}

.account-auth, .admin-invite-form {
  display: grid;
  gap: 1rem;
  width: min(100%, 32rem);
  margin-block: 1rem 1.5rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
}
.auth-field { display: grid; gap: .35rem; min-width: 0; }
.auth-field label { margin: 0; color: var(--text); font-weight: 600; }
.auth-field input { width: 100%; min-height: 2.8rem; }
.password-wrap { position: relative; }
.password-wrap input { min-width: 0; padding-inline-end: 3.25rem; }
.password-wrap input::-ms-reveal { display: none; }
.password-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 1px;
  display: grid;
  place-items: center;
  width: 2.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover, .password-toggle:focus-visible { background: transparent; color: var(--cyan); }
.password-toggle:focus-visible { outline-offset: -4px; }
.password-toggle::before {
  content: "";
  width: 1.4rem;
  height: 1.4rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M1.5 12s4-7.5 10.5-7.5S22.5 12 22.5 12s-4 7.5-10.5 7.5S1.5 12 1.5 12Z'/%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.password-toggle[aria-pressed="true"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 3 18 18M10.2 4.7a9 9 0 0 1 1.8-.2c6.5 0 10.5 7.5 10.5 7.5a21 21 0 0 1-3.1 3.9M6.4 6.4A22 22 0 0 0 1.5 12s4 7.5 10.5 7.5c2.2 0 4.1-.8 5.7-2M9.8 9.8a3.1 3.1 0 0 0 4.4 4.4'/%3E%3C/svg%3E");
}
@media (forced-colors: active) {
  .password-toggle::before { forced-color-adjust: none; background: ButtonText; }
}
.auth-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.auth-actions button, .admin-invite-form > button { min-height: 2.75rem; max-width: 100%; }
.admin-invite-form > button { justify-self: start; }
.auth-hint { margin: 0; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.auth-error:not(:empty) {
  margin: 0;
  padding: .6rem .8rem;
  border-inline-start: 3px solid #ff8c9c;
  background: #351d2b;
  color: #ffe2e6;
}
#administratorEmails { overflow-wrap: anywhere; }
#verificationCode { letter-spacing: .15em; font-variant-numeric: tabular-nums; }
