:root {
  --spider-red: #e62429;
  --spider-red-dark: #8a141a;
  --spider-blue: #1b1f4d;
  --spider-blue-deep: #0d0f29;
  --spider-black: #0a0a0a;
  --spider-white: #ffffff;
  --gold: #f5c518;
  --muted: rgba(255, 255, 255, 0.65);
  --line: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--spider-black);
  color: var(--spider-white);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(230, 36, 41, 0.18), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(27, 31, 77, 0.55), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g stroke='white' stroke-width='0.6' stroke-opacity='0.07' fill='none'><line x1='0' y1='0' x2='200' y2='0'/><line x1='0' y1='0' x2='200' y2='80'/><line x1='0' y1='0' x2='160' y2='160'/><line x1='0' y1='0' x2='80' y2='200'/><line x1='0' y1='0' x2='0' y2='200'/><path d='M 0 0 Q 35 35 70 70'/><path d='M 0 0 Q 70 70 140 140'/><path d='M 70 0 Q 95 35 70 70'/><path d='M 120 0 Q 130 60 120 120'/><path d='M 0 70 Q 35 95 70 70'/><path d='M 0 120 Q 60 130 120 120'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g stroke='white' stroke-width='0.6' stroke-opacity='0.06' fill='none' transform='rotate(180 100 100)'><line x1='0' y1='0' x2='200' y2='0'/><line x1='0' y1='0' x2='200' y2='80'/><line x1='0' y1='0' x2='160' y2='160'/><line x1='0' y1='0' x2='80' y2='200'/><path d='M 0 0 Q 35 35 70 70'/><path d='M 0 0 Q 70 70 140 140'/><path d='M 70 0 Q 95 35 70 70'/><path d='M 0 70 Q 35 95 70 70'/></g></svg>");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: top left, bottom right, top left, bottom right;
  background-size: cover, cover, 240px 240px, 240px 240px;
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px calc(32px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.screen.animate-in {
  animation: fade-in 0.32s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 28px;
  letter-spacing: 3px;
  background: var(--spider-red);
  color: var(--spider-white);
  border: 3px solid var(--spider-white);
  border-radius: 14px;
  padding: 16px 24px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 0 var(--spider-red-dark), 0 8px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--spider-red-dark), 0 3px 6px rgba(0, 0, 0, 0.45);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: 0 4px 0 var(--spider-red-dark);
}

.btn-bottom {
  margin-top: auto;
}

.fill-screen .btn-bottom {
  margin-top: 0;
}

/* ---------- Back button (small, top-left) ---------- */
.back-btn {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: "Marvel", "Bangers", cursive;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 6px 4px;
  margin: -4px 0 10px -4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.back-btn:active {
  color: var(--spider-white);
}

/* ---------- Welcome screen ---------- */
.hanging {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 8px;
}

.thread {
  width: 2px;
  height: 70px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 100%
  );
  transform-origin: top;
}

.spider {
  font-size: 64px;
  line-height: 1;
  margin-top: -6px;
  transform-origin: center -70px;
  animation: dangle 3.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.spider-pixel {
  width: 92px;
  font-size: 0;
  margin-top: -2px;
  display: block;
}

.spider-pixel svg {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.spider-swing {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 5;
  transform-origin: 50% 0;
  will-change: transform;
}

.spider-swing-thread {
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 30%,
    rgba(255, 255, 255, 0.85) 100%
  );
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.45);
}

.spider-swing-body {
  line-height: 1;
  margin-top: -2px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}

@keyframes dangle {
  0%,
  100% {
    transform: rotate(-9deg);
  }
  50% {
    transform: rotate(9deg);
  }
}

/* ---------- Cinematic intro ---------- */
.welcome.intro .thread {
  animation: thread-drop 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.welcome.intro .spider {
  animation: spider-drop 1s cubic-bezier(0.2, 0.8, 0.3, 1) both,
             dangle 3.4s ease-in-out 1.6s infinite;
}

.welcome.intro .title {
  animation: title-slam 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4) 0.85s both;
}

.welcome.intro .tagline {
  animation: fade-in 0.5s ease-out 1.25s both;
}

.welcome.intro .btn-bottom {
  animation: fade-in 0.5s ease-out 1.45s both;
}

@keyframes thread-drop {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

@keyframes spider-drop {
  0%   { transform: translateY(-120vh) rotate(-25deg); opacity: 0; }
  60%  { transform: translateY(14px) rotate(8deg); opacity: 1; }
  78%  { transform: translateY(-6px) rotate(-6deg); }
  100% { transform: translateY(0) rotate(-9deg); opacity: 1; }
}

@keyframes title-slam {
  0%   { transform: scale(2.2) rotate(-3deg); opacity: 0; filter: blur(6px); }
  60%  { transform: scale(0.95) rotate(1deg); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.web-crack {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: crack-fade 1.1s ease-out forwards;
}

.web-crack svg {
  width: min(140vmin, 1400px);
  height: min(140vmin, 1400px);
  opacity: 0;
  transform: scale(0.4);
  animation: crack-pop 0.7s cubic-bezier(0.15, 0.9, 0.25, 1.1) forwards;
}

.web-crack .crack-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9), rgba(230, 36, 41, 0.4) 30%, transparent 60%);
  animation: flash 0.35s ease-out forwards;
}

@keyframes crack-pop {
  0%   { opacity: 0; transform: scale(0.3) rotate(-8deg); }
  35%  { opacity: 1; transform: scale(1.05) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes crack-fade {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes flash {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Mute toggle */
.mute-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  right: 14px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.6);
  color: var(--spider-white);
  font-size: 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  transition: transform 0.1s, background 0.15s;
}

.mute-toggle:active { transform: scale(0.92); }
.mute-toggle.muted  { opacity: 0.55; }

.title {
  font-family: "Marvel", "Bangers", cursive;
  font-size: clamp(48px, 15vw, 84px);
  letter-spacing: 2px;
  color: var(--spider-red);
  text-align: center;
  line-height: 0.95;
  margin-top: 36px;
  text-shadow:
    3px 3px 0 var(--spider-blue),
    6px 6px 0 rgba(0, 0, 0, 0.55);
}

.tagline {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 18px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ---------- Question shell ---------- */
.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
}

.progress-dot {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  transition: background 0.2s;
}

.progress-dot.done {
  background: rgba(230, 36, 41, 0.55);
}

.progress-dot.active {
  background: var(--spider-red);
}

.q-label {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--spider-red);
  margin-bottom: 10px;
}

.point-tracker {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.point-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.point-stat:last-child {
  text-align: right;
}

.point-label {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}

.point-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0;
  white-space: nowrap;
}

.q-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 22px;
}

/* ---------- Multiple choice ---------- */
.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.choice {
  background: rgba(27, 31, 77, 0.6);
  border: 2px solid var(--line);
  color: var(--spider-white);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 14px 16px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice:active {
  transform: scale(0.98);
}

.choice.selected {
  background: var(--spider-red);
  border-color: var(--spider-white);
  font-weight: 600;
}

.choice-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.choice.selected .choice-num {
  border-color: var(--spider-white);
  color: var(--spider-white);
}

.choice-text {
  flex: 1;
}

.feedback-splash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 22px 34px;
  border-radius: 18px;
  background: rgba(12, 14, 40, 0.92);
  border: 3px solid var(--spider-red);
  color: var(--spider-red);
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(34px, 9vw, 64px);
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 92vw;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  box-shadow:
    0 0 40px rgba(226, 53, 49, 0.45),
    0 14px 40px rgba(0, 0, 0, 0.55);
  text-shadow: 0 0 14px rgba(226, 53, 49, 0.6);
  transition: opacity 0.18s ease-out, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feedback-splash.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.feedback-splash.leave {
  opacity: 0;
  transform: translate(-50%, -55%) scale(0.92);
  transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}

.feedback-splash.success {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow:
    0 0 40px rgba(245, 197, 24, 0.5),
    0 14px 40px rgba(0, 0, 0, 0.55);
  text-shadow: 0 0 14px rgba(245, 197, 24, 0.65);
}

/* ---------- Fill-in-the-blank (Jeopardy) ---------- */
.jeopardy {
  background: var(--spider-blue);
  border: 4px solid var(--gold);
  border-radius: 14px;
  padding: 28px 18px;
  margin-bottom: 22px;
  box-shadow:
    0 6px 0 var(--spider-blue-deep),
    0 12px 22px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.jeopardy-prompt {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 26px;
  color: var(--gold);
  text-align: center;
  letter-spacing: 1px;
  line-height: 1.15;
  text-shadow: 2px 2px 0 var(--spider-black);
}

.jeopardy-input {
  width: 100%;
  background: var(--spider-black);
  border: 2px solid var(--gold);
  color: var(--spider-white);
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 22px;
  text-align: center;
  letter-spacing: 0.5px;
}

.jeopardy-input:focus {
  outline: none;
  border-color: var(--spider-red);
  box-shadow: 0 0 0 3px rgba(230, 36, 41, 0.25);
}

.hint-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.hint-btn {
  background: transparent;
  border: 2px dashed var(--gold);
  color: var(--gold);
  font-family: "Marvel", "Bangers", cursive;
  font-size: 16px;
  letter-spacing: 2px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.hint-btn:active {
  background: var(--gold);
  color: var(--spider-black);
}

.hint-text {
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  text-align: center;
  padding: 10px 16px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: rgba(245, 197, 24, 0.08);
  animation: fade-in 0.25s ease-out;
}

/* ---------- Picture matching ---------- */
.match-help {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.4;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 56px;
  margin-bottom: 18px;
  position: relative;
  touch-action: pan-y;
}

body.match-dragging,
body.match-dragging .match-grid,
body.match-dragging .match-item {
  touch-action: none;
  overscroll-behavior: contain;
}

.match-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.match-lines .web-strand,
.match-lines .web-cross-thread {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.match-lines .web-strand {
  stroke: rgba(255, 255, 255, 0.92);
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.62))
    drop-shadow(0 0 8px rgba(245, 197, 24, 0.28));
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-web 0.42s ease-out forwards;
}

.match-lines .web-strand-main {
  stroke-width: 2.7;
}

.match-lines .web-strand-side {
  opacity: 0.58;
  stroke-width: 1.2;
}

.match-lines .web-cross-thread {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.1;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.35));
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: draw-web 0.28s ease-out forwards;
}

.match-lines .web-knot {
  fill: var(--spider-white);
  stroke: rgba(245, 197, 24, 0.72);
  stroke-width: 1.5;
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0 9px rgba(245, 197, 24, 0.36));
}

.match-lines .match-preview-line {
  fill: none;
  stroke: var(--spider-white);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
  opacity: 0.88;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.45));
}

.match-lines .match-preview-dot {
  fill: var(--spider-white);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.58));
}

@keyframes draw-web {
  to {
    stroke-dashoffset: 0;
  }
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  z-index: 2;
}

.match-item {
  position: relative;
  background: rgba(27, 31, 77, 0.6);
  border: 2px solid var(--line);
  color: var(--spider-white);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.match-item:active {
  transform: scale(0.97);
}

.match-item .emoji-icon {
  font-size: 30px;
  line-height: 1;
}

.match-image-item {
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
  background-image:
    linear-gradient(
      180deg,
      rgba(5, 8, 28, 0.02) 0%,
      rgba(5, 8, 28, 0.26) 46%,
      rgba(5, 8, 28, 0.94) 100%
    ),
    var(--match-image);
  background-position: center, var(--match-image-position, center);
  background-repeat: no-repeat;
  background-size: cover, var(--match-image-size, cover);
  border-color: rgba(255, 255, 255, 0.26);
}

.match-image-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 55% 18%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(7, 10, 31, 0.36), transparent 45%);
  pointer-events: none;
}

.match-image-label {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 22px 6px 8px;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 28, 0.92));
  color: var(--spider-white);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.88);
}

.match-item.drawing-source,
.match-item.drop-target {
  background-color: var(--spider-red);
  border-color: var(--spider-white);
}

.match-image-item.drawing-source,
.match-image-item.drop-target {
  background-image:
    linear-gradient(
      180deg,
      rgba(194, 24, 7, 0.12) 0%,
      rgba(194, 24, 7, 0.46) 48%,
      rgba(82, 9, 8, 0.96) 100%
    ),
    var(--match-image);
}

.match-item.matched {
  background-color: rgba(245, 197, 24, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

.match-image-item.matched {
  background-image:
    linear-gradient(
      180deg,
      rgba(245, 197, 24, 0.04) 0%,
      rgba(31, 28, 10, 0.22) 48%,
      rgba(26, 22, 6, 0.94) 100%
    ),
    var(--match-image);
  color: var(--spider-white);
}

.pair-num {
  position: absolute;
  top: -9px;
  right: -9px;
  background: var(--gold);
  color: var(--spider-black);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-family: "Marvel", "Bangers", cursive;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 0;
}

/* ---------- Results ---------- */
.results-eyebrow {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--spider-red);
  text-align: center;
  margin-top: 24px;
}

.score-display {
  text-align: center;
  margin: 20px 0 10px;
}

.score-number {
  font-family: "Marvel", "Bangers", cursive;
  font-size: clamp(96px, 32vw, 144px);
  color: var(--spider-red);
  letter-spacing: 4px;
  line-height: 1;
  text-shadow:
    4px 4px 0 var(--spider-blue),
    8px 8px 0 rgba(0, 0, 0, 0.6);
  display: inline-block;
  animation: pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.score-total {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 30px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: -8px;
}

@keyframes pop {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0 0;
}

.rank-row {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}

.rank-row.achieved {
  opacity: 1;
}

.rank-row.current {
  background: rgba(245, 197, 24, 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 6px 18px rgba(245, 197, 24, 0.18);
  opacity: 1;
}

.rank-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rank-row-title {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 20px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.6);
}

.rank-row.achieved .rank-row-title {
  color: rgba(255, 255, 255, 0.85);
}

.rank-row.current .rank-row-title {
  color: var(--gold);
  font-size: 22px;
  text-shadow: 1px 1px 0 var(--spider-black);
}

.rank-row-min {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  flex-shrink: 0;
}

.rank-row.current .rank-row-min {
  color: var(--gold);
}

.rank-row-blurb {
  display: none;
  font-family: "Inter", sans-serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 6px;
  line-height: 1.4;
}

.rank-row.current .rank-row-blurb {
  display: block;
}

.breakdown {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row .mark {
  font-family: "Marvel", "Bangers", cursive;
  font-size: 18px;
  letter-spacing: 1px;
}

.breakdown-row .mark.right {
  color: var(--gold);
}

.breakdown-row .mark.wrong {
  color: var(--spider-red);
}

/* ---------- About / attribution block ---------- */
.about-block {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.about-block p {
  margin: 0 0 8px;
}

.about-block p:last-child {
  margin-bottom: 0;
}

.about-block a {
  color: var(--spider-red);
  text-decoration: underline;
}

.about-block a:visited {
  color: var(--spider-red);
}

/* ---------- Match keyboard shortcuts ---------- */
.match-kb-shortcut {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 2;
  font-family: "Marvel", "Bangers", cursive;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(10, 10, 10, 0.65);
  color: var(--spider-white);
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-transform: uppercase;
  pointer-events: none;
}

.match-item.kb-pending {
  background-color: rgba(230, 36, 41, 0.35);
  border-color: var(--spider-red);
}

.match-image-item.kb-pending {
  background-image:
    linear-gradient(
      180deg,
      rgba(194, 24, 7, 0.18) 0%,
      rgba(194, 24, 7, 0.46) 48%,
      rgba(82, 9, 8, 0.92) 100%
    ),
    var(--match-image);
}
