.match3-shell-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 180, 66, 0.16), transparent 22%),
    radial-gradient(circle at 82% 16%, rgba(76, 201, 240, 0.14), transparent 28%),
    linear-gradient(180deg, #09101b 0%, #121d30 54%, #0d1623 100%);
}

.match3-page-content {
  display: grid;
  gap: 14px;
}

.match3-head .page-kicker,
.section-kicker {
  color: #f2b45a;
}

.match3-head h1,
.match3-section-head h2,
.match3-info-card h2 {
  color: #f4f7fb;
}

.match3-head .page-copy,
.match3-meta-copy,
.match3-message,
.match3-info-card p,
.match3-info-card li {
  color: #9fb0c7;
}

.match3-stage-card,
.match3-info-card,
.match3-sheet .info-card {
  border: 1px solid rgba(129, 154, 188, 0.16);
  background: linear-gradient(180deg, rgba(17, 29, 47, 0.96), rgba(11, 20, 34, 0.98));
  box-shadow: 0 24px 60px rgba(2, 8, 20, 0.42);
}

.match3-stage-card {
  padding: 12px;
  border-radius: 30px;
}

.match3-topbar,
.match3-objective-card,
.match3-skill-panel {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(129, 154, 188, 0.14);
  background: rgba(10, 18, 31, 0.76);
}

.match3-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match3-section-head h2 {
  margin: 0;
  font-size: 1.18rem;
}

.section-kicker {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match3-meta-copy {
  font-size: 0.86rem;
  text-align: right;
}

.match3-level-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.match3-level-button {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(129, 154, 188, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 36, 58, 0.98), rgba(14, 24, 40, 0.98));
  color: #e6edf7;
  text-align: left;
  font: inherit;
}

.match3-level-button.active {
  border-color: rgba(255, 183, 77, 0.46);
  box-shadow: 0 12px 28px rgba(255, 183, 77, 0.12);
}

.match3-level-button.locked {
  opacity: 0.42;
}

.match3-level-button.cleared::after {
  content: attr(data-stars) "★";
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 0.78rem;
  color: #f5c45f;
}

.match3-level-no {
  color: #72d0ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.match3-hud-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.match3-hud-card {
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(129, 154, 188, 0.12);
  background: linear-gradient(180deg, rgba(20, 34, 54, 1), rgba(14, 23, 37, 1));
}

.match3-hud-label {
  display: block;
  margin-bottom: 8px;
  color: #89a0bd;
  font-size: 0.8rem;
}

.match3-hud-card strong {
  color: #f4f7fb;
  font-size: 1.34rem;
}

.match3-goal-list,
.match3-skill-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.match3-goal-item,
.match3-skill-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(129, 154, 188, 0.12);
  background: rgba(17, 28, 45, 0.92);
}

.match3-goal-item.done {
  border-color: rgba(92, 214, 154, 0.26);
}

.goal-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.goal-dot.collect {
  background: #72d0ff;
}

.goal-dot.jelly {
  background: #9b8cff;
}

.goal-dot.deliver {
  background: #f5c45f;
}

.goal-dot.blocker {
  background: #d3795b;
}

.goal-copy {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.goal-copy strong {
  color: #eef3fa;
}

.goal-copy span {
  color: #89a0bd;
  font-weight: 700;
}

.match3-canvas-shell {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(129, 154, 188, 0.16);
  background:
    radial-gradient(circle at top, rgba(114, 208, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #06101c 0%, #0b1726 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.match3-canvas {
  width: 100%;
  min-height: min(76vh, 840px);
  aspect-ratio: 9 / 16;
  touch-action: none;
}

.match3-canvas canvas {
  display: block;
  width: 100%;
  height: auto;
}

.stage-toast {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-10px);
  min-width: 180px;
  max-width: calc(100% - 28px);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(242, 180, 90, 0.26);
  background: rgba(9, 17, 28, 0.94);
  color: #f2b45a;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 180ms ease, transform 180ms ease;
}

.stage-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stage-toast.hidden {
  display: none;
}

.match3-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 10, 18, 0.52);
  z-index: 5;
}

.match3-overlay.hidden {
  display: none;
}

.match3-overlay-card {
  width: 100%;
  max-width: 352px;
  padding: 24px 20px;
  border-radius: 24px;
  border: 1px solid rgba(129, 154, 188, 0.2);
  background: linear-gradient(180deg, rgba(17, 29, 47, 0.98), rgba(10, 18, 31, 0.98));
  text-align: center;
}

.match3-overlay-tag {
  margin: 0 0 8px;
  color: #f2b45a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match3-overlay-card h2 {
  margin: 0 0 10px;
  color: #f4f7fb;
  font-size: 1.72rem;
}

.match3-overlay-card p {
  margin: 0 0 16px;
  color: #9fb0c7;
  line-height: 1.6;
}

.match3-overlay-actions {
  display: grid;
  gap: 8px;
}

#match3ActionButton {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: #07111d;
  background: linear-gradient(135deg, #f7c55d, #ef9f3f);
  font: inherit;
  font-weight: 800;
}

#match3SecondaryButton {
  width: 100%;
  border-radius: 16px;
  border-color: rgba(129, 154, 188, 0.18);
  color: #d8e3f1;
}

.match3-skill-button {
  width: 100%;
  justify-content: space-between;
  color: #eaf0f8;
  font: inherit;
  text-align: left;
}

.match3-skill-button.active {
  border-color: rgba(114, 208, 255, 0.34);
  box-shadow: 0 10px 20px rgba(114, 208, 255, 0.08);
}

.match3-skill-button:disabled {
  opacity: 0.5;
}

.match3-skill-copy {
  display: block;
  margin-top: 4px;
  color: #8ea2be;
  font-size: 0.88rem;
}

.match3-skill-count {
  color: #f2b45a;
  font-weight: 800;
}

.match3-message {
  margin: 12px 0 0;
}

.match3-info-card .card-content {
  position: relative;
}

.match3-info-card .card-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(114, 208, 255, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 60%);
  pointer-events: none;
}

.match3-info-card h2,
.match3-info-card p,
.match3-info-card ul,
.match3-info-card ol {
  position: relative;
  z-index: 1;
}

.match3-sheet .info-card p,
.match3-sheet .powerup-list,
.match3-info-card .powerup-list,
.match3-info-card .leaderboard-list {
  color: #9fb0c7;
}

.match3-sheet .info-card h2 {
  color: #f4f7fb;
}

@media (min-width: 768px) {
  .match3-insight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .match3-level-list,
  .match3-hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match3-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .match3-meta-copy {
    text-align: left;
  }
}

@media (max-width: 430px) {
  .match3-page-content {
    gap: 12px;
  }

  .match3-stage-card {
    padding: 10px;
    border-radius: 24px;
  }

  .match3-topbar,
  .match3-objective-card,
  .match3-skill-panel {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 18px;
  }

  .match3-level-list,
  .match3-hud-grid {
    gap: 8px;
  }

  .match3-level-button,
  .match3-hud-card {
    min-height: 68px;
    padding: 10px;
    border-radius: 16px;
  }

  .match3-canvas {
    min-height: min(62vh, 620px);
  }
}
