/* Меню, окна, общие кнопки. Палитра: имперский синий, алый, золото, белый. */
body { background: radial-gradient(circle at 50% 30%, #163a9c, #050f33 70%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #fff; }
#scr-menu { background: #0a1a52; }
.m3 { --plate-a: #e3392c; --plate-b: #b3120f; --plate-c: #7d0a0a; --edge: #2a0303; --rivet: #fff6c8;
  --screen-a: #06112f; --screen-b: #13265e; --num: #ffe27a; --num-glow: rgba(255, 200, 60, .6); --label: #fff3d6;
  position: absolute; inset: 0; font-weight: 900; }
.m3-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.m3-top { position: absolute; left: 12px; right: 12px; top: 10px; display: flex; justify-content: space-between; z-index: 3; }
.m3-stat { position: relative; display: flex; align-items: center; height: 40px; padding: 3px 3px 3px 26px; margin-left: 14px; border-radius: 11px;
  background: linear-gradient(#fff3b0, #e0a100 45%, #8a5a00); border: 2px solid #3a2200;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 4px 8px rgba(0,0,0,.5); }
.m3-stat svg { position: absolute; left: -18px; top: -5px; width: 44px; height: 46px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.m3-stat * { pointer-events: none; }
.m3-val { min-width: 70px; height: 100%; padding: 0 9px; border-radius: 7px; display: flex; align-items: center; justify-content: flex-end; gap: 5px;
  background: linear-gradient(var(--screen-a), var(--screen-b)); box-shadow: inset 0 2px 4px #000, inset 0 -1px 0 rgba(255,255,255,.12);
  color: var(--num); font-size: 17px; text-shadow: 0 0 8px var(--num-glow); white-space: nowrap; }
.m3-val small { color: #9fb4e8; font-size: 12px; text-shadow: none; font-weight: 800; }
.m3-rank b { font-size: 13px; color: #fff; text-shadow: 0 0 6px rgba(120,170,255,.8); }
.m3-rank small { color: var(--num); font-size: 15px; }
.m3-pre { font-size: 11px !important; }

.m3-plate { position: absolute; left: 50%; top: 60px; width: 344px; margin-left: -172px; padding: 10px 0 9px; border-radius: 16px; line-height: 0; z-index: 3;
  background: linear-gradient(var(--plate-a), var(--plate-b) 45%, var(--plate-c)); border: 3px solid #ffd23f;
  box-shadow: 0 0 0 3px var(--edge), inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.4), 0 10px 22px rgba(0,0,0,.6); }
.m3-plate::before { content: ""; position: absolute; inset: 5px; border-radius: 11px; border: 1.5px dashed rgba(255,216,90,.55); pointer-events: none; }
.m3-plate i { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--rivet), #c98a00 70%); box-shadow: 0 1px 1px #000; }
.m3-plate i:nth-child(1) { left: 9px; top: 9px; } .m3-plate i:nth-child(2) { right: 9px; top: 9px; } .m3-plate i:nth-child(3) { left: 9px; bottom: 9px; } .m3-plate i:nth-child(4) { right: 9px; bottom: 9px; }

.m3-hero { position: absolute; left: 50%; top: 168px; width: 340px; height: 340px; margin-left: -170px; z-index: 2; }
.hero-glow { position: absolute; left: 10%; right: 10%; top: 12%; bottom: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,214,90,.55), rgba(255,120,40,.18) 50%, rgba(255,80,40,0) 70%); animation: glow 3s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.bear { position: absolute; left: 0; top: 0; width: 340px; height: 340px; pointer-events: none; transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(#000 78%, transparent 99%); mask-image: linear-gradient(#000 78%, transparent 99%);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.55)); animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1) rotate(-.6deg); } 50% { transform: scale(1.015, 1.03) rotate(.6deg); } }
.bear.strum { animation: strum .5s ease-out; }
@keyframes strum { 0% { transform: scale(1); } 30% { transform: scale(1.06, .95) rotate(-2deg); } 60% { transform: scale(.98, 1.04) rotate(2deg); } 100% { transform: scale(1); } }
.bear-say { position: absolute; left: 4px; top: 46px; z-index: 5; max-width: 170px; padding: 8px 11px; border-radius: 14px; background: #fff; color: #10204f;
  font-size: 12.5px; font-weight: 700; line-height: 1.25; box-shadow: 0 4px 10px rgba(0,0,0,.4); border: 2px solid #10204f;
  opacity: 0; transform: scale(.6); transform-origin: 80% 100%; transition: opacity .2s, transform .2s; pointer-events: none; }
.bear-say::after { content: ""; position: absolute; right: 22px; bottom: -10px; border: 8px solid transparent; border-top-color: #10204f; border-bottom: 0; }
.bear-say.show { opacity: 1; transform: scale(1); }

.m3-menu { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 3; }
.m3-guest { display: none; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: rgba(5, 10, 40, .8); color: #ffd9a0; font-size: 12px; font-weight: 600; }
.m3-guest.show { display: flex; }
.m3-play { position: relative; width: 290px; height: 78px; border-radius: 20px; border: 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: 8px; line-height: 0;
  background: linear-gradient(#ffd75a, #ff9d00 48%, #f26a00 52%, #ff8c00);
  box-shadow: 0 0 0 3px #7a2a00, 0 0 0 6px #ffe7a0, 0 0 0 8px #7a2a00, 0 10px 0 8px #3a1200, 0 22px 24px rgba(0,0,0,.6);
  transition: transform .06s; animation: m3pulse 1.7s ease-in-out infinite; margin-bottom: 6px; }
.m3-play::before { content: ""; position: absolute; left: 10px; right: 10px; top: 6px; height: 34%; border-radius: 14px; background: linear-gradient(rgba(255,255,255,.75), rgba(255,255,255,.1)); pointer-events: none; }
.m3-play:active { transform: translateY(6px); }
.m3-play > * { position: relative; pointer-events: none; }
@keyframes m3pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.14); } }
.m3-sub { font-size: 13px; font-weight: 800; color: #ffe7a0; text-shadow: 0 1px 3px #000; margin-top: 4px; }
.m3-row { display: flex; gap: 5px; margin-top: 4px; }
.m3-rb { width: 58px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--label); font: inherit; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.m3-rb b { position: relative; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid #0a0a1a;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(0,0,0,.35), 0 4px 0 #050510, 0 8px 10px rgba(0,0,0,.5); transition: transform .06s; }
.m3-rb:active b { transform: translateY(4px); }
.m3-rb * { pointer-events: none; }
.m3-g b { background: radial-gradient(circle at 35% 25%, #8df27a, #1f9e2c 70%); }
.m3-b b { background: radial-gradient(circle at 35% 25%, #8fd8ff, #1860d8 70%); }
.m3-r b { background: radial-gradient(circle at 35% 25%, #ff9d8a, #d5281b 70%); }
.m3-v b { background: radial-gradient(circle at 35% 25%, #e0a8ff, #7b2fd0 70%); }
.m3-s b { background: radial-gradient(circle at 35% 25%, #ffe98a, #e0a100 70%); }
.m3-p b { background: radial-gradient(circle at 35% 25%, #c7ccd4, #5c626c 70%); }
.badge { position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ffd23f; color: #5a0808;
  border: 2px solid #2a0303; font-size: 11px; font-style: normal; line-height: 16px; text-align: center; text-shadow: none; }
.badge.hide { display: none; }

/* Общие кнопки и окна */
.btn { min-width: 240px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 14px; font: inherit; font-size: 18px; font-weight: 900; color: #fff;
  background: linear-gradient(#5a8cff, #1f4fd0 55%, #163ba8); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 4px 0 #0a1f66, 0 6px 10px rgba(0,0,0,.4); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 1px 0 #0a1f66; }
.btn-play { min-height: 56px; font-size: 21px; background: linear-gradient(#ffd75a, #ff9d00 50%, #f26a00); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 #7a2a00, 0 6px 10px rgba(0,0,0,.4); }
.btn-red { background: linear-gradient(#ff7a6a, #e3261b 55%, #a8120c); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 4px 0 #5a0808, 0 6px 10px rgba(0,0,0,.4); }
.btn-blue { background: linear-gradient(#5a8cff, #1f4fd0 55%, #163ba8); }
.btn-sm { min-height: 42px; font-size: 15px; background: linear-gradient(#5d6a86, #36405a); box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 3px 0 #181d2b; }
.btn-icon { width: 44px; height: 44px; flex-shrink: 0; border: 2px solid #ffd23f; border-radius: 12px; color: #fff; background: linear-gradient(#2f5fe0, #10297a);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #061440; }
.btn-icon:active { transform: translateY(2px); }
.btn-icon * { pointer-events: none; }
.overlay { background: rgba(3, 8, 30, .72); }
.panel { width: 330px; padding: 20px 18px 18px; border-radius: 20px; align-items: stretch;
  background: linear-gradient(#173a9e, #0b1f63 60%, #08164a); border: 3px solid #ffd23f;
  box-shadow: 0 0 0 3px #2a0303, inset 0 2px 0 rgba(255,255,255,.25), 0 18px 40px rgba(0,0,0,.7); animation: pop .28s cubic-bezier(.2, 1.4, .5, 1); }
.panel::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 6px; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #fff 0 33%, #2f6bff 33% 66%, #e3261b 66%); }
@keyframes pop { 0% { opacity: 0; transform: scale(.7); } 100% { opacity: 1; transform: scale(1); } }
.panel .btn { min-width: 0; width: 100%; }
.panel-title { font-size: 25px; font-weight: 900; text-align: center; color: #ffd23f; text-shadow: 0 2px 0 #7a2a00, 0 4px 8px rgba(0,0,0,.5); }
.res-line { font-size: 15px; text-align: center; line-height: 1.35; color: #e6edff; }
#toast { bottom: 26px; padding: 10px 16px; border-radius: 14px; background: rgba(5, 12, 45, .92); border: 2px solid #ffd23f; font-size: 15px; font-weight: 700; }

/* Рейтинг */
#lb-list { max-height: 300px; }
.lb-me { padding: 8px 10px; border-radius: 12px; background: rgba(255,210,63,.14); border: 1.5px solid rgba(255,210,63,.6); font-size: 13px; font-weight: 700; text-align: center; color: #fff3c4; }
.lb-row { border-radius: 12px; background: rgba(255,255,255,.08); font-size: 14px; font-weight: 700; }
.lb-row.top-1 { background: linear-gradient(90deg, rgba(255,200,40,.45), rgba(255,200,40,.08)); }
.lb-row.top-2 { background: linear-gradient(90deg, rgba(220,230,245,.38), rgba(220,230,245,.06)); }
.lb-row.top-3 { background: linear-gradient(90deg, rgba(210,128,62,.45), rgba(210,128,62,.06)); }
.lb-row.me { outline: 2px solid #ffd23f; }
.lb-medal { font-weight: 900; color: #9fb4e8; font-size: 13px; }
.lb-medal.gold, .lb-medal.silver, .lb-medal.bronze { height: 28px; line-height: 28px; border-radius: 50%; color: #2a1600; font-size: 15px; border: 2px solid #2a1600; box-shadow: inset 0 2px 0 rgba(255,255,255,.6); }
.lb-medal.gold { background: radial-gradient(circle at 35% 30%, #fff6a8, #ffc21a 60%, #b06a00); }
.lb-medal.silver { background: radial-gradient(circle at 35% 30%, #fff, #c3ccd8 60%, #6c7889); }
.lb-medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd2a1, #d0803e 60%, #7a3f12); }
.lb-avatar { background: linear-gradient(#e3261b, #8a0f12); color: #fff; font-weight: 900; border: 2px solid #ffd23f; }
.lb-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.lb-score i { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; color: #fff; }
.lb-score b { font-size: 15px; color: #ffe27a; }
.tb1 { background: #b9672b; } .tb2 { background: #6c7889; } .tb3 { background: #c98a00; } .tb4 { background: #c0201a; }
