:root {
  --bg-start: #f8f4e7;
  --bg-end: #e6ecf5;
  --board-bg: #fffdfa;
  --board-border: #cfb677;
  --text-main: #1a1a1a;
  --muted-red: #b78c8c;
  --muted-black: #7f7f7f;
  --card-red: #d01919;
  --card-black: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-main);
  background: linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  padding: 0 24px 0;
}

.home-brand-link {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-left: 14px;
  color: #000000;
  text-shadow: none;
  text-decoration: none;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  letter-spacing: 0.03em;
  font-weight: 700;
  line-height: 1;
}

.home-brand-text {
  margin-left: 10px;
}

.home-brand-link:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.8);
  outline-offset: 4px;
  border-radius: 8px;
}

.home-brand-icons {
  display: inline-flex;
  gap: 6px;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1;
  transform: translateY(1px);
}

.home-brand-icon.spade,
.home-brand-icon.club {
  color: #b08a48;
}

.home-brand-icon.heart,
.home-brand-icon.diamond {
  color: #ff1e1e;
}

.top-header {
  width: min(1000px, 96vw);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 16px;
}

.score-box {
  position: absolute;
  left: 0;
  width: 126px;
  min-height: 82px;
  border: 3px solid #b79c5e;
  border-radius: 12px;
  background: #fff7e8;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  padding: 8px;
}

.target-box {
  position: absolute;
  left: 138px;
  width: 126px;
  min-height: 82px;
  border: 3px solid #b79c5e;
  border-radius: 12px;
  background: #fff7e8;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  padding: 8px;
}

.score-label {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.score-value {
  width: 90px;
  min-height: 36px;
  border: 2px solid #8a7a51;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lives-settings-group {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lives-box {
  min-width: 150px;
  min-height: 82px;
  border: 3px solid #b79c5e;
  border-radius: 12px;
  background: #fff7e8;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  padding: 8px;
}

.settings-gear-btn {
  width: 34px;
  height: 34px;
  border: 2px solid #b79c5e;
  border-radius: 10px;
  background: #efe9d9;
  color: #6d5f3f;
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.settings-gear-btn:hover {
  background: #e6dcc6;
}

.lives-label {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lives-hearts {
  font-size: 1.45rem;
  font-weight: 700;
  color: #c40e0e;
  letter-spacing: 0.08em;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.03em;
}

.board {
  --pad-top: 28px;
  --pad-x: 28px;
  --pad-bottom: 36px;
  --show-guide-lines: 0;
  width: min(1000px, 96vw);
  min-height: 700px;
  border: 4px solid var(--board-border);
  border-radius: 20px;
  background: var(--board-bg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0;
}

.site-footer {
  width: 100vw;
  margin-top: 18px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 18px 16px 30px;
  text-align: center;
  background: #a9bddd;
  color: #4f5662;
}

.site-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 10px;
}

.site-footer-help-button {
  border: 2px solid #0b3b88;
  border-radius: 12px;
  padding: 8px 14px;
  background: #2f6fed;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.site-footer-help-button:hover {
  background: #1f58c5;
}

.site-footer-nav-button {
  border: 2px solid #0b3b88;
  border-radius: 10px;
  padding: 10px 18px;
  background: #e5efff;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.site-footer-nav-button:hover {
  background: #d5e5ff;
}

.site-footer-nav-button .burst-word {
  color: #dc2626;
}

.seo-content-sb {
  width: min(1000px, 96vw);
  margin-top: 6px;
  padding: 16px 18px;
  border: 1px solid #8ea0bb;
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.96);
  color: #0f172a;
}

.seo-content-sb h2 {
  margin: 0 0 10px;
  color: #0b3b88;
  font-size: 1.25rem;
}

.seo-content-sb h3 {
  margin: 12px 0 6px;
  color: #0b3b88;
  font-size: 0.98rem;
}

.seo-content-sb p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
  color: #1f2f45;
}

.sb-explainer-figure {
  margin: 10px 0 4px;
}

.sb-explainer-figure img {
  display: block;
  width: min(100%, 960px);
  height: auto;
  border: 1px solid #8ea0bb;
  border-radius: 10px;
  background: #ffffff;
}

.sb-howto-mobile {
  display: none;
}

.sb-howto-desktop {
  display: inline;
}

.sb-help-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  place-items: center;
  padding: 16px;
}

.sb-help-panel {
  width: min(760px, 96vw);
  max-height: min(90vh, 860px);
  overflow: auto;
  position: relative;
  border-radius: 14px;
  border: 2px solid #0b3b88;
  background: rgba(239, 246, 255, 0.99);
  color: #0f172a;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.38);
  padding: 18px 14px 14px;
}

.sb-help-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid #0b3b88;
  border-radius: 8px;
  background: #dbeafe;
  color: #0f172a;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
}

.sb-help-panel h2 {
  margin: 2px 0 10px;
  color: #0b3b88;
  font-size: 1.3rem;
}

.sb-help-panel h3 {
  margin: 12px 0 5px;
  color: #0b3b88;
  font-size: 1rem;
}

.sb-help-panel p {
  margin: 0;
  line-height: 1.48;
  color: #1f2f45;
}

.sb-help-play-button {
  margin-top: 16px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border: 2px solid #8f1515;
  border-radius: 12px;
  padding: 9px 14px;
  background: #c72020;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.sb-help-play-button:hover {
  background: #a61919;
}

.sb-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 5001;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  place-items: center;
  padding: 16px;
}

.sb-settings-panel {
  width: min(420px, 94vw);
  position: relative;
  border-radius: 14px;
  border: 2px solid #0b3b88;
  background: rgba(239, 246, 255, 0.99);
  color: #0f172a;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.38);
  padding: 18px 14px 14px;
}

.sb-settings-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid #0b3b88;
  border-radius: 8px;
  background: #dbeafe;
  color: #0f172a;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
}

.sb-settings-panel h2 {
  margin: 2px 0 12px;
  color: #0b3b88;
  font-size: 1.2rem;
}

.sb-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: #f8fbff;
}

.sb-settings-label {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0f172a;
}

.sb-settings-toggle {
  min-width: 78px;
  border: 2px solid #0b3b88;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: #dcfce7;
  color: #166534;
}

.sb-settings-toggle.off {
  background: #fee2e2;
  color: #991b1b;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 2.6vw, 34px);
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.site-footer-links a {
  color: #073f8d;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.site-footer-links a:hover {
  text-decoration: underline;
}

.site-footer-copy,
.site-footer-desc {
  margin: 6px 0 0;
  font-size: clamp(1.05rem, 1.6vw, 2rem);
  letter-spacing: 0.01em;
}

.suits-large,
.suits-small {
  width: 100%;
  align-items: center;
  position: relative;
  z-index: 2;
}

.play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  border: 0;
  border-radius: 999px;
  padding: 14px 34px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: #d01919;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(208, 25, 25, 0.35);
}

.play-btn:hover {
  background: #b31414;
}

.hidden {
  display: none;
}

.resume-btn {
  background: #2f6bca;
  box-shadow: 0 8px 20px rgba(47, 107, 202, 0.35);
}

.resume-btn:hover {
  background: #2458ab;
}

.top-area {
  width: 100%;
  min-height: 180px;
}

.top-columns {
  position: absolute;
  inset: var(--pad-top) var(--pad-x) var(--pad-bottom);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  pointer-events: none;
  z-index: 3;
}

.top-column {
  position: relative;
  border-left: 3px solid #d01919;
}

.top-column:last-child {
  border-right: 3px solid #d01919;
}

.top-column::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(232, 128, 12, 0.95);
}

.suits-large {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 100%;
  gap: 0;
}

.suits-small {
  display: block;
  overflow: hidden;
  min-height: 78px;
}

.suits-small::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: #17b33f;
  z-index: 1;
}

.suits-small-track {
  display: flex;
  align-items: center;
  width: 100%;
  transform: translateX(0);
}

.suits-small-track.is-moving {
  transition: transform 220ms linear;
}

.suit {
  display: grid;
  place-items: center;
  line-height: 0;
  position: relative;
  z-index: 2;
}

.suits-large .suit {
  --energy-fill: 1;
  --energy-color: #20d067;
  width: clamp(100px, 15vw, 150px);
  justify-self: center;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.suits-large .suit::before,
.suits-large .suit::after {
  content: "";
  position: absolute;
  left: 50%;
  border-radius: 999px;
  pointer-events: none;
}

.suits-large .suit::before {
  bottom: -13px;
  width: 78%;
  height: 10px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.45) 1px, transparent 1px),
    #c5c9d0;
  background-size: 4px 4px, auto;
  border: 1px solid rgba(62, 68, 79, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.suits-large .suit::after {
  bottom: -12px;
  left: 11%;
  width: calc(78% * var(--energy-fill));
  height: 8px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--energy-color) 0 7px,
      rgba(0, 0, 0, 0) 7px 9px
    );
  box-shadow: 0 0 6px rgba(32, 208, 103, 0.35);
  border-radius: 1px;
}

.suits-large .suit.suit-club svg {
  transform: scale(1.24);
  transform-origin: center;
}

.suits-large .suit.suit-dimmed {
  opacity: 0.4;
}

.suits-large .suit.suit-inactive {
  opacity: 0.4;
  filter: grayscale(0.2);
}

.suits-large .suit.suit-inactive::before,
.suits-large .suit.suit-inactive::after {
  opacity: 0;
}

.suits-large .suit.suit-available-pulse {
  animation: available-suit-pulse 2s ease;
}

@keyframes available-suit-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  15% {
    transform: scale(1.15);
    opacity: 1;
  }
  30% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  70% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.suits-small .suit {
  flex: 0 0 10%;
  width: 100%;
  justify-self: center;
}

.suits-small .suit svg {
  max-width: clamp(55px, 7.8vw, 91px);
}

.suit svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  fill: currentColor;
}

.suit-heart,
.heart {
  color: var(--card-red);
}

.suit-diamond,
.diamond {
  color: var(--card-red);
}

.suit-club,
.club {
  color: var(--card-black);
}

.suit-spade,
.spade {
  color: var(--card-black);
}

.muted.heart,
.muted.diamond {
  color: var(--muted-red);
}

.muted.club,
.muted.spade {
  color: var(--muted-black);
}

.suits-small .suit.suit-hit-feedback.heart,
.suits-small .suit.suit-hit-feedback.diamond,
.suits-small .suit.suit-perfect-feedback.heart,
.suits-small .suit.suit-perfect-feedback.diamond {
  color: var(--card-red);
}

.suits-small .suit.suit-hit-feedback.club,
.suits-small .suit.suit-hit-feedback.spade,
.suits-small .suit.suit-perfect-feedback.club,
.suits-small .suit.suit-perfect-feedback.spade {
  color: var(--card-black);
}

.suits-small .suit.suit-hit-feedback {
  animation: small-suit-hit-pulse 0.46s ease-out 3;
}

.suits-small .suit.suit-perfect-feedback {
  animation: small-suit-perfect-pulse 0.58s ease-out 4;
}

.columns {
  position: absolute;
  inset: var(--pad-top) var(--pad-x) var(--pad-bottom);
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  pointer-events: none;
  z-index: 1;
}

.column {
  position: relative;
  border-left: 1px solid rgba(36, 64, 123, 0.35);
  border-top: 1px solid rgba(36, 64, 123, 0.25);
  border-bottom: 1px solid rgba(36, 64, 123, 0.25);
}

.column:last-child {
  border-right: 1px solid rgba(36, 64, 123, 0.35);
}

.column::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: #17b33f;
}

/* Visual test mode: hide all guide lines without removing code. */
.top-columns,
.columns,
.suits-small::before,
.column-guide-flash {
  opacity: var(--show-guide-lines);
}

.drop-layer {
  position: absolute;
  inset: var(--pad-top) var(--pad-x) var(--pad-bottom);
  pointer-events: none;
  z-index: 6;
}

.column-guide-flash {
  position: absolute;
  border-left: 2px solid rgba(255, 196, 76, 0.95);
  border-right: 2px solid rgba(255, 196, 76, 0.95);
  background: rgba(255, 231, 168, 0.2);
  box-shadow: inset 0 0 18px rgba(255, 214, 112, 0.38);
  animation: column-guide-flash 1s ease-out forwards;
}

@keyframes column-guide-flash {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.match-zone-debug {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.match-zone-debug-match,
.match-zone-debug-perfect {
  position: absolute;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.match-zone-debug-match {
  place-items: start center;
  z-index: 2;
  border: 2px dashed rgba(37, 118, 198, 0.9);
  background: rgba(76, 152, 226, 0.16);
}

.match-zone-debug-perfect {
  z-index: 1;
  border: 2px solid rgba(18, 134, 53, 0.9);
  background: rgba(67, 194, 107, 0.22);
}

.match-zone-debug-match span,
.match-zone-debug-perfect span {
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.86);
}

.match-zone-debug-match span {
  margin-top: -12px;
}

.match-zone-debug-perfect span {
  text-align: center;
  line-height: 1.02;
}

.perfect-banner {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  z-index: 8;
  padding: 12px 20px;
  border: 2px solid #118631;
  border-radius: 12px;
  background: rgba(230, 255, 236, 0.96);
  color: #0e7a2c;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
}

.perfect-banner.show {
  animation: perfect-pop 2s ease-out forwards;
}

.hit-banner {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  z-index: 8;
  padding: 10px 18px;
  border: 2px solid #2c6fb8;
  border-radius: 12px;
  background: rgba(233, 245, 255, 0.98);
  color: #124f90;
  font-weight: 800;
  letter-spacing: 0.1em;
  pointer-events: none;
  opacity: 0;
}

.hit-banner.show {
  animation: combo-pop 0.9s ease-out forwards;
}

.combo-banner {
  position: absolute;
  left: 50%;
  top: 66%;
  transform: translate(-50%, -50%);
  z-index: 8;
  padding: 10px 16px;
  border: 2px solid #9e6a00;
  border-radius: 12px;
  background: rgba(255, 248, 223, 0.96);
  color: #8c5a00;
  font-weight: 800;
  letter-spacing: 0.06em;
  pointer-events: none;
  opacity: 0;
}

.combo-banner.perfect {
  border-color: #0d7e8f;
  background: rgba(228, 252, 255, 0.97);
  color: #076370;
}

.combo-banner.show {
  animation: combo-pop 1.2s ease-out forwards;
}

.target-bonus-banner {
  position: absolute;
  left: 50%;
  top: 39%;
  transform: translate(-50%, -50%);
  z-index: 8;
  padding: 10px 18px;
  border: 2px solid #6f4a00;
  border-radius: 12px;
  background: rgba(255, 241, 196, 0.98);
  color: #6a4700;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
}

.target-bonus-banner.show {
  animation: combo-pop 3s ease-out forwards;
}

.miss-banner {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  z-index: 8;
  padding: 12px 18px;
  border: 2px solid #b41f1f;
  border-radius: 12px;
  background: rgba(255, 235, 235, 0.98);
  color: #a10f0f;
  font-weight: 800;
  letter-spacing: 0.1em;
  pointer-events: none;
  opacity: 0;
}

.miss-banner.show {
  animation: combo-pop 1.1s ease-out forwards;
}

.game-over {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  width: min(460px, 90%);
  padding: 24px 22px;
  border: 3px solid #8d2c2c;
  border-radius: 16px;
  background: rgba(255, 249, 247, 0.98);
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.game-over h2 {
  margin: 0 0 14px;
  font-size: 2rem;
  letter-spacing: 0.05em;
}

.game-over p {
  margin: 8px 0;
  font-weight: 600;
}

.game-over .game-over-hidden-meta {
  display: none;
}

.game-over button {
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: #b21e1e;
  cursor: pointer;
}

.game-over-play-card-burst-button {
  display: inline-block;
  margin-top: 14px;
  border: 2px solid #6d28d9;
  background: #a78bfa;
  color: #1f1147;
  font-weight: 900;
  letter-spacing: 0.05em;
  font-size: 0.96rem;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.game-over-play-card-burst-button:hover {
  background: #8b5cf6;
}

#saveLogButton {
  margin-right: 10px;
  background: #2f6bca;
}

.drop-piece,
.drop-trail {
  position: absolute;
  width: clamp(44px, 6vw, 72px);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, 0);
}

.drop-piece {
  transition: transform 460ms cubic-bezier(0.24, 0.72, 0.32, 1);
}

.drop-trail {
  opacity: 0.55;
  animation: trail-fade 420ms ease-out forwards;
}

.drop-piece.preview {
  transition:
    transform 1.75s cubic-bezier(0.16, 0.84, 0.32, 1),
    opacity 1.8s ease;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.12));
}

.drop-trail.preview {
  animation-duration: 900ms;
  opacity: 0.4;
}

.drop-piece svg,
.drop-trail svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

@keyframes trail-fade {
  to {
    opacity: 0;
  }
}

@keyframes perfect-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.03);
  }
}

@keyframes combo-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.02);
  }
}

@keyframes small-suit-hit-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes small-suit-perfect-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .home-brand-link {
    width: 100%;
    margin-left: 0;
    padding-left: 8px;
    justify-content: flex-start;
    font-size: clamp(1.3rem, 6vw, 1.8rem);
  }

  .home-brand-text {
    margin-left: 6px;
  }

  .home-brand-icons {
    gap: 4px;
    font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  }

  .top-header {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "score target lives"
      "title title title";
    align-items: center;
    justify-items: center;
    gap: 8px 10px;
  }

  .score-box {
    position: static;
    width: 110px;
    min-height: 74px;
    padding: 6px;
    grid-area: score;
  }

  .target-box {
    position: static;
    width: 110px;
    min-height: 74px;
    padding: 6px;
    grid-area: target;
  }

  .page-title {
    grid-area: title;
    width: 100%;
    text-align: center;
  }

  .score-value {
    width: 82px;
    min-height: 32px;
    font-size: 0.9rem;
  }

  .lives-settings-group {
    position: static;
    grid-area: lives;
    justify-self: center;
  }

  .lives-box {
    min-width: 110px;
    min-height: 74px;
    padding: 6px;
  }

  .settings-gear-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .lives-hearts {
    font-size: 1.15rem;
  }

  .board {
    --pad-top: 22px;
    --pad-x: 16px;
    --pad-bottom: 26px;
    min-height: 620px;
  }

  .match-zone-debug-match,
  .match-zone-debug-perfect {
    transform: translateY(-18px);
  }

  .combo-banner,
  .perfect-banner {
    left: 50%;
    max-width: calc(100% - 24px);
    width: fit-content;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .site-footer {
    padding: 16px 12px 24px;
  }

  .site-footer-links {
    gap: 10px 18px;
  }

  .site-footer-help-button {
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  .site-footer-nav-button {
    padding: 8px 12px;
    font-size: 0.86rem;
  }

  .seo-content-sb {
    margin-top: 4px;
    padding: 12px 12px;
  }

  .seo-content-sb h2 {
    font-size: 1.06rem;
  }

  .seo-content-sb h3 {
    font-size: 0.9rem;
  }

  .seo-content-sb p {
    font-size: 0.9rem;
  }

  .sb-explainer-figure {
    margin-top: 8px;
  }

  .sb-howto-desktop {
    display: none;
  }

  .sb-howto-mobile {
    display: inline;
  }

  .sb-help-panel {
    padding: 16px 12px 12px;
  }

  .sb-help-panel h2 {
    font-size: 1.15rem;
  }

  .sb-help-panel h3 {
    font-size: 0.92rem;
  }

  .sb-help-panel p {
    font-size: 0.9rem;
  }
}

