.candy-shell { max-width: 1000px; }
.candy-card { backdrop-filter: none; }
.candy-page .topbar { font-size: .875rem; letter-spacing: .06em; }
.candy-header { padding: 1.5rem 2rem; align-items: center; }
.candy-header h1 { font-size: clamp(2.6rem, 6vw, 4rem); }
.candy-page .eyebrow { font-size: .875rem; letter-spacing: .1em; }
.level-path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; list-style: none; margin: 0; padding: 1.2rem 2rem 0; }
.level-path li { display: flex; align-items: center; gap: .7rem; padding: .75rem; border: 1px solid #9b69804f; border-radius: 13px; background: #2a102b; color: #dbc3cf; }
.level-path li > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; background: #5b304d; color: #fff0bd; font-weight: 700; font-size: .875rem; }
.level-path strong, .level-path small { display: block; font-size: .875rem; line-height: 1.45; }
.level-path small { font-weight: 400; color: #dec6d4; }
.level-path [data-state="current"] { border-color: #ef9ec5; background: #672441; }
.level-path [data-state="complete"] > span { background: #366153; color: #f5ffee; }
.level-label { margin: 0 0 .7rem; font-size: 1rem; color: #f6d2e4; font-weight: 700; }
.last-moves { color: #ffa8b5 !important; }
.candy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2rem; padding: 1.8rem 2rem; }
.candy-play { min-width: 0; max-width: 510px; width: 100%; margin: 0 auto; }
.candy-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.candy-stats > div { display: grid; gap: .2rem; padding: .6rem .35rem; border: 1px solid #edb8d437; border-radius: 14px; background: #461237; text-align: center; }
.candy-stats span { color: #eed4e1; font-size: .875rem; }
.candy-stats strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; color: #fff0bb; }
.score-progress { display: block; appearance: none; width: 100%; height: 9px; margin: .8rem 0 1rem; border: 0; border-radius: 20px; overflow: hidden; background: #48263f; color: #ffb7ce; }
.score-progress::-webkit-progress-bar { background: #48263f; }
.score-progress::-webkit-progress-value { background: linear-gradient(90deg, #f171a3, #ffd782); border-radius: 20px; transition: width .25s; }
.score-progress::-moz-progress-bar { background: linear-gradient(90deg, #f171a3, #ffd782); }
.board-frame { padding: .7rem; border: 1px solid #ffdda36b; border-radius: 22px; background: linear-gradient(150deg, #743255, #291330); box-shadow: 0 12px 32px #0005, inset 0 1px 0 #fff3; }
.candy-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; touch-action: none; user-select: none; }
.candy-cell { display: grid; place-items: center; position: relative; min-width: 0; aspect-ratio: 1; padding: 0; border: 1px solid #ffffff38; border-radius: 13px; color: #fff; background: #8e4278; cursor: pointer; box-shadow: inset 0 2px 1px #ffffff26, inset 0 -4px 0 #0002; -webkit-tap-highlight-color: transparent; transition: background .15s, transform .15s, box-shadow .15s; }
.candy-cell span { display: block; font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: clamp(1.4rem, 4.3vw, 2.3rem); line-height: 1; filter: drop-shadow(0 3px 1px #0003); pointer-events: none; }
.candy-cell[data-type="1"] { background: #b14966; }
.candy-cell[data-type="2"] { background: #2a6583; }
.candy-cell[data-type="3"] { background: #834156; }
.candy-cell[data-type="4"] { background: #836139; }
.candy-cell.selected { outline: 3px solid #fff9eb; outline-offset: -3px; transform: scale(.93); box-shadow: 0 0 18px #ffa8d87a; }
.candy-cell.hint { outline: 3px solid #ffe49a; outline-offset: -3px; animation: hint-glow 1s ease-in-out infinite alternate; }
.candy-cell:focus-visible { outline: 3px solid #fff; outline-offset: 1px; z-index: 2; }
.candy-cell.swapping span { animation: swap-pop .18s ease; }
.candy-cell.clearing span { animation: sweet-clear .24s ease-in forwards; }
.candy-cell.falling span { animation: sweet-fall .23s ease-out; }
.candy-status { min-height: 2.8rem; display: grid; place-items: center; margin: .7rem 0 .25rem; color: #ffe4ed; font-size: 1rem; line-height: 1.4; text-align: center; }
.candy-controls { display: flex; gap: .6rem; }
.candy-controls button { flex: 1; min-height: 44px; padding: .55rem; border: 1px solid #f4b1ce6b; border-radius: 12px; background: #72244f; color: #fff8f0; cursor: pointer; font-size: .875rem; font-weight: 700; touch-action: manipulation; }
.candy-controls button:last-child { background: #31112b; }
.candy-controls button:hover { background: #914165; }
.candy-controls button:disabled { cursor: default; opacity: .5; }
.candy-rules { margin-top: 0; padding: 1.25rem; }
.candy-rules .eyebrow { margin-bottom: .8rem; color: #f5c978; }
.candy-rules h2 { font-size: 1.9rem; }
.candy-rules ol { display: grid; gap: .85rem; padding-left: 1.2rem; margin: 1.2rem 0; color: #efdbe5; line-height: 1.5; }
.candy-rules li::marker { color: #f5c978; }
.candy-rules .gentle-note { padding-top: 1rem; border-top: 1px solid #fff2; color: #ecc2d3; }
.candy-rules .resource-note { font-size: .875rem; line-height: 1.5; }
.boosters { display: grid; gap: .65rem; margin: 1rem 0; }
.booster { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: .5rem; width: 100%; padding: .75rem .6rem; border: 1px solid #c987a268; border-radius: 12px; background: #50203e; color: #fff3ea; text-align: left; cursor: pointer; touch-action: manipulation; }
.booster strong, .booster small { display: block; font-size: .875rem; line-height: 1.45; }
.booster small { color: #eccedc; }
.booster-icon { font-size: 1.5rem; }
.booster-count { font-size: .875rem; color: #ffe7a5; white-space: nowrap; }
.booster.active { border-color: #ffe3a1; box-shadow: 0 0 0 2px #ffe3a14d; background: #78404f; }
.booster:disabled { opacity: .48; cursor: default; }
.booster-targeting .candy-cell { cursor: crosshair; border-color: #ffdfa5aa; }
.candy-rules .booster-help { font-size: .875rem; color: #eccedc; line-height: 1.5; }
.candy-rules .rules-heading { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid #ffffff25; font-size: 1.6rem; }
.candy-page .result-overlay { position: fixed; }
.candy-page .result-overlay::before { height: min(85%, 380px); }
@keyframes hint-glow { to { box-shadow: 0 0 17px #ffd175aa; } }
@keyframes swap-pop { 50% { transform: scale(.78); } }
@keyframes sweet-clear { 30% { transform: scale(1.15); } to { transform: scale(.25); opacity: 0; } }
@keyframes sweet-fall { from { transform: translateY(-20px); opacity: .3; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 780px) {
  .candy-header { padding: 1.25rem; gap: .5rem; }
  .candy-header > p { font-size: 1rem; }
  .level-path { gap: .35rem; padding: 1rem 1.1rem 0; }
  .level-path li { display: grid; justify-items: start; gap: .4rem; padding: .6rem; }
  .candy-layout { grid-template-columns: 1fr; gap: 1.3rem; padding: 1.1rem; }
  .candy-rules { order: 1; max-width: 510px; width: 100%; margin: 0 auto; }
  .candy-page .topbar a { min-height: 44px; }
}
@media (max-width: 390px) {
  .candy-layout { padding: .8rem; }
  .board-frame { padding: .4rem; border-radius: 16px; }
  .candy-board { gap: 4px; }
  .candy-cell { border-radius: 9px; }
  .candy-stats strong { font-size: 1.6rem; }
  .level-path { padding-inline: .8rem; }
  .level-path strong { font-size: .875rem; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .candy-cell, .candy-cell span, .score-progress { animation: none !important; transition: none !important; }
}
