/* «Проспал!»: окна — тетрадный лист, кнопки — глянцевые, HUD — крупные цифры с обводкой. */
body { background: #1d4fb8; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #1b2a6b; }
#sky, #gl { position: absolute; left: 0; top: 0; display: block; }
#gl { touch-action: none; }
#scr-menu, #scr-game { background: transparent; }

/* ---------- игровой экран */
.touch { position: absolute; inset: 0; touch-action: none; }
.hud { pointer-events: none; }
.hud-left { position: absolute; left: 10px; top: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hud-score { font-size: 34px; font-weight: 900; color: #fff; letter-spacing: .5px; -webkit-text-stroke: 2px #0b1f5c; paint-order: stroke; text-shadow: 0 3px 0 #0b1f5c, 0 5px 10px rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.hud-small { display: flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 900; color: #ffe27a; -webkit-text-stroke: 1.5px #5a2400; paint-order: stroke; text-shadow: 0 2px 0 #5a2400; }
.hud-mult { margin-left: 6px; padding: 0 7px; border-radius: 8px; background: linear-gradient(#ff8a95, #e0203c); color: #fff; -webkit-text-stroke: 0; text-shadow: 0 1px 0 #7a0010; font-size: 16px; border: 2px solid #7a0010; }
.hud-bon { display: flex; gap: 6px; margin-top: 4px; }
.bon { position: relative; width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 3px solid #1b2a6b; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #1b2a6b; }
.bon svg.ic { width: 30px; height: 30px; }
.bon svg.ring { position: absolute; inset: -4px; width: 50px; height: 50px; transform: rotate(-90deg); }
.bon.shield { background: #ffd23f; }
.hud-clock { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px 14px 4px 6px; border-radius: 30px;
  background: linear-gradient(#fffdf2, #ffe9b8); border: 3px solid #7a2a00; box-shadow: 0 4px 0 #7a2a00, 0 6px 12px rgba(0,0,0,.3); }
#hud-time { font-size: 30px; font-weight: 900; color: #1b2a6b; font-variant-numeric: tabular-nums; min-width: 66px; text-align: center; }
.hud-clock.low { background: linear-gradient(#ffd0d5, #ff8a95); animation: shakeC .25s linear infinite; }
.hud-clock.low #hud-time { color: #b3001b; }
.hud-clock.plus { animation: popC .35s ease-out; }
@keyframes shakeC { 0%, 100% { transform: translateX(-50%) rotate(-3deg); } 50% { transform: translateX(-50%) rotate(3deg); } }
@keyframes popC { 0% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
.hud-pause { position: absolute; right: 10px; top: 10px; width: 48px; height: 48px; border-radius: 14px; border: 3px solid #0b1f5c; color: #fff; pointer-events: auto;
  background: linear-gradient(#6fc0ff, #1e88e5 55%, #1565c0); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 0 #0b1f5c; display: flex; align-items: center; justify-content: center; }
.hud-pause:active { transform: translateY(3px); }
.hud-rec { position: absolute; right: 10px; top: 66px; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; text-align: right; }
.warn { position: absolute; left: 0; right: 0; top: 112px; height: 60px; }
.warn i { position: absolute; top: 0; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe082, #ff6d00 70%); border: 3px solid #fff; color: #fff;
  font-style: normal; font-size: 30px; font-weight: 900; display: flex; align-items: center; justify-content: center; text-shadow: 0 2px 0 #7a2a00; box-shadow: 0 0 14px rgba(255,120,0,.9); animation: warnB .3s ease-in-out infinite alternate; }
@keyframes warnB { from { transform: scale(.9); } to { transform: scale(1.1); } }
.pops { position: absolute; left: 0; right: 0; top: 190px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pop { font-size: 26px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #0b1f5c; paint-order: stroke; text-shadow: 0 3px 0 #0b1f5c; animation: popU 1.1s ease-out forwards; white-space: nowrap; }
.pop.gold { color: #ffd23f; -webkit-text-stroke-color: #7a2a00; text-shadow: 0 3px 0 #7a2a00; }
.pop.green { color: #7dff6a; -webkit-text-stroke-color: #0d4a14; text-shadow: 0 3px 0 #0d4a14; }
.pop.red { color: #ff8a95; -webkit-text-stroke-color: #6a0010; text-shadow: 0 3px 0 #6a0010; }
@keyframes popU { 0% { transform: scale(.4); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
.banner { position: absolute; left: 0; right: 0; top: 230px; display: flex; justify-content: center; opacity: 0; line-height: 0; }
.banner.show { animation: bannerA 2.2s ease-out forwards; }
@keyframes bannerA { 0% { opacity: 0; transform: scale(.3) rotate(-6deg); } 12% { opacity: 1; transform: scale(1.12) rotate(2deg); } 20% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.tip { position: absolute; left: 20px; right: 20px; top: 118px; display: none; justify-content: center; }
.tip.show { display: flex; }
.tip span { padding: 9px 16px; border-radius: 16px; background: #fffdf2; border: 3px solid #1b2a6b; box-shadow: 0 4px 0 #1b2a6b; font-size: 16px; font-weight: 900; color: #1b2a6b; text-align: center; animation: tipIn .25s ease-out; }
@keyframes tipIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.coach { position: absolute; left: 50%; top: 250px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 4px; }
.coach.show { display: flex; }
.coach svg { animation: coachA .6s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
@keyframes coachA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
#coach-text { font-size: 26px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #0b1f5c; paint-order: stroke; text-shadow: 0 3px 0 #0b1f5c; }

/* ---------- окна: тетрадный лист */
.overlay { background: rgba(10, 25, 80, .55); }
.panel { width: 336px; padding: 16px 16px 16px 26px; border-radius: 18px; background-color: #fffdf4; color: #1b2a6b; border: 3px solid #1b2a6b;
  background-image: linear-gradient(90deg, transparent 13px, #ff8a95 13px, #ff8a95 15px, transparent 15px), linear-gradient(rgba(64,140,255,.2) 1px, transparent 1px); background-size: 100% 100%, 100% 22px;
  box-shadow: 0 6px 0 #1b2a6b, 0 18px 30px rgba(0,0,0,.4); animation: panelIn .22s ease-out; }
@keyframes panelIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.panel-title { display: flex; justify-content: center; line-height: 0; min-height: 40px; align-items: center; }
.panel-title.small { font-size: 24px; font-weight: 900; line-height: 1.1; color: #1b2a6b; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wallet { display: flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; background: #0b1440; color: #ffe27a; font-weight: 900; font-size: 17px; text-shadow: 0 0 6px rgba(255,200,40,.6); }
.qbtn { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #1b2a6b; background: #ffd23f; color: #1b2a6b; font-size: 20px; font-weight: 900; box-shadow: 0 3px 0 #1b2a6b; }
.btn { min-height: 50px; padding: 0 18px; border-radius: 15px; border: 3px solid #0b1f5c; font: inherit; font-size: 19px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35);
  background: linear-gradient(#6fc0ff, #1e88e5 55%, #1565c0); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 5px 0 #0b1f5c; transition: transform .06s; }
.btn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 1px 0 #0b1f5c; }
.btn-play { min-height: 58px; font-size: 23px; border-color: #7a2a00; background: linear-gradient(#ffc233, #ff8a00 48%, #f25c00 52%, #ff7a00); box-shadow: inset 0 3px 0 rgba(255,255,255,.55), 0 6px 0 #7a2a00; text-shadow: 0 2px 0 #7a2a00; }
.btn-blue { }
.btn-green { border-color: #0d4a14; background: linear-gradient(#8df27a, #2fbf4f 55%, #1f9e2c); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 5px 0 #0d4a14; text-shadow: 0 2px 0 #0d4a14; }
.btn-sm { min-height: 42px; font-size: 15px; background: linear-gradient(#ffe98a, #ffc400 55%, #e0a100); color: #3a2400; text-shadow: none; border-color: #6a4a00; box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 #6a4a00; }
.btn.off { filter: saturate(.25) brightness(.9); }
.row2 { display: flex; gap: 10px; } .row2 .btn { flex: 1; min-width: 0; font-size: 17px; padding: 0 8px; }
.res-reason { text-align: center; font-size: 17px; font-weight: 800; color: #c62828; }
.res-score { text-align: center; font-size: 48px; font-weight: 900; color: #ffb300; -webkit-text-stroke: 3px #7a2a00; paint-order: stroke; text-shadow: 0 4px 0 #7a2a00; line-height: 1; }
.res-best { text-align: center; font-size: 15px; font-weight: 800; }
.res-best b { color: #1e88e5; }
.res-stats { display: flex; justify-content: center; gap: 10px; }
.res-stats span { display: flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 10px; background: #e3f0ff; font-size: 15px; font-weight: 900; }
.res-stats svg { width: 20px; height: 20px; }
.res-mis, .res-ach { display: flex; flex-direction: column; gap: 5px; }
.res-ach:empty, .res-mis:empty { display: none; }
.mini { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: #fff; border: 2px solid #c5d7ff; font-size: 14px; font-weight: 800; }
.mini svg { width: 22px; height: 22px; flex-shrink: 0; }
.mini .bar { flex: 1; height: 8px; border-radius: 4px; background: #e3e9f7; overflow: hidden; } .mini .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7be65a, #2fbf4f); }
.mini.done { background: #e8ffe0; border-color: #7be65a; }
.mini.new { background: #fff6cc; border-color: #ffd23f; }
.cont-bar { height: 12px; border-radius: 6px; background: #e3e9f7; overflow: hidden; border: 2px solid #1b2a6b; }
.cont-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff8a00, #ffd23f); transform-origin: 0 50%; }

/* «Как играть» */
.how-row { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 800; }
.how-ic { width: 46px; height: 46px; border-radius: 12px; background: #e3f0ff; border: 2px solid #1b2a6b; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* магазин */
.tabs { display: flex; gap: 8px; }
.tab { flex: 1; min-height: 40px; border-radius: 12px; border: 3px solid #1b2a6b; background: #e3f0ff; color: #1b2a6b; font: inherit; font-size: 16px; font-weight: 900; }
.tab.on { background: linear-gradient(#ffe98a, #ffc400); box-shadow: 0 3px 0 #1b2a6b; }
.shop-list { max-height: 330px; display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #fff; border: 3px solid #c5d7ff; }
.card.sel { border-color: #2fbf4f; background: #efffe9; }
.card .pic { width: 84px; height: 96px; flex-shrink: 0; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #bfe6ff, #5fb0ff); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .pic.up { width: 56px; height: 56px; align-items: center; background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd23f); border: 2px solid #1b2a6b; border-radius: 50%; }
.card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card .nm { font-size: 15px; font-weight: 900; line-height: 1.15; }
.card .ds { font-size: 13px; font-weight: 700; color: #3a4a8a; }
.card .lv { display: flex; gap: 4px; } .card .lv i { width: 14px; height: 14px; border-radius: 50%; background: #e3e9f7; border: 2px solid #1b2a6b; } .card .lv i.on { background: #2fbf4f; }
.card .buy { flex-shrink: 0; min-height: 40px; width: 96px; padding: 0 6px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.card .buy svg { width: 20px; height: 20px; }
.shop-msg { min-height: 18px; text-align: center; font-size: 14px; font-weight: 800; color: #c62828; }
/* задания и достижения */
.mult-big { padding: 2px 12px; border-radius: 12px; background: linear-gradient(#ff8a95, #e0203c); color: #fff; font-size: 22px; font-weight: 900; border: 3px solid #7a0010; text-shadow: 0 2px 0 #7a0010; }
.mis-list { display: flex; flex-direction: column; gap: 8px; }
.mis { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fff; border: 3px solid #c5d7ff; }
.mis.done { border-color: #7be65a; background: #efffe9; }
.mis .ic { width: 40px; height: 40px; flex-shrink: 0; }
.mis .txt { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; }
.mis .bar { height: 9px; margin-top: 4px; border-radius: 5px; background: #e3e9f7; overflow: hidden; } .mis .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7be65a, #2fbf4f); }
.mis .rw { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 900; color: #a85a00; }
.mis .rw svg { width: 18px; height: 18px; }
.ach-list { max-height: 360px; display: flex; flex-direction: column; gap: 6px; }
.ach { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 12px; background: #fff; border: 2px solid #c5d7ff; }
.ach.got { background: #fff6cc; border-color: #ffc400; }
.ach .ic { width: 34px; height: 34px; flex-shrink: 0; opacity: .35; } .ach.got .ic { opacity: 1; }
.ach .txt { flex: 1; min-width: 0; } .ach .nm { font-size: 15px; font-weight: 900; } .ach .ds { font-size: 12px; font-weight: 700; color: #3a4a8a; }
.ach .rw { font-size: 13px; font-weight: 900; color: #a85a00; white-space: nowrap; }
.help-text { font-size: 15px; font-weight: 700; line-height: 1.4; }
/* рейтинг */
.lb-sub { text-align: center; font-size: 13px; font-weight: 800; color: #3a4a8a; }
.lb-row { border-radius: 12px; background: #fff; border: 2px solid #c5d7ff; font-weight: 800; }
.lb-row.top-1 { background: linear-gradient(#fff3b0, #ffd23f); border-color: #c79100; }
.lb-row.top-2 { background: linear-gradient(#ffffff, #cfe3ff); border-color: #7fa8e0; }
.lb-row.top-3 { background: linear-gradient(#ffe0c8, #ffb27a); border-color: #d9773a; }
.lb-row.me { outline: 3px solid #2fbf4f; }
.lb-medal { font-weight: 900; } .lb-medal.gold, .lb-medal.silver, .lb-medal.bronze { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid #1b2a6b; }
.lb-medal.gold { background: radial-gradient(circle at 35% 30%, #fff3a0, #e0a100); } .lb-medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #8fa8c8); } .lb-medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd0a8, #c46a2a); }
.lb-avatar { background: #1e88e5; color: #fff; font-weight: 900; }
.lb-score { color: #1e63d8; font-weight: 900; }
.lb-empty { font-weight: 800; }
.lb-my { text-align: center; font-size: 14px; font-weight: 800; }
#toast { top: 205px; bottom: auto; padding: 10px 16px; border-radius: 14px; background: #fffdf2; border: 3px solid #1b2a6b; box-shadow: 0 4px 0 #1b2a6b; font-size: 15px; font-weight: 900; color: #1b2a6b; }
