/* The LucidMC store. Pixel letters for anything that is a name or a price, a readable pixel
   face for the rest; flat colour blocks with a hard shadow, the way a Minecraft screen is. */

/* Pixelify Sans draws its euro sign like an 8: the sign alone comes from a plain font. */
@font-face {
  font-family: "Euro";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("DejaVu Sans Bold");
  unicode-range: U+20AC;
}

/* Pixelify's 5 reads as an S: digits come from Silkscreen, the heading font, whose figures are plain. */
@font-face {
  font-family: "Digits";
  src: url("fonts/silkscreen-400.woff2") format("woff2");
  font-weight: 400 600;
  unicode-range: U+0030-0039;
}

@font-face {
  font-family: "Digits";
  src: url("fonts/silkscreen-700.woff2") format("woff2");
  font-weight: 700;
  unicode-range: U+0030-0039;
}

:root {
  --night: #0f1118;
  --panel: #191c26;
  --panel-edge: #262a38;
  --panel-deep: #12141c;
  --ink: #f2f6fa;
  --muted: #9aa5b4;
  --sky: #87ceeb;
  --sky-deep: #4fa8d8;
  --sky-dark: #1b4f73;
  --gold: #ffd23f;
  --good: #7ed957;
  --bad: #ff8a8a;
  --heading: "Euro", "Silkscreen", "Pixelify Sans", monospace;
  --body: "Euro", "Digits", "Pixelify Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Whatever is hidden stays hidden, whatever its own display says. */
[hidden] { display: none !important; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.4;
}

img { image-rendering: pixelated; }

a { color: var(--sky); }

button { font: inherit; color: inherit; cursor: pointer; }

/* A few stars, still, in a night sky that fades to the page. */
.sky {
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 18%, #87ceeb 50%, transparent 51%),
    radial-gradient(2px 2px at 27% 62%, #c9b6ff 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 30%, #e6f8ff 50%, transparent 51%),
    radial-gradient(2px 2px at 68% 14%, #87ceeb 50%, transparent 51%),
    radial-gradient(2px 2px at 81% 48%, #e6f8ff 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 22%, #c9b6ff 50%, transparent 51%),
    linear-gradient(#16263a, var(--night));
  opacity: 0.85;
}

/* A column as tall as the window at least, so the footer sits at the bottom of a short page. */
.page {
  position: relative;
  max-width: 1280px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 24px 32px;
  display: flex;
  flex-direction: column;
}

/* --- the bar at the top --- */

.bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 128px;
  padding: 18px 20px;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 12px;
  margin-bottom: 24px;
}

.account {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  background: var(--panel-deep);
  border: 2px solid var(--panel-edge);
  border-radius: 10px;
  text-align: left;
}

.account:hover { border-color: var(--sky-dark); }

.account-face {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #2b3242;
}

.account-text small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.account-text strong {
  font-family: var(--heading);
  font-size: 22px;
  font-weight: 700;
}

/* The logo sits on the bar's top edge and spills over it, as a sign would; the address hangs under it. */
.middle {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -84px;
}

.brand img {
  display: block;
  width: min(360px, 56vw);
  height: auto;
  image-rendering: auto;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.45));
}

.address {
  margin-top: 6px;
  background: none;
  border: 0;
  color: var(--sky);
  font-family: var(--heading);
  font-size: 17px;
  letter-spacing: 2px;
}

.address:hover { color: var(--ink); }

.cart-button {
  grid-column: 3;
  justify-self: end;
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  background: var(--sky-deep);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 6px 0 var(--sky-dark);
  color: #fff;
}

.cart-button:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--sky-dark); }
.cart-button svg { width: 40px; height: 40px; fill: currentColor; }

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 28px;
  padding: 2px 6px;
  background: var(--gold);
  color: #3a2a00;
  border-radius: 8px;
  font-family: var(--heading);
  font-size: 15px;
}

/* --- the categories --- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 210px;
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 36px 40px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  background: var(--card);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.16);
  transition: transform 0.12s steps(2);
}

.card:hover { transform: translateY(-4px); }
.card.big { grid-row: span 2; }

.card h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  max-width: 60%;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.22);
}

.card.big h2 { font-size: 64px; }

.card p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 50%;
  font-family: var(--heading);
  font-size: 17px;
  text-transform: uppercase;
  opacity: 0.92;
}

.card img {
  position: absolute;
  right: 18px;
  bottom: 50%;
  transform: translateY(50%);
  height: 86%;
  image-rendering: auto;
}

.card.big img { height: auto; width: 62%; right: 14px; bottom: 24px; transform: none; }

/* --- one category: tabs and products --- */

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  padding: 0 18px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--card);
  color: #fff;
  text-decoration: none;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.22);
  opacity: 0.6;
}

.tab img { height: 86%; image-rendering: auto; }
.tab:hover, .tab.on { opacity: 1; }
.tab.on { outline: 3px solid #fff; outline-offset: 2px; }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* A product is a Minecraft panel: a dark frame with a lighter inner edge, square corners. */
.product {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 3px solid #07090f;
  box-shadow: inset 0 0 0 2px #2b3350, 0 6px 0 rgba(0, 0, 0, 0.35);
}

/* The picture sits on a block of the product's own colour, a shade darker at the foot. */
.product-picture {
  position: relative;
  display: grid;
  place-items: center;
  height: 170px;
  margin: 5px 5px 0;
  background: linear-gradient(transparent 70%, rgba(0, 0, 0, 0.14) 70%), var(--accent);
}

.product-picture img { max-height: 150px; max-width: 92%; image-rendering: auto; }

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: #fff;
  color: #1a1f2e;
  font-family: var(--body);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.product h3 {
  margin: 16px 18px 4px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 24px;
  color: var(--accent);
}

.perks {
  list-style: none;
  margin: 14px 18px 18px;
  padding: 0;
  flex: 1;
}

.perks li { padding-left: 20px; position: relative; margin: 5px 0; }
.perks li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; background: var(--accent); }

/* The button is the product's colour, its letters dark: one look per product, not one for all. */
.buy {
  margin: 0 12px 12px;
  padding: 12px 16px;
  background: var(--accent, var(--sky-deep));
  border: 0;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.22);
  color: #141a28;
  font-family: var(--body);
  font-weight: 700;
  font-size: 20px;
}

/* The stepper and the button share one row; the button takes what is left. */
.buy-row { display: flex; gap: 8px; margin: 0 12px 12px; }
.buy-row .buy { flex: 1; margin: 0; padding-left: 6px; padding-right: 6px; font-size: 17px; white-space: nowrap; }

.stepper {
  display: flex;
  align-items: center;
  background: #07090f;
  box-shadow: inset 0 0 0 2px #2b3350;
}

.stepper button {
  width: 26px;
  height: 100%;
  background: none;
  border: 0;
  color: var(--accent);
  font-family: var(--body);
  font-weight: 700;
  font-size: 22px;
  cursor: pointer;
}

.stepper button:hover { background: rgba(255, 255, 255, 0.06); }
.stepper .count { min-width: 22px; text-align: center; font-weight: 700; font-size: 18px; color: #fff; }

.buy:hover { filter: brightness(1.08); }
.buy:active { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22); transform: translateY(2px); }
.buy:disabled { opacity: 0.5; cursor: default; transform: none; }
.buy.wide { width: 100%; margin: 12px 0 8px; --accent: var(--sky); }

/* --- the cart --- */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 2px solid var(--panel-edge);
  box-shadow: -12px 0 0 rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 2px solid var(--panel-edge); }
.drawer-head h2 { margin: 0; font-family: var(--heading); font-size: 22px; text-transform: uppercase; }
.close { background: none; border: 0; font-size: 22px; color: var(--muted); }
.drawer-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.drawer-items .empty { color: var(--muted); text-align: center; margin-top: 40px; }

.line { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 2px solid var(--panel-edge); }
.line img { width: 48px; height: 48px; object-fit: contain; }
.line strong { display: block; font-family: var(--heading); font-size: 15px; color: var(--accent); }
.line small { color: var(--muted); }
.line button { background: none; border: 0; color: var(--muted); font-size: 18px; }
.line button:hover { color: var(--bad); }

.drawer-foot { padding: 16px 20px 20px; border-top: 2px solid var(--panel-edge); }
.total { display: flex; justify-content: space-between; font-size: 18px; }
.total strong { font-family: var(--heading); color: var(--gold); font-size: 22px; }
.small { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }

/* --- the name box --- */

.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 12, 0.72); z-index: 20; padding: 16px; }
.modal-box { width: min(420px, 100%); padding: 26px; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 12px; }
.modal-box h2 { margin: 0 0 8px; font-family: var(--heading); text-transform: uppercase; font-size: 24px; }
.modal-box p { color: var(--muted); margin: 0 0 14px; }
.modal-box input { width: 100%; padding: 12px 14px; font: inherit; font-size: 19px; color: var(--ink); background: var(--panel-deep); border: 2px solid var(--panel-edge); border-radius: 8px; outline: none; }
.modal-box input:focus { border-color: var(--sky-deep); }
.modal-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-buttons .buy { margin: 0; }
.ghost { padding: 12px 16px; background: none; border: 2px solid var(--panel-edge); border-radius: 8px; font-family: var(--heading); }
.error { color: var(--bad) !important; margin: 10px 0 0 !important; }
code { color: var(--sky); }

.notice { margin: 18px 0 0; padding: 14px 18px; border-radius: 10px; background: var(--panel); border: 2px solid var(--panel-edge); text-align: center; font-size: 18px; }
.notice.good { border-color: var(--good); }
.notice.bad { border-color: var(--bad); }

.foot { margin-top: auto; padding-top: 40px; color: var(--muted); font-size: 14px; text-align: center; }
.foot p { margin: 4px 0; }

/* --- narrow screens --- */

@media (max-width: 760px) {
  .page { padding: 64px 16px 32px; }
  .bar { grid-template-columns: auto 1fr auto; min-height: 112px; padding: 14px; }
  .account-text { display: none; }
  .account { padding: 6px; }
  .account-face { width: 44px; height: 44px; }
  .cart-button { width: 60px; height: 60px; }
  .brand img { width: min(220px, 50vw); }
  .middle { margin-top: -60px; }
  .address { font-size: 13px; }
  .grid { grid-template-columns: 1fr; grid-auto-rows: 170px; }
  .card.big { grid-row: span 1; }
  .card { padding: 24px; }
  .card h2, .card.big h2 { font-size: 34px; }
  .card p { font-size: 13px; }
  .card.big img { height: 92%; right: -10px; bottom: -14px; }
  .tabs { grid-template-columns: 1fr; }
  .tab { height: 64px; font-size: 18px; }
}
