*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#fff7e9;color:#382933;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}button{font:inherit;border:0;cursor:pointer}#app,.screen{width:100%;height:100%;position:relative}.screen{display:none}.screen.active{display:flex}.eyebrow{display:block;color:#ee7336;font-size:12px;font-weight:900;letter-spacing:2px;margin-bottom:9px}.menu-copy{position:absolute;z-index:2;left:9%;top:16%;width:38%}.menu-copy h1{font-size:clamp(42px,6vw,82px);line-height:.96;margin:0;font-weight:950;letter-spacing:0}.menu-copy h1 b{color:#f37a35}.menu-copy p{color:#967b72;font-weight:700;margin-top:24px}.menu-stage{position:absolute;right:6%;top:7%;width:53%;height:86%;border-radius:48% 43% 50% 42%;background:#b9edaf;border:12px solid #ffd07d;box-shadow:inset 0 0 0 8px #72c879,0 12px 0 #e7b27a;overflow:hidden;transform:rotate(-3deg)}.stage-grid{position:absolute;inset:0;background:repeating-linear-gradient(45deg,rgba(255,255,255,.08) 0 2px,transparent 2px 34px)}.stage-orb{position:absolute;border-radius:50%;opacity:.7}.orb-a{width:150px;height:150px;background:#ffcf67;right:13%;top:12%}.orb-b{width:100px;height:100px;background:#f58cb3;left:12%;bottom:13%}.stage-snake{position:absolute;left:27%;top:39%;display:flex;align-items:center;gap:3px;transform:rotate(15deg)}.stage-snake i{display:block;width:clamp(42px,6vw,74px);height:clamp(42px,6vw,74px);border-radius:50%;background:#ff8a3d;border:6px solid #fff;box-shadow:0 7px 0 #da6030}.stage-snake i:nth-child(2){background:#ff9950}.stage-snake i:nth-child(3){background:#ffab5b}.stage-snake .head{position:relative;background:#ed5a83}.head b{position:absolute;width:12px;height:12px;border:3px solid #3a2730;background:#fff;border-radius:50%;top:17px}.head b:first-child{left:16px}.head b:last-child{right:16px}.food{position:absolute;color:#fff;font-weight:900;text-shadow:0 2px 0 rgba(93,65,55,.25)}.food-apple{left:17%;top:19%;font-size:44px;color:#ef557a}.food-bolt{right:24%;bottom:18%;font-size:54px;color:#ffbd32}.food-star{left:15%;bottom:28%;font-size:35px;color:#f7e862}.menu-actions{position:absolute;z-index:3;left:9%;top:55%;width:min(330px,32vw);display:grid;gap:14px}.btn{min-height:58px;border-radius:16px;padding:0 22px;font-size:18px;font-weight:900;transition:transform .15s,filter .15s}.btn:hover{transform:translateY(-2px);filter:brightness(1.04)}.btn span{float:right;font-size:26px}.primary{color:#fff;background:#ff8a3d;box-shadow:0 6px 0 #d86632}.secondary{color:#ed7738;background:#fff;border:3px solid #ffab6b;box-shadow:0 4px 0 #edc29e}.sound-row{position:absolute;z-index:4;bottom:11%;left:9%;display:flex;align-items:center;gap:13px;font-weight:800}.sound-row input{display:none}.sound-row i{width:52px;height:29px;border-radius:20px;background:#d7cfca;position:relative}.sound-row i:after{content:"";position:absolute;width:21px;height:21px;left:4px;top:4px;background:#fff;border-radius:50%;transition:.2s}.sound-row input:checked+i{background:#ff8a3d}.sound-row input:checked+i:after{left:27px}.screen-head{position:absolute;top:10%;left:10%;display:flex;align-items:center;gap:18px}.screen-head h2,.result-screen h2{font-size:clamp(32px,4.5vw,58px);margin:0;font-weight:950}.circle-btn{width:50px;height:50px;border-radius:50%;background:#fff;color:#ec7438;font-size:27px;box-shadow:0 4px 0 #e8c9ae}.difficulty-list{position:absolute;left:10%;top:32%;width:min(780px,76%);display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.difficulty-card{position:relative;min-height:190px;background:#fff;border:3px solid #f1ded1;border-radius:21px;padding:20px;display:flex;flex-direction:column;gap:12px;cursor:pointer}.difficulty-card.selected{border-color:#ff8a3d;box-shadow:0 7px 0 #ffd0ad}.difficulty-card input{display:none}.difficulty-card strong{font-size:21px}.difficulty-card small{color:#9d8175;line-height:1.5;font-weight:700}.difficulty-card em{display:none;position:absolute;right:15px;top:12px;color:#ff8a3d;font-style:normal;font-size:20px}.difficulty-card.selected em{display:block}.diff-mark{font-size:35px}.diff-mark.easy{color:#67bd76}.diff-mark.normal{color:#ff9a47}.diff-mark.hard{color:#e96774}.wide{width:min(780px,76%)}#difficulty .wide{position:absolute;left:10%;bottom:13%}.game-screen{background:#9bdc93}.game-screen canvas{width:100%;height:100%;display:block}.hud,.rank-panel,.skill-bar,.pause-btn,.joystick{position:absolute;z-index:3}.top-left{top:18px;left:22px;display:flex;gap:10px;align-items:flex-start}.hud-tag,.stat-box,.rank-panel{background:rgba(255,255,255,.92);border:3px solid #efa05b;border-radius:15px;box-shadow:0 4px 0 rgba(133,85,54,.2)}.hud-tag{padding:12px 15px;font-weight:900}.hud-tag i{display:inline-block;width:10px;height:10px;border-radius:50%;background:#58ba69;margin-right:7px}.stat-box{padding:7px 14px;display:flex;gap:8px;align-items:baseline}.stat-box strong{font-size:25px;color:#eb6d35}.stat-box small{color:#92776e;font-weight:800}.rank-panel{top:18px;right:22px;width:188px;padding:12px 14px}.rank-panel>b{color:#7b574b}.rank-panel ol{list-style:none;padding:0;margin:4px 0 0}.rank-panel li{display:flex;justify-content:space-between;padding:4px 0;font-size:13px;font-weight:800}.rank-panel li.player{color:#ec6d35}.skill-bar{bottom:19px;left:50%;transform:translateX(-50%);display:flex;gap:7px}.skill{position:relative;width:48px;height:48px;border-radius:14px;background:rgba(255,255,255,.9);border:3px solid #efaa72;display:grid;place-items:center;font-size:23px}.skill small{position:absolute;bottom:-17px;color:#fff;text-shadow:0 2px 3px #765;font-size:10px;font-weight:900}.pause-btn{right:23px;bottom:21px;width:49px;height:49px;border-radius:50%;background:#fff;color:#e87538;font-weight:900;font-size:20px;box-shadow:0 4px 0 #dba16d}.joystick{left:24px;bottom:22px;width:116px;height:116px;border-radius:50%;background:rgba(255,255,255,.3);border:3px solid rgba(255,255,255,.8);touch-action:none}.joystick:before{content:"";position:absolute;inset:17px;border:2px solid rgba(255,255,255,.45);border-radius:50%}#stick{position:absolute;left:35px;top:35px;width:40px;height:40px;border-radius:50%;background:#fff;box-shadow:0 3px 7px #b97c52}.overlay{display:none;position:absolute;z-index:8;inset:0;background:rgba(61,39,39,.45);align-items:center;justify-content:center}.overlay.active{display:flex}.modal{width:min(90%,390px);padding:30px;background:#fff9ef;border-radius:24px;text-align:center;box-shadow:0 10px 0 rgba(98,57,39,.3)}.modal h2{margin:0 0 20px;font-size:31px}.modal .wide{width:100%;margin:6px 0}.text-btn{background:none;color:#a67b6a;padding:14px;font-weight:800}.result-screen{flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px}.result-star{width:60px;height:60px;display:grid;place-items:center;border-radius:50%;background:#ff8a3d;color:#fff;font-size:31px;box-shadow:0 5px 0 #d96732}.result-screen h2{margin:0 0 15px}.result-stats{display:flex;gap:34px;margin:0 0 16px}.result-stats div{display:flex;flex-direction:column}.result-stats strong{font-size:30px;color:#e87537}.result-stats small{color:#977b70;font-weight:800}.final-ranking{list-style:none;width:min(90vw,400px);padding:0;margin:0 0 15px;text-align:left}.final-ranking li{display:flex;justify-content:space-between;background:#fff;padding:8px 14px;margin:4px 0;border-radius:10px;font-weight:800}.result-screen .wide{min-height:51px;width:min(90vw,400px);margin:4px 0}@media(max-width:720px){.menu-copy{left:6%;top:10%;width:43%}.menu-copy h1{font-size:clamp(32px,7vw,55px)}.menu-copy p{font-size:11px;margin-top:12px}.menu-stage{right:3%;top:11%;width:51%;height:55%;border-width:8px}.stage-snake i{border-width:4px}.menu-actions{left:6%;top:auto;bottom:23%;width:43%;gap:8px}.btn{min-height:46px;font-size:14px;border-radius:12px}.sound-row{left:6%;bottom:9%;font-size:12px}.screen-head{left:6%;top:6%}.screen-head h2{font-size:28px}.difficulty-list{left:6%;top:25%;width:88%;gap:8px}.difficulty-card{min-height:145px;padding:13px 10px;border-radius:14px}.difficulty-card strong{font-size:16px}.difficulty-card small{font-size:10px}.diff-mark{font-size:26px}.wide,#difficulty .wide{left:6%;width:88%}.top-left{left:10px;top:10px;transform:scale(.8);transform-origin:top left}.rank-panel{right:10px;top:10px;width:142px;padding:8px 10px;transform:scale(.86);transform-origin:top right}.joystick{left:12px;bottom:12px;transform:scale(.8);transform-origin:bottom left}.pause-btn{right:10px;bottom:12px;transform:scale(.85)}.skill-bar{bottom:11px;transform:translateX(-50%) scale(.75)} }

/* Gameplay status cues for item effects. */
.game-screen:has(.skill[style*="pepper"]) canvas{filter:saturate(1.12)}
.game-screen:has(.skill[style*="potato"]) .hud-tag{border-color:#c99450;box-shadow:0 0 0 3px rgba(201,148,80,.24),0 4px 0 rgba(133,85,54,.2)}
.game-screen:has(.skill[style*="chocolate"]) .stat-box{border-color:#825846}

/* Active item cues mirror the in-game palette and expire with the matching skill node. */
.skill[class*="effect-"]{box-shadow:0 0 0 2px currentColor,0 4px 10px rgba(65,47,38,.2);animation:skill-pulse .9s ease-in-out infinite alternate}
.skill.effect-gold,.skill.effect-pepper{background:#fff2c4}
.skill.effect-silver,.skill.effect-cabbage{background:#eef9ee}
.skill.effect-iron,.skill.effect-copper,.skill.effect-potato{background:#f3e8dc}
.skill.effect-apple,.skill.effect-watermelon,.skill.effect-grape{background:#fff0f3}
.skill.effect-burger,.skill.effect-chocolate{background:#f1e8df}
.skill.effect-lightning,.skill.effect-freeze,.skill.effect-devour{background:#f2f4ff}
@keyframes skill-pulse{from{transform:translateY(0)}to{transform:translateY(-3px)}}
/* Menu snake uses the same coral head, rounded segments and light outline as gameplay. */
.stage-snake{gap:0;align-items:center;filter:drop-shadow(0 5px 0 rgba(93,112,80,.2))}
.stage-snake i{width:clamp(36px,5.4vw,66px);height:clamp(36px,5.4vw,66px);border:4px solid rgba(255,255,255,.92);background:#ff5c82;box-shadow:inset -7px -7px 0 rgba(174,47,86,.16);margin-left:-5px}
.stage-snake i:nth-child(2){background:#ff7891}.stage-snake i:nth-child(3){background:#ff91a3}.stage-snake i:nth-child(4){background:#ff5c82}
.stage-snake .head{z-index:2;border-radius:48% 52% 45% 55%;transform:scale(1.08)}
.stage-snake .head b{width:11px;height:11px;border:2px solid #523642;box-shadow:0 1px 0 rgba(0,0,0,.15)}
.food-apple,.food-bolt,.food-star{filter:drop-shadow(0 3px 0 rgba(98,70,52,.22));text-shadow:none}
.food-apple{color:#ed5870}.food-bolt{color:#ffdc42}.food-star{color:#8b5dcc}
@media(max-width:720px){.stage-snake i{border-width:3px;margin-left:-4px}}


/* Cohesive arcade UI polish: preserve layout and interaction geometry. */
:root{--ui-accent:#ff8a3d;--ui-accent-hot:#ffb13b;--ui-ink:#33251f;--ui-muted:#a99a8f;--ui-panel:rgba(36,32,39,.88);--ui-stroke:rgba(255,255,255,.18);--ui-shadow:0 5px 14px rgba(35,24,21,.22)}
html,body{background:#221f26;color:var(--ui-ink)}
button,.btn,.circle-btn,.pause-btn,.skill,.difficulty-card{transition:transform .14s ease,filter .14s ease,box-shadow .14s ease,border-color .14s ease}
button:active,.btn:active,.circle-btn:active,.pause-btn:active{transform:translateY(2px) scale(.98);filter:brightness(1.08)}
.eyebrow{color:var(--ui-accent);letter-spacing:1px}
.menu-copy h1 b{color:var(--ui-accent)}
.menu-copy p{color:#796d68}
.menu-stage{border-color:#ffbe64;box-shadow:inset 0 0 0 7px #65bd78,0 9px 0 #d7a36f,0 18px 36px rgba(48,39,31,.16)}
.btn{border-radius:14px;box-shadow:var(--ui-shadow);text-shadow:0 1px 1px rgba(78,40,24,.18)}
.primary{background:linear-gradient(180deg,#ffa44d,#f47a35);box-shadow:0 4px 0 #c95d2d,var(--ui-shadow)}
.secondary{color:#e96e32;background:#fffaf3;border:2px solid #ffc08a;box-shadow:0 4px 0 #d8b18f,var(--ui-shadow)}
.circle-btn{background:#fff8ef;color:#e87538;box-shadow:var(--ui-shadow)}
.difficulty-card{background:#fffaf4;border:2px solid #f0ddcb;box-shadow:0 3px 9px rgba(66,43,30,.08)}
.difficulty-card.selected{border-color:var(--ui-accent);box-shadow:0 0 0 3px rgba(255,138,61,.14),0 5px 12px rgba(125,66,33,.14)}
.game-screen{background:#27252b}
.game-screen canvas{border-radius:10px;filter:drop-shadow(0 0 16px rgba(16,13,20,.24))}
.hud-tag,.stat-box,.rank-panel{background:var(--ui-panel);color:#fff8ef;border:1px solid var(--ui-stroke);border-radius:12px;box-shadow:var(--ui-shadow);backdrop-filter:blur(8px)}
.hud-tag i{background:#77dc83;box-shadow:0 0 9px rgba(119,220,131,.72)}
.stat-box strong,.rank-panel li.player{color:#ffad54}
.stat-box small,.rank-panel>b{color:#c5b7ac}
.rank-panel ol{margin-top:6px}
.rank-panel li{border-bottom:1px solid rgba(255,255,255,.08)}
.rank-panel li:last-child{border-bottom:0}
.skill{background:rgba(39,35,43,.9);border:1px solid rgba(255,255,255,.32);border-radius:12px;box-shadow:var(--ui-shadow);text-shadow:0 1px 3px rgba(0,0,0,.45)}
.skill small{color:#fff;text-shadow:0 1px 4px #211c23}
.skill[class*="effect-"]{box-shadow:0 0 0 2px currentColor,0 0 15px color-mix(in srgb,currentColor 40%,transparent),var(--ui-shadow);animation:skill-pulse 1.35s ease-in-out infinite alternate}
.pause-btn{background:#fff8ef;color:#d96131;border:1px solid rgba(255,255,255,.75);box-shadow:var(--ui-shadow)}
.joystick{background:rgba(35,31,39,.38);border:2px solid rgba(255,255,255,.7);box-shadow:inset 0 0 20px rgba(255,255,255,.08),var(--ui-shadow);backdrop-filter:blur(4px)}
.joystick:before{border-color:rgba(255,255,255,.28)}
#stick{background:linear-gradient(145deg,#fff,#ffd6ac);box-shadow:0 3px 10px rgba(18,14,18,.4),inset 0 1px 2px #fff}
.joystick:active{border-color:#ffcf80;box-shadow:0 0 0 4px rgba(255,174,78,.22),var(--ui-shadow)}
.overlay{background:rgba(19,17,23,.68);backdrop-filter:blur(5px)}
.modal{background:#fff9ef;border:1px solid rgba(255,255,255,.8);border-radius:18px;box-shadow:0 16px 42px rgba(15,12,16,.34);padding:28px}
.modal h2{color:#33251f}
.text-btn{border-radius:10px;color:#947463}
.result-screen{background:radial-gradient(ellipse at 50% 38%,#fff7e8 0%,#f1dcc1 100%)}
.result-star{background:linear-gradient(145deg,#ffb33e,#f27636);box-shadow:0 4px 0 #ca5e2e,var(--ui-shadow)}
.result-screen h2{color:#352720}
.result-stats strong{color:#e87537}
.final-ranking li{background:rgba(255,255,255,.82);box-shadow:0 2px 6px rgba(85,56,37,.08)}
@keyframes status-glow{0%,100%{opacity:.78;text-shadow:0 0 0 rgba(255,178,70,0)}50%{opacity:1;text-shadow:0 0 12px rgba(255,178,70,.58)}}
.status-tip{animation:status-glow 1.8s ease-in-out infinite}
@media(max-width:720px){.game-screen canvas{border-radius:0}.modal{padding:23px}.skill{border-radius:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}
