/* Grandpa Griggles, retro 90s option. System fonts only, web-safe colours, no build. */
:root {
  --black: #000000;
  --navy: #000080;
  --silver: #c0c0c0;
  --grey: #808080;
  --white: #ffffff;
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --yellow: #ffff00;
  --lime: #00ff00;
  --purple: #330066;
  --text: "Verdana", "Geneva", "DejaVu Sans", sans-serif;
  --fun: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Marker Felt", cursive;
  --loud: "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --led: "Courier New", "Courier", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 0.75rem; scrollbar-color: var(--silver) var(--navy); }
body {
  margin: 0;
  background: var(--black) url("assets/tile.svg") 0 0 / 72px auto;
  color: var(--white);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, p, ul, table { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--cyan); }
a:visited { color: #ff99ff; }
a:hover { color: var(--yellow); }
::selection { background: var(--magenta); color: var(--white); }
:focus-visible { outline: 3px dotted var(--yellow); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -4rem; z-index: 30; background: var(--yellow); color: var(--black); padding: 0.5rem 0.75rem; font-weight: bold; }
.skip:focus { top: 0.5rem; }

#trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }

.page { max-width: 66rem; margin: 0 auto; padding: 0.75rem; display: grid; gap: 0.75rem; }

/* The two bevels every 90s interface is made of */
.bevel { border: 3px solid; border-color: #dfdfdf #404040 #404040 #dfdfdf; box-shadow: inset 1px 1px 0 var(--white), inset -1px -1px 0 var(--grey); }
.bevel-in { border: 3px solid; border-color: #404040 #dfdfdf #dfdfdf #404040; }

/* ---------- Banner ---------- */
.banner {
  background: var(--navy) url("assets/tile.svg") center / 54px auto;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 1rem;
  overflow: hidden;
}
.banner__mid { text-align: center; min-width: 0; flex: 1; }
.banner h1 {
  font-family: var(--loud);
  font-weight: normal;
  font-size: clamp(2.3rem, 9.5vw, 5.6rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  filter: drop-shadow(3px 3px 0 #000) drop-shadow(0 0 14px rgba(255, 0, 255, 0.7));
}
.rainbow {
  background: linear-gradient(180deg, #ffff00 0%, #ffff00 22%, #00ff00 22%, #00ff00 40%, #00ffff 40%, #00ffff 60%, #ff66ff 60%, #ff66ff 80%, #ff9933 80%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.banner__sub { margin-top: 0.5rem; font-family: var(--fun); font-size: clamp(1rem, 2.6vw, 1.35rem); color: var(--yellow); }
.spin { width: clamp(3.5rem, 12vw, 7rem); height: clamp(3.5rem, 12vw, 7rem); flex: none; color: var(--cyan); }
.spin--back { color: var(--magenta); }
.spin--small { width: 5rem; height: 5rem; color: var(--lime); }

/* ---------- Marquee ---------- */
.marquee { background: var(--black); color: var(--lime); overflow: hidden; font-family: var(--led); font-weight: bold; font-size: 1.05rem; padding: 0.35rem 0; }
.marquee__track { display: flex; width: max-content; }
.marquee__track > span { white-space: nowrap; padding-right: 0.6rem; }
.hot { color: var(--yellow); }
.ico { width: 0.9em; height: 0.9em; display: inline-block; vertical-align: -0.05em; color: var(--yellow); }
.marquee .ico { color: var(--magenta); margin: 0 0.5rem; }

/* ---------- Frames ---------- */
.frames { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.side { background: var(--silver); color: var(--black); padding: 0.6rem; position: sticky; top: 0.75rem; }
.side__h { font-weight: bold; font-size: 0.875rem; background: var(--navy); color: var(--white); padding: 0.25rem 0.5rem; margin-bottom: 0.5rem; }
.side__nav { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.lang { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }

.btn95 {
  display: inline-block; width: auto;
  font: bold 0.9375rem/1.2 var(--text);
  color: var(--black); background: var(--silver);
  text-decoration: none; text-align: center;
  padding: 0.5rem 0.8rem;
  border: 2px solid; border-color: var(--white) #404040 #404040 var(--white);
  box-shadow: inset -1px -1px 0 var(--grey), inset 1px 1px 0 #dfdfdf;
  cursor: pointer;
}
.side .btn95 { display: block; width: 100%; }
a.btn95:visited { color: var(--black); }
.btn95:hover { color: var(--navy); background: #d4d0c8; }
.btn95:active, .btn95[aria-pressed="true"] { border-color: #404040 var(--white) var(--white) #404040; box-shadow: inset 1px 1px 0 var(--grey); padding: 0.55rem 0.75rem 0.45rem 0.85rem; }
.btn95[aria-pressed="true"] { background: #dcdcdc; }
.btn95--go, a.btn95--go:visited { background: var(--yellow); color: var(--black); }
.btn95--go:hover { background: #ffff99; color: var(--black); }

.counter { text-align: center; font-size: 0.8125rem; font-weight: bold; }
.led {
  display: block; margin-top: 0.3rem;
  background: var(--black); color: var(--lime);
  font: bold 1.5rem/1 var(--led); letter-spacing: 0.18em;
  padding: 0.4rem 0 0.4rem 0.18em;
  border: 2px solid; border-color: #404040 var(--white) var(--white) #404040;
}

/* ---------- Boxes ---------- */
.main { display: grid; gap: 0.75rem; min-width: 0; }
.box { background: var(--navy); padding: 0.9rem 1rem 1.1rem; min-width: 0; }
.box__title {
  font-family: var(--fun); font-size: clamp(1.4rem, 3.4vw, 1.9rem); line-height: 1.2;
  color: var(--yellow);
  margin-bottom: 0.8rem;
  text-shadow: 2px 2px 0 var(--black);
}
.box p + p { margin-top: 0.75rem; }
.big { font-family: var(--fun); font-size: 1.25rem; line-height: 1.4; color: var(--cyan); }
.hint { font-size: 0.9375rem; color: var(--silver); margin-bottom: 0.75rem; }

.welcome { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.1rem; align-items: start; }
.pic { display: block; background: var(--black); }
.pic img { width: 100%; }
.welcome__text .btn95 { margin: 0.25rem 0.35rem 0.25rem 0; }
.menu95 { width: 100%; margin: 1rem 0; border-collapse: collapse; background: var(--black); color: var(--lime); font: bold 1rem/1.3 var(--led); }
.menu95 caption { text-align: left; font: bold 0.875rem/1.3 var(--text); color: var(--yellow); padding-bottom: 0.35rem; }
.menu95 th, .menu95 td { padding: 0.3rem 0.6rem; text-align: left; font-weight: bold; }
.menu95 td { text-align: right; color: var(--yellow); white-space: nowrap; }
.menu95 tr + tr th, .menu95 tr + tr td { border-top: 1px dashed #006600; }

.rule {
  height: 10px;
  background: linear-gradient(90deg, #ff0000 0 14.28%, #ff9900 0 28.56%, #ffff00 0 42.84%, #00ff00 0 57.12%, #00ffff 0 71.4%, #3366ff 0 85.68%, #ff00ff 0);
  border: 2px solid; border-color: #404040 #dfdfdf #dfdfdf #404040;
}

.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; }
.thumb {
  display: grid; grid-template-rows: auto 1fr; gap: 0.4rem; width: 100%; height: 100%;
  background: var(--silver); color: var(--black);
  padding: 0.4rem;
  font: bold 0.875rem/1.25 var(--text); text-align: center;
  cursor: pointer;
}
.thumb img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--black); border: 2px solid; border-color: #404040 #dfdfdf #dfdfdf #404040; }
.thumb:hover { background: var(--yellow); }
.thumb:active { border-color: #404040 #dfdfdf #dfdfdf #404040; }

/* ---------- Shop table ---------- */
.goods { width: 100%; border-collapse: separate; border-spacing: 3px; background: var(--silver); color: var(--black); border: 3px solid; border-color: #dfdfdf #404040 #404040 #dfdfdf; }
.goods caption { caption-side: bottom; text-align: left; color: var(--silver); font-size: 0.875rem; padding-top: 0.6rem; }
.goods th, .goods td { padding: 0.45rem 0.55rem; border: 1px solid; border-color: var(--grey) var(--white) var(--white) var(--grey); vertical-align: middle; text-align: left; }
.goods thead th { background: var(--navy); color: var(--white); font-size: 0.875rem; }
.goods tbody th { font-weight: bold; background: var(--white); }
.goods tbody td { background: var(--white); }
.goods small { display: block; font-weight: normal; font-size: 0.8125rem; color: #333333; margin-top: 0.15rem; }
.goods img { width: 5.5rem; aspect-ratio: 1; object-fit: cover; }
.goods td:first-child { width: 6.9rem; }
.price { font: bold 1.2rem/1 var(--led); white-space: nowrap; color: #cc0000; }
.new { font-family: var(--loud); font-weight: normal; font-size: 0.8em; color: #ff3333; background: var(--yellow); padding: 0 0.35em; margin-left: 0.4em; text-shadow: none; display: inline-block; transform: rotate(-6deg); }

.stars li { position: relative; padding-left: 1.7rem; }
.stars li + li { margin-top: 0.6rem; }
.stars li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 1rem; height: 1rem; background: var(--yellow); clip-path: polygon(50% 0, 63% 37%, 100% 37%, 70% 60%, 82% 100%, 50% 76%, 18% 100%, 30% 60%, 0 37%, 37% 37%); }
.links { margin-top: 1rem; font-size: 0.9375rem; }

.mail { display: flex; gap: 1.1rem; align-items: center; }
.mail__big { font-family: var(--fun); font-size: clamp(1.15rem, 3.6vw, 1.7rem); font-weight: bold; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.foot { text-align: center; font-size: 0.875rem; padding: 0.5rem 0 1.5rem; display: grid; gap: 0.6rem; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.badge {
  min-width: 8.5rem; height: 2.4rem; padding: 0 0.6rem;
  display: grid; place-items: center;
  font: bold 0.75rem/1.1 var(--text);
  border: 2px solid; border-color: var(--white) #404040 #404040 var(--white);
}
.badge a, .badge a:visited { color: inherit; text-decoration: none; }
.badge--a { background: var(--black); color: var(--lime); }
.badge--b { background: var(--silver); color: var(--black); }
.badge--b b { background: var(--navy); color: var(--white); padding: 0 0.3em; }
.badge--c { background: var(--purple); color: var(--yellow); }
.badge--d { background: #cc0000; color: var(--white); }
.badge--d b { color: var(--yellow); }

/* ---------- The picture viewer: a window ---------- */
.win {
  padding: 3px; margin: auto;
  width: min(44rem, calc(100vw - 1rem)); max-height: calc(100dvh - 1rem);
  background: var(--silver); color: var(--black);
  border: 2px solid; border-color: #dfdfdf #404040 #404040 #dfdfdf;
  box-shadow: inset 1px 1px 0 var(--white), inset -1px -1px 0 var(--grey), 6px 6px 0 rgba(0, 0, 0, 0.6);
  overflow: auto;
}
.win::backdrop { background: rgba(0, 0, 40, 0.75); }
.win__bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; background: linear-gradient(90deg, var(--navy), #1084d0); color: var(--white); padding: 0.25rem 0.3rem 0.25rem 0.5rem; font-weight: bold; font-size: 0.9375rem; }
.win__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win__bar form { margin: 0; }
.win__x { width: 1.75rem; height: 1.6rem; font: bold 1.1rem/1 var(--text); background: var(--silver); color: var(--black); border: 2px solid; border-color: var(--white) #404040 #404040 var(--white); cursor: pointer; padding: 0; }
.win__body { padding: 0.6rem; background: var(--silver); }
.win__body img { margin: 0 auto; max-height: calc(100dvh - 11rem); width: auto; background: var(--black); }
.win__foot { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; padding: 0 0.6rem 0.6rem; }

/* ---------- Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scroll { to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: 0.15; } }
@keyframes hue { to { filter: drop-shadow(3px 3px 0 #000) drop-shadow(0 0 14px rgba(0, 255, 255, 0.8)); } }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .spin { animation: spin 24s linear infinite; }
  .spin--back { animation-direction: reverse; }
  .spin--small { animation-duration: 12s; }
  .marquee__track { animation: scroll 32s linear infinite; }
  .marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
  .new { animation: blink 1s steps(2, jump-none) infinite; }
  .banner h1 { animation: hue 2.4s ease-in-out infinite alternate; }
  .win[open] { animation: pop 140ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { width: auto; flex-wrap: wrap; }
  .marquee__track > span { white-space: normal; padding: 0 0.6rem; }
  .marquee__track > span[aria-hidden] { display: none; }
  #trail { display: none; }
}

/* ---------- Small screens: the side frame becomes a top bar, the table becomes cards ---------- */
@media (max-width: 760px) {
  .page { padding: 0.5rem; gap: 0.5rem; }
  .frames { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .side { position: static; display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 0.75rem; align-items: start; }
  .side__h { display: none; }
  .side__nav { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); margin: 0; }
  .side .btn95 { padding: 0.65rem 0.3rem; }
  .lang { grid-template-columns: 1fr 1fr; margin: 0; }
  .counter { display: flex; align-items: center; gap: 0.5rem; text-align: left; }
  .counter p { max-width: 5rem; line-height: 1.2; }
  .led { margin: 0; font-size: 1.1rem; padding: 0.4rem 0.3rem 0.4rem 0.45rem; }
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .box { padding: 0.75rem; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thumbs li:last-child { grid-column: 1 / -1; }
  .thumbs li:last-child img { aspect-ratio: 16 / 10; }

  .goods, .goods tbody, .goods tr, .goods th, .goods td { display: block; }
  .goods { border-spacing: 0; background: transparent; border: 0; }
  .goods thead { display: none; }
  .goods caption { display: block; }
  .goods tr { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; grid-template-areas: "pic name name" "pic price order"; gap: 0.35rem 0.7rem; align-items: center; background: var(--white); padding: 0.5rem; margin-bottom: 0.5rem; border: 3px solid; border-color: #dfdfdf #404040 #404040 #dfdfdf; }
  .goods th, .goods td { border: 0; padding: 0; background: none; }
  .goods td:first-child { grid-area: pic; width: auto; }
  .goods tbody th { grid-area: name; background: none; }
  .goods .price { grid-area: price; }
  .goods td:last-child { grid-area: order; }
  .mail { align-items: flex-start; }
  .spin--small { width: 3.25rem; height: 3.25rem; }
}
