:root{
  font-family:"Trebuchet MS","Segoe UI",system-ui,sans-serif;
  color:#493a57;
  --ink:#493a57;
  --muted:#76667f;
  --pink:#f68fc1;
  --pink-dark:#d95c9a;
  --purple:#8c72c9;
  --purple-dark:#6c52ad;
  --cream:#fffaf2;
  --panel:rgba(255,255,255,.95);
  --line:#ead5e7;
  --shadow:0 14px 35px rgba(93,58,105,.16);
}
*{box-sizing:border-box}
html{min-width:320px}
body{
  margin:0;
  min-height:100vh;
  padding:24px 14px 40px;
  background:
    linear-gradient(rgba(255,245,251,.36),rgba(239,246,255,.48)),
    url("assets/background-candy.png") center top/cover fixed no-repeat;
}
button{font:inherit}
button:focus-visible{outline:4px solid #4e3d8f;outline-offset:3px}
.page-overlay{position:fixed;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.3))}
.game-shell{position:relative;z-index:1;width:min(980px,100%);margin:0 auto;display:grid;gap:16px}
.top-card,.machine-card,.paytable-card,.info-card,.album-card,.safe-card,.bonus-card{border:2px solid rgba(255,255,255,.9);background:var(--panel);box-shadow:var(--shadow);border-radius:28px;backdrop-filter:blur(5px)}
.top-card{padding:18px}
.brand-row{display:grid;grid-template-columns:116px minmax(0,1fr) auto;gap:16px;align-items:center}
.brand-mascot{width:116px;height:116px;object-fit:contain;object-position:center;filter:drop-shadow(0 7px 5px rgba(71,48,78,.16))}
.brand-copy{min-width:0}
.eyebrow{margin:0 0 4px;color:var(--purple-dark);font-size:.78rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
h1,h2,p{margin-top:0}
h1{margin-bottom:7px;font-size:clamp(2rem,6vw,3.3rem);line-height:.98;color:#714f9e;letter-spacing:-.045em}
h2{margin-bottom:4px;color:#644b82}
.brand-copy>p:last-child,.section-heading p,.card-heading p,.bonus-card p,.safe-card p{margin-bottom:0;color:var(--muted)}
.current-world{display:flex;align-items:center;gap:9px;min-width:175px;padding:10px 13px;border:2px solid #f0d8ea;border-radius:18px;background:#fff9fd}
.current-world img{width:42px;height:42px;object-fit:contain}
.current-world span,.current-world strong{display:block}
.current-world span{font-size:.72rem;color:var(--muted);font-weight:800}
.current-world strong{font-size:.95rem}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}
.stat{min-width:0;display:flex;align-items:center;justify-content:center;gap:9px;min-height:70px;padding:9px 12px;border:2px solid #f0deed;border-radius:19px;background:linear-gradient(180deg,#fff,#fff7fc)}
.stat img{width:45px;height:45px;object-fit:contain;flex:none}
.stat span{min-width:0}
.stat b,.stat small{display:block}
.stat b{font-size:1.25rem;color:#66498f}
.stat small{font-size:.75rem;color:var(--muted);font-weight:800}
.world-picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.world-btn{min-width:0;min-height:84px;border:2px solid #ead8e7;border-radius:20px;background:#fff;color:var(--ink);padding:9px 10px;display:grid;grid-template-columns:54px minmax(0,1fr) 24px;gap:9px;align-items:center;text-align:left;cursor:pointer;transition:transform .15s ease,border-color .15s ease,background .15s ease}
.world-btn>img:first-child{width:54px;height:54px;object-fit:contain}
.world-btn span{min-width:0}
.world-btn strong,.world-btn small{display:block}
.world-btn small{margin-top:2px;color:var(--muted);font-size:.72rem;line-height:1.15}
.world-btn .lock-icon{width:22px;height:22px;object-fit:contain;opacity:.7}
.world-btn.active{border-color:#a98ad9;background:#fbf7ff;box-shadow:inset 0 0 0 2px #eadfff}
.world-btn.locked{opacity:.76}
@media(hover:hover) and (pointer:fine){.world-btn:hover,.icon-button:hover,.spin-button:hover,.secondary-action:hover{transform:translateY(-2px)}}
.machine-card,.paytable-card,.album-card{padding:18px}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.heading-with-icon,.card-heading,.safe-copy{display:flex;align-items:center;gap:12px;min-width:0}
.heading-with-icon>img,.card-heading>img,.safe-copy>img{width:54px;height:54px;object-fit:contain;flex:none}
.section-heading h2,.card-heading h2,.safe-card h2{margin:0;font-size:1.2rem}
.machine-tools{display:flex;gap:9px;flex-wrap:wrap}
.icon-button,.secondary-action{border:2px solid #ead7e7;background:#fff;color:var(--ink);border-radius:16px;min-height:48px;padding:8px 12px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:900;cursor:pointer;transition:transform .15s ease,background .15s ease}
.icon-button img,.secondary-action img{width:30px;height:30px;object-fit:contain}
.icon-button[aria-pressed="true"]{background:#fbf5ff;border-color:#baa2df}
.reel-frame{position:relative;margin:18px auto 14px;padding:13px;border:4px solid #9a75c8;border-radius:30px;background:linear-gradient(180deg,#fff2f8,#f4efff);box-shadow:inset 0 0 0 5px #fff,0 8px 0 rgba(112,82,142,.12)}
.reels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;position:relative;z-index:2}
.reel{min-width:0;aspect-ratio:1/1;border:3px solid #e7cfe3;border-radius:23px;background:radial-gradient(circle at 50% 44%,#fff 0 42%,#fff6fb 70%,#f6eafd 100%);display:flex;align-items:center;justify-content:center;overflow:hidden}
.reel img{width:84%;height:84%;object-fit:contain;object-position:center;filter:drop-shadow(0 6px 4px rgba(61,39,73,.16))}
.reel.spinning img{animation:reel-hop .12s linear infinite}
@keyframes reel-hop{0%{transform:translateY(-8px) scale(.96)}50%{transform:translateY(8px) scale(1.02)}100%{transform:translateY(-8px) scale(.96)}}
.match-overlay{
  position:absolute;
  inset:13px;
  width:calc(100% - 26px);
  height:calc(100% - 26px);
  z-index:4;
  pointer-events:none;
  overflow:visible;
}
.match-line{
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:5;
  vector-effect:non-scaling-stroke;
  opacity:0;
  filter:drop-shadow(0 2px 3px rgba(83,49,109,.35));
  transition:opacity .16s ease;
}
.match-line.show{opacity:.95}
.row-line{stroke:#ed6cab}
.diag-line{stroke:#7959c7}
.column-line{stroke:#f1a23d}
.message-box{min-height:64px;margin:10px 0;display:flex;align-items:center;justify-content:center;gap:10px;padding:10px 14px;border-radius:17px;background:#fff8fc;border:2px solid #f1ddea;text-align:center;font-weight:900}
.message-box img{width:36px;height:36px;object-fit:contain;flex:none}
.spin-button{width:100%;min-height:68px;border:0;border-radius:20px;padding:10px 18px;display:flex;align-items:center;justify-content:center;gap:12px;background:linear-gradient(135deg,#8e72c9,#ef7ab5);color:#fff;font-size:1.28rem;font-weight:950;letter-spacing:.02em;box-shadow:0 8px 0 #6f52a5,0 14px 24px rgba(95,62,124,.22);cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}
.spin-button img{width:43px;height:43px;object-fit:contain}
.spin-button:active{transform:translateY(4px);box-shadow:0 4px 0 #6f52a5}
.spin-button:disabled{opacity:.62;cursor:not-allowed;transform:none}
.meters{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}
.meter-card{border:2px solid #f0dce9;background:#fffafd;border-radius:19px;padding:12px}
.meter-title{display:flex;justify-content:space-between;align-items:center;gap:9px;font-weight:900}
.meter-title span{display:flex;align-items:center;gap:7px}
.meter-title img{width:31px;height:31px;object-fit:contain}
.meter-card small{display:block;margin-top:7px;color:var(--muted);font-weight:700}
.track{height:14px;margin-top:8px;border-radius:99px;background:#f0e6ef;border:1px solid #e3d5e2;overflow:hidden}
.fill{height:100%;width:0;transition:width .25s ease}
.treasure-fill{background:linear-gradient(90deg,#8b72c7,#d983c0)}
.streak-fill{background:linear-gradient(90deg,#f4a05f,#f56b8b)}
.paytable-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
.pay-item{border:2px solid #f0dce9;background:#fffafd;border-radius:18px;padding:12px 14px}
.pay-item strong,.pay-item span{display:block}
.pay-item strong{color:#66498f}
.pay-item span{margin-top:3px;font-weight:900}
.bonus-card{padding:18px;display:grid;grid-template-columns:180px minmax(0,1fr);gap:18px;align-items:center}
.bonus-card.hidden{display:none}
.bonus-wheel{width:175px;height:175px;object-fit:contain;filter:drop-shadow(0 9px 6px rgba(63,38,75,.16))}
.bonus-wheel.turn{animation:wheel-turn 1.25s cubic-bezier(.12,.75,.18,1)}
@keyframes wheel-turn{from{transform:rotate(0)}to{transform:rotate(1080deg)}}
.secondary-action{margin-top:8px;background:linear-gradient(180deg,#fff,#f9effd)}
.lower-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.info-card{padding:16px}
.card-heading{padding-bottom:12px;border-bottom:1px solid #efdfeb}
.chest-content{display:flex;align-items:center;gap:13px;padding-top:10px}
.big-chest{width:112px;height:112px;object-fit:contain;flex:none;filter:drop-shadow(0 6px 5px rgba(74,50,83,.14))}
.mission-list{margin-top:5px}
.mission{min-height:54px;display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:9px;align-items:center;border-bottom:1px solid #f0e2ed}
.mission:last-child{border-bottom:0}
.mission img{width:32px;height:32px;object-fit:contain}
.mission span{font-weight:800}
.mission b{color:#6a4c91}
.album-count{border-radius:999px;padding:8px 12px;background:#f7edfc;border:2px solid #ead8f2;color:#68498f;font-weight:950}
.collection{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:14px}
.collectible{min-width:0;aspect-ratio:1;border:2px solid #ead7e6;border-radius:19px;background:radial-gradient(circle,#fff 0 45%,#fff6fb 76%,#f6edfb);display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px}
.collectible img{width:86%;height:86%;object-fit:contain;object-position:center}
.collectible span{display:block;text-align:center;font-size:.74rem;font-weight:900;color:#6a4c91}
.collectible-wrap{display:grid;gap:6px}
.safe-card{padding:14px 16px;display:flex;justify-content:space-between;align-items:center;gap:14px}
.reset-button{flex:none}
.pop{animation:pop .34s ease-out}
@keyframes pop{0%{transform:scale(.94)}65%{transform:scale(1.04)}100%{transform:scale(1)}}
@media(max-width:760px){
  body{padding:12px 9px 28px;background-attachment:scroll}
  .brand-row{grid-template-columns:86px minmax(0,1fr)}
  .brand-mascot{width:86px;height:86px}
  .current-world{grid-column:1/-1;width:100%}
  .stats{grid-template-columns:1fr 1fr 1fr}
  .world-picker{grid-template-columns:1fr}
  .world-btn{min-height:74px}
  .meters,.lower-grid,.paytable-grid{grid-template-columns:1fr}
  .collection{grid-template-columns:repeat(3,1fr)}
  .bonus-card{grid-template-columns:125px 1fr}
  .bonus-wheel{width:120px;height:120px}
}
@media(max-width:480px){
  .brand-row{grid-template-columns:72px minmax(0,1fr);gap:10px}
  .brand-mascot{width:72px;height:72px}
  .stats{gap:6px}
  .stat{padding:7px 5px;min-height:62px}
  .stat img{width:34px;height:34px}
  .stat b{font-size:1.05rem}
  .stat small{font-size:.67rem}
  .machine-card,.top-card,.paytable-card,.info-card,.album-card,.safe-card,.bonus-card{border-radius:21px}
  .reel-frame{padding:8px;border-radius:23px}
  .reels{gap:6px}
  .reel{border-radius:16px}
  .machine-tools{width:100%}
  .machine-tools .icon-button{flex:1}
  .bonus-card{grid-template-columns:1fr;text-align:center}
  .bonus-wheel{margin:auto}
  .safe-card{align-items:flex-start;flex-direction:column}
  .reset-button{width:100%}
  .match-overlay{inset:8px;width:calc(100% - 16px);height:calc(100% - 16px)}
  .match-line{stroke-width:4}
}
@media(prefers-reduced-motion:reduce){
  .reel.spinning img,.bonus-wheel.turn,.pop{animation:none}
  .fill{transition:none}
  .world-btn,.icon-button,.spin-button,.secondary-action{transition:none}
}
