:root {
  color-scheme: dark;
  --bg: #090b14;
  --panel: #121424;
  --panel-elevated: #1a1c32;
  --panel-card: #0d0f1c;
  --ink: #f7f4fc;
  --muted: #9f96b8;
  --line: #ffffff14;
  --accent-pink: #ff3b81;
  --accent-gold: #ffbe0b;
  --accent-purple: #9d4edd;
  --accent-cyan: #00d2ff;
  --accent-mint: #06d6a0;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 75% 0%, #26163b 0%, transparent 48%),
              radial-gradient(ellipse at 20% 90%, #151b3a 0%, transparent 45%),
              var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  color: inherit;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}


.site-header {
  height: 82px;
  max-width: 1350px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-logo {
  height: 38px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 600px) {
  .brand-logo {
    height: 28px;
  }
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff3b81, #ffbe0b);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(255, 59, 129, 0.35);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--muted);
}

.header-links a:hover {
  color: var(--accent-gold);
}


main {
  max-width: 1350px;
  margin: 0 auto;
  padding: 10px 0 0;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 6px;
}

.eyebrow {
  color: var(--accent-pink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.title-row h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin: 6px 0 4px;
  font-weight: 700;
}

.title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.game-tags {
  display: flex;
  gap: 8px;
}

.game-tags span {
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 6px 12px;
  color: #c9bfdb;
  letter-spacing: 0.06em;
}


.game-shell {
  position: relative;
  background: #0f111f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.55);
}


.candy-hud-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 26px;
  background: linear-gradient(90deg, #16182c, #131426 50%, #17182e);
  border-bottom: 1px solid var(--line);
}

.hud-pill-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.candy-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d0e1a;
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 10px;
}

.stat-pill-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.candy-stat-pill strong {
  font-size: 15px;
  font-weight: 750;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.moves-pill.moves-low {
  border-color: rgba(255, 59, 129, 0.6);
  background: rgba(255, 59, 129, 0.15);
  animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-danger {
  from { box-shadow: 0 0 0 0 rgba(255, 59, 129, 0.4); }
  to { box-shadow: 0 0 14px 2px rgba(255, 59, 129, 0.35); }
}

.candy-objective-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #0b0c16;
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: 12px;
  margin: 0 auto;
}

.objective-items {
  display: flex;
  gap: 12px;
  align-items: center;
}

.obj-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.obj-item.done {
  opacity: 0.45;
  text-decoration: line-through;
}

.obj-item-icon {
  font-size: 16px;
}


.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #171a2e;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #b7aed1;
  transition: all 0.2s ease;
}

.icon-button:hover {
  background: #252a47;
  color: var(--accent-gold);
  border-color: rgba(255, 190, 11, 0.4);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.candy-star-track-wrap {
  padding: 12px 26px 14px;
  background: #0f1122;
  border-bottom: 1px solid var(--line);
}

.star-track-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 6px;
}

.star-track-label {
  color: var(--muted);
}

.star-track-label strong {
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  margin-left: 4px;
}

.star-track-target {
  color: #8c82a8;
}

.star-track-target strong {
  color: #d1c8ea;
  font-variant-numeric: tabular-nums;
}

.candy-progress-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: visible;
}

.candy-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff3b81, #ffbe0b);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(255, 190, 11, 0.45);
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.star-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  filter: grayscale(1) opacity(0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.star-marker.star-1 { left: 33%; }
.star-marker.star-2 { left: 66%; }
.star-marker.star-3 { left: 100%; }

.star-marker.reached {
  filter: none;
  transform: translate(-50%, -50%) scale(1.35);
  text-shadow: 0 0 10px rgba(255, 190, 11, 0.8);
}


.candy-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 260px;
  background: radial-gradient(ellipse at 50% 50%, rgba(38, 22, 59, 0.25) 0%, transparent 70%);
}


.candy-sidebar-left {
  padding: 22px 20px;
  border-right: 1px solid var(--line);
  background: #111324;
  display: flex;
  flex-direction: column;
}

.sidebar-heading {
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--accent-pink);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.candy-sidebar-left h2 {
  font-size: 15px;
  margin: 0 0 8px;
  font-weight: 700;
  color: #fff;
}

.sidebar-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 20px;
}

.stage-btn {
  height: 38px;
  border: 1px solid var(--line);
  background: #171a2e;
  border-radius: 8px;
  color: #b7aed1;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
}

.stage-btn:hover {
  background: #252a4a;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.stage-btn.active {
  background: linear-gradient(135deg, #ff3b81, #d62d69);
  color: #fff;
  border-color: #ff3b81;
  box-shadow: 0 3px 12px rgba(255, 59, 129, 0.35);
}

.stage-btn.complete {
  border-color: rgba(6, 214, 160, 0.45);
  color: var(--accent-mint);
}

.sidebar-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.candy-secondary-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #171a2e;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  color: #d1c8ea;
  text-align: center;
  transition: all 0.2s ease;
}

.candy-secondary-btn:hover {
  background: #252a4a;
  color: #fff;
  border-color: rgba(255, 190, 11, 0.4);
}


.candy-playfield {
  padding: 24px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.candy-board-wrap {
  position: relative;
  width: 100%;
  max-width: 490px;
  aspect-ratio: 1;
  background: #090a14;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 10px;
  overflow: hidden;
}

.candy-board-wrap.board-shake {
  animation: shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.candy-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 5px;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.candy-cell {
  position: relative;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  transition: transform 0.15s ease, background-color 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.candy-cell:hover {
  background: rgba(255, 255, 255, 0.08);
}

.candy-cell.selected {
  outline: 2px solid var(--accent-gold);
  outline-offset: -1px;
  background: rgba(255, 190, 11, 0.15);
  transform: scale(0.96);
}

.candy-cell.matched {
  animation: pop-disappear 0.22s forwards ease-in;
}

@keyframes pop-disappear {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(0.2); opacity: 0; }
}

.candy-cell.hint {
  animation: hint-bounce 0.8s infinite alternate ease-in-out;
}

@keyframes hint-bounce {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}


.candy-cell.has-jelly-1 {
  background: rgba(255, 59, 129, 0.25);
  box-shadow: inset 0 0 10px rgba(255, 59, 129, 0.5);
  border-color: rgba(255, 59, 129, 0.4);
}

.candy-cell.has-jelly-2 {
  background: rgba(255, 59, 129, 0.45);
  box-shadow: inset 0 0 14px rgba(255, 59, 129, 0.8);
  border-color: rgba(255, 59, 129, 0.6);
}


.candy-piece {
  display: block;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  box-shadow: inset -2px -3px 4px rgba(0, 0, 0, 0.45),
              inset 2px 3px 4px rgba(255, 255, 255, 0.5),
              0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  position: relative;
}

.candy-piece.type-0 { background: radial-gradient(circle at 35% 30%, #ff85b3, #ff3b81 60%, #a81347); }
.candy-piece.type-1 { background: radial-gradient(circle at 35% 30%, #80e5ff, #00b4d8 60%, #005a78); border-radius: 28%; }
.candy-piece.type-2 { background: radial-gradient(circle at 35% 30%, #fff2b2, #ffd166 60%, #a37500); transform: rotate(45deg); border-radius: 22%; }
.candy-piece.type-3 { background: radial-gradient(circle at 35% 30%, #80f5d4, #06d6a0 60%, #00664c); border-radius: 12px; }
.candy-piece.type-4 { background: radial-gradient(circle at 35% 30%, #d896ff, #9d4edd 60%, #4b107c); }
.candy-piece.type-5 { background: radial-gradient(circle at 35% 30%, #ffbe76, #f77f00 60%, #873e00); border-radius: 35%; }
.candy-piece.type-6 { background: radial-gradient(circle at 35% 30%, #85ffff, #00f5d4 60%, #007363); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }


.candy-piece.special-striped-h {
  background: repeating-linear-gradient(0deg, #fff 0, #fff 3px, transparent 3px, transparent 7px),
              radial-gradient(circle at 35% 30%, #ff85b3, #ff3b81 60%, #a81347);
  box-shadow: 0 0 10px #00d2ff, inset 0 0 6px #fff;
}

.candy-piece.special-striped-v {
  background: repeating-linear-gradient(90deg, #fff 0, #fff 3px, transparent 3px, transparent 7px),
              radial-gradient(circle at 35% 30%, #ff85b3, #ff3b81 60%, #a81347);
  box-shadow: 0 0 10px #00d2ff, inset 0 0 6px #fff;
}

.candy-piece.special-wrapped {
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 14px rgba(255, 190, 11, 0.8), inset 0 0 8px rgba(255, 255, 255, 0.6);
  animation: pulse-wrapped 1s infinite alternate;
}

@keyframes pulse-wrapped {
  from { transform: scale(0.95); }
  to { transform: scale(1.05); }
}

.candy-piece.special-color-bomb {
  background: radial-gradient(circle at 35% 30%, #523b2c, #2b1d14 70%);
  border-radius: 50%;
  border: 2px dashed #ffbe0b;
  box-shadow: 0 0 16px rgba(255, 59, 129, 0.7);
  animation: spin-bomb 4s linear infinite;
}

@keyframes spin-bomb {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


.candy-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}


.candy-praise-banner {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-family: Georgia, serif;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent-gold);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 190, 11, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

.candy-praise-banner.show {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 1;
}


.candy-message {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  min-height: 20px;
}


.candy-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 20, 0.88);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 30;
  transition: opacity 0.25s ease;
}

.candy-overlay.hidden {
  display: none !important;
}

.candy-overlay-card {
  width: 380px;
  max-width: 100%;
  background: linear-gradient(160deg, #1f223d, #121426);
  border: 1px solid rgba(255, 190, 11, 0.35);
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
}

.overlay-candy-icon {
  font-size: 38px;
  margin-bottom: 10px;
}

.overlay-eyebrow {
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.candy-overlay-card h2 {
  font: normal 30px/1.2 var(--font-serif);
  letter-spacing: -0.5px;
  margin: 0 0 14px;
  color: #fff;
}

.overlay-stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 26px;
  margin-bottom: 12px;
}

.overlay-star {
  color: #433e54;
  transition: all 0.3s ease;
}

.overlay-star.active {
  color: var(--accent-gold);
  text-shadow: 0 0 14px rgba(255, 190, 11, 0.7);
}

.candy-overlay-card p {
  font-size: 13px;
  color: #c0b7d8;
  line-height: 1.6;
  margin: 0 0 20px;
}

.overlay-score {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.overlay-score strong {
  font-size: 18px;
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
}

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

.candy-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.candy-primary-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffbe0b, #e09700);
  color: #1a1500;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(255, 190, 11, 0.3);
  transition: all 0.2s ease;
}

.candy-primary-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}


.candy-sidebar-right {
  padding: 22px 20px;
  border-left: 1px solid var(--line);
  background: #111324;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card-single {
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.stat-card-single span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-card-single b {
  font-size: 26px;
  font-family: var(--font-serif);
  color: var(--accent-gold);
  font-weight: 400;
  line-height: 1.3;
}

.combo-card {
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.combo-title {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: #d1c8ea;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.guide-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.guide-item:last-child {
  margin-bottom: 0;
}

.guide-icon {
  font-size: 14px;
  line-height: 1.4;
}

.guide-item strong {
  display: block;
  font-size: 11px;
  color: #fff;
}

.guide-item p {
  font-size: 10px;
  color: var(--muted);
  margin: 1px 0 0;
  line-height: 1.4;
}

.recipe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.recipe-row:last-child {
  border-bottom: 0;
}

.recipe-row strong {
  color: var(--accent-gold);
}

.recipe-row span {
  color: var(--muted);
}


.instructions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: #0d0f1c;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.key-group {
  display: flex;
  gap: 18px;
  align-items: center;
}

.key-group span {
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  font-family: inherit;
  color: #e5def4;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  background: #1b1e35;
  font-size: 10px;
}

.save-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #9288ad;
}

.save-note:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 6px var(--accent-mint);
}

.guide-link {
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 600;
}

.guide-link:hover {
  text-decoration: underline;
}


.content-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 75px;
  padding: 46px 6px 48px;
}

.content-grid h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.4px;
  margin: 0 0 12px;
  color: #fff;
}

.content-grid h3 {
  font-size: 13px;
  font-weight: 700;
  color: #dcd4f0;
  margin: 22px 0 8px;
}

.content-grid p, .content-grid li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
  margin: 0 0 12px;
}

.control-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 18px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.control-list dt {
  font-size: 11px;
  color: #e5def4;
}

.control-list dd {
  margin: 0;
  line-height: 1.6;
}

.related {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.related a {
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 11px;
  color: #b7aed1;
  transition: all 0.2s ease;
}

.related a:hover {
  border-color: var(--accent-pink);
  color: #fff;
}


.site-footer {
  max-width: 1350px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #6a6282;
  font-size: 10px;
}

.site-footer nav {
  display: flex;
  gap: 22px;
}

.site-footer a:hover {
  color: var(--accent-gold);
}


html.has-fullscreen-game,
body.has-fullscreen-game {
  overflow: hidden !important;
  touch-action: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
}

.game-shell:fullscreen,
.game-shell.pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  border: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 999999 !important;
  margin: 0 !important;
  max-width: none !important;
  background: var(--bg-surface, #090c16) !important;
}

.game-shell:fullscreen .candy-sidebar-left,
.game-shell.pseudo-fullscreen .candy-sidebar-left,
.game-shell:fullscreen .candy-sidebar-right,
.game-shell.pseudo-fullscreen .candy-sidebar-right {
  display: none !important;
}

.game-shell:fullscreen .candy-workspace,
.game-shell.pseudo-fullscreen .candy-workspace {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  grid-template-columns: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-shell:fullscreen .candy-playfield,
.game-shell.pseudo-fullscreen .candy-playfield {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
}

.game-shell:fullscreen .candy-board-wrap,
.game-shell.pseudo-fullscreen .candy-board-wrap {
  width: min(calc(100dvh - 180px), calc(100vw - 32px), 520px) !important;
  height: min(calc(100dvh - 180px), calc(100vw - 32px), 520px) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 180px) !important;
  aspect-ratio: 1 !important;
  margin: auto !important;
  padding: 8px !important;
}


@media (max-width: 1380px) {
  .site-header, main, .site-footer {
    margin-left: 28px;
    margin-right: 28px;
  }
}

@media (max-width: 1100px) {
  .candy-workspace {
    grid-template-columns: 210px minmax(0, 1fr) 220px;
  }
  .stage-grid {
    gap: 5px;
  }
  .stage-btn {
    height: 34px;
    font-size: 12px;
  }
  .content-grid {
    gap: 40px;
  }
}

@media (max-width: 900px) {
  .candy-workspace {
    grid-template-columns: 1fr;
  }
  .candy-sidebar-left {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .candy-sidebar-right {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .content-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 650px) {
  .site-header {
    height: 65px;
    padding: 0 16px;
  }
  .site-header, main, .site-footer {
    margin-left: 0;
    margin-right: 0;
  }
  .title-row {
    padding: 0 16px;
    margin-bottom: 18px;
  }
  .title-row h1 {
    font-size: 26px;
  }
  .game-tags {
    display: none;
  }
  .game-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .candy-hud-bar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 16px;
  }
  .candy-objective-card {
    margin: 0;
    justify-content: center;
  }
  .toolbar-actions {
    justify-content: center;
  }
  .candy-playfield {
    padding: 16px 10px;
  }
  .candy-board-wrap {
    padding: 6px;
    border-radius: 12px;
  }
  .key-group {
    display: none;
  }
  .instructions-bar {
    padding: 12px 16px;
    justify-content: center;
  }
  .site-footer {
    padding: 20px 16px;
    flex-direction: column;
    gap: 12px;
  }
}

/* Candy Match: polished, high-contrast arcade grid */
.candy-board-wrap {
  background: radial-gradient(circle at 50% 20%, #1c2750 0%, #0a1027 70%, #080b1a 100%);
  border: 3px solid #6575df;
  box-shadow: inset 0 0 0 2px #131d47, inset 0 0 28px #0009, 0 12px 36px #0008, 0 0 24px #5065ee3a;
  padding: 9px;
}
.candy-board { gap: 3px; }
.candy-cell {
  border: 2px solid #4b5f9d;
  background: linear-gradient(145deg, #25305a 0%, #101a37 70%);
  border-radius: 8px;
  box-shadow: inset 0 1px 1px #c7d5ff22, inset 0 -2px 3px #0009;
  overflow: visible;
}
.candy-cell:hover { background: linear-gradient(145deg,#34457a,#182549);border-color:#88b3ff; }
.candy-cell.selected { border-color:#ffe276; outline:2px solid #ffe276; outline-offset:0; }
.candy-piece {
  width: 82%; height: 82%;
  border: 1px solid #ffffff99;
  box-shadow: inset 2px 3px 5px #ffffff9c, inset -3px -5px 7px #0008, 0 3px 5px #000a, 0 0 9px #ffffff20;
  filter: saturate(1.25) contrast(1.07);
  will-change: transform, opacity;
}
.candy-piece::after {
  content:""; position:absolute; top:10%;left:15%;width:44%;height:23%;
  border-radius:100%; transform:rotate(-26deg);
  background:linear-gradient(#ffffffcc,#ffffff04);pointer-events:none;
}
.candy-cell.matched { z-index:8; animation:candy-match-burst .23s cubic-bezier(.25,.85,.3,1) forwards; }
.candy-cell.matched .candy-piece { filter:saturate(1.5) brightness(1.4) drop-shadow(0 0 11px #fff9); }
@keyframes candy-match-burst {
  0% {transform:scale(1);opacity:1;box-shadow:inset 0 0 6px #fff4,0 0 0 0 #ffde6e99}
  48% {transform:scale(1.18);opacity:1;box-shadow:0 0 0 4px #ffde6e80,0 0 24px #ffffff99}
  100% {transform:scale(.12);opacity:0;box-shadow:0 0 0 12px #ffde6e00}
}
@media(max-width:520px){ .candy-board-wrap{padding:5px;border-width:2px}.candy-board{gap:2px}.candy-cell{border-width:1.5px;border-radius:5px}.candy-piece{width:86%;height:86%} }
@media(prefers-reduced-motion:reduce){.candy-cell.matched{animation:none;opacity:.2}}


.candy-praise-banner{max-width:94%;width:max-content;white-space:nowrap;padding:12px 26px;border:3px solid #fff4c9;border-radius:22px;background:linear-gradient(135deg,#ffbf40 0%,#ff65b5 54%,#b94af0 100%);color:#fff!important;font-family:Inter,system-ui,sans-serif;font-size:clamp(23px,5.4vw,42px);font-weight:950;letter-spacing:.04em;box-shadow:0 10px 0 #8a3374,0 18px 35px #290839aa,inset 0 3px 4px #ffffff70;text-shadow:0 3px 0 #8b286c,0 4px 12px #4d073e80;isolation:isolate}
.candy-praise-banner.praise-sweet{background:linear-gradient(135deg,#ff81ce,#ff4892 58%,#bb3da6);border-color:#ffe0f6}
.candy-praise-banner.praise-tasty{background:linear-gradient(135deg,#ffcf3b,#ff8736 58%,#f34c7c);border-color:#fff2b4}
.candy-praise-banner.praise-delicious{background:linear-gradient(135deg,#8f61ff,#d653ed 45%,#ff65a0);border-color:#f3deff}
.candy-praise-banner.show{animation:candy-praise-bounce .56s cubic-bezier(.2,1.4,.3,1) both}
@keyframes candy-praise-bounce{0%{transform:translate(-50%,-50%) scale(.55) rotate(-5deg)}65%{transform:translate(-50%,-50%) scale(1.24) rotate(2deg)}100%{transform:translate(-50%,-50%) scale(1.1)}}
@media(max-width:520px){.candy-praise-banner{padding:9px 15px;border-width:2px;border-radius:16px;box-shadow:0 6px 0 #8a3374,0 12px 24px #290839aa}}
@media(prefers-reduced-motion:reduce){.candy-praise-banner.show{animation:none}}
