* { box-sizing: border-box; }
  html,body { padding:0; margin:0; width:100%; height:100%; overflow:hidden; touch-action:manipulation; }
  body { background:radial-gradient(circle at 40% 30%,#fffaed,#c5dcf1 74%); font-family:system-ui,'Apple SD Gothic Neo','Malgun Gothic',sans-serif; color:#60495d; user-select:none; -webkit-user-select:none; }
  button { font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; border:0; }
  #game { position:absolute; width:414px; height:896px; transform-origin:top left; overflow:hidden; background:linear-gradient(160deg,#ffedf2 0%,#e7f4ff 52%,#f6edfc 100%); }
  #game:before { content:"";position:absolute;inset:0;pointer-events:none;opacity:.23; background-image:radial-gradient(#ffffff 2px, transparent 2.1px);background-size:26px 26px; }
  .header { position:absolute;left:14px;top:10px;width:386px;height:52px;display:flex;align-items:center;justify-content:space-between; }
  .logoSmall { font-size:10px;font-weight:900;letter-spacing:3px;color:#ae90b7;line-height:1.2; }
  h1 { margin:1px 0 0;font-size:31px;line-height:1.17;font-weight:1000;color:#7862a6;letter-spacing:-1.5px;text-shadow:2px 3px 0 #fff; }
  .tagline { font-size:12px;font-weight:800;color:#967c92;line-height:1.5;padding-top:0;text-align:right; }
  .stats { position:absolute;left:14px;top:66px;width:386px;height:54px;display:flex;gap:8px; }
  .stat { flex:1;min-width:0;border-radius:18px;background:rgba(255,255,255,.83);box-shadow:0 5px 0 rgba(168,149,187,.15),0 0 0 1px rgba(255,255,255,.7);padding:5px 10px 4px; }
  .stat b { display:block; font-size:11px; color:#a48da8;letter-spacing:0; }
  .stat strong { display:block; margin-top:0;font-size:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#6b5b9b;font-weight:1000;line-height:1.3;font-variant-numeric:tabular-nums; }
  .stat.high strong { color:#eb9a5d; }
  .stat.shot { width:72px; flex:0 0 72px; text-align:center;padding-left:5px;padding-right:5px; }
  .readies { position:absolute;left:14px;top:122px;width:386px;height:44px;display:flex;gap:8px; }
  .ready { border-radius:15px;background:rgba(255,255,255,.72);display:flex;gap:5px;align-items:center;flex:1;min-width:0;padding:4px 8px;box-shadow:0 1px 2px rgba(92,80,110,.09); }
  .ready canvas { width:38px;height:38px;flex:0 0 38px;object-fit:contain; }
  .ready small { font-size:10px;display:block;color:#a48ca9;font-weight:800; }
  .ready strong { display:block;margin-top:2px;font-size:12px;color:#5d557e;font-weight:950;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  .ready.current { flex:0 0 142px; }
  .ready.current canvas { width:34px;height:34px;flex-basis:34px; }
  .ready.current strong { font-size:11px; }
  .ready.next { height:48px;align-self:center;gap:9px;padding:2px 10px;background:#fff9e9;border:2px solid #edbf75;box-shadow:0 3px 0 rgba(204,154,84,.22); }
  .ready.next canvas { width:44px;height:44px;flex:0 0 44px; }
  .ready.next small { font-size:12px;color:#ae722f; }
  .ready.next strong { font-size:14px;color:#6d4c70; }
  #arena { position:absolute;left:7px;top:168px;width:400px;height:646px;border-radius:26px; background:linear-gradient(#fffaf7,#fff3e6);border:6px solid #b29abb;box-shadow:inset 0 0 0 3px rgba(255,255,255,.65),0 8px 0 rgba(119,95,136,.20),0 13px 25px rgba(130,100,128,.13);overflow:hidden; }
  #world { display:block;position:absolute;left:0;top:0;width:388px;height:634px;touch-action:none;cursor:crosshair; }
  .footer { position:absolute;left:14px;top:818px;width:386px;height:65px; }
  #hint {text-align:center;font-size:13px;line-height:18px;font-weight:850;color:#876b94;height:19px;text-shadow:0 1px #fff;white-space:nowrap; }
  .actionRow { display:flex;gap:8px;margin-top:5px; }
  .act { flex:1;height:40px;line-height:40px;text-align:center;padding:0 8px;border-radius:15px;border:2px solid rgba(255,255,255,.91);background:#c9b6ea;box-shadow:0 4px 0 #a28abb;color:#fff;font-size:13px;font-weight:1000;text-shadow:0 1px rgba(78,63,99,.18); }
  .act:active { box-shadow:0 1px 0 #a28abb;transform:translateY(3px); }


  #overlay { position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;background:rgba(72,47,83,.40); }
  #overlay[hidden] { display:none; }
  .modal {width:345px;min-height:250px;background:#fff8f4;border:5px solid #baa8d0;border-radius:28px;box-shadow:0 12px 45px rgba(68,37,66,.25);text-align:center;padding:31px 15px; }
  .modal h2 {font-size:32px;margin:7px 0 10px;color:#8466ac;}
  .modal p {font-size:15px;color:#886e7e;font-weight:800;line-height:1.6;min-height:47px;margin:0 0 15px;}
  .modal button { background:#97c8b9;box-shadow:0 4px 0 #60a18b;color:#fff;font-size:19px;font-weight:950;border-radius:16px;padding:13px 24px; }
  .tinyNote { position:absolute; bottom:4px; width:100%;text-align:center;font-size:10px;color:rgba(101,85,124,.75);pointer-events:none; }

/* Suika-style play layout: next preview at top right, full evolution strip below board.
   Preserve the original 388×634 game-canvas geometry and uniform global scaling. */
body { background:#dfc58f; color:#785b33; }
#game { background:linear-gradient(180deg,#f4dfa9 0%,#edce8c 100%); }
#game:before { opacity:.06; }
.header { left:11px;top:12px;width:90px;height:44px;align-items:flex-start; }
.logoSmall { font-size:8px;letter-spacing:1px;color:#a37e3f;line-height:1.1; }
h1 { font-size:21px;letter-spacing:-1px;color:#875c21;text-shadow:0 1px 0 #fff4d3;margin-top:3px; }
.tagline { display:none; }
.stats { left:104px;top:12px;width:205px;height:56px;gap:5px; }
.stat { background:rgba(255,247,220,.87);border:2px solid #dfbc73;border-radius:10px;box-shadow:0 2px 0 #b58c4f;padding:5px 4px;text-align:center; }
.stat b { font-size:9px;color:#97703c;line-height:14px; }
.stat strong { font-size:21px;color:#7a4b1f;line-height:24px; }
.stat.high strong { color:#ae752d; }
.stat.shot { width:42px;flex:0 0 42px;padding:5px 2px; }
.stat.shot strong { font-size:18px; }
.readies { left:318px;top:8px;width:88px;height:69px;display:block; }
.ready.current { display:none; }
.ready.next { width:88px;height:69px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:0;padding:2px 2px 0;background:rgba(255,246,216,.96);border:2px solid #e4b460;border-radius:10px;box-shadow:0 2px 0 #b58c4f; }
.ready.next div { width:100%;height:17px;min-width:0;text-align:center; }
.ready.next canvas { order:2;width:45px;height:45px;flex:0 0 45px; }
.ready.next small { display:block;line-height:16px;font-size:12px;font-weight:1000;color:#ae712b; }
.ready.next strong { display:none; }
#arena { left:7px;top:82px;width:400px;height:646px;border:6px solid #c68a35;border-radius:4px;background:linear-gradient(180deg,#fbefd4,#f3dfb8);box-shadow:inset 0 0 0 2px rgba(255,255,255,.35),0 3px 0 #b17a30;overflow:hidden; }
#world { width:388px;height:634px; }
.mergeGuide { position:absolute;left:7px;top:730px;width:400px;height:68px;border:2px solid #c58d38;border-radius:7px;background:linear-gradient(180deg,#e9b45a,#dba044);overflow:hidden;box-shadow:0 2px 0 rgba(130,83,24,.18); }
#mergeStrip { width:396px;height:64px;display:block;margin:0; }
.footer { left:14px;top:798px;width:386px;height:80px; }
#hint { font-size:12px;color:#8b652f;text-shadow:0 1px 0 #ffecca; }
.actionRow { margin-top:6px; }
.act { border-radius:11px;background:#cbaa71;border-color:#ffe8b9;box-shadow:0 4px 0 #a88242; }


/* Three rewarded-use items share the existing lower controls; preserve the arena. */
.footer { top:798px;height:96px; }
#hint { font-size:12px;line-height:18px;height:19px;overflow:hidden;text-overflow:ellipsis; }
.itemRow { display:flex;gap:6px;margin-top:1px; }
.itemBtn { flex:1;min-width:0;height:33px;border:2px solid #fff0c6;border-radius:11px;background:#d39853;box-shadow:0 2px 0 #b17535;color:white;font-size:14px;font-weight:1000;text-shadow:0 1px rgba(78,45,18,.35); }

.itemBtn:disabled {filter:grayscale(.6);opacity:.55;cursor:default;}
.actionRow {margin-top:4px;}
.act {height:34px;line-height:30px;font-size:12px;}
.tinyNote {display:none;}
.modal #modalCancel {background:#d3c2ad;box-shadow:0 4px 0 #a48f7d;color:#705945;margin-left:10px;}
.modal #modalCancel[hidden] {display:none;}
.modal button:disabled {opacity:.6;cursor:default;}

/* v0.22: screenshot-based Suika layout, fixed 414×896. Move only the board
   geometry, controls, and strip; never stretch the source animal art. */
#game { background:#ffe8b8; }
#game:before { display:none; }
.header { left:13px;top:12px;width:160px;height:25px;align-items:flex-start; }
.logoSmall { font-size:9px;letter-spacing:.6px;line-height:12px;color:#a27639; }
.header h1 { display:none; }
.stats { left:183px;top:37px;width:94px;height:85px;display:flex;flex-direction:column;gap:0;align-items:center; }
.stat { width:94px;flex:none;min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;text-align:center; }
.stat b { display:none; }
.stat strong { color:#785027;font-size:31px;line-height:36px;font-weight:1000;text-shadow:-1px -1px 0 #fff9dc,1px -1px 0 #fff9dc,-1px 1px 0 #fff9dc,1px 2px 0 #fff9dc; }
.stat.high strong { color:#e2a63f;font-size:19px;line-height:23px; }
.stat.high strong:before { content:"♛ ";font-size:14px; }
.stat.shot { position:absolute;left:72px;top:48px;width:56px;height:22px;flex:none;padding:0; }
.stat.shot b { display:none; }
.stat.shot strong { font-size:12px;line-height:20px;color:#8a6846;text-shadow:none; }
.stat.shot strong:after { content:"발";font-size:10px;margin-left:1px; }
.readies { left:343px;top:93px;width:62px;height:85px; }
.ready.next { width:62px;height:77px;padding:3px 2px 0;flex-direction:column-reverse;justify-content:center;gap:0;border-radius:100px;background:rgba(255,249,229,.88);border:2px solid #d8a85a;box-shadow:0 2px 0 #b98e50; }
.ready.next canvas { width:51px;height:51px;flex:0 0 51px;order:0; }
.ready.next div { height:17px;order:0; }
.ready.next small { font-size:17px;line-height:17px;letter-spacing:-.5px;white-space:nowrap; }
.ready.next div { width:76px; flex:0 0 17px; }
#arena { left:0;top:249px;width:414px;height:504px;border:5px solid #be8437;border-radius:0;background:#fff1d0;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);overflow:hidden;z-index:1; }
#world { position:absolute;left:5px;top:176px;width:404px;height:572px;z-index:2;touch-action:none;cursor:crosshair; }
#aimArea { position:absolute;left:0;top:748px;width:414px;height:79px;z-index:2;touch-action:none;cursor:crosshair;background:transparent; }
.mergeGuide { left:7px;top:835px;width:400px;height:53px;border:2px solid #b68137;border-radius:8px;background:#dda453;box-shadow:0 2px 0 #b6853a;z-index:4; }
#mergeStrip { width:396px;height:49px;display:block; }
.footer { position:absolute;left:0;top:0;width:414px;height:0;z-index:5;pointer-events:none; }
.footer .itemRow,.footer .actionRow { pointer-events:auto; }
#hint { display:none; }
.itemRow { position:absolute;left:13px;top:47px;width:172px;height:54px;display:flex;gap:5px;margin:0; }
.itemBtn { flex:1;width:54px;min-width:0;height:54px;border-radius:27px;border:3px solid #dfaf5d;font-size:12px;line-height:1.15;padding:0 2px;background:#efca82;color:#78502b;box-shadow:0 2px 0 #c08e45;text-shadow:none;white-space:normal; }

.actionRow { position:absolute;left:307px;top:46px;width:99px;height:54px;display:flex;gap:5px;margin:0; }
.act { flex:1;min-width:0;height:54px;line-height:1.35;padding:5px 1px;border-radius:17px;border:2px solid #e3bd79;background:#bda273;box-shadow:0 2px 0 #90713f;font-size:11px;text-align:center;white-space:normal;text-shadow:none; }


#overlay { z-index:20; }
.tinyNote { display:none; }

/* v0.23 polish: preserve the supplied screenshot's image-above-NEXT order
   and keep all five top controls outside the centered score. */
.itemRow { left:13px;width:156px;gap:6px; }
.itemBtn { height:49px;border-radius:25px;font-size:11px; }
.stats { left:174px;top:36px;width:102px; }
.stat { width:102px; }
.stat.shot { left:86px;top:51px;width:33px; }
.stat.shot strong { font-size:10px; }
.ready.next { flex-direction:column; }
.ready.next canvas { order:0; }
.ready.next div { order:1; }

/* v0.38 HUD layout. The fixed 414×896 playfield and physics coordinates
   remain unchanged. Raise only its visible background/frame: big animals
   can move above the red danger line without disappearing behind the panel. */
.header { left:13px; top:7px; width:155px; height:38px; align-items:flex-start; }
.logoSmall { font-size:9px; line-height:12px; letter-spacing:.35px; }
.header h1 { display:block; font-size:25px; line-height:25px; margin:1px 0 0; color:#88571e; }
.stats { left:calc(50% - 90px); top:7px; width:180px; height:104px; display:block; }
.stats .stat { width:100%; flex:none; height:auto; padding:0; text-align:center; }
.stats .stat b { display:block; color:#986e30; font-size:12px; font-weight:900; line-height:13px; }
.stats .stat strong { font-size:44px; line-height:44px; }
.stats .stat.high { margin-top:0; }
.stats .stat.high b { font-size:12px; line-height:13px; }
.stats .stat.high strong { position:relative; width:max-content; max-width:100%; margin:0 auto; overflow:visible; font-size:34px; line-height:34px; }
.stats .stat.high strong:before { content:none; }
.stats .stat.shot[hidden] { display:none; }
.stats .stat.shot b { display:none; }
.stats .stat.shot strong { font-size:11px; line-height:17px; }
.itemRow { top:111px; }
.actionRow { top:52px; }
.readies { top:90px; }
#arena { top:170px; height:583px; touch-action:none; }
#aimArea::before {
  content:"좌우로 조준 · 손을 떼면 바로 발사";
  position:absolute; left:0; top:30px; width:100%;
  text-align:center; font-size:15px; font-weight:850;
  color:#906f3d; opacity:.80; text-shadow:0 1px 0 #fff4d3;
  pointer-events:none;
}

/* v0.50: prominent restart, aligned items, sound in upper-right corner. */
.itemRow { left:134.5px; top:117px; width:145px; height:45px; gap:5px; }
.itemRow .itemBtn { flex:0 0 45px; width:45px; height:45px; padding:0; border:0; border-radius:0; box-shadow:none; background-color:transparent; background-repeat:no-repeat; background-size:contain; background-position:center; image-rendering:auto; }
.itemRow #bombButton { background-image:url("./item-bomb.png"); }
.itemRow #shakeButton { background-image:url("./item-shake.png"); }
.itemRow #shuffleButton { background-image:url("./item-shuffle.png?v=1.19"); }
.itemRow .itemBtn:active:not(:disabled) { transform:none; box-shadow:none; }
.itemRow #bombButton:active:not(:disabled) { background-image:url("./item-bomb-pressed.png"); }
.itemRow #shakeButton:active:not(:disabled) { background-image:url("./item-shake-pressed.png"); }
.itemRow #shuffleButton:active:not(:disabled) { background-image:url("./item-shuffle-pressed.png?v=1.19"); }
.footer .actionRow { left:0; top:0; width:414px; height:0; margin:0; display:block; pointer-events:none; }
.actionRow .act { position:absolute; pointer-events:auto; flex:none; padding:0; border:0; border-radius:0; background-color:transparent; box-shadow:none; background-repeat:no-repeat; }
.actionRow #muteButton { left:361.2px; top:7px; width:46.8px; height:46.8px; background-image:url("./hud-v048.png"); background-size:187.2px 93.6px; background-position:0 -46.8px; }
.actionRow #muteButton[aria-pressed="true"] { background-position:-46.8px -46.8px; }
.actionRow #muteButton:active:not(:disabled) { background-image:url("./hud-v048-pressed.png"); transform:none; box-shadow:none; }
.actionRow #resetButton { left:7px; top:42px; width:131.25px; height:49.21875px; background-image:url("./restart-v052.png"); background-size:contain; background-position:center; }
.actionRow #resetButton:active:not(:disabled) { background-image:url("./restart-v052.png"); filter:brightness(.82); transform:none; box-shadow:none; }
/* Original preview frame re-cropped at high resolution, without scaling either axis independently. */
.readies { left:306px; top:64px; width:102px; height:102px; }
.ready.next { position:relative; display:block; width:102px; height:102px; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent url("./hud-detail-v049.png") -5px -5.5px / 112px 154px no-repeat; }
.ready.next canvas { position:absolute; left:19px; top:32px; width:64px; height:64px; }
.ready.next div { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.ready.next small { white-space:nowrap; }

/* v0.51 rank button adjacent to audio; no change to other HUD positions. */

/* v0.54: show targeting instructions only while using an earned bomb. */
#game.bomb-target #aimArea::before { content:"제거할 동물을 터치하세요"; color:#9b542a; opacity:1; }

/* v0.57: user-supplied separate popup artwork; preserve native aspect ratio. */
#revivePreview,#finalScores { display:none; }
#overlay[data-mode="revive"],#overlay[data-mode="result"] { background:rgba(62,43,24,.54); }
#overlay[data-mode="revive"] .modal,#overlay[data-mode="result"] .modal { position:relative; width:330px; height:314px; min-height:0; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent url("./popup-v057-panel.webp") center / contain no-repeat; }
#overlay[data-mode="revive"] #modalTitle,#overlay[data-mode="result"] #modalTitle { position:absolute; left:65px; top:-25px; width:200px; height:57px; margin:0; display:flex; align-items:center; justify-content:center; color:#87501e; font-size:25px; line-height:1; font-weight:1000; background:transparent url("./popup-v057-title.webp") center / contain no-repeat; }
#overlay[data-mode="revive"] #revivePreview { display:block; position:absolute; left:127px; top:45px; width:76px; height:76px; }
#overlay[data-mode="revive"] #modalText { position:absolute; left:28px; top:131px; width:274px; height:58px; min-height:0; margin:0; color:#785027; font-size:16px; line-height:1.45; white-space:pre-line; }
#overlay[data-mode="result"] #modalText { display:none; }
#overlay[data-mode="result"] #finalScores { position:absolute; left:25px; top:56px; width:280px; height:140px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-weight:1000; color:#93652d; }
#finalScore { font-size:54px; line-height:1.05; color:#785027; font-variant-numeric:tabular-nums; }
#finalScores span { font-size:21px; line-height:1.2; }
#finalBest { font-size:28px; color:#a77728; }
#overlay[data-mode="revive"] #modalButton,#overlay[data-mode="result"] #modalButton { position:absolute; padding:0; border:0; border-radius:0; box-shadow:none; font-size:0; color:transparent; background-repeat:no-repeat; }
#overlay[data-mode="revive"] #modalButton { left:41px; bottom:23px; width:248px; height:88px; background:transparent url("./popup-v057-revive.webp") center / contain no-repeat; }
#overlay[data-mode="result"] #modalButton { left:49px; bottom:23px; width:232px; height:87px; background:transparent url("./restart-v052.png") center / contain no-repeat; }
#overlay[data-mode="revive"] #modalCancel:not([hidden]) { position:absolute; left:auto; right:-12px; top:-12px; bottom:auto; width:52px; height:51px; z-index:2; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; font-size:0; color:transparent; background:transparent url("./popup-v057-close.webp") center / contain no-repeat; }
#overlay[data-mode="revive"] #modalButton:active:not(:disabled),#overlay[data-mode="result"] #modalButton:active:not(:disabled),#overlay[data-mode="revive"] #modalCancel:active { filter:brightness(.83); }

/* v0.56: opt-in test-only ad layer. */

/* Prevent browser gestures in the fixed game surface. */
#game { touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }

/* One short record celebration per run; no modal or layout shift. */
.stats .stat.high strong.new-record { animation:mergeshot-record-glow .85s ease-out both; }
@keyframes mergeshot-record-glow {
  0%,100% { transform:scale(1); text-shadow:none; }
  30% { transform:scale(1.16); color:#ffb529; text-shadow:0 0 9px #ffd86a,0 0 16px #ffe7a0; }
  70% { transform:scale(1.04); text-shadow:0 0 5px #ffd86a; }
}
@media (prefers-reduced-motion:reduce) { .stats .stat.high strong.new-record { animation:none; } }


/* v1.16: rewarded item confirmation uses the existing illustrated popup
   panel, title plate, close image and the matching HUD item sprite. */
#overlay[data-mode="item"],#overlay[data-mode="item-ad"],#overlay[data-mode="item-error"] { background:rgba(62,43,24,.54); }
#overlay[data-mode="item"] .modal,#overlay[data-mode="item-ad"] .modal,#overlay[data-mode="item-error"] .modal {
  position:relative;width:330px;height:314px;min-height:0;padding:0;border:0;border-radius:0;box-shadow:none;
  background:transparent url("./popup-v057-panel.webp") center / contain no-repeat;
}
#overlay[data-mode="item"] #modalTitle,#overlay[data-mode="item-ad"] #modalTitle,#overlay[data-mode="item-error"] #modalTitle {
  position:absolute;left:65px;top:-25px;width:200px;height:57px;margin:0;display:flex;align-items:center;justify-content:center;
  color:#87501e;font-size:25px;line-height:1;font-weight:1000;background:transparent url("./popup-v057-title.webp") center / contain no-repeat;
}
#overlay[data-mode="item"] #modalText,#overlay[data-mode="item-ad"] #modalText,#overlay[data-mode="item-error"] #modalText {
  position:absolute;left:18px;top:57px;width:294px;min-height:0;margin:0;color:#785027;font-size:18px;line-height:1.55;white-space:pre-line;word-break:keep-all;
}
#overlay[data-mode="item"] #modalButton,#overlay[data-mode="item-ad"] #modalButton,#overlay[data-mode="item-error"] #modalButton {
  position:absolute;left:25px;bottom:22px;width:280px;height:138px;padding:0;border:0;border-radius:0;box-shadow:none;
  display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:center;
  background:transparent;color:#87501e;font-size:22px;line-height:1.3;font-weight:1000;text-shadow:0 1px #fff7dd;
}
/* v1.18: independent 3x raster assets, avoiding adjacent atlas pixels. */
#overlay[data-mode="item"] .modal::before {
  content:"";display:block;position:absolute;left:133px;top:123px;width:64px;height:64px;
  pointer-events:none;background-color:transparent;background-position:center;background-size:contain;background-repeat:no-repeat;image-rendering:auto;
}
#overlay[data-mode="item"][data-item="bomb"] .modal::before {background-image:url("./item-bomb.png");}
#overlay[data-mode="item"][data-item="shake"] .modal::before {background-image:url("./item-shake.png");}
#overlay[data-mode="item"][data-item="shuffle"] .modal::before {background-image:url("./item-shuffle.png?v=1.19");}
#overlay[data-mode="item"] #modalButton {
  left:41px;bottom:23px;width:248px;height:88px;display:block;
  font-size:0;color:transparent;text-shadow:none;
  background:transparent url("./item-use-v121.webp") center / contain no-repeat;
}
#overlay[data-mode="item"] #modalButton:active:not(:disabled) {filter:brightness(.83);transform:translateY(2px);}
#overlay[data-mode="item-ad"] #modalButton {visibility:hidden;}
#overlay[data-mode="item-error"] #modalButton {height:64px;bottom:27px;}
#overlay[data-mode="item-error"] #modalText {top:66px;font-size:17px;line-height:1.5;}
#overlay[data-mode="item"] #modalCancel:not([hidden]),#overlay[data-mode="item-error"] #modalCancel:not([hidden]) {
  position:absolute;left:auto;right:-12px;top:-12px;bottom:auto;width:52px;height:51px;z-index:2;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;
  font-size:0;color:transparent;background:transparent url("./popup-v057-close.webp") center / contain no-repeat;
}
#overlay[data-mode="item"] #modalCancel:active,#overlay[data-mode="item-error"] #modalCancel:active {filter:brightness(.83);}

/* v1.28: localizable text preview; each new label only appears when its original
   artwork has been safely processed. Original image fallback remains intact. */
.restart-plate-label,.next-plate-label {display:none;}
#game.text-plate-restart .actionRow #resetButton,
#game.text-plate-restart .actionRow #resetButton:active:not(:disabled) {background-image:var(--text-plate-restart);}
#game.text-plate-next .ready.next {background-image:var(--text-plate-next);}
#game.text-plate-restart .restart-plate-label,
#game.text-plate-next .next-plate-label,
#game.text-plate-restart #overlay[data-mode="result"] #modalButton,
#game.text-plate-revive #overlay[data-mode="revive"] #modalButton,
#game.text-plate-use #overlay[data-mode="item"] #modalButton {
  font-family:"Jua","Arial Rounded MT Bold","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  font-weight:400;line-height:1;letter-spacing:-.4px;white-space:nowrap;
  box-sizing:border-box;align-items:center;justify-content:center;display:flex;text-shadow:none;
}
#game.text-plate-restart .restart-plate-label {position:absolute;left:40px;right:7px;top:0;bottom:0;font-size:22px;color:#773c14;-webkit-text-stroke:.6px #773c14;pointer-events:none;}
#game.text-plate-next .next-plate-label {position:absolute;left:14px;top:1px;width:74px;height:24px;font-size:16px;color:#74380f;-webkit-text-stroke:.4px #74380f;pointer-events:none;}
#game.text-plate-restart #overlay[data-mode="result"] #modalButton {background-image:var(--text-plate-restart);padding:0 8px 0 72px;font-size:38px;color:#773c14;-webkit-text-stroke:1px #773c14;}
#game.text-plate-restart #overlay[data-mode="result"] #modalButton:disabled {font-size:25px;}
#game.text-plate-revive #overlay[data-mode="revive"] #modalButton {background-image:var(--text-plate-revive);}
#game.text-plate-use #overlay[data-mode="item"] #modalButton {background-image:var(--text-plate-use);}
#game.text-plate-revive #overlay[data-mode="revive"] #modalButton,
#game.text-plate-use #overlay[data-mode="item"] #modalButton {padding:0 12px 0 91px;font-size:36px;color:#fff5d8;-webkit-text-stroke:5px #713910;paint-order:stroke fill;}

/* v1.29 locale preview. Fixed coordinates; only the language control is new. */
#languageSelect {position:absolute;left:0;top:13px;width:125px;height:20px;padding:0 4px;border:1px solid #b98739;border-radius:5px;background:#fff0ca;color:#785027;font:700 11px/18px system-ui,sans-serif;pointer-events:auto;z-index:10;touch-action:manipulation;}
#aimArea::before {content:var(--aim-label,"좌우로 조준 · 손을 떼면 바로 발사");}
#game.bomb-target #aimArea::before {content:var(--bomb-label,"제거할 동물을 터치하세요");}
#game[data-locale]:not([data-locale="ko"]) .restart-plate-label,
#game[data-locale]:not([data-locale="ko"]) .next-plate-label,
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="revive"] #modalButton,
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="result"] #modalButton,
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="item"] #modalButton {
  font-family:"Arial Rounded MT Bold",system-ui,sans-serif;font-weight:800;letter-spacing:-.4px;
  white-space:normal;overflow-wrap:anywhere;text-align:center;
}
#game[data-locale]:not([data-locale="ko"]).text-plate-restart .restart-plate-label {font-size:15px;-webkit-text-stroke:.25px #773c14;}
#game[data-locale]:not([data-locale="ko"]).text-plate-next .next-plate-label {font-size:12px;-webkit-text-stroke:.15px #74380f;}
#game[data-locale]:not([data-locale="ko"]).text-plate-restart #overlay[data-mode="result"] #modalButton {font-size:27px;-webkit-text-stroke:.5px #773c14;}
#game[data-locale]:not([data-locale="ko"]).text-plate-revive #overlay[data-mode="revive"] #modalButton,
#game[data-locale]:not([data-locale="ko"]).text-plate-use #overlay[data-mode="item"] #modalButton {font-size:23px;-webkit-text-stroke:3px #713910;}
#game[data-locale]:not([data-locale="ko"]) #overlay #modalTitle {font-size:19px;line-height:1.1;text-align:center;overflow-wrap:anywhere;padding:0 13px;}
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="revive"] #modalText {font-size:13px;line-height:1.3;height:66px;overflow-wrap:anywhere;}
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="item"] #modalText,#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="item-ad"] #modalText,#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="item-error"] #modalText {font-size:13px;line-height:1.35;word-break:normal;overflow-wrap:anywhere;}
#game[data-locale]:not([data-locale="ko"]) #aimArea::before {font-size:12px;line-height:1.2;}
#game[data-locale]:not([data-locale="ko"]) #finalScores span {font-size:17px;white-space:normal;}
#finalBest {margin-left:4px;}

/* v1.34: native Korean artwork, rounded localized labels, width-aware typography. */
@font-face {
  font-family:"Merge Rounded";src:url("./fonts/fredoka-variable.ttf") format("truetype");
  font-style:normal;font-weight:300 700;font-display:swap;
}
/* Korean uses the exact approved lettering already baked into the art. */
#game[data-locale="ko"].text-plate-restart .actionRow #resetButton,
#game[data-locale="ko"].text-plate-restart .actionRow #resetButton:active:not(:disabled) {background-image:url("./restart-v052.png");}
#game[data-locale="ko"].text-plate-next .ready.next {background-image:url("./hud-detail-v049.png");}
#game[data-locale="ko"] .restart-plate-label,#game[data-locale="ko"] .next-plate-label {display:none;}
#game[data-locale="ko"].text-plate-restart #overlay[data-mode="result"] #modalButton {background-image:url("./restart-v052.png");}
#game[data-locale="ko"].text-plate-revive #overlay[data-mode="revive"] #modalButton {background-image:url("./popup-v057-revive.webp");}
#game[data-locale="ko"].text-plate-use #overlay[data-mode="item"] #modalButton {background-image:url("./item-use-v121.webp");}
#game[data-locale="ko"].text-plate-restart #overlay[data-mode="result"] #modalButton,
#game[data-locale="ko"].text-plate-revive #overlay[data-mode="revive"] #modalButton,
#game[data-locale="ko"].text-plate-use #overlay[data-mode="item"] #modalButton {display:block;padding:0;font-size:0;color:transparent;-webkit-text-stroke:0;text-shadow:none;}
/* Keep original icon/label centers and all button dimensions. Only text changes. */
#game[data-locale]:not([data-locale="ko"]) .restart-plate-label,
#game[data-locale]:not([data-locale="ko"]) .next-plate-label,
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="revive"] #modalButton,
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="result"] #modalButton,
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="item"] #modalButton {
  font-family:"Merge Rounded","Arial Rounded MT Bold",system-ui,sans-serif;
  font-weight:700;letter-spacing:0;line-height:1.12;white-space:nowrap;overflow-wrap:normal;text-align:center;
}
#game[data-locale]:not([data-locale="ko"]).text-plate-restart .restart-plate-label {font-size:var(--label-size,27px);-webkit-text-stroke:.35px #773c14;paint-order:stroke fill;}
#game[data-locale]:not([data-locale="ko"]).text-plate-next .next-plate-label {font-size:var(--label-size,20px);-webkit-text-stroke:.2px #74380f;paint-order:stroke fill;}
#game[data-locale]:not([data-locale="ko"]).text-plate-restart #overlay[data-mode="result"] #modalButton {font-size:var(--label-size,44px);-webkit-text-stroke:.6px #773c14;paint-order:stroke fill;}
#game[data-locale]:not([data-locale="ko"]).text-plate-revive #overlay[data-mode="revive"] #modalButton,
#game[data-locale]:not([data-locale="ko"]).text-plate-use #overlay[data-mode="item"] #modalButton {font-size:var(--label-size,44px);-webkit-text-stroke:var(--label-stroke,9px) #713910;paint-order:stroke fill;}
#game[data-locale]:not([data-locale="ko"]) #overlay:is([data-mode="revive"],[data-mode="result"],[data-mode="item"],[data-mode="item-ad"],[data-mode="item-error"]) #modalTitle {
  font-family:"Merge Rounded","Arial Rounded MT Bold",system-ui,sans-serif;font-weight:700;
  font-size:var(--label-size,25px);line-height:1.1;white-space:nowrap;overflow-wrap:normal;
}
#game[data-locale]:not([data-locale="ko"]) #overlay[data-mode="revive"] #modalText,
#game[data-locale]:not([data-locale="ko"]) #overlay:is([data-mode="item"],[data-mode="item-ad"],[data-mode="item-error"]) #modalText {
  font-size:var(--body-size,16px);line-height:1.3;white-space:pre-line;word-break:normal;overflow-wrap:anywhere;
}
#game[data-locale]:not([data-locale="ko"]) #aimArea::before {font-size:var(--aim-size,15px);}
#game[data-locale]:not([data-locale="ko"]).bomb-target #aimArea::before {font-size:var(--bomb-size,15px);}

/* MS: free item confirmation; preserve button dimensions and use a clean green plate. */
#game[data-locale][data-locale] #overlay[data-mode="item"] #modalButton {
  display:flex;align-items:center;justify-content:center;padding:0 14px;
  font-family:"Merge Rounded","Arial Rounded MT Bold","Malgun Gothic",system-ui,sans-serif;
  font-weight:700;font-size:var(--label-size,36px);color:#fff5d8;
  -webkit-text-stroke:9px #713910;paint-order:stroke fill;text-align:center;white-space:nowrap;
  background:#97c8b9;border-radius:16px;
}
#game[data-locale][data-locale].text-plate-use #overlay[data-mode="item"] #modalButton {
  background:transparent var(--text-plate-use) center / contain no-repeat;border-radius:0;
}
