/* Which Kitchen Appliance Are You? – studio look: square corners, 3px black outlines, hard shadows, Rubik. */
:root {
  --paper: #FAF7F0; --beige: #EFE7D3; --slate: #4C5966; --ink: #1E2328; --ink-soft: #4A4F55;
  --sunny: #FFC845; --sky: #3DA5F4; --coral: #FF6B57; --grape: #7A5CFF; --glow: #80FF84;
  --accent: var(--sunny);
  --border: 3px solid #000; --shadow: 5px 5px 0 #000; --shadow-sm: 3px 3px 0 #000;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); font: 400 1rem/1.45 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
canvas.sprite { image-rendering: pixelated; display: block; }

/* ---- The fake quiz site's header ---- */
.site {
  display: flex; align-items: center; gap: 24px; padding: 8px max(16px, env(safe-area-inset-left));
  background: var(--grape); border-bottom: var(--border);
}
.logo {
  font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; color: var(--sunny);
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.fake-nav { display: flex; gap: 18px; color: #fff; font-weight: 500; font-size: .95rem; }
.fake-nav span { opacity: .9; }
.mute {
  margin-left: auto; width: 40px; height: 40px; font-size: 1.1rem; line-height: 1;
  background: #fff; border: var(--border); box-shadow: var(--shadow-sm); cursor: pointer; border-radius: 0; padding: 0;
}
.mute:active { transform: translate(3px, 3px); box-shadow: none; }

main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 20px 16px 28px; }
.screen { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1, h2 { font-weight: 800; letter-spacing: -.01em; margin: 0; line-height: 1.08; }
.kicker { margin: 0 0 6px; font-weight: 700; color: var(--ink-soft); font-size: .95rem; }
.hot { display: inline-block; padding: 1px 8px; margin-right: 6px; background: var(--coral); color: #000; border: 2px solid #000; }
.fine { margin: 10px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 48px; padding: .6em 1.2em;
  font: 700 1.05rem/1.1 var(--font); color: #000; text-decoration: none; text-align: center;
  background: #fff; border: var(--border); border-radius: 0; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn.primary { background: var(--sunny); font-size: 1.15rem; }
.btn.small { min-height: 44px; padding: .5em .9em; font-size: .95rem; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn:focus-visible, .answer:focus-visible, .g-item:focus-visible, .rel:focus-visible, .mute:focus-visible, .link:focus-visible {
  outline: 3px solid var(--sky); outline-offset: 3px;
}
.link { background: none; border: 0; padding: 4px 2px; font: 500 .9rem var(--font); color: var(--ink-soft); text-decoration: underline; cursor: pointer; }

/* ---- Tiles holding sprites ---- */
.tile { display: inline-flex; padding: 4px; border: var(--border); flex: none; }
.tile.small { padding: 2px; border-width: 2px; vertical-align: middle; margin-right: 8px; }

/* ---- Start ---- */
#start { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding-top: 12px; }
#start h1 { font-size: clamp(2rem, 6vw, 3.6rem); margin: 4px 0 10px; }
.dek { font-size: 1.25rem; font-weight: 500; margin: 0 0 22px; }
.start-buttons { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.start-sprites { display: grid; grid-template-columns: repeat(4, auto); gap: 10px; }
.start-sprites .tile { box-shadow: var(--shadow-sm); }

/* ---- Question ---- */
.q-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.q-num { font-weight: 700; white-space: nowrap; }
.q-bar { flex: 1; height: 16px; border: var(--border); background: #fff; position: relative; display: block; }
.q-bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--grape); transition: width .2s; }
.q-text { font-size: clamp(1.5rem, 4.2vw, 2.4rem); margin-bottom: 20px; outline: none; }
.answers { display: grid; grid-template-columns: 1fr; gap: 12px; }
.answer {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 14px; text-align: left;
  font: 500 1.1rem/1.25 var(--font); color: var(--ink); background: #fff;
  border: var(--border); border-radius: 0; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .08s;
}
.answer:hover { background: #FFF6DA; }
.answer:active, .answer.picked { transform: translate(3px, 3px); box-shadow: none; background: var(--sunny); }
.answer .key {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px;
  font-weight: 800; background: var(--grape); color: #fff; border: 2px solid #000;
}

/* ---- Calculating ---- */
#calc { text-align: center; padding: 40px 0; cursor: pointer; user-select: none; }
#calc h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.calc-line { font-size: 1.2rem; font-weight: 500; min-height: 1.6em; margin: 14px 0; }
.q-bar.big { max-width: 420px; margin: 0 auto; height: 22px; }

/* ---- Result ---- */
.result-top { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 28px; align-items: start; }
.card-wrap { line-height: 0; }
#card { width: 100%; height: auto; display: block; }
.r-name { font-size: clamp(2.2rem, 6vw, 3.8rem); margin-bottom: 8px; }
.r-line { font-size: 1.3rem; font-weight: 500; margin: 0 0 18px; }
.r-buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.r-status { min-height: 1.4em; margin: 10px 0 0; font-weight: 500; color: #1D6831; }
.result-more { max-width: 720px; margin-top: 28px; }
.r-blurb { font-size: 1.1rem; margin: 0 0 16px; }
.r-pals { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 20px; }
.r-pals dt { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.r-pals dd { margin: 4px 0 0; font-weight: 700; display: flex; align-items: center; }

.related { margin-top: 36px; padding-top: 18px; border-top: var(--border); }
.related h2 { font-size: 1.2rem; margin-bottom: 12px; }
.related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rel {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; color: #000; text-decoration: none;
  background: var(--c, #fff); border: var(--border); box-shadow: var(--shadow-sm);
}
.rel b { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.rel small { font-size: .8rem; }
.rel span { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: .9rem; }
.rel:active { transform: translate(3px, 3px); box-shadow: none; }

/* ---- Gallery ---- */
.g-top { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.g-top h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.g-top .fine { margin-top: 4px; }
.g-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.g-item {
  position: relative; display: flex; gap: 12px; align-items: center; padding: 10px; text-align: left;
  font: inherit; color: inherit; background: #fff; border: var(--border); box-shadow: var(--shadow-sm); cursor: pointer; border-radius: 0;
}
.g-item:active { transform: translate(3px, 3px); box-shadow: none; }
.g-text b { display: block; font-weight: 800; font-size: 1.05rem; }
.g-text span { display: block; font-size: .9rem; color: var(--ink-soft); line-height: 1.3; }
.g-item.seen::after {
  content: "✓"; position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; display: grid; place-items: center;
  font-weight: 800; background: var(--glow); border: var(--border);
}

.foot { padding: 14px 16px; text-align: center; font-size: .85rem; color: var(--ink-soft); background: var(--beige); border-top: var(--border); }
.foot a { color: inherit; font-weight: 700; }

/* ---- Wider screens: answers in a 2x2 grid ---- */
@media (min-width: 640px) {
  .answers { grid-template-columns: 1fr 1fr; }
  .answer { min-height: 72px; }
}

/* ---- Phones held upright ---- */
@media (max-width: 640px) {
  .fake-nav { display: none; }
  #start { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .start-sprites { grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px; }
  .start-sprites .tile { padding: 2px; }
  .result-top { grid-template-columns: 1fr; gap: 18px; }
  .card-wrap { max-width: 420px; }
  .q-top { flex-wrap: wrap; }
  .q-bar { order: 3; flex-basis: 100%; }
  .q-top .link { margin-left: auto; }
}

/* ---- Short screens (phones held sideways: as little as 700x260) ---- */
@media (max-height: 480px) and (min-width: 500px) {
  .site { padding-top: 4px; padding-bottom: 4px; }
  .logo { font-size: 1.2rem; }
  .mute { width: 34px; height: 34px; font-size: .95rem; }
  main { padding: 10px 16px 16px; }
  .fine { margin-top: 6px; }
  #start { grid-template-columns: 1fr auto; gap: 18px; padding-top: 0; }
  #start h1 { font-size: 1.8rem; margin: 2px 0 4px; }
  .dek { font-size: 1rem; margin-bottom: 10px; }
  .start-sprites .tile { padding: 1px; }
  .start-sprites canvas { width: 32px; height: 32px; }
  .start-sprites { gap: 6px; }
  .q-top { margin-bottom: 8px; }
  .q-text { font-size: 1.25rem; margin-bottom: 10px; }
  .answers { grid-template-columns: 1fr 1fr; gap: 8px; }
  .answer { min-height: 48px; padding: 6px 10px; font-size: .95rem; }
  .answer .key { width: 26px; height: 26px; }
  #calc { padding: 16px 0; }
  .result-top { grid-template-columns: auto 1fr; gap: 18px; }
  .card-wrap { width: calc(100vh - 110px); width: calc(100dvh - 110px); max-width: 300px; min-width: 140px; }
  .r-name { font-size: 1.9rem; margin-bottom: 4px; }
  .r-line { font-size: 1rem; margin-bottom: 10px; }
  .r-buttons { gap: 8px; }
  .btn { min-height: 44px; }
  .btn.primary { font-size: 1.05rem; }
  .result-more { margin-top: 18px; }
  .g-top { margin-bottom: 10px; }
}
@media (max-height: 300px) and (min-width: 500px) {
  .site { padding-top: 2px; padding-bottom: 2px; }
  .logo { font-size: 1.05rem; }
  .fake-nav { font-size: .85rem; }
  .mute { width: 30px; height: 30px; box-shadow: 2px 2px 0 #000; }
  main { padding-top: 6px; }
  .kicker { margin-bottom: 2px; font-size: .85rem; }
  #start .fine { display: none; }
  .q-top { margin-bottom: 4px; }
  .q-bar { height: 12px; }
  .q-text { font-size: 1.15rem; margin-bottom: 8px; }
  .answers { gap: 6px; }
  .answer { min-height: 40px; padding: 4px 10px; font-size: .9rem; line-height: 1.2; }
  .card-wrap { width: calc(100vh - 100px); width: calc(100dvh - 100px); }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .btn, .answer, .q-bar > span { transition: none; }
}
