* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0B0920; overscroll-behavior: none; }
body {
  font-family: "Trebuchet MS", "Segoe UI", Roboto, system-ui, sans-serif;
  color: #F3F0FF; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
#app {
  position: relative; height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; background: #1B1836; overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* HUD */
#hud { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; background: linear-gradient(#231e4a, #1B1836); border-bottom: 2px solid #0B0920; }
#hud b { font-weight: 900; }
.money b { display: flex; align-items: center; gap: 6px; font-size: 28px; line-height: 1; }
.money img { width: 28px; height: 28px; }
.money small, .cnt small { font-size: 11px; opacity: .8; }
#menu-btn { align-self: flex-start; flex-shrink: 0; background: #3A3560; border-radius: 9px; width: 34px; height: 34px; font-size: 16px; box-shadow: 0 3px 0 #1f1b3d; }
#dev-btn { align-self: flex-start; flex-shrink: 0; background: #4EC66B; color: #0B1914; border-radius: 9px; height: 34px; padding: 0 8px; font-size: 11px; font-weight: 900; letter-spacing: .4px; box-shadow: 0 3px 0 #236B37; }
#hud .right { text-align: right; }
#h-stage { font-size: 22px; display: block; line-height: 1.1; }
.cnt { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 2px; }
.cnt img { width: 20px; height: 20px; }
.cnt .skull { font-size: 16px; width: 20px; text-align: center; }
.cnt b { font-size: 16px; }
#arena { position: relative; flex: 1; min-height: 0; background: #171A22; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#banner {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  background: rgba(11, 9, 32, .88); border: 2px solid #FFD35C; border-radius: 14px;
  padding: 10px 18px; font-weight: 900; font-size: 18px; text-align: center; width: max-content; max-width: 86%;
}
#pat { position: relative; margin: 6px 12px 4px; height: 24px; border-radius: 99px; background: #3A2A3E; overflow: hidden; flex-shrink: 0; border: 2px solid #0B0920; }
#pat-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(#ff7a70, #d93f3f); transition: width .2s; }
#pat-txt { position: relative; display: block; padding-left: 10px; font-size: 12px; font-weight: 900; line-height: 20px; }
#fx { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 4px; flex-shrink: 0; }
#fx span { font-size: 10px; font-weight: 900; background: #FFD35C; color: #1D2440; padding: 2px 6px; border-radius: 4px; }
#army-h { display: flex; align-items: center; padding: 4px 12px 2px; flex-shrink: 0; }
#army-h h4 { margin: 0; font-size: 18px; font-weight: 900; }
#army-h small { font-size: 12px; opacity: .8; }
#army-h .sp { flex: 1; }
#buymode { background: #3A3560; border-radius: 9px; padding: 6px 12px; font-weight: 900; font-size: 13px; min-width: 52px; box-shadow: 0 3px 0 #1f1b3d; }
/* Linhas dos bebês */
#rows { height: 24%; min-height: 126px; overflow-y: auto; padding-bottom: 4px; flex-shrink: 0; -webkit-overflow-scrolling: touch; }
.row { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; margin: 4px 8px; border-radius: 12px; border: 1px solid #332c63; background: linear-gradient(#2a2452, #221d42); }
.row.locked { opacity: .55; }
.row .pt { width: 50px; height: 50px; border-radius: 10px; border: 1px solid #4b4390; background: radial-gradient(circle at 50% 35%, #8fd0f5, #4a7fc0); }
.row h5 { margin: 0; font-size: 15px; font-weight: 900; }
.row h5 small { font-size: 11px; opacity: .8; }
.row .st { font-size: 11px; line-height: 1.3; font-weight: 700; }
.star { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.star i { color: #FFD35C; font-style: normal; font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
.star .bar { flex: 1; height: 7px; border-radius: 99px; background: #15122e; overflow: hidden; border: 1px solid #0B0920; }
.star .bar b { display: block; height: 100%; background: linear-gradient(90deg, #ffb52e, #ffe27a); }
.star small { font-size: 10px; opacity: .8; white-space: nowrap; }
.buy { background: #4AB8FF; color: #0B0920; font-weight: 900; font-size: 14px; border-radius: 10px; padding: 9px 8px; min-width: 76px; line-height: 1.1; box-shadow: 0 3px 0 #2577ad; }
.buy small { display: block; font-size: 10px; }
.buy:active { transform: translateY(2px); box-shadow: 0 1px 0 #2577ad; }
.buy:disabled { background: #4B4670; color: #A39DC4; box-shadow: 0 3px 0 #2c2850; }
/* Navegação */
#nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: #120F2A; padding: 6px 4px 8px; flex-shrink: 0; }
#nav button { background: none; font-size: 11px; font-weight: 800; padding: 8px 0; }
#nav .turbo { background: #FFD35C; color: #1D2440; border-radius: 12px; font-size: 14px; font-weight: 900; line-height: 1.1; padding: 5px 0; box-shadow: 0 3px 0 #b88f1f; }
#nav .turbo.on { background: #7EDBA9; box-shadow: 0 3px 0 #3f9c6c; }
#nav .turbo small { font-size: 10px; }
/* Folhas */
#overlay { position: absolute; inset: 0; background: rgba(8, 6, 20, .82); display: flex; align-items: flex-end; z-index: 10; }
#sheet { background: #241F45; border-top: 2px solid #3B3470; border-radius: 20px 20px 0 0; padding: 16px; width: 100%; max-height: 86%; overflow-y: auto; }
#sheet h3 { margin: 0 0 4px; font-size: 24px; font-weight: 900; }
#sheet p { margin: 0 0 10px; font-size: 13px; opacity: .85; line-height: 1.4; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #1B1836; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.item b { display: block; font-size: 15px; }
.item span { font-size: 12px; opacity: .8; }
.sbtn { background: #3A3560; border-radius: 10px; padding: 10px 14px; font-weight: 900; font-size: 14px; }
.sbtn.pri { background: #FFD35C; color: #1D2440; }
.sbtn.blue { background: #4AB8FF; color: #0B0920; }
.sbtn.green { background: #7EDBA9; color: #0B0920; }
.sbtn:disabled { background: #4B4670; color: #A39DC4; }
.sbtn.wide { display: block; width: 100%; margin-top: 8px; }
.bal { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.bal span { background: #1B1836; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.test { background: #3d2f12; border: 1px dashed #FFD35C; border-radius: 10px; padding: 8px 10px; font-size: 12px; margin-bottom: 10px; }
.price { font-size: 30px; font-weight: 900; margin: 6px 0 10px; }
/* Menu principal */
#title { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px 22px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #3a2f8a 0%, #1a1345 55%, #0C0922 100%); }
#title::before { content: ""; position: absolute; inset: -60px; pointer-events: none; opacity: .35;
  background-image: radial-gradient(circle, #fff 1px, transparent 1.6px), radial-gradient(circle, #FFD35C 1.2px, transparent 2px);
  background-size: 46px 52px, 110px 90px; animation: drift 40s linear infinite; }
#title > * { position: relative; }
@keyframes drift { to { transform: translate(46px, 52px); } }
.t-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.t-chips span { background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.logo { text-align: center; line-height: .92; font-weight: 900; transform: rotate(-3deg); }
.logo span { display: block; text-shadow: 0 4px 0 #1D2440, 0 8px 18px rgba(0, 0, 0, .5); }
.l1 { color: #FF7FA8; font-size: 70px; }
.l2 { color: #FFD35C; font-size: 24px; }
.l3 { color: #6CC4FF; font-size: 60px; }
.art { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; }
.art svg { width: 42%; max-width: 170px; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .3)); }
.a-baby { animation: bobA 2.2s ease-in-out infinite; }
.a-pit { animation: bobB 1.8s ease-in-out infinite; }
.vs { font-size: 22px; background: #E8504D; border: 3px solid #1D2440; border-radius: 99px; width: 46px; height: 46px; display: grid; place-items: center; flex-shrink: 0; animation: pulse 1.2s ease-in-out infinite; }
@keyframes bobA { 50% { transform: translateY(-7px) rotate(-3deg); } }
@keyframes bobB { 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes pulse { 50% { transform: scale(1.14); } }
.big { background: linear-gradient(#ffe27a, #ffc531); color: #1D2440; font-weight: 900; font-size: 28px; border-radius: 18px; padding: 14px; width: 100%; max-width: 320px; box-shadow: 0 6px 0 #a87c12, 0 12px 24px rgba(0, 0, 0, .4); animation: pulse 1.6s ease-in-out infinite; }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #a87c12; animation: none; }
.t-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 320px; }
.t-grid button { background: #2c2560; border: 1px solid #4b4390; border-radius: 14px; padding: 10px 4px; box-shadow: 0 4px 0 #120F2A; }
.t-grid b { display: block; font-size: 15px; }
.t-grid small { font-size: 10px; opacity: .75; }
.ghost { background: transparent; border: 2px solid #3B3470; border-radius: 14px; padding: 9px; width: 100%; max-width: 320px; font-weight: 800; }
.ghost.dev-btn { border-color: #4EC66B; color: #8EF0A4; background: rgba(78, 198, 107, .12); }
.code-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.code-row.code-title { width: 100%; max-width: 320px; margin-top: 2px; }
.code-row[hidden], #dev-btn[hidden], #t-dev[hidden] { display: none; }
.code-row input { flex: 1; min-width: 0; background: #191533; color: #FFF9ED; border: 2px solid #3B3470; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 700; outline: none; }
.code-row input:focus { border-color: #62B2FF; }
.sbtn.dev { background: #4EC66B; color: #0B1914; box-shadow: 0 3px 0 #236B37; }
.sbtn.off { background: #3A3560; color: #D8D2F2; box-shadow: 0 3px 0 #1f1b3d; }
.ver { opacity: .5; font-size: 11px; }
#toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 12; background: #0B0920; border: 2px solid #4AB8FF; border-radius: 12px; padding: 8px 14px; font-size: 13px; font-weight: 800; max-width: 90%; text-align: center; }
@media (prefers-reduced-motion: reduce) { .a-baby, .a-pit, .vs, .big, #title::before { animation: none; } }

#hud .money { flex: 1; text-align: center; }
#hud .money b { justify-content: center; }
#hud .right { flex-shrink: 0; }
