* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --ink: #3a2e5c;
  --pink: #ff5e8a;
  --card: rgba(255, 255, 255, 0.82);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #9fd4ff;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: 'Fredoka', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* O atributo hidden sempre esconde (mesmo em elementos com display: flex/grid) */
[hidden] { display: none !important; }

/* ---- HUD ---- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
#hud.show { opacity: 1; }

.side { display: flex; flex-direction: column; gap: 6px; }
/* Selos do topo: área morta, tocar neles não faz a bolinha pular */
#hud.show .side, #hud.show #settingsBtn { pointer-events: auto; }

.chip {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  font: 700 15px 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(90, 70, 150, 0.12);
}

#settingsBtn {
  pointer-events: auto;
  font-size: 18px;
  padding: 6px 10px;
  cursor: pointer;
}

#score {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 4px);
  transform: translateX(-50%);
  font-size: 64px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 0 rgba(90, 70, 150, 0.22);
}
#score.pop { animation: pop .25s ease-out; }
@keyframes pop {
  0% { transform: translateX(-50%) scale(1.35); }
  100% { transform: translateX(-50%) scale(1); }
}

/* ---- Overlays ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
  padding: 16px;
  text-align: center;
}
.overlay.show { opacity: 1; visibility: visible; }

#menu {
  pointer-events: none;
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + 9vh);
  padding-bottom: calc(env(safe-area-inset-bottom) + 13vh);
}
#menu h1 {
  font-size: clamp(40px, 12vw, 72px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  text-shadow: 0 5px 0 rgba(255, 94, 138, 0.55), 0 12px 30px rgba(90, 70, 150, 0.25);
  animation: float 3s ease-in-out infinite;
}
#menu h1 span { color: var(--pink); text-shadow: 0 5px 0 rgba(255, 255, 255, 0.8); }
#menu .spacer { flex: 1; }
#menu .hint {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
  background: var(--card);
  padding: 10px 20px;
  border-radius: 18px;
  margin-bottom: 14px;
}
#menu .hint b { color: var(--pink); }
#menu .tap {
  font-size: 22px;
  font-weight: 700;
  color: var(--pink);
  text-shadow: 0 2px 0 #fff, 0 0 12px rgba(255, 255, 255, 0.9);
  animation: pulse 1.2s ease-in-out infinite;
}
#menu .world {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(58, 46, 92, 0.7);
}

@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .75; } }

#over { background: rgba(60, 40, 110, 0.25); }
#over .card {
  width: min(340px, 100%);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 24px 20px 18px;
  box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3);
  transform: translateY(20px) scale(.95);
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1);
}
#over.show .card { transform: none; }
#over .title { font-size: 22px; font-weight: 700; color: #ff5e62; }
#over .big { font-size: 84px; font-weight: 700; line-height: 1; margin-top: 6px; }
#over .sub { font-size: 15px; opacity: .7; margin-bottom: 8px; }
#over .newrec {
  display: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #ff9f1c, #ff5e8a);
  border-radius: 999px;
  padding: 4px 14px;
  margin: 4px auto 8px;
  width: fit-content;
  animation: pulse 1s ease-in-out infinite;
}
#over .row {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 10px 0 18px;
}
#over .row span { display: block; font-size: 13px; opacity: .65; }
#over .row b { font-size: 24px; }
#over .row i { font-style: normal; }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px;
  font: 700 20px 'Fredoka', system-ui, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, #ff7a9c, #ff5e8a);
  box-shadow: 0 5px 0 #d9406d;
  cursor: pointer;
  margin-bottom: 10px;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #d9406d; }
.btn.ghost {
  background: rgba(58, 46, 92, 0.08);
  color: rgba(58, 46, 92, 0.55);
  box-shadow: none;
  font-size: 15px;
  padding: 10px;
  cursor: default;
}

/* ---- Menu: ranking ---- */
#menu .rank-btn {
  pointer-events: auto;
  margin-top: 14px;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font: 700 16px 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 3px 0 rgba(90, 70, 150, 0.15);
  cursor: pointer;
}

/* ---- Túmulo ---- */
#over .card { max-height: calc(100dvh - 32px); overflow-y: auto; }
.tomb { margin: 0 0 6px; text-align: left; }
.tomb label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 6px 4px; }
.tomb .field {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 4px 4px 4px 12px;
  box-shadow: inset 0 0 0 2px rgba(122, 104, 176, 0.25);
}
.tomb .field:focus-within { box-shadow: inset 0 0 0 2px var(--pink); }
.tomb .field span { font-weight: 700; color: rgba(58, 46, 92, 0.5); }
.tomb input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: 500 17px 'Fredoka', system-ui, sans-serif; /* 16px+ evita zoom no iPhone */
  color: var(--ink);
  padding: 8px 4px;
  user-select: text;
  -webkit-user-select: text;
}
.tomb button {
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font: 700 15px 'Fredoka', system-ui, sans-serif;
  color: #fff;
  background: #7a68b0;
  cursor: pointer;
}
.tomb button:disabled { opacity: .5; }
.tomb.done { display: none; }
.msg { min-height: 0; font-size: 14px; margin: 0 4px 10px; line-height: 1.3; }
.msg:empty { display: none; }
.msg.err { color: #e0384f; }
.msg.ok {
  color: #3a2e5c;
  background: rgba(255, 94, 138, 0.12);
  border-radius: 14px;
  padding: 10px;
  font-weight: 600;
}
.btn.ghost[data-open-rank] { cursor: pointer; color: var(--ink); }

/* ---- Ranking ---- */
#rank { background: rgba(60, 40, 110, 0.35); z-index: 5; }
#rank .card {
  position: relative;
  width: min(380px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 20px 16px 14px;
  box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3);
}
#rank .title { font-size: 24px; font-weight: 700; }
#rank .close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08);
  font-size: 16px; color: var(--ink); cursor: pointer;
}
#rank .tabs, #rushTabs {
  display: flex;
  gap: 6px;
  background: rgba(58, 46, 92, 0.08);
  border-radius: 14px;
  padding: 4px;
  margin: 12px 0 6px;
}
#rank .tab, #rushTabs .tab {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 8px;
  font: 700 15px 'Fredoka', system-ui, sans-serif;
  color: rgba(58, 46, 92, 0.6);
  background: transparent;
  cursor: pointer;
}
#rank .tab.on, #rushTabs .tab.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(90, 70, 150, 0.12); }
#rank .info { font-size: 13px; opacity: .6; margin-bottom: 6px; }
#rankList { list-style: none; overflow-y: auto; flex: 1; text-align: left; margin: 0 -4px; }
#rankList li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
}
#rankList li:nth-child(odd) { background: rgba(255, 255, 255, 0.5); }
#rankList li.me { background: rgba(255, 94, 138, 0.18); }
#rankList li.empty { justify-content: center; opacity: .6; background: none; padding: 24px 0; }
#rankList .pos { width: 28px; text-align: center; font-weight: 700; }
#rankList .h {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
#rankList .s { font-weight: 700; color: var(--pink); }
#rank .me-line { font-size: 14px; font-weight: 600; padding-top: 8px; }
#rank .me-line:empty { display: none; }

/* ---- Efeitos ativos ---- */
.fx { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.fx .chip { font-size: 13px; padding: 3px 10px; background: rgba(255, 244, 200, 0.85); }

/* ---- Deixar caixinha ---- */
.boxform { display: none; margin: 0 0 12px; }
.boxform.show { display: block; }
.boxform .q { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.boxform .choices { display: flex; gap: 8px; }
.boxform button {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 12px 8px;
  font: 700 17px 'Fredoka', system-ui, sans-serif;
  color: #fff;
  cursor: pointer;
}
.boxform button[data-kind="good"] { background: linear-gradient(180deg, #5fd3a0, #2fb07c); box-shadow: 0 4px 0 #23875f; }
.boxform button[data-kind="bad"] { background: linear-gradient(180deg, #ff7a7a, #e0384f); box-shadow: 0 4px 0 #b3263a; }
.boxform button:active { transform: translateY(2px); box-shadow: none; }
.boxform button:disabled { opacity: .5; }

.btn.share {
  background: linear-gradient(90deg, #f9a03f, #e1306c 55%, #8a3ab9);
  box-shadow: 0 5px 0 #a1245a;
}
.btn.share:active { box-shadow: 0 2px 0 #a1245a; }

/* ---- Conta ---- */
#menu .menu-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.acc-hint { font-size: 13px; opacity: .7; margin: -2px 4px 8px; }
.acc-hint:empty { display: none; }
#account { background: rgba(60, 40, 110, 0.35); z-index: 6; }
#account .card {
  position: relative;
  width: min(380px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 22px 18px 16px;
  box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3);
}
#account .title { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
#account .close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer;
}
#account .view { display: none; }
#account .view.on { display: block; }
#account .lead { font-size: 15px; line-height: 1.35; margin: 0 4px 12px; }
#account .small { font-size: 13px; opacity: .65; margin: 6px 4px; }
.inp {
  display: block; width: 100%;
  border: none; outline: none;
  border-radius: 16px;
  padding: 13px 14px;
  margin-bottom: 10px;
  font: 500 17px 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(122, 104, 176, 0.25);
  user-select: text; -webkit-user-select: text;
}
.inp:focus { box-shadow: inset 0 0 0 2px var(--pink); }
.inp.code { text-align: center; font-size: 30px; letter-spacing: 8px; font-weight: 700; }
#account .who { font-size: 26px; font-weight: 700; margin: 4px 0 10px; }
#account .who .ver, #rankList .ver { color: #1f9e6e; }
#account .claim { text-align: left; margin-bottom: 12px; }
#account .claim label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 6px 4px; }
.field.tomb-like {
  display: flex; align-items: center; background: #fff; border-radius: 16px;
  padding: 4px 4px 4px 12px; box-shadow: inset 0 0 0 2px rgba(122, 104, 176, 0.25);
}
.field.tomb-like span { font-weight: 700; color: rgba(58, 46, 92, 0.5); }
.field.tomb-like input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: 500 17px 'Fredoka', system-ui, sans-serif; color: var(--ink); padding: 8px 4px;
  user-select: text; -webkit-user-select: text;
}
.field.tomb-like button {
  border: none; border-radius: 12px; padding: 9px 14px;
  font: 700 15px 'Fredoka', system-ui, sans-serif; color: #fff; background: #7a68b0; cursor: pointer;
}
#account .stats { display: flex; gap: 8px; margin: 6px 0 10px; }
#account .stats div { flex: 1; background: rgba(255, 255, 255, 0.7); border-radius: 16px; padding: 10px 4px; }
#account .stats b { display: block; font-size: 22px; }
#account .stats span { font-size: 12px; opacity: .7; }
.link-danger {
  border: none; background: none; color: #e0384f; font: 500 13px 'Fredoka', system-ui, sans-serif;
  text-decoration: underline; cursor: pointer; margin-top: 4px;
}
.tomb input:disabled { opacity: .8; }

/* ---- Configurações ---- */
#menu .rank-btn.icon { padding: 8px 12px; }
#settings { background: rgba(60, 40, 110, 0.35); z-index: 7; }
#settings .card {
  position: relative; width: min(360px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 28px; padding: 22px 18px 14px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3); text-align: left;
}
#settings .title { font-size: 24px; font-weight: 700; margin-bottom: 12px; text-align: center; }
#settings .close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer;
}
.toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.7); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px;
  font-weight: 600; font-size: 17px; cursor: pointer;
}
.toggle input { display: none; }
.toggle i {
  width: 48px; height: 28px; border-radius: 999px; background: rgba(58, 46, 92, 0.2); position: relative; transition: background .2s;
}
.toggle i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.toggle input:checked + i { background: #2fb07c; }
.toggle input:checked + i::after { transform: translateX(20px); }
.set-section { margin-top: 14px; }
.set-section .set-title { font-weight: 700; margin: 0 4px 8px; opacity: .7; }
#settings .small { font-size: 12px; opacity: .6; margin: 4px; }
#settings .ver-line { text-align: center; margin-top: 10px; }
.btn.danger { background: rgba(224, 56, 79, 0.1); color: #e0384f; box-shadow: none; font-size: 16px; padding: 11px; }

/* ---- Skins e conquistas ---- */
#skins { background: rgba(60, 40, 110, 0.35); z-index: 6; }
#skins .card {
  position: relative; width: min(440px, 100%); height: min(720px, calc(100dvh - 32px));
  display: flex; flex-direction: column;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 28px; padding: 20px 14px 12px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3);
}
#skins .title { font-size: 24px; font-weight: 700; }
#skins .close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer;
}
#skins .tabs { display: flex; gap: 6px; background: rgba(58, 46, 92, 0.08); border-radius: 14px; padding: 4px; margin: 12px 0 6px; }
#skins .tab {
  flex: 1; border: none; border-radius: 10px; padding: 8px; font: 700 15px 'Fredoka', system-ui, sans-serif;
  color: rgba(58, 46, 92, 0.6); background: transparent; cursor: pointer;
}
#skins .tab.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(90, 70, 150, 0.12); }
#skins .info { font-size: 13px; opacity: .7; margin: 0 4px 8px; }
.skins-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.skins-top .info { flex: 1; min-width: 0; }
.redeem-open { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; margin: 0 0 8px; font: inherit; font-size: 13px; font-weight: 700;
  color: #6b3fd6; background: rgba(122, 92, 255, .12); cursor: pointer; }
.redeem-box { display: flex; gap: 8px; margin: 0 0 10px; }
.redeem-box[hidden] { display: none; }
.redeem-box input { flex: 1; min-width: 0; border: 2px solid rgba(122, 92, 255, .35); border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 17px;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #3a2e5c; background: #fff; }
.redeem-box .btn, .redeem-box .btn.play { flex: 0 0 auto; width: auto; min-width: 0; margin: 0; padding: 10px 16px; font-size: 16px; }
.skin-grid, .ach-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; align-content: start; padding: 2px; }
.skin-grid .sk {
  position: relative; border: none; background: rgba(255, 255, 255, 0.7); border-radius: 16px; padding: 6px 4px 8px;
  font: 600 11.5px 'Fredoka', system-ui, sans-serif; color: var(--ink); cursor: pointer; line-height: 1.15;
}
.skin-grid .sk canvas { display: block; margin: 0 auto 2px; width: 64px; height: 64px; }
.skin-grid .sk.on { box-shadow: inset 0 0 0 3px var(--pink); background: #fff; }
.skin-grid .sk.locked canvas { filter: grayscale(1) brightness(0.55) contrast(0.8); opacity: .55; }
.skin-grid .sk .lock { position: absolute; top: 6px; right: 8px; font-size: 13px; }
.skin-grid .sk .tag { display: block; font-size: 10px; opacity: .6; margin-top: 2px; }
.ach-list { display: none; }
.ach-list .ach { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.7); border-radius: 14px; padding: 8px 10px; margin-bottom: 6px; text-align: left; }
.ach-list .ach canvas { width: 44px; height: 44px; flex: none; }
.ach-list .ach.locked canvas { filter: grayscale(1) brightness(0.6); opacity: .6; }
.ach-list .ach .tx { flex: 1; min-width: 0; }
.ach-list .ach b { display: block; font-size: 15px; }
.ach-list .ach span { display: block; font-size: 12px; opacity: .7; }
.ach-list .bar { height: 6px; border-radius: 3px; background: rgba(58, 46, 92, 0.12); margin-top: 5px; overflow: hidden; }
.ach-list .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb21f, #ff5e8a); border-radius: 3px; }
.ach-list .ach .ok { font-size: 18px; }
#skins .msg { margin: 8px 4px 0; }
.skins-link { margin-top: 4px; }

/* ---- Aviso de conquista ---- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); transform: translate(-50%, -150%);
  display: flex; align-items: center; gap: 10px; z-index: 20;
  background: #fff; border-radius: 18px; padding: 8px 16px 8px 8px; box-shadow: 0 10px 30px rgba(60, 40, 110, 0.3);
  transition: transform .4s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.toast canvas { width: 48px; height: 48px; flex: none; }
.toast b { display: block; font-size: 15px; }
.toast span { display: block; font-size: 13px; opacity: .75; }

/* ---- Abertura ---- */
#splash { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; transition: opacity .5s; background: #cfe4ff; }
#splash.hide { opacity: 0; pointer-events: none; }

/* ---- Personalizar ---- */
#lookPreview { display: block; width: 100%; height: 130px; border-radius: 18px; margin-top: 10px; flex: none; }
#skins .tabs.four .tab { font-size: 13px; padding: 8px 2px; }
.skin-grid .sk.priced .tag { color: #b36b00; opacity: 1; font-weight: 700; }
.look-actions { display: flex; gap: 8px; margin-top: 8px; flex: none; }
.look-actions .btn { margin: 0; font-size: 16px; padding: 12px 8px; }
.look-actions .btn:disabled { opacity: .55; }
.btn.play { background: linear-gradient(180deg, #5fd3a0, #2fb07c); box-shadow: 0 5px 0 #23875f; }
.btn.set-custom { font-size: 16px; margin-bottom: 12px; }
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { font-size: 15px; }

/* ---- Instalar ---- */
.install-fab {
  position: fixed; left: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 4;
  border: none; border-radius: 999px; padding: 10px 16px;
  font: 700 15px 'Fredoka', system-ui, sans-serif; color: #fff;
  background: linear-gradient(90deg, #7a5cff, #ff5e8a); box-shadow: 0 6px 18px rgba(90, 60, 180, 0.35);
  cursor: pointer; animation: fabIn .5s ease-out;
}
@keyframes fabIn { from { transform: translateY(40px); opacity: 0; } }
body:not([data-mode="menu"]) .install-fab, .install-fab[hidden] { display: none; }
#install { background: rgba(60, 40, 110, 0.35); z-index: 8; }
#install .card {
  position: relative; width: min(380px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 28px; padding: 22px 18px 14px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3); text-align: left;
}
#install .title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 6px; }
#install .close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer;
}
#install .lead { font-size: 15px; margin: 0 4px 12px; text-align: center; }
#install .how { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
#install .os { background: rgba(255, 255, 255, 0.75); border-radius: 16px; padding: 12px 14px; }
#install .os.mine { box-shadow: inset 0 0 0 2px var(--pink); }
#install .os b { font-size: 16px; }
#install ol { margin: 8px 0 0 20px; font-size: 14.5px; line-height: 1.5; }
#install .k { font-weight: 700; color: #7a5cff; }
#install .ico { display: inline-block; background: #fff; border-radius: 6px; padding: 0 4px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* Esconde o botão de instalar quando há janela aberta */
body:has(.overlay.show:not(#menu)) .install-fab { display: none; }

/* ---- Desafio x1 ---- */
#x1bar {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 76px); transform: translateX(-50%);
  font-weight: 700; font-size: 14px; color: #fff; background: rgba(122, 92, 255, 0.75);
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
#x1bar:empty { display: none; }
#menu .x1-btn { background: linear-gradient(90deg, #7a5cff, #ff5e8a); color: #fff; }
#x1 { background: rgba(60, 40, 110, 0.35); z-index: 8; }
#x1 .card {
  position: relative; width: min(380px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 28px; padding: 22px 18px 16px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3);
}
#x1 .title { font-size: 22px; font-weight: 700; margin: 0 28px 8px; }
#x1 .close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer;
}
#x1 .lead { font-size: 15px; line-height: 1.35; margin: 0 4px 12px; }
#x1 .field { margin-bottom: 10px; }
.x1-list { list-style: none; text-align: left; margin: 0 0 10px; max-height: 40vh; overflow-y: auto; }
.x1-list:empty { display: none; }
.x1-list li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 12px; }
.x1-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.55); }
.x1-list li.me { background: rgba(255, 94, 138, 0.18); }
.x1-list li.empty { justify-content: center; opacity: .6; background: none; }
.x1-list .pos { width: 26px; text-align: center; font-weight: 700; }
.x1-list .h { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.x1-list .s { font-weight: 700; color: var(--pink); }
.x1-list .ver { color: #1f9e6e; }
.x1-result { display: none; }
body.x1 .x1-result { display: block; }
.x1-res-title { font-weight: 700; margin: 4px 0 8px; }
body.x1 #rankForm, body.x1 #rankMsg, body.x1 #shareBtn, body.x1 #menuBtn, body.x1 #boxForm, body.x1 #tombMsg, body.x1 #accHint,
body.x1 #over .stats, body.x1 #over .newrec, body.x1 #again { display: none !important; }

/* ---- Tela de encerramento ---- */
#over .stats { display: flex; gap: 8px; margin: 10px 0 12px; }
#over .stat {
  flex: 1; border: none; border-radius: 16px; padding: 8px 6px; background: rgba(255, 255, 255, 0.7);
  font: inherit; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 1px;
}
#over button.stat { cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 159, 28, 0.35); }
#over button.stat:active { transform: scale(0.97); }
#over .stat span { font-size: 12px; opacity: .7; }
#over .stat b { font-size: 24px; }
#over .stat i { font-style: normal; font-size: 11.5px; font-weight: 700; color: #b36b00; }
#over .stat i:empty { display: none; }
.rank-form { text-align: left; margin-bottom: 6px; }
.rank-form label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 6px 4px; }
.rank-form .field {
  display: flex; align-items: center; background: #fff; border-radius: 16px;
  padding: 4px 4px 4px 12px; box-shadow: inset 0 0 0 2px rgba(122, 104, 176, 0.25);
}
.rank-form .field:focus-within { box-shadow: inset 0 0 0 2px var(--pink); }
.rank-form .field span { font-weight: 700; color: rgba(58, 46, 92, 0.5); }
.rank-form input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: 500 17px 'Fredoka', system-ui, sans-serif; color: var(--ink); padding: 8px 4px;
  user-select: text; -webkit-user-select: text;
}
.rank-form button {
  border: none; border-radius: 12px; padding: 9px 14px;
  font: 700 15px 'Fredoka', system-ui, sans-serif; color: #fff; background: #7a68b0; cursor: pointer;
}
.rank-form button:disabled { opacity: .5; }
.btn.big-play {
  font-size: 22px; padding: 16px; margin: 4px 0 10px;
  background: linear-gradient(180deg, #5fd3a0, #2fb07c); box-shadow: 0 5px 0 #23875f;
}
.btn.big-play:active { box-shadow: 0 2px 0 #23875f; }
.end-actions { display: flex; gap: 8px; }
.end-actions .btn { font-size: 15px; padding: 11px 6px; margin-bottom: 6px; color: var(--ink); cursor: pointer; }
.end-actions .btn small { font-size: 12px; color: #b36b00; font-weight: 700; }
.end-actions .btn:disabled { opacity: .6; }
#over .msg { margin: 4px 4px 8px; }
#best { cursor: pointer; }

/* ---- Menu inicial (estilo jogo mobile): só o botão JOGAR começa a partida ---- */
#menu {
  pointer-events: auto;
  justify-content: flex-start;
  padding: calc(env(safe-area-inset-top) + 7vh) 16px calc(env(safe-area-inset-bottom) + 14px);
}
#menu .menu-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 14px 14px 10px;
  box-shadow: 0 12px 40px rgba(60, 40, 110, 0.18);
}
.menu-best { font-weight: 700; font-size: 15px; color: #6b5a9c; margin-bottom: 8px; }
.menu-best:empty { display: none; }
.play-btn {
  display: block; width: 100%;
  border: none; border-radius: 22px;
  padding: 18px 12px;
  font: 700 28px 'Fredoka', system-ui, sans-serif; letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(180deg, #ff7a9c, #ff5e8a);
  box-shadow: 0 6px 0 #d9406d, 0 12px 24px rgba(255, 94, 138, 0.35);
  cursor: pointer;
  animation: playPulse 1.6s ease-in-out infinite;
  touch-action: manipulation;
}
.play-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d9406d; animation: none; }
@keyframes playPulse { 50% { transform: scale(1.035); } }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 84px; border: none; border-radius: 20px; padding: 10px 6px;
  background: #fff; color: var(--ink);
  box-shadow: 0 4px 0 rgba(90, 70, 150, 0.14);
  font: 700 16px 'Fredoka', system-ui, sans-serif; cursor: pointer;
  touch-action: manipulation;
}
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(90, 70, 150, 0.14); }
.tile .ic { font-size: 26px; line-height: 1.1; }
.tile b { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile small { font-size: 11.5px; font-weight: 500; opacity: .6; }
.tile-x1 { background: linear-gradient(135deg, #7a5cff, #ff5e8a); color: #fff; box-shadow: 0 4px 0 #5a3fd0; }
.tile-x1 small { opacity: .85; }
.menu-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 0 4px; }
.menu-foot .world { font-size: 13px; font-weight: 500; color: rgba(58, 46, 92, 0.6); }
.icon-btn {
  width: 48px; height: 48px; border: none; border-radius: 50%;
  background: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 3px 0 rgba(90, 70, 150, 0.14);
}
@media (max-height: 640px) {
  #menu { padding-top: calc(env(safe-area-inset-top) + 3vh); }
  .tile { min-height: 68px; }
  .tile small { display: none; }
  .play-btn { padding: 14px; font-size: 24px; }
}
/* Botão de instalar no canto de cima no menu */
.install-fab { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; left: 12px; padding: 8px 14px; font-size: 14px; }

/* ---- Dica de como jogar (aparece depois de apertar JOGAR) ---- */
.tuto {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18vh); transform: translateX(-50%);
  display: none; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(60, 40, 110, 0.2);
  font-size: 17px; line-height: 1.3; color: var(--ink); pointer-events: none; z-index: 3;
}
.tuto b { color: var(--pink); }
.tuto.show { display: flex; animation: fabIn .4s ease-out; }
.tuto .finger { font-size: 32px; animation: press 1.4s ease-in-out infinite; }
@keyframes press { 0%, 100% { transform: translateY(0) scale(1); } 40%, 60% { transform: translateY(6px) scale(0.9); } }

/* ---- Compartilhar (alternativa para navegadores de dentro de apps) ---- */
#shareSheet { background: rgba(60, 40, 110, 0.4); z-index: 9; }
#shareSheet .card {
  position: relative; width: min(360px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 28px; padding: 20px 16px 12px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3);
}
#shareSheet .title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
#shareSheet .close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer;
}
#shareImg {
  display: block; width: 62%; margin: 0 auto 8px; border-radius: 16px; box-shadow: 0 6px 20px rgba(60, 40, 110, 0.25);
  -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; pointer-events: auto;
}
#shareImg[hidden] { display: none; }
#shareSheet .small { font-size: 13px; line-height: 1.35; margin: 6px 4px; opacity: .8; }
#shareSheet .tip { opacity: .65; }
.share-text {
  background: #fff; border-radius: 14px; padding: 10px 12px; margin: 8px 0; font-size: 14px; text-align: left;
  user-select: all; -webkit-user-select: all; word-break: break-word;
}

/* ---- Voltar ao menu ---- */
.btn.set-menu { font-size: 16px; margin-bottom: 8px; background: linear-gradient(180deg, #8f7aff, #7a5cff); box-shadow: 0 5px 0 #5a3fd0; }
body[data-mode="menu"] #setMenu { display: none; }
.end-actions .menu-sm { flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }

/* Encerramento: Jogar e Compartilhar com o mesmo destaque; Menu por último, discreto */
.btn.big-share {
  font-size: 22px; padding: 16px; margin: 0 0 10px;
  background: linear-gradient(90deg, #f9a03f, #e1306c 55%, #8a3ab9); box-shadow: 0 5px 0 #a1245a;
}
.btn.big-share:active { box-shadow: 0 2px 0 #a1245a; }
.btn.big-share small { font-size: 14px; opacity: .95; }
.btn.big-share:disabled { opacity: .7; }
.btn.menu-line { font-size: 15px; padding: 10px; margin: 6px 0 0; color: var(--ink); cursor: pointer; }

.btn.look-buy { margin: 8px 0 0; font-size: 17px; flex: none; background: linear-gradient(180deg, #ffb21f, #ff8a1f); box-shadow: 0 5px 0 #cc6a10; }
.btn.look-buy[hidden] { display: none; }
.btn.set-admin { display: block; text-align: center; text-decoration: none; font-size: 16px; margin-bottom: 8px; background: linear-gradient(180deg, #4a4560, #2f2a45); box-shadow: 0 5px 0 #1b1830; }
.btn.set-admin[hidden] { display: none; }

.ach-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8d6, #ffd23f 75%); }
/* ---- Reinos ---- */
.crest { display: block; flex: none; filter: drop-shadow(0 3px 4px rgba(30, 20, 60, 0.25)); }
.realm-card { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 8px 12px; margin-bottom: 8px; cursor: pointer; text-align: left;
  background: linear-gradient(100deg, color-mix(in srgb, var(--c1) 22%, #fff), #fff 70%); box-shadow: 0 3px 0 color-mix(in srgb, var(--c1) 45%, #fff); font-family: inherit; color: var(--ink); }
.realm-card .tx { display: flex; flex-direction: column; gap: 2px; }
.realm-card .tx b { font-size: 18px; }
.realm-card .tx span { font-size: 12px; opacity: .75; }
.realm-grid { display: grid; gap: 6px; margin: 8px 0; }
.realm-cta { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; border: 0; border-radius: 18px; padding: 12px; margin-bottom: 10px; cursor: pointer;
  font-family: inherit; color: #fff; background: linear-gradient(90deg, #b3122a, #1f6b3a, #1d3f8f, #e8a90f); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.realm-cta b { font-size: 18px; }
.realm-cta span { font-size: 12px; opacity: .9; }
.realm-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; text-align: left; }
.realm-head.center { flex-direction: column; text-align: center; }
.realm-head.glow .crest { animation: crestGlow 1.8s ease-in-out infinite; }
@keyframes crestGlow { 50% { transform: scale(1.05); filter: drop-shadow(0 0 14px var(--c1)); } }
.realm-head .tx { display: flex; flex-direction: column; gap: 4px; }
.realm-head .tx b { font-size: 17px; }
.realm-head .tx i { font-weight: 700; color: #6b5a9c; }
.realm-head .tx span { font-size: 13px; opacity: .8; }
.realm-rules { text-align: left; padding-left: 20px; margin: 8px 0 14px; font-size: 14px; line-height: 1.4; }
.realm-rules li { margin-bottom: 6px; }
.arsenal { display: grid; gap: 6px; margin: 6px 0; }
.arsenal .pw { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: rgba(255,255,255,.6); text-align: left; }
.arsenal .pw.strong { background: rgba(255, 216, 77, 0.35); }
.arsenal .pw .ic { font-size: 22px; }
.arsenal .pw .t { flex: 1; display: flex; flex-direction: column; }
.arsenal .pw .t b { font-size: 14px; }
.arsenal .pw .t small { font-size: 11.5px; opacity: .7; }
.arsenal .pw .n { font-size: 16px; letter-spacing: 2px; color: #7a5cff; white-space: nowrap; }
.arsenal .pw .n em { font-style: normal; opacity: .2; }
.team-game { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 18px; text-decoration: none; color: #fff;
  background: linear-gradient(90deg, #ff8a5c, #ff5e3a); box-shadow: 0 4px 0 #c9401f; text-align: left; }
.team-game .ic { font-size: 28px; }
.team-game .tx { flex: 1; display: flex; flex-direction: column; }
.team-game .tx b { font-size: 18px; }
.team-game .tx small { font-size: 12px; opacity: .9; }
.team-game .go { font-size: 26px; font-weight: 700; }
.realm-cup { margin-top: 14px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.55); }
.cup-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.cup-bar i { display: block; }
.cup-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: 12px; font-weight: 600; }
.cup-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.btn.quiz-opt { width: 100%; margin-bottom: 8px; text-align: left; }
.realm-mini { display: inline-flex; vertical-align: -3px; margin-right: 3px; }
.realm-mini .crest { filter: none; }

/* ---- x1 em duelos ---- */
.x1-create { display: none; }
#x1[data-mode="create"] .x1-create { display: block; }
.x1-formats { display: flex; gap: 6px; background: rgba(58, 46, 92, 0.08); border-radius: 14px; padding: 4px; margin: 10px 0; }
.x1-formats button { flex: 1; border: 0; border-radius: 10px; padding: 9px 4px; font: 700 14px 'Fredoka', system-ui, sans-serif; color: rgba(58, 46, 92, 0.6); background: transparent; cursor: pointer; }
.x1-formats button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(90, 70, 150, 0.12); }
.x1-invited { font-weight: 700; margin: 6px 0; }
.x1-board { margin: 6px 0; }
.x1-board:empty { display: none; }
.x1-score { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.x1-score b { font-size: 26px; color: #7a5cff; }
.x1-score .vs { opacity: .5; }
.x1-rounds { list-style: none; margin: 0; padding: 0; }
.x1-rounds li { display: grid; grid-template-columns: 48px 1fr 24px 1fr; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; font-weight: 600; }
.x1-rounds li:nth-child(odd) { background: rgba(255, 255, 255, 0.55); }
.x1-rounds .r { opacity: .55; font-size: 13px; }
.x1-rounds .s { text-align: center; }
.x1-rounds .s.win { color: #1f9e6e; font-weight: 800; }
.x1-rounds .s.lose { opacity: .55; }
.x1-rounds .x { text-align: center; opacity: .4; }
.x1-status { font-size: 13px; opacity: .75; margin-top: 6px; }
.x1-mine { margin-top: 10px; }
.x1-mine:empty { display: none; }
.x1-mine .sec { font-size: 13px; font-weight: 700; opacity: .6; margin: 6px 2px; text-align: left; }
.x1-mine button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 12px; padding: 9px 10px; margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.7); font: 600 14px 'Fredoka', system-ui, sans-serif; color: var(--ink); cursor: pointer; text-align: left; }
.x1-mine button span { font-size: 12px; opacity: .7; white-space: nowrap; }
.x1-mine button.turn { background: rgba(255, 216, 77, 0.45); }
#x1Again[hidden], #x1Link[hidden] { display: none; }

/* ---- Mapa do Dia (2º botão do menu) e botões menores de Corrida e x1 ---- */
.daily-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 12px;
  border: none; border-radius: 20px; padding: 10px 12px; cursor: pointer; touch-action: manipulation; color: #fff;
  background: linear-gradient(90deg, #2fb07c, #1fb5c9); box-shadow: 0 5px 0 #17806a, 0 10px 20px rgba(31, 181, 201, 0.25);
  font-family: 'Fredoka', system-ui, sans-serif;
}
.daily-btn .ic { font-size: 28px; }
.daily-btn .tx { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.daily-btn b { font-size: 21px; }
.daily-btn small { font-size: 12px; font-weight: 600; opacity: .92; }
.daily-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #17806a; }
.daily-btn:disabled { opacity: .7; }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 16px; padding: 9px 8px;
  font: 700 16px 'Fredoka', system-ui, sans-serif; color: #fff; cursor: pointer; touch-action: manipulation;
}
.mode-btn .ic { font-size: 19px; }
.mode-rush { background: linear-gradient(90deg, #ffb21f, #ff7a1f); box-shadow: 0 4px 0 #cc5a10; }
.mode-x1 { background: linear-gradient(90deg, #7a5cff, #ff5e8a); box-shadow: 0 4px 0 #5a3fd0; }
.mode-btn:active { transform: translateY(3px); box-shadow: none; }
.mode-btn:disabled { opacity: .7; }
.daily-result { display: none; }
body.daily .daily-result { display: block; }
body.daily #rankForm, body.daily #rankMsg, body.daily #shareBtn, body.daily #shareChoice, body.daily #boxForm, body.daily #tombMsg,
body.daily #accHint, body.daily #pushAsk, body.daily #over .stats, body.daily #over .newrec, body.daily #again, body.daily #x1Result, body.daily #rushResult { display: none !important; }
.daily-tries { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.daily-tries span { min-width: 54px; padding: 6px 8px; border-radius: 12px; font-weight: 700; background: rgba(58, 46, 92, 0.08); }
.daily-tries span.best { background: #2fb07c; color: #fff; }
.daily-tries span.done { background: #ffd84d; }
.daily-me { font-weight: 700; color: #17806a; margin-bottom: 6px; }
#dailyList { max-height: 170px; overflow-y: auto; }
#dailyAgain { margin-top: 10px; background: linear-gradient(180deg, #2fb07c, #1fa86a); box-shadow: 0 6px 0 #17806a; }
.daily-come { margin: 10px 0; padding: 10px; border-radius: 16px; background: rgba(31, 181, 201, 0.12); font-weight: 700; }
.daily-come b { display: block; font-size: 22px; color: #17806a; font-variant-numeric: tabular-nums; }

/* ---- Corrida contra o tempo ---- */
.rush-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px;
  border: none; border-radius: 20px; padding: 12px 12px; cursor: pointer; touch-action: manipulation;
  font: 700 20px 'Fredoka', system-ui, sans-serif; color: #fff;
  background: linear-gradient(90deg, #ffb21f, #ff7a1f); box-shadow: 0 5px 0 #cc5a10, 0 10px 20px rgba(255, 122, 31, 0.3);
}
.rush-btn .ic { font-size: 24px; }
.rush-btn small { font-size: 12px; font-weight: 600; opacity: .9; }
.rush-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #cc5a10; }
.rush-btn:disabled { opacity: .7; }
#menu .menu-grid { margin-top: 12px; }
#rushTimer {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 88px); transform: translateX(-50%);
  font: 700 22px 'Fredoka', system-ui, sans-serif; color: #fff; background: rgba(255, 122, 31, 0.92);
  padding: 4px 14px; border-radius: 999px; box-shadow: 0 3px 0 #cc5a10; pointer-events: none; font-variant-numeric: tabular-nums;
}
#rushTimer:empty { display: none; }
#rushTimer.hurry { background: rgba(229, 57, 53, 0.95); box-shadow: 0 3px 0 #a31c1a; animation: pulse .5s ease-in-out infinite; }
.rush-result { display: none; }
body.rush .rush-result { display: block; }
body.rush #rankForm, body.rush #rankMsg, body.rush #shareBtn, body.rush #shareChoice, body.rush #boxForm, body.rush #tombMsg,
body.rush #accHint, body.rush #pushAsk, body.rush #over .stats, body.rush #over .newrec, body.rush #again, body.rush #x1Result { display: none !important; }
.rush-pos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 10px; }
.rush-pos div { background: rgba(255, 178, 31, 0.18); border-radius: 14px; padding: 6px 4px; }
.rush-pos b { display: block; font-size: 20px; color: #e0661a; }
.rush-pos span { font-size: 12px; opacity: .75; }
.rush-tabs, .rush-sub { margin-bottom: 6px !important; }
#rank .rush-sub { margin-top: 0; }
#rank .rush-sub .tab { font-size: 13px; padding: 6px; }
#rushList { max-height: 190px; overflow-y: auto; }
#rushAgain { margin-top: 10px; background: linear-gradient(180deg, #ffb21f, #ff7a1f); box-shadow: 0 6px 0 #cc5a10; }
.claim-hist { background: rgba(255, 210, 63, 0.25); border-radius: 16px; padding: 10px 12px; margin: 8px 0; }
.claim-hist[hidden] { display: none; }
.claim-hist .q { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.btn.set-profile { display: block; text-align: center; text-decoration: none; font-size: 16px; margin-bottom: 8px; background: linear-gradient(180deg, #3f8cff, #2a64ff); box-shadow: 0 5px 0 #1c3fa8; }
#rankList li[data-hid], .member[data-u], #x1ResList li[data-u] { cursor: pointer; }
#rankList li[data-hid]:active, .member[data-u]:active { transform: scale(0.98); }

/* ---- Equipes ---- */
.tile.wide { grid-column: span 2; min-height: 64px; flex-direction: row; gap: 10px; }
.tile.wide small { display: none; }
#teams { background: rgba(60, 40, 110, 0.35); z-index: 8; }
#teams .card {
  position: relative; width: min(420px, 100%); height: min(760px, calc(100dvh - 24px));
  display: flex; flex-direction: column;
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 28px; padding: 14px 14px 12px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.3); text-align: left;
}
.teams-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.teams-top .title { flex: 1; font-size: 21px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teams-top .close { position: static; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer; flex: none; }
.teams-top .back { font-size: 24px; line-height: 1; }
.teams-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px; }
.teams-body .lead { font-size: 15px; margin: 4px 4px 12px; }
.teams-body .small { font-size: 12.5px; opacity: .65; margin: 6px 4px; }
.teams-body .btn { margin-bottom: 8px; font-size: 16px; padding: 12px; }
.teams-body .btn.sm { font-size: 14px; padding: 7px 10px; margin: 0; width: auto; flex: none; }
.team-actions { margin: 6px 0 10px; }
.team-actions .row-btns .btn { margin-bottom: 0; }
.sec { font-weight: 700; margin: 14px 4px 6px; opacity: .75; }
.team-row {
  display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: rgba(255, 255, 255, 0.75);
  border-radius: 16px; padding: 8px 10px; margin-bottom: 6px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
}
.team-row .tx { flex: 1; min-width: 0; }
.team-row b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row span:not(.tag-badge) { display: block; font-size: 12px; opacity: .7; }
.tag-badge {
  display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: #7a5cff;
  border-radius: 6px; padding: 1px 5px; vertical-align: middle; letter-spacing: .5px; margin-right: 3px;
}
.tag-badge.big { font-size: 16px; padding: 3px 10px; border-radius: 8px; }
.team-head { display: flex; align-items: center; gap: 14px; margin: 4px 4px 8px; }
.team-head .pts { font-weight: 700; margin-top: 6px; }
.primary-note { background: rgba(255, 216, 77, 0.35); border-radius: 12px; padding: 10px; font-weight: 600; font-size: 14px; }
.team-admin { background: rgba(122, 92, 255, 0.08); border-radius: 16px; padding: 4px 10px 10px; margin: 8px 0; }
.team-admin .field { margin-bottom: 8px; }
.member { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; }
.member:nth-child(odd) { background: rgba(255, 255, 255, 0.55); }
.member .pos { width: 20px; text-align: center; font-weight: 700; opacity: .6; }
.member .h { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.member .s { font-weight: 700; color: var(--pink); }
.emblem-preview { display: block; width: 110px; height: 110px; margin: 0 auto 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-opt {
  min-width: 40px; height: 40px; border: none; border-radius: 12px; background: #fff; font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 rgba(90, 70, 150, 0.12);
}
.chip-opt.swatch { width: 40px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.1); }
.chip-opt.on { box-shadow: 0 0 0 3px var(--pink); }
.acc-team { margin: -4px 0 10px; font-weight: 600; }
.acc-team:empty { display: none; }

/* ---- Offline ---- */
.offline-note { display: none; font-size: 13px; font-weight: 600; background: rgba(255, 216, 77, 0.45); border-radius: 12px; padding: 6px 10px; margin-bottom: 8px; }
body.is-offline .offline-note { display: block; }

/* Menu em telas baixas: painel compacto para sobrar espaço para o cenário */
@media (max-height: 780px) {
  #menu { padding-top: calc(env(safe-area-inset-top) + 3vh); }
  #menu h1 { font-size: clamp(34px, 10vw, 56px); }
  .play-btn { padding: 12px; font-size: 24px; }
  .menu-grid { gap: 8px; margin-top: 10px; }
  .tile { min-height: 58px; padding: 6px; }
  .tile .ic { font-size: 22px; }
  .tile small { display: none; }
  .tile.wide { min-height: 50px; }
  .menu-best { margin-bottom: 6px; font-size: 14px; }
  .menu-foot { margin-top: 6px; }
  .icon-btn { width: 42px; height: 42px; font-size: 19px; }
}

/* Espaço no topo para o botão Instalar não encostar no logo */
#menu h1 { margin-top: 36px; }

/* ---- Cafezinho pro criador (menu, fim de partida e ranking; nunca durante o jogo) ---- */
.coffee {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-weight: 700; font-size: 14px; color: #8a5a2b; text-decoration: none;
  background: rgba(255, 216, 150, 0.55); border-radius: 999px; padding: 7px 12px;
  touch-action: manipulation;
}
.coffee:active { transform: scale(0.97); }
.menu-foot .coffee { font-size: 13px; padding: 7px 10px; }
.menu-foot { gap: 8px; }
.menu-foot .world { flex: 1; text-align: center; }
#over .coffee { display: flex; margin: 8px 0 0; }
#rank .coffee { display: flex; margin-top: 10px; }
body.x1 #over .coffee { display: flex; }

/* Compartilhar: escolhe entre imagem (card) e vídeo (clipe) */
.share-choice { display: flex; gap: 10px; margin: 0 0 10px; }
.share-choice[hidden] { display: none; }
.share-choice .btn { flex: 1; min-width: 0; margin: 0; font-size: 18px; padding: 14px 8px; }
.share-choice .btn small { font-size: 12px; opacity: .8; margin-left: 2px; }
#shareImgBtn { background: linear-gradient(90deg, #f9a03f, #e1306c); box-shadow: 0 4px 0 #a1245a; }
#clipBtn { background: linear-gradient(90deg, #1b1b24, #3a2e5c); box-shadow: 0 4px 0 #0d0d12; }

/* Bounce leve no Compartilhar e no Cafezinho do fim de partida */
@keyframes softBounce { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-4px); } 90% { transform: translateY(1px); } }
#over .btn.big-share, #over .coffee { animation: softBounce 2.4s ease-in-out infinite; }
#over .coffee { animation-delay: 1.2s; }
#over .btn.big-share:active, #over .coffee:active { animation: none; }
body.x1 #shareImgBtn { display: none; }

.btn.push-ask { font-size: 15px; padding: 10px; margin: 0 0 8px; background: rgba(122, 92, 255, 0.12); color: #5a3fd0; box-shadow: none; }
.btn.push-ask[hidden] { display: none; }
body.x1 #pushAsk { display: none !important; }
#setPushHint:empty { display: none; }

/* ---- Nome no jogo ---- */
.set-name { margin-bottom: 10px; }
.set-name label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 6px 4px; }
.set-name .field button { margin-left: 4px; }
.set-name .field button + button { background: #fff; color: var(--ink); padding: 9px 10px; box-shadow: inset 0 0 0 2px rgba(122, 104, 176, 0.25); }

/* Menu com o botão da Corrida: painel mais compacto para o fundo (ilha + bolinha) continuar com espaço */
@media (max-height: 900px) {
  .tile { min-height: 70px; padding: 8px 6px; }
  .tile.wide { min-height: 52px; }
  .rush-btn { padding: 10px 12px; font-size: 18px; margin-top: 10px; }
  #menu .menu-grid { margin-top: 10px; gap: 8px; }
}
@media (max-height: 780px) {
  .tile { min-height: 54px; }
  .tile.wide { min-height: 46px; }
  .rush-btn { padding: 8px 10px; font-size: 17px; }
  .rush-btn small { display: none; }
}
.menu-foot .world { white-space: nowrap; font-size: 11px; }
.menu-foot .coffee { white-space: nowrap; }

/* ---- Rouba Bandeira ---- */
#flagBar {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 88px); transform: translateX(-50%);
  max-width: calc(100vw - 32px); width: max-content; text-align: center;
  font: 600 15px 'Fredoka', system-ui, sans-serif; color: #fff; background: rgba(58, 46, 92, 0.86);
  padding: 5px 14px; border-radius: 999px; box-shadow: 0 3px 0 rgba(30, 20, 60, 0.5); pointer-events: none; font-variant-numeric: tabular-nums;
}
#flagBar:empty { display: none; }
#flagBar b { color: #ffd84d; }
#flagBar.hurry { background: rgba(229, 57, 53, 0.95); box-shadow: 0 3px 0 #a31c1a; animation: pulse .5s ease-in-out infinite; }
.flag-powers {
  position: fixed; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; gap: 10px; pointer-events: auto;
}
.flag-powers[hidden] { display: none !important; }
.fp {
  position: relative; width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer; touch-action: manipulation;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 0 rgba(58, 46, 92, 0.25); font-size: 26px; display: grid; place-items: center;
}
.fp i { font-style: normal; line-height: 1; }
.fp span { position: absolute; right: -2px; top: -2px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
  background: #ff5e3a; color: #fff; font: 700 13px/22px 'Fredoka', system-ui, sans-serif; }
.fp:disabled { opacity: .38; }
.fp:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
body.flag #best, body.flag #pts { display: none; }
#flag { background: rgba(60, 40, 110, 0.45); z-index: 9; }
#flag .card {
  position: relative; width: min(420px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fffaf3; border-radius: 28px; padding: 16px 14px 14px; box-shadow: 0 20px 50px rgba(60, 40, 110, 0.35); text-align: center;
}
#flag .close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(58, 46, 92, 0.08); font-size: 16px; color: var(--ink); cursor: pointer; }
#flag .title { font-size: 22px; font-weight: 700; margin: 2px 40px 4px; }
#flag .lead { font-size: 15px; margin: 6px 4px 10px; }
#flag .small { font-size: 12.5px; opacity: .7; margin: 6px 4px; }
#flag .btn { margin-bottom: 8px; }
.flag-tabs { display: flex; gap: 6px; background: rgba(58, 46, 92, 0.08); border-radius: 14px; padding: 4px; margin: 10px 0 8px; }
.flag-tabs .tab { flex: 1; border: none; border-radius: 10px; padding: 8px 4px; font: 700 14px 'Fredoka', system-ui, sans-serif;
  color: rgba(58, 46, 92, 0.6); background: transparent; cursor: pointer; }
.flag-tabs .tab.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(90, 70, 150, 0.12); }
.flag-left { font-weight: 600; margin: 4px 0 8px; }
.fort-list { display: flex; flex-direction: column; gap: 8px; }
.fort-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 18px; text-align: left;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c1) 18%, #fff), #fff); border: 2px solid color-mix(in srgb, var(--c1) 40%, transparent); }
.fort-card .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fort-card .tx b { font-size: 16px; }
.fort-card .tx small { font-size: 12px; opacity: .8; }
.fort-card .crest { flex: none; }
.btn.fort-go { width: auto; margin: 0; padding: 10px 14px; font-size: 15px; flex: none; }
.fort-card.own { margin-bottom: 6px; }
.flag-box { margin-top: 12px; padding: 10px; border-radius: 16px; background: rgba(58, 46, 92, 0.05); }
.flag-arsenal { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 16px; margin: 4px 0; }
.flag-arsenal span { background: #fff; padding: 3px 9px; border-radius: 999px; }
.flag-rules { text-align: left; font-size: 13px; }
.trap-strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 8px 0; }
.trap-cell { border: 0; border-radius: 9px; padding: 4px 0; background: #fff; box-shadow: 0 2px 0 rgba(58, 46, 92, 0.15); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; font: 600 11px 'Fredoka', system-ui, sans-serif; color: var(--ink); min-height: 40px; }
.trap-cell i { font-style: normal; font-size: 15px; height: 18px; }
.trap-cell.off { background: rgba(58, 46, 92, 0.08); box-shadow: none; opacity: .55; cursor: default; }
.trap-cell.on { background: #ffe0e4; }
.trap-cell.mine { outline: 2px solid #e0384f; }
.trap-cell.flagc { background: #fff1c2; opacity: 1; }
.trap-cell.exitc { background: #d9f5e6; opacity: 1; }
.trap-cell:disabled:not(.off):not(.on):not(.flagc):not(.exitc) { opacity: .6; cursor: default; }
.flag-board { margin-top: 12px; }
.flag-standings { list-style: none; margin: 6px 0; padding: 0; }
.flag-standings li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; }
.flag-standings li.me { background: rgba(255, 216, 77, 0.35); }
.flag-standings .pos { width: 28px; font-weight: 700; }
.flag-standings .h { flex: 1; text-align: left; font-weight: 700; }
.flag-standings .det { font-size: 12px; opacity: .75; }
.flag-standings .s { min-width: 28px; text-align: right; font-weight: 700; font-size: 18px; }
.flag-feed { list-style: none; padding: 0; margin: 6px 0; text-align: left; font-size: 13px; }
.flag-feed li { padding: 5px 2px; border-bottom: 1px dashed rgba(58, 46, 92, 0.12); }
.flag-result { padding: 6px 0 10px; }
.flag-result .big-ic { font-size: 56px; line-height: 1.1; animation: pop .5s ease-out; }
.flag-result .fort-of { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; opacity: .8; }
.btn.flag-share { background: linear-gradient(180deg, #ffb21f, #ff7a1f); box-shadow: 0 6px 0 #cc5a10; color: #fff; }
.team-game.flag-game { width: 100%; border: 0; font: inherit; cursor: pointer; background: linear-gradient(90deg, #7a5cff, #3d6bff); box-shadow: 0 4px 0 #2c3fb0; }
