* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(160deg, #7b5cff 0%, #ff7eb6 55%, #ffcf5c 100%);
  color: #3a2a40;
  user-select: none; -webkit-user-select: none;
}
#app { position: fixed; inset: 0; }
.hidden { display: none !important; }

.screen { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 12px; overflow-y: auto; }
.screen.active { display: flex; }

.title-box, .panel {
  background: #fffaf2; border-radius: 26px; padding: 22px 26px; text-align: center;
  box-shadow: 0 10px 0 rgba(58, 42, 64, 0.25), 0 20px 40px rgba(0,0,0,0.2);
  max-width: 460px; width: 100%;
}
.logo { position: relative; margin: 6px 0 4px; line-height: 0.92; font-family: 'Arial Black', 'Trebuchet MS', system-ui, sans-serif; font-weight: 900; letter-spacing: 1px; display: flex; flex-direction: column; align-items: center; }
.logo-line { display: flex; gap: 1px; }
.logo-line span { display: inline-block; -webkit-text-stroke: 2px #3a2a40; paint-order: stroke fill; animation: hop 2.4s ease-in-out infinite; }
.logo .l1 span { font-size: 54px; color: #ffcf5c; text-shadow: 0 5px 0 #3a2a40, 0 9px 12px rgba(58,42,64,.35); }
.logo .l2 span { font-size: 40px; color: #ff4f9a; text-shadow: 0 4px 0 #3a2a40, 0 8px 10px rgba(58,42,64,.3); margin-top: 2px; }
.logo .l1 span:nth-child(odd) { color: #ffd84d; } .logo .l1 span:nth-child(even) { color: #ffb627; }
.logo .l2 span:nth-child(odd) { color: #ff5fa8; } .logo .l2 span:nth-child(even) { color: #7b5cff; }
.logo-line span:nth-child(1) { animation-delay: 0s; } .logo-line span:nth-child(2) { animation-delay: .1s; }
.logo-line span:nth-child(3) { animation-delay: .2s; } .logo-line span:nth-child(4) { animation-delay: .3s; }
.logo-line span:nth-child(5) { animation-delay: .4s; } .logo-line span:nth-child(6) { animation-delay: .5s; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-7px) rotate(-3deg); } 90% { transform: translateY(0) scale(1.05, .95); } }
.logo-bomb { font-size: 46px; display: inline-block; animation: bob 1s ease-in-out infinite alternate; filter: drop-shadow(0 4px 0 rgba(58,42,64,.35)); margin-bottom: -4px; }
@keyframes bob { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-6px) rotate(8deg); } }
.subtitle { margin: 6px 0 16px; font-size: 16px; }
.tip { font-size: 13px; opacity: 0.8; margin: 12px 0 0; }
h2 { margin: 4px 0 12px; color: #7b5cff; }

.menu { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: inline-block; border: none; border-radius: 16px; padding: 12px 18px; margin: 6px 4px;
  font: inherit; font-weight: bold; font-size: 17px; cursor: pointer; text-decoration: none;
  background: #7b5cff; color: #fff; box-shadow: 0 5px 0 #4b33b8; transition: transform .05s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #4b33b8; }
.btn.big { font-size: 20px; padding: 15px 20px; width: 100%; margin: 6px 0; }
.btn.alt { background: #ff4f9a; box-shadow: 0 5px 0 #c42a6d; }
.btn.whats { background: #25d366; box-shadow: 0 5px 0 #128c48; }
.btn.ghost { background: transparent; color: #7b5cff; box-shadow: none; text-decoration: underline; }
.btn:disabled { opacity: 0.5; }

.status { margin: 12px 0; font-weight: bold; }
.status.waiting { color: #ff4f9a; animation: pulse 1.2s infinite alternate; }
.status.error { color: #d62828; }
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }
.code { font-size: 54px; font-weight: bold; letter-spacing: 10px; color: #ff4f9a; background: #fff; border: 4px dashed #ffcf5c; border-radius: 16px; padding: 4px 10px; margin-bottom: 8px; }
.linkrow input { width: 100%; font-size: 14px; padding: 10px; border-radius: 10px; border: 2px solid #ddd; text-align: center; }
.code-input { font-size: 44px; text-align: center; width: 230px; letter-spacing: 8px; text-transform: uppercase; border: 4px solid #7b5cff; border-radius: 16px; padding: 6px; margin: 4px 0 10px; font-weight: bold; color: #ff4f9a; }

/* Seleção */
.select-wrap { background: #fffaf2; border-radius: 26px; padding: 14px; text-align: center; max-width: 720px; width: 100%; box-shadow: 0 10px 0 rgba(58,42,64,.25); position: relative; }
.players-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.vs { font-size: 30px; font-weight: bold; color: #ff4f9a; }
.player-panel { flex: 1; min-width: 0; max-width: 250px; border-radius: 20px; padding: 8px; border: 4px solid var(--pc, #ccc); background: #fff; }
.player-panel.ready { background: #e8ffe9; }
.player-panel.empty { border-style: dashed; opacity: .6; }
.player-panel.mine { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pc); }
.pp-label { font-weight: bold; font-size: 14px; color: var(--pc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jtag { display: inline-block; background: var(--pc); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 12px; }
.pp-empty { display: flex; align-items: center; justify-content: center; font-size: 40px; background: #f3eefa; }
.players-row.n3 .player-panel, .players-row.n4 .player-panel { max-width: 170px; padding: 6px; }
.players-row.n3 .pp-portrait, .players-row.n4 .pp-portrait { max-width: 120px; }
.players-row.n3 .pp-name, .players-row.n4 .pp-name { font-size: 17px; }
.players-row.n3 .pp-ready, .players-row.n4 .pp-ready { font-size: 13px; padding: 7px 4px; width: 100%; margin: 4px 0; }
.pp-portrait { width: 100%; max-width: 170px; aspect-ratio: 1; border-radius: 18px; display: block; margin: 4px auto; }
.pp-name { font-size: 22px; font-weight: bold; }
.pp-ready { width: 90%; font-size: 15px; padding: 9px; }
.player-panel.ready .pp-ready { background: #22b07d; box-shadow: 0 5px 0 #127650; }
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px auto 0; max-width: 470px; }
.card { position: relative; width: 104px; border-radius: 16px; background: #fff; border: 4px solid #eee; padding: 4px; cursor: pointer; }
.card img { width: 100%; border-radius: 12px; display: block; }
.card .nm { font-weight: bold; }
.card.mine { transform: translateY(-3px); box-shadow: 0 6px 0 rgba(58,42,64,.18); }
.card .badge { position: absolute; top: -10px; font-size: 11px; font-weight: bold; color: #fff; border-radius: 10px; padding: 2px 6px; white-space: nowrap; }
.card.taken img { opacity: 0.45; filter: grayscale(.6); }
.card.taken::after { content: 'Escolhido'; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-12deg); background: #3a2a40; color: #fff; font-size: 12px; font-weight: bold; padding: 2px 8px; border-radius: 8px; }
.invite-bar { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 15px; margin: -4px 0 8px; }
.invite-bar b { color: #ff4f9a; letter-spacing: 2px; }
.btn.mini { font-size: 14px; padding: 6px 12px; margin: 0 4px; box-shadow: 0 3px 0 #4b33b8; }
.btn.roll { background: #ff9f1c; box-shadow: 0 3px 0 #c26b00; }
.btn.start { background: #22b07d; box-shadow: 0 5px 0 #127650; max-width: 420px; margin-top: 12px; }
.cpu-row { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px auto 0; }
.countdown { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; font-family: 'Arial Black', 'Trebuchet MS', sans-serif; font-weight: 900; font-size: min(30vw, 30vh); line-height: 1; color: #ffcf5c; -webkit-text-stroke: 5px #3a2a40; paint-order: stroke fill; text-shadow: 0 8px 0 #3a2a40, 0 14px 24px rgba(0,0,0,.4); }
.countdown.go { color: #22e08f; font-size: min(22vw, 24vh); }
.countdown.pop { animation: cdpop .9s ease-out both; }
@keyframes cdpop { 0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(.9); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1.05); } 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }
.toast { position: absolute; left: 50%; top: 45%; transform: translateX(-50%); background: #3a2a40; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: bold; }

.btn.share { background: #22b07d; box-shadow: 0 5px 0 #127650; }
#pause { z-index: 30; }
#pause-text { white-space: pre-line; font-size: 18px; font-weight: bold; }
.pause-icon { font-size: 46px; animation: pulse 1s infinite alternate; }

/* Modo sozinho */
.btn.solo { background: #ff9f1c; box-shadow: 0 5px 0 #c26b00; }
.btn.solo small { font-size: 15px; font-weight: normal; }
.diff-row { margin: 10px auto 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.diff-label { font-weight: bold; font-size: 14px; }
.diff-btns { display: flex; gap: 6px; background: #f1e9ff; padding: 4px; border-radius: 16px; }
.diff { border: none; border-radius: 12px; padding: 8px 14px; font: inherit; font-weight: bold; font-size: 16px; cursor: pointer; background: transparent; color: #7b5cff; }
.diff.on { background: #7b5cff; color: #fff; box-shadow: 0 3px 0 #4b33b8; }
.diff[data-diff="facil"].on { background: #22b07d; box-shadow: 0 3px 0 #127650; }
.diff[data-diff="dificil"].on { background: #e0344f; box-shadow: 0 3px 0 #9c1830; }
.diff-desc { font-size: 13px; opacity: 0.85; min-height: 1.2em; }
.pp-roll { background: #ff9f1c; box-shadow: 0 5px 0 #c26b00; }
.player-panel.bot .pp-portrait { cursor: pointer; }
.sdbadge { position: absolute; left: 50%; transform: translateX(-50%); top: 6px; z-index: 4; background: rgba(58,42,64,.85); color: #fff; font-weight: bold; padding: 4px 14px; border-radius: 12px; font-size: 15px; pointer-events: none; white-space: nowrap; }
.sdbadge.on { background: #e0344f; animation: pulse .5s infinite alternate; }

/* Jogo */
#screen-game { flex-direction: column; justify-content: flex-start; padding: 6px; gap: 6px; touch-action: none; overflow: hidden; }
.hud { flex: 0 0 auto; display: flex; gap: 6px; justify-content: center; width: 100%; max-width: 900px; padding-right: 132px; }
.hud .pl { position: relative; flex: 1; display: flex; align-items: center; gap: 6px; background: linear-gradient(#fffdf8, #fff3e2); border-radius: 14px; padding: 4px 8px; border: 3px solid var(--pc, #5a7bff); min-width: 0; box-shadow: 0 3px 0 rgba(58,42,64,.18); }
.hud .pl.me { box-shadow: 0 0 0 2px #fff, 0 3px 0 rgba(58,42,64,.18); }
.hud .pl.dead { opacity: 0.45; filter: grayscale(.8); }
.hud img { width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto; }
.hud .jt { position: absolute; left: 2px; bottom: -7px; background: var(--pc); color: #fff; font-size: 10px; font-weight: bold; border-radius: 6px; padding: 0 4px; line-height: 1.3; }
.hud.n3 .st, .hud.n4 .st { font-size: 11px; }
.hud .info { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.hud .nm { font-weight: bold; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .st { font-size: 13px; white-space: nowrap; }
.hud .wins { margin-left: auto; font-weight: bold; color: #e08a00; font-size: 18px; }
.topbtns { position: fixed; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; z-index: 40; }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; border: none; background: #fffaf2; color: #7b5cff; font-size: 18px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; padding: 0; }
.iconbtn.ingame { display: none; }
body.in-game .iconbtn.ingame { display: flex; }
.screen:not(#screen-game) { padding-top: 54px; }
.canvas-wrap { flex: 1 1 0; width: 100%; min-height: 0; position: relative; overflow: hidden; }
.canvas-wrap canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#game { border-radius: 14px; box-shadow: 0 8px 0 rgba(58,42,64,.3); image-rendering: auto; background: #9be57a; }

.overlay { position: absolute; inset: 0; background: rgba(40, 20, 60, 0.55); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 12px; }

/* Controles de toque */
.touch-controls { display: none; }
body.touch .touch-controls { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 4px 18px 14px; flex: 0 0 auto; }
.dpad { position: relative; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,250,242,0.9); box-shadow: 0 6px 0 rgba(0,0,0,0.2); touch-action: none; }
.dpad .arr { position: absolute; font-size: 22px; color: #7b5cff; opacity: 0.8; }
.dpad .up { top: 8px; left: 50%; transform: translateX(-50%); }
.dpad .down { bottom: 8px; left: 50%; transform: translateX(-50%); }
.dpad .left { left: 10px; top: 50%; transform: translateY(-50%); }
.dpad .right { right: 10px; top: 50%; transform: translateY(-50%); }
/* área de toque maior que o desenho (invisível) */
.dpad::before { content: ''; position: absolute; inset: -40px; border-radius: 50%; }
.dpad .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: #7b5cff; box-shadow: 0 4px 0 #4b33b8; pointer-events: none; }
.bombbtn { width: 110px; height: 110px; border-radius: 50%; border: none; background: #ff4f9a; box-shadow: 0 7px 0 #c42a6d; font-size: 48px; touch-action: none; }
.bombbtn.pressed { transform: translateY(4px); box-shadow: 0 3px 0 #c42a6d; }

@media (orientation: landscape) and (max-height: 560px) {
  body.touch .touch-controls { position: absolute; inset: auto 0 0 0; padding: 0 12px 12px; pointer-events: none; }
  body.touch .touch-controls > * { pointer-events: auto; }
  body.touch .dpad { width: 140px; height: 140px; opacity: 0.85; }
  body.touch .bombbtn { opacity: 0.9; }
  .hud .st { display: none; }
  .hud { padding-right: 132px; margin-top: 0; display: flex !important; }
  .countdown { font-size: 34vh; }
}
@media (max-width: 520px) {
  .cards { gap: 12px 8px; max-width: 330px; }
  .card { width: 74px; }
  .card .nm { font-size: 13px; }
  .players-row { gap: 5px; }
  .players-row.n3 .player-panel, .players-row.n4 .player-panel { padding: 4px; border-width: 3px; border-radius: 14px; }
  .players-row.n4 .pp-label { font-size: 10px; } .players-row.n4 .pp-name { font-size: 14px; }
  .players-row.n4 .pp-ready { font-size: 11px; padding: 6px 2px; }
  .logo .l1 span { font-size: 46px; } .logo .l2 span { font-size: 34px; }
  .hud { padding-right: 0; margin-top: 42px; }
  .hud.n3, .hud.n4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 5px; }
  .select-wrap { padding: 10px; }
  .select-wrap h2 { font-size: 20px; margin: 2px 0 8px; }
  .pp-portrait { max-width: 120px; }
  .pp-label { font-size: 12px; }
  .vs { font-size: 22px; }
  .pp-name { font-size: 18px; }
  .diff { padding: 7px 9px; font-size: 14px; }
  .diff-label, .diff-desc { font-size: 12px; }
  .sdbadge { font-size: 12px; padding: 3px 10px; }
  .hud img { width: 28px; height: 28px; }
  .hud .nm { font-size: 12px; } .hud .st { font-size: 10px; }
  .hud .info { flex: 1 1 auto; overflow: hidden; } .hud .st { overflow: hidden; }
  .hud .wins { flex: 0 0 auto; }
  .hud .pl { padding: 3px 5px; gap: 4px; border-width: 2px; }
  .hud .wins { font-size: 14px; }
  .topbtns { gap: 4px; } .iconbtn { width: 34px; height: 34px; font-size: 16px; }
  .screen:not(#screen-game) { padding-top: 48px; }
}

/* Janela do jogo (no lugar de alert/confirm) */
.overlay.modal { z-index: 50; background: rgba(40, 20, 60, 0.6); }
.modal-card { max-width: 360px; padding: 20px 20px 14px; border: 4px solid #7b5cff; animation: modalin .22s ease-out; }
@keyframes modalin { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 52px; line-height: 1; margin-bottom: 4px; }
.modal-card h3 { margin: 4px 0 6px; font-size: 24px; color: #7b5cff; }
#modal-text { white-space: pre-line; font-size: 17px; margin: 6px 0 12px; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; margin: 6px 0; }
.btn.danger { background: #e0344f; box-shadow: 0 5px 0 #9c1830; }
.btn.ghostbtn { background: #efe8ff; color: #7b5cff; box-shadow: 0 5px 0 #c9bcf2; }
.btn.menu { background: #8f86a6; box-shadow: 0 5px 0 #5f5775; }

/* Classificação no fim da rodada */
.rank-card { position: relative; overflow: hidden; max-width: 420px; padding: 14px 16px 10px; max-height: 100%; overflow-y: auto; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; opacity: .9; animation: fall linear infinite; }
@keyframes fall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(560px) rotate(540deg); } }
.champ { position: relative; }
.crown { font-size: 40px; line-height: 1; animation: bob 1s ease-in-out infinite alternate; }
.champ-portrait { width: 112px; height: 112px; border-radius: 24px; border: 5px solid var(--pc); box-shadow: 0 0 0 4px #ffcf5c, 0 8px 18px rgba(58,42,64,.3); margin-top: 2px; }
.champ-name { margin: 6px 0 2px; font-size: 26px; }
.champ-sub { margin: 0 0 4px; font-size: 15px; }
.champ-pts { display: inline-block; background: #fff1c9; border-radius: 12px; padding: 3px 10px; font-size: 15px; }
.champ-pts b { color: #e08a00; }
.rank-list { list-style: none; padding: 0; margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.rank-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 3px solid var(--pc); border-radius: 14px; padding: 4px 8px; text-align: left; }
.rank-row .medal { font-size: 22px; width: 30px; text-align: center; font-weight: bold; color: #8f86a6; }
.rank-row img { width: 40px; height: 40px; border-radius: 10px; }
.rank-row .rn { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .rn small { color: var(--pc); font-weight: bold; }
.rank-row .rp { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.rank-row .rp b { color: #e08a00; font-size: 17px; }
.rank-row .rp small { font-size: 12px; opacity: .8; white-space: nowrap; }
.rank-foot { font-size: 12px; opacity: .7; margin: 4px 0 2px; position: relative; }
.rank-btns { display: flex; gap: 8px; position: relative; }
.rank-btns .btn { flex: 1; margin: 6px 0; font-size: 15px; padding: 10px 6px; }
.rank-card #btn-again { position: relative; }

/* Reações: barra fixa de emojis (entre a arena e os controles) e balões no alto */
.emo-bar { flex: 0 0 auto; display: flex; justify-content: center; gap: 8px; padding: 2px 0; z-index: 6; transition: opacity .2s; }
.emo-bar .emo { width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,250,242,.92); font-size: 24px; padding: 0; cursor: pointer; box-shadow: 0 3px 0 rgba(58,42,64,.22); touch-action: manipulation; }
.emo-bar .emo:active { transform: translateY(2px) scale(.93); box-shadow: 0 1px 0 rgba(58,42,64,.22); }
.emo-bar.cool { opacity: .45; }
.emo-bubbles { position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 5; pointer-events: none; }
.emo-bubble { position: absolute; top: 4px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; background: #fffaf2; border: 3px solid var(--pc); border-radius: 18px; padding: 2px 10px 3px; box-shadow: 0 4px 10px rgba(58,42,64,.25); animation: bubble 2.2s ease-out forwards; }
.emo-bubble::after { content: ''; position: absolute; bottom: -9px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--pc); border-bottom: 0; }
.emo-bubble .e { font-size: 30px; line-height: 1.1; }
.emo-bubble small { font-size: 11px; font-weight: bold; color: var(--pc); white-space: nowrap; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 20% { transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }
@media (orientation: landscape) and (max-height: 560px) {
  body.touch .emo-bar { position: absolute; left: 8px; top: 64px; display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; }
  body.touch .emo-bar .emo { width: 40px; height: 40px; font-size: 21px; }
}
/* Logo e instalar */
.logo-img { margin: 0 auto 6px; }
.logo-img img { display: block; width: min(68vw, 280px, 38vh); height: auto; margin: 0 auto; border-radius: 26px; box-shadow: 0 6px 0 rgba(58,42,64,.2); }
.btn.small { font-size: 15px; padding: 9px 16px; margin-top: 12px; }
.btn.install { background: #0246bf; box-shadow: 0 4px 0 #012d7c; }
@media (max-width: 520px) {
  .champ-portrait { width: 92px; height: 92px; }
  .champ-name { font-size: 22px; }
}

/* Ajustes app instalado (tela cheia): cartões abaixo dos botões do topo; controles mais altos, longe da marca do Netlify */
#screen-game { padding-top: max(6px, env(safe-area-inset-top)); }
body.touch .touch-controls { padding: 4px 28px calc(48px + env(safe-area-inset-bottom)); }
@media (max-width: 520px) { .hud { margin-top: 46px; } }
@media (orientation: landscape) and (max-height: 560px) {
  body.touch .touch-controls { padding: 0 24px calc(40px + env(safe-area-inset-bottom)); }
}

/* Votação do cenário */
.vote-wrap h2 { margin: 2px 0 2px; }
.vote-tip { font-weight: bold; font-size: 16px; margin: 2px 0 10px; min-height: 1.3em; color: #3a2a40; }
.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 600px; margin: 0 auto; }
.map-card { position: relative; border-radius: 16px; background: #fff; border: 4px solid #eee; padding: 5px 5px 6px; cursor: pointer; transition: transform .12s, opacity .25s, filter .25s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.map-card img { width: 100%; aspect-ratio: 7 / 5; border-radius: 10px; display: block; }
.map-card .nm { font-weight: bold; font-size: 16px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-card .marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 20px; margin-top: 4px; }
.vmark { background: var(--pc); color: #fff; font-size: 11px; font-weight: bold; border-radius: 8px; padding: 1px 6px; animation: modalin .2s ease-out; }
.map-card.mine { border-color: #7b5cff; transform: translateY(-3px); box-shadow: 0 6px 0 rgba(58,42,64,.18); }
.map-card.out { opacity: .3; filter: grayscale(.8); }
.map-card.spin { border-color: #ffcf5c; transform: scale(1.06); box-shadow: 0 0 0 4px #ffcf5c, 0 6px 0 rgba(58,42,64,.18); }
.map-card.win { border-color: #22b07d; transform: scale(1.08); box-shadow: 0 0 0 5px #22b07d, 0 8px 18px rgba(58,42,64,.3); }
.map-card.win .nm { color: #127650; }
.vote-voters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 4px; }
.vchip { border: 3px solid var(--pc); border-radius: 12px; padding: 2px 8px; font-size: 13px; font-weight: bold; color: var(--pc); background: #fff; }
.vchip.ok { background: var(--pc); color: #fff; }
.vote-timer { display: inline-block; margin-top: 6px; background: #3a2a40; color: #fff; font-weight: bold; border-radius: 12px; padding: 3px 12px; font-size: 14px; }
@media (max-width: 520px) {
  .maps { gap: 7px; }
  .map-card { padding: 3px 3px 4px; border-width: 3px; border-radius: 13px; }
  .map-card .nm { font-size: 13px; }
  .vote-tip { font-size: 14px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .vote-wrap h2 { font-size: 20px; margin: 0; }
  .maps { max-width: 470px; }
  .vote-voters { margin-top: 8px; }
}

/* =====================================================================
   Visual novo dos menus (v13): azul royal liso, botões coloridos de jogo,
   sem cartões brancos. Fonte Baloo 2 (OFL) embutida em assets/fonts.
   ===================================================================== */
@font-face { font-family: 'Baloo 2'; src: url('../assets/fonts/baloo2-sub.woff') format('woff'); font-weight: 600 800; font-style: normal; font-display: swap; }
:root { --royal: #0646c0; --royal-d: #04318a; --navy: #0a1d5c; --ink: #2a2350; --sun: #ffd23f; --sky: #cfe2ff; }
body { background: var(--royal); color: #fff; font-family: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif; font-weight: 600; line-height: 1.25; }
h2 { color: #fff; font-size: 28px; font-weight: 800; line-height: 1.1; text-shadow: 0 3px 0 var(--royal-d); margin: 2px 0 10px; }
.tip { color: #bcd6ff; opacity: 1; font-weight: 600; }

/* ---------- Botões estilo jogo ---------- */
.btn { --b1: #5aa0ff; --b2: #2a6ef0; --sd: #143f9e; position: relative; font-family: inherit; font-weight: 800; color: #fff; letter-spacing: .2px;
  background: linear-gradient(var(--b1), var(--b2)); border: 3px solid var(--navy); border-radius: 18px;
  box-shadow: 0 5px 0 var(--sd), 0 8px 14px rgba(0, 12, 60, .3); text-shadow: 0 2px 0 rgba(0, 0, 0, .18); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn::after { content: ''; position: absolute; left: 10px; right: 10px; top: 3px; height: 38%; border-radius: 12px; background: rgba(255, 255, 255, .22); pointer-events: none; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sd), 0 2px 6px rgba(0, 12, 60, .3); }
@media (hover: hover) { .btn:not(:disabled):hover { filter: brightness(1.06); } }
.btn:disabled { opacity: .5; filter: saturate(.6); }
.btn.big { font-size: 21px; padding: 11px 18px; border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 6px 0 var(--sd), 0 10px 18px rgba(0, 12, 60, .35); }
.btn.big:active { box-shadow: 0 1px 0 var(--sd), 0 3px 8px rgba(0, 12, 60, .3); transform: translateY(5px); }
.btn .bi { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: rgba(255, 255, 255, .32); text-shadow: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.btn.solo { --b1: #ffe36e; --b2: #ffb400; --sd: #c27800; color: #4a2700; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
.btn.host, .btn.share, .btn.whats, .btn.start { --b1: #4fe08f; --b2: #17b464; --sd: #0c7a42; }
.btn.alt { --b1: #ff7fac; --b2: #f2407f; --sd: #b01d55; }
.btn.rules { --b1: #ffffff; --b2: #dce8ff; --sd: #86a8ea; color: var(--royal); text-shadow: none; }
.btn.rules .bi { background: #e6efff; }
.btn.roll, .pp-roll { --b1: #ffb04d; --b2: #ff8a1f; --sd: #c25a00; }
.btn.menu { --b1: #9ab3e6; --b2: #6b88c6; --sd: #3d568c; }
.btn.danger { --b1: #ff6b7f; --b2: #e0344f; --sd: #9c1830; }
.btn.ghostbtn { --b1: #ffffff; --b2: #e3ecff; --sd: #86a8ea; color: var(--royal); text-shadow: none; }
.btn.install { --b1: #ffffff; --b2: #dce8ff; --sd: #86a8ea; color: var(--royal); text-shadow: none; }
.btn.mini, .btn.mini:is(.roll) { box-shadow: 0 3px 0 var(--sd); border-width: 2px; border-radius: 14px; }
/* as variações antigas definiam fundo/sombra próprios: aqui todas usam o gradiente novo */
.btn:is(.solo, .host, .share, .whats, .start, .alt, .rules, .roll, .pp-roll, .menu, .danger, .ghostbtn, .install, .pp-ready) { background: linear-gradient(var(--b1), var(--b2)); box-shadow: 0 5px 0 var(--sd), 0 8px 14px rgba(0, 12, 60, .3); }
.btn.big:is(.solo, .host, .share, .whats, .start, .alt, .rules) { box-shadow: 0 6px 0 var(--sd), 0 10px 18px rgba(0, 12, 60, .35); }
.btn:is(.solo, .host, .share, .whats, .start, .alt, .rules, .roll, .pp-roll, .menu, .danger, .ghostbtn, .install, .pp-ready):active { box-shadow: 0 1px 0 var(--sd), 0 2px 6px rgba(0, 12, 60, .3); }

.btn.mini::after, .btn.small::after { display: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--sky); text-decoration: none; text-shadow: none; font-weight: 700; }
.btn.ghost::after { display: none; }
.btn.ghost:active { transform: translateY(1px); box-shadow: none; }

/* ---------- Tela inicial ---------- */
#screen-title { background: var(--royal); }
.home { width: 100%; max-width: 420px; margin: auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 6px 10px; }
.home-logo { margin: 0 0 2px; width: min(90vw, 370px, 44vh); line-height: 0; animation: lgbob 3.2s ease-in-out infinite; will-change: transform; }
.lg { width: 100%; height: auto; overflow: visible; }
.lg-t1, .lg-t2 { font-family: 'Baloo 2', 'Arial Rounded MT Bold', 'Arial Black', system-ui, sans-serif; font-weight: 800; text-anchor: middle; stroke-linejoin: round; paint-order: stroke; }
.lg-t1 { font-size: 96px; fill: url(#lgB); stroke: #24103a; stroke-width: 14px; }
.lg-t2 { font-size: 76px; fill: url(#lgF); stroke: var(--navy); stroke-width: 12px; }
.lg-t1.sh { fill: #050a24; stroke: #050a24; opacity: .55; }
.lg-t2.sh { fill: #04123d; stroke: #04123d; opacity: .55; }
.lg-word { transform-box: fill-box; transform-origin: 50% 100%; animation: lghop 3.2s ease-in-out infinite; }
.lg-w2 { animation-delay: .14s; }
.lg-bomb { transform-box: fill-box; transform-origin: 50% 90%; animation: lgwob 1.6s ease-in-out infinite alternate; }
.lg-spark { transform-box: fill-box; transform-origin: center; animation: lgspark .26s ease-in-out infinite alternate; }
.lg-sp { animation: lgsp .9s ease-out infinite; }
.lg-sp.s1 { --dx: -20px; --dy: -18px; } .lg-sp.s2 { --dx: 22px; --dy: -14px; animation-delay: .22s; }
.lg-sp.s3 { --dx: 18px; --dy: 20px; animation-delay: .45s; } .lg-sp.s4 { --dx: -22px; --dy: 12px; animation-delay: .67s; }
.lg-rays { transform-box: fill-box; transform-origin: center; animation: lgrays 1.6s ease-in-out infinite alternate; }
@keyframes lgbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes lghop { 0%, 62%, 100% { transform: none; } 70% { transform: translateY(-9px) scale(1.03); } 79% { transform: translateY(0) scale(1.05, .93); } 87% { transform: scale(.99, 1.02); } }
@keyframes lgwob { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes lgspark { from { transform: scale(.8) rotate(-10deg); } to { transform: scale(1.15) rotate(12deg); } }
@keyframes lgsp { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes lgrays { from { opacity: .55; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
.home-sub { color: var(--sky); font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.home .menu { width: min(100%, 330px); gap: 13px; }
.home .menu .btn { margin: 0; animation: popin .5s cubic-bezier(.3, 1.5, .5, 1) both; }
.home .menu .btn:nth-child(2) { animation-delay: .06s; } .home .menu .btn:nth-child(3) { animation-delay: .12s; } .home .menu .btn:nth-child(4) { animation-delay: .18s; }
@keyframes popin { from { transform: scale(.7) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.home #btn-resume-room { margin: 14px 0 0; width: min(100%, 330px); }
.home .btn.small { margin-top: 14px; }
.home .tip { max-width: 320px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .home-logo, .lg-word, .lg-bomb, .lg-spark, .lg-rays, .home .menu .btn { animation: none; }
  .lg-sp { display: none; }
}

/* ---------- Telas de menu sem cartão branco ---------- */
.screen:not(#screen-game) > .panel, .select-wrap { background: transparent; box-shadow: none; color: #fff; border-radius: 0; }
.screen > .panel { padding: 8px 6px; max-width: 420px; }
.screen > .panel p { color: var(--sky); font-weight: 700; margin: 8px 0 6px; }
.status { color: #fff; }
.status.waiting { color: var(--sun); }
.status.error { color: #ffb3c0; }
.code { font-size: 52px; font-weight: 800; letter-spacing: 10px; color: var(--navy); background: linear-gradient(#ffe36e, #ffc21a); border: 3px solid var(--navy); border-radius: 20px; box-shadow: 0 6px 0 #c27800; padding: 2px 10px 0 20px; margin: 4px auto 12px; max-width: 300px; }
.linkrow input { background: rgba(255, 255, 255, .14); color: #fff; border: 2px solid rgba(255, 255, 255, .25); border-radius: 14px; font-family: inherit; font-weight: 600; }
.code-input { font-family: inherit; font-weight: 800; color: var(--royal); background: #fff; border: 3px solid var(--navy); border-radius: 20px; box-shadow: 0 6px 0 rgba(0, 12, 60, .4); padding: 4px 6px 0; }
.code-input::placeholder { color: #b9cdf3; }
#screen-host .row { display: flex; gap: 8px; justify-content: center; }
#screen-host .row .btn { flex: 1; margin: 8px 0; }

/* ---------- Escolha de personagem ---------- */
.select-wrap { padding: 2px 4px; max-width: 560px; }
.invite-bar { background: rgba(255, 255, 255, .13); border-radius: 999px; padding: 4px 6px 4px 14px; width: fit-content; margin: -2px auto 10px; color: #fff; }
.invite-bar b { color: var(--sun); }
.player-panel { background: rgba(255, 255, 255, .1); border: 3px solid var(--pc, #9fc3ff); border-radius: 18px; color: #fff; }
.player-panel.ready { background: rgba(40, 210, 130, .22); }
.player-panel.empty { background: rgba(255, 255, 255, .05); opacity: .7; }
.player-panel.mine { box-shadow: 0 0 0 3px var(--sun); }
.pp-label { color: #fff; }
.jtag { border: 2px solid var(--navy); border-radius: 999px; padding: 0 7px; line-height: 1.3; }
.pp-portrait { aspect-ratio: 6 / 5; height: auto; max-width: 150px; border-radius: 14px; background: radial-gradient(circle at 50% 58%, #7eaeff 0%, #3a74e6 62%, #2a5fd0 100%); }
.pp-empty { background: rgba(255, 255, 255, .08); color: #fff; }
.pp-name { color: #fff; font-weight: 800; }
.pp-ready { width: 92%; margin: 4px auto 2px; }
.player-panel.ready .pp-ready { --b1: #4fe08f; --b2: #17b464; --sd: #0c7a42; background: linear-gradient(var(--b1), var(--b2)); box-shadow: 0 5px 0 var(--sd); }
.vs { color: var(--sun); text-shadow: 0 3px 0 var(--royal-d); }
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; margin: 14px auto 2px; max-width: 520px; }
.card { width: 116px; padding: 4px 4px 6px; border-radius: 18px; border: 3px solid var(--navy); background: radial-gradient(circle at 50% 46%, #84b2ff 0%, #3a74e6 60%, #2a5fd0 100%); box-shadow: 0 5px 0 #03236a; transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), box-shadow .14s; touch-action: manipulation; }
@media (hover: hover) { .card:hover { transform: translateY(-2px); } }
.card:active { transform: translateY(2px) scale(.97); }
.card .art img { width: 100%; aspect-ratio: 6 / 5; display: block; border-radius: 12px; }
.card .nm { position: relative; display: flex; align-items: center; gap: 4px; margin: -12px 0 0; padding: 1px 8px 1px 2px; background: var(--cc); color: #fff; border: 2px solid var(--navy); border-radius: 999px; font-size: 15px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); box-shadow: 0 2px 0 rgba(0, 12, 60, .35); }
.card .nm b { flex: 0 0 auto; width: 19px; height: 19px; border-radius: 50%; background: #fff; color: var(--cc); display: grid; place-items: center; font-size: 12px; text-shadow: none; }
.card.mine { transform: translateY(-4px) scale(1.05); box-shadow: 0 0 0 4px var(--sun), 0 9px 0 #03236a, 0 0 22px rgba(255, 210, 63, .55); z-index: 1; }
.card.mine::before { content: '✔'; position: absolute; right: -8px; top: -9px; width: 26px; height: 26px; border-radius: 50%; background: var(--sun); color: var(--navy); border: 2px solid var(--navy); display: grid; place-items: center; font-size: 14px; font-weight: 800; z-index: 3; }
.card.taken { background: #2a4f9e; }
.card.taken img { opacity: .4; filter: grayscale(.85); }
.card.taken .nm { filter: grayscale(.7); opacity: .75; }
.card.taken::after { content: 'Escolhido'; top: 40%; background: var(--navy); border: 2px solid #fff; font-size: 13px; padding: 1px 9px; border-radius: 999px; z-index: 2; }
.card .badge { top: -11px; border: 2px solid var(--navy); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 0 6px; z-index: 2; }
.cpu-row, .diff-row { color: #fff; }
.diff-label { color: var(--sky); font-weight: 800; }
.diff-btns { background: rgba(255, 255, 255, .13); border-radius: 16px; }
.diff { font-family: inherit; font-weight: 800; color: #fff; }
.diff.on { background: var(--sun); color: #4a2700; box-shadow: 0 3px 0 #c27800; }
.diff[data-diff="facil"].on { background: #2bd07f; color: #fff; box-shadow: 0 3px 0 #0c7a42; }
.diff[data-diff="dificil"].on { background: #f04460; color: #fff; box-shadow: 0 3px 0 #9c1830; }
.diff-desc { color: var(--sky); opacity: 1; }
.btn.start { margin: 14px auto 0; }
.toast { background: var(--navy); border: 2px solid #fff; z-index: 5; }
.foot-links { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.foot-links .btn { margin: 2px; }

/* ---------- Votação do cenário ---------- */
.vote-tip { color: var(--sun); }
.map-card { background: rgba(255, 255, 255, .12); border: 3px solid var(--navy); box-shadow: 0 5px 0 #03236a; }
.map-card .nm { color: #fff; font-weight: 800; }
.map-card.mine { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun), 0 8px 0 #03236a; }
.map-card.spin { border-color: var(--sun); box-shadow: 0 0 0 4px var(--sun), 0 6px 0 #03236a; }
.map-card.win { border-color: #2bd07f; box-shadow: 0 0 0 5px #2bd07f, 0 8px 18px rgba(0, 0, 0, .35); }
.map-card.win .nm { color: #9dffcb; }
.vmark { border: 2px solid var(--navy); border-radius: 999px; }
.vchip { background: rgba(255, 255, 255, .1); border-radius: 999px; }
.vchip.ok { color: #fff; }
.vote-timer { background: var(--navy); border: 2px solid rgba(255, 255, 255, .5); border-radius: 999px; }

/* ---------- Janelas por cima (resultado, pausa, aviso, regras) ---------- */
.overlay { background: rgba(2, 16, 66, .62); }
.overlay > .panel { background: linear-gradient(#0b55d6, #0646c0 40%, #0540b0); color: #fff; border: 3px solid #5a92ff; border-radius: 26px; box-shadow: 0 10px 0 rgba(2, 16, 66, .55), 0 22px 50px rgba(0, 0, 0, .4); }
#pause-text { color: #fff; }
.overlay.modal { background: rgba(2, 16, 66, .62); }
.modal-card { border-color: #5a92ff; }
.modal-card h3 { color: var(--sun); text-shadow: 0 2px 0 var(--royal-d); }
#modal-text { color: #fff; }
.champ-portrait { box-shadow: 0 0 0 4px var(--sun), 0 8px 18px rgba(0, 0, 0, .35); }
.champ-name { color: #fff; font-weight: 800; text-shadow: 0 3px 0 var(--royal-d); }
.champ-sub { color: var(--sky); }
.champ-pts { background: rgba(255, 210, 63, .18); color: #fff; border-radius: 999px; }
.champ-pts b { color: var(--sun); }
.rank-row { background: rgba(255, 255, 255, .12); color: #fff; }
.rank-row .medal { color: var(--sky); }
.rank-row .rp b { color: var(--sun); }
.rank-foot { color: #bcd6ff; opacity: 1; }

.overlay.sheet { z-index: 45; }
.rules-card { position: relative; width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto; text-align: left; padding: 14px 14px 10px; animation: sheetin .25s ease-out; overscroll-behavior: contain; }
@keyframes sheetin { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.rules-card h3 { margin: 0 40px 2px; text-align: center; font-size: 26px; font-weight: 800; color: var(--sun); text-shadow: 0 3px 0 var(--royal-d); }
.rules-card h4 { margin: 8px 2px 6px; font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #9fc3ff; }
.rules-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; cursor: pointer; }
.r-items, .r-rules { list-style: none; margin: 0; padding: 0; }
.r-items li { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .11); border-radius: 16px; padding: 4px 10px 4px 4px; margin-bottom: 6px; }
.r-items .ic { width: 46px; height: 46px; flex: 0 0 auto; }
.r-items b { display: block; color: #fff; font-size: 16px; font-weight: 800; line-height: 1.15; }
.r-items span { display: block; color: #d6e6ff; font-size: 14px; line-height: 1.25; }
.r-rules li { display: flex; gap: 8px; color: #fff; font-size: 14.5px; line-height: 1.3; margin: 0 2px 7px; }
.r-rules .re { flex: 0 0 22px; text-align: center; }
.rules-card #rules-ok { margin: 10px 0 4px; }

/* ---------- Barra do topo e controles (só cores) ---------- */
.iconbtn { background: #fff; color: var(--royal); border-radius: 12px; box-shadow: 0 3px 0 rgba(2, 16, 66, .45); font-family: inherit; font-weight: 800; }
#btn-help { font-size: 21px; }
body.in-game .iconbtn.menuonly { display: none; }
.hud { color: var(--ink); }
.dpad .arr { color: #1f6fe0; }
.dpad .knob { background: #1f6fe0; box-shadow: 0 4px 0 #0b3f99; }

@media (max-width: 520px) {
  h2, .select-wrap h2 { font-size: 24px; margin: 0 0 8px; }
  .cards { gap: 10px 7px; max-width: 370px; }
  .card { width: calc((100% - 21px) / 4); padding: 3px 3px 5px; border-radius: 15px; }
  .card .nm { font-size: 12.5px; padding-right: 5px; gap: 3px; margin-top: -10px; }
  .card .nm b { width: 16px; height: 16px; font-size: 10.5px; }
  .card.mine::before { width: 22px; height: 22px; font-size: 12px; right: -6px; top: -8px; }
  .pp-portrait { max-width: 118px; }
  .players-row.n3 .pp-portrait, .players-row.n4 .pp-portrait { max-width: 92px; }
  .home .menu { gap: 12px; }
  .btn.big { font-size: 20px; }
  .code { font-size: 44px; }
}
@media (max-height: 820px) {
  .home-logo { width: min(90vw, 330px, 37vh); }
  .home-sub { margin-bottom: 12px; }
  .home .menu { gap: 10px; }
  .home .menu .btn.big { padding: 8px 16px; }
}
.rank-card #btn-again { --b1: #4fe08f; --b2: #17b464; --sd: #0c7a42; background: linear-gradient(var(--b1), var(--b2)); box-shadow: 0 6px 0 var(--sd), 0 10px 18px rgba(0, 12, 60, .35); }
.rank-card #btn-again:active { box-shadow: 0 1px 0 var(--sd); }

/* ---------- Votação do cenário (v14): cartões grandes ---------- */
.vote-wrap { max-width: 960px; }
.vote-wrap h2 { font-size: 30px; }
.vote-tip { font-size: 18px; }
.maps { grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 900px; }
.map-card { padding: 6px 6px 10px; border-radius: 22px; background: linear-gradient(#2f6ae0, #2559c8); }
.map-card img { border-radius: 16px; }
.map-card .nm { font-size: 22px; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.map-card .mi { font-size: 26px; }
.map-card .cnt { font-size: 15px; font-weight: 800; color: var(--sky); min-height: 1.3em; }
.map-card .cnt.has { color: var(--sun); }
.map-card .vmark { font-size: 13px; padding: 1px 8px; }
.map-card.mine::after { content: '✔ Seu voto'; position: absolute; top: -12px; right: 10px; background: var(--sun); color: var(--navy); border: 2px solid var(--navy); border-radius: 999px; font-size: 13px; font-weight: 800; padding: 0 9px; }
.map-card.spin { transform: scale(1.04); }
.map-card.win { transform: scale(1.05); }
.map-card.win::after { content: '🏁 Vai ser este!'; position: absolute; top: -12px; right: 10px; background: #2bd07f; color: #fff; border: 2px solid var(--navy); border-radius: 999px; font-size: 13px; font-weight: 800; padding: 0 9px; }
@media (orientation: portrait) and (max-width: 640px) {
  #screen-vote { align-items: flex-start; }
  .vote-wrap { padding-top: 4px; }
  .vote-wrap h2 { font-size: 27px; margin: 4px 0 4px; }
  .maps { grid-template-columns: 1fr; gap: 16px; max-width: 460px; }
  .map-card { display: grid; grid-template-columns: 58% 1fr; align-items: center; gap: 10px; padding: 7px; border-width: 3px; border-radius: 22px; text-align: left; }
  .map-card img { border-radius: 15px; }
  .map-card .mc-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .map-card .nm { flex-direction: column; align-items: flex-start; gap: 0; font-size: 23px; line-height: 1.05; margin: 0; white-space: normal; }
  .map-card .mi { font-size: 34px; line-height: 1.1; }
  .map-card .cnt { font-size: 16px; }
  .map-card .marks { justify-content: flex-start; min-height: 0; }
  .map-card.spin, .map-card.win { transform: scale(1.03); }
  .vote-voters { margin-top: 16px; }
  .vchip { font-size: 14px; padding: 3px 10px; }
}

/* ---------- Botão "Estou pronto!" bem visível (v18) ---------- */
.player-panel.mine:not(.ready) .pp-ready:not(:disabled) {
  --b1: #4fe08f; --b2: #17b464; --sd: #0c7a42;
  background: linear-gradient(var(--b1), var(--b2)); color: #fff; border: 3px solid var(--navy);
  box-shadow: 0 6px 0 var(--sd), 0 10px 18px rgba(0, 12, 60, .35);
  font-size: 19px; padding: 11px 8px; width: 96%; border-radius: 18px; overflow: visible;
  animation: readypulse 1.3s ease-in-out infinite;
}
.player-panel.mine:not(.ready) .pp-ready:not(:disabled)::before {
  content: ''; position: absolute; inset: -7px; border-radius: 24px; pointer-events: none;
  border: 3px solid #7dffb5; box-shadow: 0 0 16px 3px rgba(79, 224, 143, .75);
  animation: readyglow 1.3s ease-in-out infinite;
}
.player-panel.mine:not(.ready) .pp-ready:not(:disabled):active { animation: none; transform: translateY(5px); box-shadow: 0 1px 0 var(--sd); }
@keyframes readypulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes readyglow { 0%, 100% { opacity: .15; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.03); } }
/* depois de apertar: discreto, com o ✔ */
.player-panel.mine.ready .pp-ready {
  --b1: rgba(255, 255, 255, .2); --b2: rgba(255, 255, 255, .12); --sd: rgba(2, 16, 66, .45);
  background: linear-gradient(var(--b1), var(--b2)); color: #b8ffd6; border: 3px solid rgba(255, 255, 255, .35);
  box-shadow: 0 3px 0 var(--sd); text-shadow: none; animation: none;
}
.player-panel.mine.ready .pp-ready::after { display: none; }
.players-row.n3 .player-panel.mine:not(.ready) .pp-ready:not(:disabled), .players-row.n4 .player-panel.mine:not(.ready) .pp-ready:not(:disabled) { font-size: 15px; padding: 9px 4px; width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .player-panel.mine:not(.ready) .pp-ready:not(:disabled), .player-panel.mine:not(.ready) .pp-ready:not(:disabled)::before { animation: none; }
  .player-panel.mine:not(.ready) .pp-ready:not(:disabled)::before { opacity: .8; }
}

/* ===== v20: formato da partida + tela de campeão ===== */
.fmt-row { margin: 8px auto 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: #fff; }
.fmt-row .diff { padding: 7px 11px; font-size: 15px; }
.fmt-row .diff.on { background: var(--sun); color: #4a2700; box-shadow: 0 3px 0 #c27800; }
.fmt-row.ro .diff-btns { background: transparent; }
.fmt-row.ro .diff.on { cursor: default; }
@media (max-width: 640px) {
  .fmt-row { gap: 4px 6px; margin-top: 6px; }
  .fmt-row .diff { padding: 6px 8px; font-size: 13px; }
}
.match-btns { display: flex; flex-direction: column; gap: 4px; position: relative; }
.match-btns .btn { margin: 4px 0; }
.match-btns #btn-newmatch { --b1: #4fe08f; --b2: #17b464; --sd: #0c7a42; background: linear-gradient(var(--b1), var(--b2)); box-shadow: 0 6px 0 var(--sd), 0 10px 18px rgba(0, 12, 60, .35); }
.rank-card.match-end .crown { font-size: 46px; }
.champ-art { display: block; width: min(240px, 62vw); aspect-ratio: 6 / 5; margin: 2px auto 0; border-radius: 22px;
  background: radial-gradient(circle at 50% 45%, #fff6c8, #ffd23f 60%, #f0a500); box-shadow: 0 0 0 4px var(--pc, #fff), 0 0 34px 6px rgba(255, 210, 63, .55);
  animation: champpop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.champ-title { margin: 10px 0 0; font-size: 44px; line-height: 1; color: var(--sun); font-weight: 800; text-shadow: 0 4px 0 #b86e00, 0 8px 18px rgba(0, 0, 0, .3); animation: champpop .6s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.champ-name2 { margin: 6px 0 0; font-size: 24px; font-weight: 800; color: #fff; text-shadow: 0 3px 0 var(--royal-d, #0a1d5c); }
.champ-sub { margin: 2px 0 6px; color: var(--sky); font-weight: 800; font-size: 16px; }
.stars { color: var(--sun); letter-spacing: 1px; }
.hud .wins { letter-spacing: .5px; color: #e09a00; }
@keyframes champpop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .champ-art, .champ-title { animation: none; } }
.net-badge { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 6; background: rgba(10, 29, 92, .85); color: #fff; font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 999px; pointer-events: none; animation: netblink 1.2s ease-in-out infinite alternate; }
@keyframes netblink { from { opacity: .55; } to { opacity: 1; } }
