/* ROTOVERNA modern: menus, status display, level cards, messages */
#modern { background: #000; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#mhud, #mui { position: absolute; inset: 0; pointer-events: none; }
#mui > * { pointer-events: auto; }
.mfont, #mhud, #mui { font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif; color: #f6efe4; }

/* ---------------- menus */
#mui.menu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px; background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.05), rgba(0,0,0,0.55) 75%); overflow-y: auto; }
#mui.menu.over { background: rgba(4,3,2,0.62); backdrop-filter: blur(4px); }
#mui.menu.panel { background: rgba(4,3,2,0.55); backdrop-filter: blur(3px); }
.mlogo { text-align: center; }
.mlogo img { width: min(760px, 88vw); height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,0.85)); animation: logoIn 1.2s cubic-bezier(.2,.9,.2,1) both; }
.mlogo p { margin: -4px 0 0; letter-spacing: 0.45em; text-transform: uppercase; font-size: clamp(13px, 1.8vw, 18px); color: #8fe8ff; text-shadow: 0 0 14px rgba(60,200,255,0.8), 0 2px 4px #000; }
.mlogo p.mcredit { margin-top: 8px; letter-spacing: 0.2em; text-transform: none; font-size: 13px; color: #ffc070; text-shadow: 0 1px 3px #000; }
@keyframes logoIn { from { opacity: 0; transform: scale(1.12); filter: blur(8px); } to { opacity: 1; transform: none; } }
.mbtns { display: flex; flex-direction: column; gap: 9px; min-width: min(420px, 86vw); }
.mbtns.opts { min-width: min(520px, 90vw); }
.mbtn {
  position: relative; padding: 12px 22px; border-radius: 10px; cursor: pointer; text-align: center;
  font-size: 18px; font-weight: 700; letter-spacing: 0.06em; color: #f6efe4;
  background: linear-gradient(180deg, rgba(40,30,24,0.82), rgba(16,12,10,0.86)); border: 1px solid rgba(255,190,120,0.22);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45); transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.mbtn.sel { border-color: #ffb260; background: linear-gradient(180deg, rgba(120,58,16,0.9), rgba(54,24,8,0.92)); box-shadow: 0 0 0 1px rgba(255,170,80,0.4), 0 0 26px rgba(255,120,30,0.45); transform: translateX(4px); }
.mbtn.sel::before { content: '▶'; position: absolute; left: 12px; color: #ffc070; font-size: 12px; top: 50%; transform: translateY(-50%); }
/* start world: small preview in the button, dropdown with a card per world */
.mbtn .mthumb { width: 46px; height: 26px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin: -4px 10px -2px 0; box-shadow: 0 0 0 1px rgba(255,190,120,0.35); }
.mbtn .mchev { font-style: normal; margin-left: 10px; display: inline-block; color: #ffc070; transition: transform .15s; }
.mbtn.open .mchev { transform: rotate(180deg); }
.mdrop { position: fixed; z-index: 25; width: min(560px, 94vw); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px;
  border-radius: 14px; background: rgba(12,9,7,0.94); border: 1px solid rgba(255,190,120,0.35); box-shadow: 0 18px 50px rgba(0,0,0,0.75); animation: dropIn .14s ease-out both; }
.mworld { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 6px 6px 8px; border-radius: 10px; cursor: pointer; text-align: left;
  font: inherit; color: #f6efe4; background: rgba(40,30,24,0.6); border: 1px solid rgba(255,190,120,0.14); transition: border-color .12s, background .12s, box-shadow .12s; }
.mworld img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: 4px; display: block; }
.mworld small { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #9feaff; }
.mworld b { font-size: 15px; letter-spacing: 0.02em; }
.mworld.sel { border-color: #ffb260; background: linear-gradient(180deg, rgba(120,58,16,0.85), rgba(54,24,8,0.9)); box-shadow: 0 0 18px rgba(255,120,30,0.45); }
.mworld.cur::after { content: '✓'; position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #1a0e04; background: #ffc070; box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mfoot { font-size: 13px; opacity: 0.7; text-shadow: 0 1px 3px #000; text-align: center; }
.mpanel { width: min(760px, 92vw); padding: 22px 26px; border-radius: 16px; background: rgba(12,9,7,0.82); border: 1px solid rgba(255,190,120,0.18); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.mpanel.small { width: auto; padding: 14px 40px; }
.mpanel h2 { margin: 0 0 12px; font-size: 26px; letter-spacing: 0.14em; color: #ffb260; text-transform: uppercase; text-align: center; }
.mpanel ul { margin: 0; padding-left: 20px; line-height: 1.55; font-size: 16px; }
.mpanel li { margin-bottom: 6px; }
.mpanel .keys { margin: 12px 0 0; font-size: 13px; opacity: 0.75; text-align: center; }
.scores { list-style: none; margin: 0; padding: 0; counter-reset: s; font-size: 18px; }
.scores li { counter-increment: s; display: grid; grid-template-columns: 34px 112px 1fr 56px; gap: 10px; padding: 5px 10px; border-radius: 6px; }
.scores li::before { content: counter(s) '.'; opacity: 0.6; }
.scores li:nth-child(1) { color: #ffd060; } .scores li:nth-child(2) { color: #e8e8f0; } .scores li:nth-child(3) { color: #ffa060; }
.scores li b { text-align: right; font-variant-numeric: tabular-nums; } .scores li i { opacity: 0.6; font-style: normal; text-align: right; }
.scores li.hl { background: rgba(255,170,60,0.22); animation: blink 0.6s steps(2) infinite; }
.scores li.me { background: rgba(120,210,255,0.16); box-shadow: inset 3px 0 0 #8fe8ff; }
.mpanel p.rival { margin: 12px 0 0; color: #8fe8ff; letter-spacing: 0.06em; font-weight: 700; }
.mpanel p.empty { opacity: 0.7; margin: 18px 0; }
@keyframes blink { 50% { background: rgba(255,170,60,0.05); } }
.bigscore { font-size: 44px; font-weight: 800; text-align: center; margin: 0 0 6px; color: #ffd070; text-shadow: 0 0 20px rgba(255,160,40,0.6); }
.name { display: flex; justify-content: center; gap: clamp(4px, 1.2vw, 10px); margin: 10px 0; }
.name span { width: clamp(28px, 8vw, 46px); height: clamp(40px, 11vw, 60px); display: flex; align-items: center; justify-content: center; font-size: clamp(22px, 6.5vw, 38px); font-weight: 800; border-bottom: 3px solid rgba(255,255,255,0.3); }
.name span.cur { border-color: #ffb260; animation: blink 0.8s steps(2) infinite; }
.mpanel p { text-align: center; }

/* ---------------- status display */
#mhud .hl { position: absolute; left: max(16px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 7px; }
#mhud .hr { position: absolute; right: max(18px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); text-align: right; }
.gauge { display: flex; align-items: center; gap: 8px; }
.gauge i { width: 26px; height: 26px; font-style: normal; color: #9feaff; filter: drop-shadow(0 0 5px rgba(80,200,255,0.8)); }
.gauge i svg { width: 100%; height: 100%; display: block; }
.gauge.heat i { color: #ffb040; filter: drop-shadow(0 0 5px rgba(255,140,40,0.8)); }
.gauge .bar { width: clamp(140px, 18vw, 240px); height: 12px; border-radius: 7px; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.18); overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.gauge b { display: block; height: 100%; transform-origin: left center; border-radius: 7px; transition: transform 0.12s linear; }
.gauge.air b { background: linear-gradient(90deg, #1fb8ff, #7af0ff); box-shadow: 0 0 12px rgba(80,220,255,0.7); }
.gauge.air.low b { background: linear-gradient(90deg, #ff2a2a, #ff8a4a); animation: pulse 0.5s infinite alternate; }
.gauge.heat b { background: linear-gradient(90deg, #ffb020, #ff6a10); }
.gauge.heat.hot b { background: linear-gradient(90deg, #ff6a10, #ff1a1a); box-shadow: 0 0 14px rgba(255,60,20,0.9); }
.gauge.heat.stall .bar { animation: shakeX 0.1s infinite; }
@keyframes pulse { to { filter: brightness(1.6); } }
@keyframes shakeX { 50% { transform: translateX(2px); } }
#mhud .icons { display: flex; gap: 16px; align-items: center; padding-left: 38px; }
#mhud em { display: inline-block; margin-right: 4px; }
#mhud em.life { width: 20px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18'%3E%3Cpath d='M2 13a8 8 0 0 1 16 0v2H2z' fill='%23f4f4f0'/%3E%3Cpath d='M9 8h8.6a8 8 0 0 1 .4 3.5H10a1 1 0 0 1-1-1z' fill='%2310305a'/%3E%3Crect x='1' y='14' width='18' height='2.4' rx='1.2' fill='%23ff7a20'/%3E%3Ccircle cx='15' cy='5.6' r='1.6' fill='%23fff6c0'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
#mhud em.tnt { width: 6px; height: 16px; border-radius: 2px; background: linear-gradient(90deg, #e03020, #9a1410); box-shadow: 0 -3px 0 -1px #ffd040; }
#mhud .score { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; font-variant-numeric: tabular-nums; color: #ffe2a8; text-shadow: 0 0 16px rgba(255,150,40,0.55), 0 2px 4px #000; }
#mhud .lvl { font-size: 14px; letter-spacing: 0.08em; opacity: 0.85; text-shadow: 0 1px 3px #000; }
#mhud .lowair { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 160px 40px rgba(255,20,10,0.75); transition: opacity 0.1s; }
.mpop { position: absolute; left: 0; top: 0; font-weight: 800; font-size: 20px; color: #fff3c8; text-shadow: 0 0 10px rgba(255,170,40,0.9), 0 2px 3px #000; will-change: transform; }

.mtally { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); min-width: min(420px, 86vw); padding: 18px 28px; border-radius: 16px; background: rgba(10,8,6,0.72); border: 1px solid rgba(255,200,120,0.3); box-shadow: 0 0 40px rgba(255,150,40,0.25); backdrop-filter: blur(4px); animation: tallyIn 0.5s cubic-bezier(.2,1.3,.3,1) both; }
.mtally h2 { margin: 0 0 10px; text-align: center; font-size: 40px; letter-spacing: 0.1em; color: #ffe0a0; text-shadow: 0 0 24px rgba(255,160,40,0.8); }
.mtally .row { display: flex; justify-content: space-between; font-size: 20px; padding: 3px 0; }
.mtally .row b { font-variant-numeric: tabular-nums; color: #fff3c8; }
.mtally.out { animation: tallyOut 0.5s ease-in both; }
@keyframes tallyIn { from { opacity: 0; transform: translateX(-50%) scale(1.3); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes tallyOut { to { opacity: 0; transform: translateX(-50%) scale(0.9); } }

/* ---------------- banners and level cards */
.mbanner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); text-align: center; font-size: clamp(34px, 6vw, 72px); font-weight: 900; letter-spacing: 0.08em; white-space: nowrap;
  color: #fff; text-shadow: 0 0 30px rgba(255,140,40,0.9), 0 4px 0 rgba(0,0,0,0.5); animation: bannerIn 0.45s cubic-bezier(.2,1.4,.3,1) both; }
.mbanner small { display: block; font-size: 0.35em; letter-spacing: 0.3em; opacity: 0.85; }
.mbanner.go { color: #fff1c8; }
.mbanner.escape { color: #ffd0b0; text-shadow: 0 0 30px rgba(255,40,10,1), 0 4px 0 rgba(0,0,0,0.5); animation: bannerIn 0.45s cubic-bezier(.2,1.4,.3,1) both, shakeX 0.08s 0.45s 20; }
.mbanner.over { color: #ff9a8a; text-shadow: 0 0 30px rgba(255,30,10,0.9); top: 40%; }
.mbanner.warn { font-size: 28px; color: #ffb0a0; top: 60%; }
.mbanner.life { color: #c8ffd8; text-shadow: 0 0 30px rgba(40,255,120,0.9); }
.mbanner.out { animation: bannerOut 0.5s ease-in both; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -50%) scale(1.8); filter: blur(10px); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes bannerOut { to { opacity: 0; transform: translate(-50%, -70%) scale(0.9); filter: blur(6px); } }
.mintro { position: absolute; inset: 0; background: #000 center / cover no-repeat; display: flex; align-items: flex-end; justify-content: flex-start; animation: introIn 0.5s ease-out both; }
.mintro::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.85), rgba(0,0,0,0.15) 60%), linear-gradient(0deg, rgba(0,0,0,0.6), transparent 45%); }
.mintro .tx { position: relative; padding: 0 0 9vh 7vw; animation: slideIn 0.7s 0.15s cubic-bezier(.2,.9,.2,1) both; }
.mintro small { font-size: clamp(14px, 1.6vw, 20px); letter-spacing: 0.35em; text-transform: uppercase; color: #9feaff; }
.mintro h1 { margin: 6px 0 0; font-size: clamp(54px, 9vw, 120px); line-height: 0.9; letter-spacing: 0.04em; color: #ffcf8a; text-shadow: 0 0 40px rgba(255,140,30,0.6); }
.mintro h2 { margin: 6px 0 0; font-size: clamp(22px, 3vw, 40px); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.mintro.out { animation: introOut 0.9s ease-in both; }
@keyframes introIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes introOut { to { opacity: 0; transform: scale(1.04); } }
body.in-modern #pad { --pad-c: rgba(255,154,60,0.14); }
@media (max-width: 640px) {
  .gauge .bar { width: 110px; height: 10px; }
  #mhud .lvl { display: none; }
  .mbtn { font-size: 16px; padding: 10px 16px; }
  .mdrop { grid-template-columns: repeat(2, 1fr); }
  .mworld b { font-size: 14px; }
}
