/* Chaos Commerce: ugly on purpose, usable by design. */

:root {
  --ink: #1b0b3a;
  --paper: #fffbe6;
  --yellow: #ffe600;
  --pink: #ff2e93;
  --lime: #b6ff00;
  --blue: #0b3cff;
  --red: #d40000;
  --green: #0a7a2f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  background-color: #8ff;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 46, 147, 0.16) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(-45deg, rgba(11, 60, 255, 0.12) 0 14px, transparent 14px 28px);
}

a { color: var(--blue); }
a:visited { color: #6a0dad; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 4px dashed var(--pink);
  outline-offset: 2px;
}
h1, h2 { font-family: Impact, "Arial Black", sans-serif; letter-spacing: 0.5px; line-height: 1.15; }
h1 { font-size: 2.1rem; margin: 0.4em 0; text-shadow: 3px 3px 0 var(--yellow); }
h2 { font-size: 1.35rem; margin: 0.2em 0 0.5em; }
code { background: #fff; padding: 1px 5px; border: 1px dotted var(--ink); font-size: 0.85em; word-break: break-all; }

/* ------------------------------------------------------------- furniture */

.marquee { background: var(--red); color: var(--yellow); overflow: hidden; white-space: nowrap; font-weight: bold; border-bottom: 4px ridge var(--yellow); }
.marquee-track { display: inline-block; padding: 6px 0; animation: scroll 26s linear infinite; }
.marquee-track span { margin-right: 4rem; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.site-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  align-items: center;
  padding: 14px 20px 0;
  background: linear-gradient(90deg, var(--yellow), var(--lime) 45%, var(--pink));
  border-bottom: 6px double var(--ink);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:visited { color: var(--ink); }
.logo-cart { font-size: 3rem; transform: rotate(-14deg); display: inline-block; }
.logo-text { font-family: Impact, "Arial Black", sans-serif; font-size: 1.9rem; line-height: 0.95; text-shadow: 2px 2px 0 #fff, 4px 4px 0 var(--pink); }
.logo-tag { font-size: 0.75rem; background: var(--ink); color: var(--yellow); padding: 2px 6px; transform: rotate(8deg); }
.header-side { text-align: right; font-size: 0.9rem; }
.header-side p { margin: 0; }
.sale-timer strong { color: var(--red); font-size: 1.15em; }
.site-nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.site-nav a {
  background: var(--paper); color: var(--ink); font-weight: bold; text-decoration: none;
  padding: 8px 16px; border: 3px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0;
}
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--yellow); }

main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 120px; min-height: 60vh; }
main:focus { outline: none; }

.site-footer { background: var(--ink); color: #fff; padding: 20px; text-align: center; font-size: 0.9rem; }
.site-footer a { color: var(--yellow); }
.site-footer .honest { border: 2px dashed var(--yellow); display: inline-block; padding: 8px 14px; margin-top: 6px; max-width: 760px; }

.blink { color: var(--red); font-size: 0.6em; vertical-align: middle; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.cookie-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: min(1048px, calc(100% - 32px)); margin: 14px auto 0;
  background: var(--paper); border: 4px dashed var(--pink); padding: 8px 14px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; }
.cookie-banner button { font: inherit; font-size: 0.9rem; cursor: pointer; background: #fff; border: 2px solid var(--ink); padding: 3px 10px; }

.chat { position: fixed; right: 12px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chat-toggle { background: var(--blue); color: #fff; border: 3px outset #9bf; padding: 8px 12px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.chat-panel { background: #fff; border: 3px solid var(--blue); padding: 10px 14px; width: 260px; box-shadow: 5px 5px 0 var(--ink); }
.chat-panel p { margin: 0 0 6px; }
.chat-small { font-size: 0.8rem; color: #555; }
.dots { animation: blink 1.2s steps(2, start) infinite; }

.toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -150%); z-index: 10; max-width: min(90vw, 520px);
  background: var(--ink); color: var(--yellow); padding: 10px 18px; border: 3px solid var(--yellow); font-weight: bold;
  transition: transform 0.25s ease-out;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- pieces */

.panel { background: var(--paper); border: 4px solid var(--ink); padding: 16px 18px; margin: 0 0 18px; box-shadow: 7px 7px 0 var(--pink); }
.hero { background: var(--yellow); border: 5px dotted var(--red); padding: 10px 18px; margin-bottom: 18px; transform: rotate(-0.6deg); }
.hero p { margin: 0 0 8px; }
.hint { font-size: 0.85rem; color: #4a3d63; }
.loading, .empty { font-size: 1.1rem; }
.working::before { content: "⏳ "; }

.button, .mini {
  font: inherit; font-weight: bold; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-block;
  background: var(--lime); border: 3px outset #dfff80; padding: 8px 16px;
}
.button:visited, .mini:visited { color: var(--ink); }
.button:hover:not(:disabled), .mini:hover:not(:disabled) { background: var(--yellow); }
.button:active:not(:disabled) { border-style: inset; }
.button:disabled, .mini:disabled { opacity: 0.55; cursor: not-allowed; }
.button.big { font-size: 1.25rem; padding: 12px 22px; background: var(--pink); color: #fff; border-color: #ff9bcb; }
.button.big:hover:not(:disabled) { background: var(--red); }
.mini { padding: 2px 9px; font-size: 0.9rem; background: #fff; border: 2px solid var(--ink); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 20px; }
.card { background: var(--paper); border: 4px solid var(--ink); padding: 12px 14px 16px; box-shadow: 6px 6px 0 var(--blue); display: flex; flex-direction: column; }
.card h2 { font-size: 1.15rem; }
.card .buy { margin-top: auto; }
.tilt-0 { transform: rotate(-0.8deg); }
.tilt-1 { transform: rotate(0.7deg); box-shadow: 6px 6px 0 var(--pink); }
.tilt-2 { transform: rotate(-0.3deg); box-shadow: 6px 6px 0 var(--green); }
.card-emoji { font-size: 4.2rem; text-align: center; text-decoration: none; background: #fff; border: 2px dashed var(--ink); margin-bottom: 8px; }
.blurb { margin: 0 0 6px; }
.price { margin: 0; font-size: 1.05rem; }
.price s { color: #555; }
.price strong { font-size: 1.5rem; color: var(--red); background: var(--yellow); padding: 0 6px; }
.saving { margin: 2px 0 6px; font-weight: bold; color: var(--green); font-size: 0.9rem; }
.stock { margin: 0 0 6px; font-style: italic; font-size: 0.9rem; }
.rating { margin: 0 0 10px; font-size: 0.9rem; }
.stars { color: #c47a00; letter-spacing: 1px; }

.product { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 20px; align-items: center; }
.product-emoji { font-size: 7rem; text-align: center; background: #fff; border: 3px dashed var(--ink); }

.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review { border: 3px solid var(--ink); padding: 10px 14px; background: #fff; }
.review p { margin: 0 0 6px; }
.review-furious { border-left: 12px solid var(--red); }
.review-happy { border-left: 12px solid var(--green); }
.review-author { font-size: 0.85rem; color: #4a3d63; }

form label { display: block; margin: 0 0 12px; font-weight: bold; }
form label.check { font-weight: normal; }
input[type="text"], input:not([type]), select, textarea {
  display: block; width: 100%; max-width: 460px; font: inherit; padding: 6px 8px; margin-top: 4px;
  border: 3px inset #bbb; background: #fff; color: var(--ink);
}
input[type="range"] { display: block; width: 100%; max-width: 460px; }
fieldset { border: 3px groove var(--pink); margin: 0 0 16px; padding: 10px 14px; }
legend { font-family: Impact, "Arial Black", sans-serif; padding: 0 8px; background: var(--yellow); }

.star-arena { position: relative; height: 170px; max-width: 560px; border: 3px dashed var(--ink); background: #fff; margin-bottom: 6px; overflow: hidden; }
.star-row { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.star-button { font: inherit; font-size: 0.9rem; cursor: pointer; background: var(--paper); border: 2px solid var(--ink); padding: 5px 9px; color: #8a5200; }
.star-button[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
#one-star { position: absolute; transition: left 0.12s ease-out, top 0.12s ease-out; touch-action: none; }
.rating-status { min-height: 1.5em; font-weight: bold; color: var(--pink); margin: 0 0 12px; }

.lines { width: 100%; border-collapse: collapse; background: #fff; }
.lines th, .lines td { border: 2px solid var(--ink); padding: 6px 8px; text-align: left; vertical-align: middle; }
.lines thead th { background: var(--ink); color: var(--yellow); }
.lines td { white-space: nowrap; }
.lines .qty span { display: inline-block; min-width: 2ch; text-align: center; font-weight: bold; }
.lines .fee th { font-weight: normal; font-style: italic; }
.lines .sum th, .lines .sum td { background: #fff3a0; }
.lines .grand th, .lines .grand td { background: var(--yellow); font-size: 1.2rem; font-weight: bold; }
.line-note { font-weight: normal; font-size: 0.85rem; margin-top: 5px; }
.totals { font-size: 1.2rem; text-align: right; margin: 10px 0 0; }
.table-scroll { overflow-x: auto; }

.stamp { display: inline-block; font-size: 0.9rem; color: var(--green); border: 3px solid var(--green); padding: 1px 8px; transform: rotate(-7deg); text-shadow: none; vertical-align: middle; }
.attempts li, .checks li { margin-bottom: 6px; }
.attempts .bad { color: var(--red); }
.attempts .ok { color: var(--green); font-weight: bold; }
.attempts.reveal li { opacity: 0; animation: appear 0.4s ease-out forwards; }
@keyframes appear { to { opacity: 1; } }
.order-list li { margin-bottom: 8px; }

progress { width: 100%; height: 20px; accent-color: var(--pink); }
.verdict { font-size: 0.8rem; font-weight: bold; padding: 1px 7px; border: 2px solid currentColor; margin-left: 4px; }
.verdict-pass .verdict { color: var(--green); }
.verdict-fail .verdict { color: var(--red); }
.verdict-inconclusive .verdict { color: #8a5200; }

.decision { border: 6px double var(--ink); padding: 14px 18px; margin: 0 0 18px; background: #fff; }
.decision h2 { font-size: 1.7rem; }
.decision-approved { background: #d9ffd0; border-color: var(--green); }
.decision-store_credit { background: #fff3a0; border-color: #8a5200; }
.decision-denied { background: #ffd9d9; border-color: var(--red); }
.decision-waiting { background: #e4ecff; border-color: var(--blue); }

.error-box { background: #fff; border: 5px solid var(--red); padding: 12px 16px; margin: 0 0 16px; }
.error-box h2 { color: var(--red); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { grid-template-columns: 1fr; }
  .header-side { text-align: left; }
  .product { grid-template-columns: 1fr; }
  .lines th, .lines td { padding: 4px 5px; font-size: 0.82rem; }
  .lines .qty { white-space: normal; }
  .lines .qty .mini { margin-bottom: 3px; }
  .chat-toggle { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; white-space: normal; }
  .blink, .dots { animation: none; }
  .attempts.reveal li { animation: none; opacity: 1; }
  .tilt-0, .tilt-1, .tilt-2, .hero { transform: none; }
  #one-star, .toast { transition: none; }
}
