:root {
  --bg: #fff;
  --text: #202124;
  --text-2: #4d5156;
  --text-3: #70757a;
  --link: #1a0dab;
  --border: #dfe1e5;
  --box-bg: #fff;
  --box-shadow: 0 1px 6px rgba(32, 33, 36, .28);
  --btn-bg: #f8f9fa;
  --btn-border: #dadce0;
  --btn-hover-border: #dadce0;
  --footer-bg: #f2f2f2;
  --footer-border: #dadce0;
  --icon: #9aa0a6;
  --icon-dark: #5f6368;
  --hover: rgba(60, 64, 67, .08);
  --menu-bg: #fff;
  --signin-bg: #0b57d0;
  --signin-hover: #0842a0;
  --signin-text: #fff;
  --apps-bg: #e9eef6;
  --sugg-hover: #eee;
}

[data-theme="dark"] {
  --bg: #1f1f1f;
  --text: #e8eaed;
  --text-2: #bdc1c6;
  --text-3: #9aa0a6;
  --link: #8ab4f8;
  --border: #5f6368;
  --box-bg: #4d5156;
  --box-shadow: 0 1px 6px rgba(0, 0, 0, .5);
  --btn-bg: #303134;
  --btn-border: #303134;
  --btn-hover-border: #5f6368;
  --footer-bg: #171717;
  --footer-border: #3c4043;
  --icon: #9aa0a6;
  --icon-dark: #e8eaed;
  --hover: rgba(232, 234, 237, .08);
  --menu-bg: #303134;
  --signin-bg: #a8c7fa;
  --signin-hover: #d3e3fd;
  --signin-text: #062e6f;
  --apps-bg: #282a2c;
  --sugg-hover: #3c4043;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 14px;
}

a { color: inherit; }

button { font-family: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 60px;
  padding: 6px 6px 0 0;
  gap: 0;
}

.topbar-links { display: flex; }

.topbar-links a {
  color: var(--text);
  opacity: .87;
  font-size: 13px;
  line-height: 24px;
  margin: 0 5px 0 10px;
  text-decoration: none;
  display: inline-block;
  padding: 0 0 0 0;
}

.topbar-links a:hover { text-decoration: underline; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 4px 0 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icon-dark);
  cursor: pointer;
}

.icon-btn:hover { background: var(--hover); }

.icon-btn[aria-expanded="true"] { background: rgba(60, 64, 67, .12); }

.signin-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 24px;
  margin: 0 10px 0 4px;
  border-radius: 100px;
  background: var(--signin-bg);
  color: var(--signin-text);
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .25px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, box-shadow .2s;
}

.signin-btn:hover {
  background: var(--signin-hover);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
}

/* ---------- Apps panel ---------- */
.apps-panel {
  position: absolute;
  top: 58px;
  right: 120px;
  width: 328px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 28px;
  background: var(--apps-bg);
  box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  z-index: 100;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 16px 12px;
  border-radius: 20px;
  background: var(--menu-bg);
}

.apps-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 10px;
  border-radius: 8px;
  color: var(--text);
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 14px;
  text-decoration: none;
}

.apps-grid a:hover { background: var(--hover); }

.app-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
}

/* ---------- Main ---------- */
.main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.logo {
  margin-top: max(10px, calc(min(30vh, 290px) - 140px));
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* ---------- Doodle do Gugu ---------- */
.doodle {
  position: relative;
  width: 400px;
  height: 140px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.doodle:focus-visible { outline: 2px solid #4285f4; outline-offset: 6px; border-radius: 12px; }

.word {
  position: absolute;
  left: 30px;
  bottom: 6px;
  font-family: "Outfit", "Product Sans", "Google Sans", Arial, sans-serif;
  font-weight: 500;
  font-size: 104px;
  line-height: 1;
  letter-spacing: -3px;
  user-select: none;
  white-space: nowrap;
}

.L { display: inline-block; will-change: transform; }
.b { color: #4285f4; } .r { color: #ea4335; } .y { color: #fbbc05; } .g { color: #34a853; }

.lula {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 88px;
  height: 120px;
  transform-origin: center bottom;
  pointer-events: none;
}

.lula svg { display: block; overflow: visible; }

.sack {
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: scale(.55);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}

.leg { transform-box: fill-box; transform-origin: center top; }
.arm-reach { transform-box: view-box; transform-origin: 38px 78px; transition: transform .2s; }
.head { transform-box: view-box; transform-origin: 54px 64px; }

/* parado: espiando, de olho nas letras */
.lula.idle .head { animation: sneak 3.2s ease-in-out infinite; }
.lula.idle .eyes { animation: glance 3.2s ease-in-out infinite; }

.lula.walking .leg-l { animation: step .28s ease-in-out infinite alternate; }
.lula.walking .leg-r { animation: step .28s ease-in-out infinite alternate-reverse; }
.lula.walking .body-bob { animation: bob .14s ease-in-out infinite alternate; }
.lula.running .leg-l { animation-duration: .12s; }
.lula.running .leg-r { animation-duration: .12s; }
.lula.running .body-bob { animation-duration: .06s; }
.lula.grab .arm-reach { transform: rotate(38deg); }

@keyframes step { from { transform: rotate(22deg); } to { transform: rotate(-22deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes sneak { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@keyframes glance { 0%, 40%, 100% { transform: translateX(0); } 50%, 85% { transform: translateX(-2.5px); } }

.caption {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, 8px);
  padding: 6px 14px;
  border-radius: 16px;
  background: #202124;
  color: #fff;
  font-family: "Outfit", Arial, sans-serif;
  font-size: 18px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}

.caption.show { opacity: 1; transform: translate(-50%, 0); }

[data-theme="dark"] .caption { background: #e8eaed; color: #202124; }

.search-form {
  width: 100%;
  max-width: 584px;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-box {
  position: relative;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--box-bg);
  z-index: 3;
}

[data-theme="dark"] .search-box { border-color: transparent; }

.search-box:hover,
.search-box.focused {
  box-shadow: var(--box-shadow);
  border-color: rgba(223, 225, 229, 0);
}

.search-box.open {
  border-radius: 24px 24px 0 0;
  border-bottom-color: transparent;
  box-shadow: var(--box-shadow);
}

.search-row {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 8px 0 14px;
}

.search-icon {
  display: flex;
  color: var(--icon);
  margin-right: 13px;
  height: 20px;
}

#q {
  flex: 1;
  min-width: 0;
  height: 22px;
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 22px;
  white-space: nowrap;
}

.clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 12px 0 8px;
  border: 0;
  background: transparent;
  color: var(--icon-dark);
  cursor: pointer;
}
.clear-btn[hidden] { display: none; }

.divider {
  width: 1px;
  height: 65%;
  background: var(--border);
  margin-right: 4px;
}
.divider[hidden] { display: none; }

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.tool-btn + .tool-btn { margin-left: 0; }

/* ---------- Suggestions ---------- */
.suggestions {
  position: absolute;
  left: -1px;
  right: -1px;
  top: 44px;
  padding-bottom: 8px;
  border-radius: 0 0 24px 24px;
  background: var(--box-bg);
  box-shadow: 0 4px 6px rgba(32, 33, 36, .28);
  clip-path: inset(0 -10px -10px -10px);
}

.suggestions::before {
  content: "";
  display: block;
  height: 1px;
  margin: 0 20px 4px 14px;
  background: #e8eaed;
}
[data-theme="dark"] .suggestions::before { background: #5f6368; }

.suggestions ul { list-style: none; margin: 0; padding: 0; }

.suggestions li {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 20px 0 14px;
  cursor: default;
  font-size: 16px;
  color: var(--text);
}

.suggestions li.active,
.suggestions li:hover { background: var(--sugg-hover); }

.suggestions li .s-ico {
  display: flex;
  margin-right: 14px;
  color: var(--icon);
}

.suggestions li .s-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestions li .s-text b { font-weight: bold; }

.suggestions li.s-head {
  height: 30px;
  padding-top: 4px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: .2px;
}
.suggestions li.s-head:hover { background: none; }

.suggestions li.hot { height: 46px; }
.suggestions li.hot .s-ico { color: #d93025; }
.suggestions li.hot .s-text small {
  display: block;
  color: var(--text-3);
  font-size: 13px;
  margin-top: 2px;
}

.suggestions li .s-remove {
  border: 0;
  background: none;
  color: #1a0dab;
  font-size: 13px;
  cursor: pointer;
  visibility: hidden;
}
[data-theme="dark"] .suggestions li .s-remove { color: #8ab4f8; }
.suggestions li:hover .s-remove { visibility: visible; }
.suggestions li .s-remove:hover { text-decoration: underline; }

.suggest-actions {
  display: flex;
  justify-content: center;
  gap: 0;
  padding-top: 18px;
  padding-bottom: 8px;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.actions.hide { visibility: hidden; }

.g-btn {
  height: 36px;
  min-width: 54px;
  margin: 11px 4px;
  padding: 0 16px;
  border: 1px solid var(--btn-bg);
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 27px;
  cursor: pointer;
  user-select: none;
}

.g-btn:hover {
  border-color: var(--btn-hover-border);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
  color: var(--text);
}

.g-btn:focus-visible {
  outline: none;
  border-color: #4285f4;
}

/* ---------- Linha de anúncio (no lugar do "Disponibilizado em") ---------- */
.advertise {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 28px;
  text-align: center;
}

.advertise a {
  color: var(--link);
  text-decoration: none;
  margin: 0 3px;
}
.advertise a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
  flex-shrink: 0;
  background: var(--footer-bg);
  color: var(--text-3);
  font-size: 15px;
}

.footer-country {
  padding: 15px 30px;
  border-bottom: 1px solid var(--footer-border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 20px;
}

.footer-left, .footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.footer a, .footer-btn {
  display: block;
  padding: 15px;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
}

.footer a:hover, .footer-btn:hover { text-decoration: underline; }

.footer-btn {
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.settings-wrap { position: relative; }

.settings-menu {
  position: absolute;
  right: 0;
  bottom: 48px;
  min-width: 230px;
  padding: 6px 0;
  border-radius: 8px;
  background: var(--menu-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  z-index: 10;
}

.settings-menu a,
.settings-menu button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  line-height: 22px;
}

.settings-menu a:hover,
.settings-menu button:hover { background: var(--hover); text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .topbar-links { display: none; }
  .doodle { width: 300px; height: 112px; }
  .word { left: 22px; font-size: 78px; letter-spacing: -2px; }
  .lula { width: 70px; height: 96px; }
  .lula svg { width: 70px; height: 96px; }
  .caption { font-size: 15px; }
  .footer-links { justify-content: center; }
  .footer-left, .footer-right { justify-content: center; }
  .apps-panel { right: 8px; }
}

/* ---------- Mão de quatro dedos que rouba letras ---------- */
.thief {
  position: fixed;
  left: 0;
  top: 0;
  width: 80px;
  z-index: 1000;
  pointer-events: none;
  transform-origin: 40px 0;
  will-change: transform;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
}

.thief svg { display: block; }

.thief .sleeve {
  width: 64px;
  height: 2600px;
  margin: -1px 0 0 8px;
  background: linear-gradient(90deg, #1b2340, #26304f 40%, #1b2340);
}

.thief .f,
.thief .thumb {
  transform-box: fill-box;
  transition: transform .18s ease-in;
}

.thief .f { transform-origin: center bottom; }
.thief .thumb { transform-origin: center bottom; }

.thief.closed .f { transform: scaleY(.42); }
.thief.closed .thumb { transform: rotate(48deg); }

.stolen-char { visibility: hidden; }

.flying-char {
  position: fixed;
  margin: 0;
  z-index: 999;
  pointer-events: none;
  white-space: pre;
}

/* Texto só para leitores de tela e buscadores */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Modal "Anuncie no Gugu" ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(32, 33, 36, .6);
  animation: fade-in .15s ease-out;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 28px;
  background: var(--menu-bg);
  color: var(--text);
  box-shadow: 0 4px 8px 3px rgba(0, 0, 0, .15), 0 1px 3px rgba(0, 0, 0, .3);
  animation: pop-in .2s cubic-bezier(.2, .8, .3, 1.1);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94); } }

.modal h2 {
  margin: 0 0 6px;
  font-family: "Google Sans", "Outfit", Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
}

.modal-sub { margin: 0 0 20px; color: var(--text-2); font-size: 14px; line-height: 20px; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--icon-dark);
  cursor: pointer;
}
.modal-close:hover { background: var(--hover); }

.field { display: block; margin-bottom: 14px; }

.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 13px;
}
.field small { color: var(--text-3); }

.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: 16px Arial, sans-serif;
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 1px #1a73e8; }

.field.invalid input,
.field.invalid textarea { border-color: #d93025; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-status { min-height: 20px; margin: 0 0 8px; font-size: 14px; color: #d93025; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.m-btn {
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 100px;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.m-btn-text { background: none; color: #0b57d0; }
.m-btn-text:hover { background: rgba(11, 87, 208, .08); }
.m-btn-filled { background: var(--signin-bg); color: var(--signin-text); }
.m-btn-filled:hover { background: var(--signin-hover); }
.m-btn:disabled { opacity: .6; cursor: default; }

[data-theme="dark"] .m-btn-text { color: #a8c7fa; }

.modal-done { text-align: center; padding: 8px 0 0; }
.modal-done .modal-actions { justify-content: center; }
