:root {
  color-scheme: dark;
  --bg: #071510;
  --bg-soft: #0f2a20;
  --card: #163a2c;
  --text: #edfff4;
  --muted: #9fd4bd;
  --primary: #38e58f;
  --primary-strong: #19bf6e;
  --accent: #8ff8c2;
  --danger: #ef4444;
  --line: #2f6a50;
  --chip: #1c4a37;
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 24px 46px rgba(0, 0, 0, 0.35);
  --easing: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #000000;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -30%;
  background:
    radial-gradient(circle at 20% 20%, rgba(57, 229, 143, 0.08), transparent 35%),
    radial-gradient(circle at 75% 30%, rgba(57, 229, 143, 0.06), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(57, 229, 143, 0.05), transparent 35%);
  animation: bgFloat 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

.hidden {
  display: none !important;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: linear-gradient(165deg, rgba(18, 58, 43, 0.95), rgba(12, 37, 27, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.auth-card h2 {
  margin: 0 0 8px;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.session-email {
  font-size: 0.82rem;
  color: #c2d8ff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 30, 22, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 3;
  transition: border-color 240ms var(--easing), box-shadow 240ms var(--easing);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 1.4rem;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.brand-name img {
  width: 34px;
  height: 34px;
  min-width: 34px;
  object-fit: contain;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 215, 60, 0.1);
  border: 1px solid rgba(255, 215, 60, 0.45);
  filter: drop-shadow(0 0 12px rgba(255, 208, 80, 0.5));
}

.brand-trophy-fallback {
  font-size: 1.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 208, 80, 0.45));
}

.funk-player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.funk-player-controls select {
  min-width: 260px;
  flex: 1 1 280px;
}

.funk-frame-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(4, 8, 10, 0.9);
}

#funkPlayerFrame {
  display: block;
  width: 100%;
  height: 352px;
  min-height: 0;
  border: 0;
  background: #000;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  padding: 20px 24px 36px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

.card {
  background: linear-gradient(165deg, rgba(12, 18, 15, 0.96), rgba(7, 11, 9, 0.96));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition:
    transform 260ms var(--easing),
    border-color 260ms var(--easing),
    box-shadow 260ms var(--easing),
    background 260ms var(--easing);
}

.card:hover {
  transform: translateY(-3px);
  border-color: #39e58f;
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.4), 0 0 24px rgba(57, 229, 143, 0.28), var(--shadow-strong);
  background: linear-gradient(165deg, rgba(14, 26, 20, 0.97), rgba(9, 18, 14, 0.97));
}

.card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.card-header p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

label.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.92rem;
  transition:
    border-color 200ms var(--easing),
    box-shadow 200ms var(--easing),
    transform 200ms var(--easing);
}

/* Evita zoom automático no iOS ao focar campos */
input,
select,
textarea,
button {
  font-size: 16px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #39e58f;
  box-shadow: 0 0 0 3px rgba(57, 229, 143, 0.22), 0 0 14px rgba(57, 229, 143, 0.2);
  transform: translateY(-1px);
}

button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition:
    transform 200ms var(--easing),
    box-shadow 200ms var(--easing),
    background 200ms var(--easing),
    border-color 200ms var(--easing),
    color 200ms var(--easing);
  color: #072127;
}

button.primary {
  grid-column: 1 / -1;
  background: var(--primary);
  padding: 10px 14px;
}

button.primary:hover {
  background: var(--primary-strong);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.5), 0 0 20px rgba(57, 229, 143, 0.35);
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 12px;
}

a.ghost.link-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 10px;
}

button.ghost:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.45), 0 0 16px rgba(57, 229, 143, 0.28);
}

a.ghost.link-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.45), 0 0 16px rgba(57, 229, 143, 0.28);
}

.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-align: center;
}

a {
  transition: color 200ms var(--easing), transform 200ms var(--easing);
}

.top10-btn {
  gap: 7px;
}

.top10-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.7);
}

button.danger {
  color: #ffd9d9;
  border-color: #7f1d1d;
}

.list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 12, 0.78);
  transition:
    transform 220ms var(--easing),
    border-color 220ms var(--easing),
    background 220ms var(--easing),
    box-shadow 220ms var(--easing);
}

.list-item:hover {
  transform: translateY(-2px);
  border-color: #39e58f;
  background: rgba(12, 24, 18, 0.92);
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.38), 0 0 18px rgba(57, 229, 143, 0.24);
}

.item-content {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.item-meta {
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.73rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  color: #d2def8;
  transition: transform 180ms var(--easing), border-color 180ms var(--easing), background 180ms var(--easing);
}

.chip:hover {
  transform: translateY(-1px);
  border-color: #39e58f;
  background: #1a4f38;
  box-shadow: 0 0 12px rgba(57, 229, 143, 0.22);
}

.analysis-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(8, 16, 35, 0.55);
}

.analysis-box.empty {
  color: var(--muted);
}

.score {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.score.good {
  color: #34d399;
}

.score.medium {
  color: #fbbf24;
}

.score.low {
  color: #f87171;
}

.compact .list-item {
  padding: 8px 10px;
}

.remove-btn {
  white-space: nowrap;
}

.hero-card {
  position: relative;
  min-height: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 280ms var(--easing), box-shadow 280ms var(--easing), border-color 280ms var(--easing);
}

.hero-card:hover {
  transform: translateY(-4px);
  border-color: #39e58f;
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.4), 0 0 24px rgba(57, 229, 143, 0.26), var(--shadow-strong);
}

.hero-image {
  width: 100%;
  height: auto;
  min-height: 300px;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  padding: 22px;
  display: grid;
  align-content: space-between;
  background: linear-gradient(180deg, rgba(1, 9, 24, 0.12), rgba(2, 9, 24, 0.72));
}

.hero-overlay h2 {
  margin: 0;
  font-size: 1.5rem;
  max-width: 640px;
}

.hero-overlay p {
  margin: 10px 0 18px;
  color: #dce8ff;
  max-width: 640px;
}

.hero-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.kpi-box {
  border: 1px solid rgba(90, 171, 123, 0.3);
  background: rgba(10, 22, 16, 0.74);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  transition: transform 200ms var(--easing), border-color 200ms var(--easing), background 200ms var(--easing);
}

.kpi-box:hover {
  transform: translateY(-2px);
  border-color: #39e58f;
  background: rgba(14, 33, 24, 0.94);
  box-shadow: 0 0 16px rgba(57, 229, 143, 0.2);
}

.kpi-box strong {
  font-size: 1.5rem;
}

.kpi-box span {
  color: #c7f5da;
  font-size: 0.82rem;
}

.tool-player {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 24, 17, 0.78);
  transition: transform 220ms var(--easing), border-color 220ms var(--easing), background 220ms var(--easing);
}

.tool-player-inline {
  margin-top: 4px;
}

.tool-player img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #3f8a64;
  transition: transform 220ms var(--easing), box-shadow 220ms var(--easing);
}

.tool-player span {
  color: #d8ffea;
  font-size: 0.82rem;
}

.tool-player:hover {
  transform: translateY(-2px);
  border-color: #39e58f;
  background: rgba(12, 31, 22, 0.95);
  box-shadow: 0 0 16px rgba(57, 229, 143, 0.25);
}

.tool-player:hover img {
  transform: scale(1.08);
  box-shadow: 0 8px 16px rgba(5, 15, 32, 0.5);
}

.tool-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.tool-button {
  min-height: 44px;
  transition: transform 220ms var(--easing), border-color 220ms var(--easing), background 220ms var(--easing), box-shadow 220ms var(--easing);
}

.tool-button:hover {
  transform: translateY(-2px);
  border-color: #39e58f;
  background: rgba(14, 33, 24, 0.84);
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.42), 0 0 20px rgba(57, 229, 143, 0.3);
}

.tool-page-card {
  max-width: 980px;
  margin: 0 auto;
}

.tool-hero {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 360px) 1fr;
  align-items: center;
}

.tool-hero-image {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 17, 12, 0.76);
  box-shadow: var(--shadow-soft);
  transition: transform 260ms var(--easing), box-shadow 260ms var(--easing), border-color 260ms var(--easing);
}

.tool-hero-image:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: #39e58f;
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.45), 0 0 24px rgba(57, 229, 143, 0.28), var(--shadow-strong);
}

.search-card {
  padding-bottom: 10px;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
}

.search-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 16, 35, 0.35);
}

.hashtag-suggestion-box {
  border: 1px solid #3f8e67;
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 36, 25, 0.82);
}

.hashtag-suggestion-title {
  font-size: 0.86rem;
  color: #ccffde;
  margin-bottom: 8px;
}

.hashtag-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hashtag-chip {
  border: 1px solid #44956d;
  background: rgba(14, 57, 39, 0.92);
  color: #dbffe9;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  transition: transform 180ms var(--easing), border-color 180ms var(--easing), background 180ms var(--easing);
}

.hashtag-chip:hover {
  transform: translateY(-1px);
  border-color: #91ffbf;
  background: rgba(18, 77, 52, 0.96);
}

.insights-card {
  padding-bottom: 14px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.insight-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8, 35, 24, 0.5);
}

.insight-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.bars {
  margin-top: 10px;
  display: grid;
  gap: 9px;
}

.bar-row {
  border: 1px solid rgba(86, 180, 125, 0.48);
  border-radius: 10px;
  padding: 8px;
  background: rgba(8, 34, 24, 0.72);
  transition: transform 200ms var(--easing), border-color 200ms var(--easing), background 200ms var(--easing);
}

.bar-row:hover {
  transform: translateY(-2px);
  border-color: #39e58f;
  background: rgba(12, 40, 28, 0.92);
  box-shadow: 0 0 16px rgba(57, 229, 143, 0.22);
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.bar-title {
  font-weight: 600;
}

.bar-value {
  color: #c8ffd6;
  font-weight: 700;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #133628;
  overflow: hidden;
  border: 1px solid #347b5b;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1cdf78, #97ffc6);
}

.audio-row .item-meta {
  margin-top: 6px;
}

.audio-links {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.audio-links a {
  color: #c3ffdc;
  text-decoration: none;
  border: 1px solid #2f7a57;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.8rem;
  transition: transform 180ms var(--easing), border-color 180ms var(--easing), background 180ms var(--easing);
}

.audio-links a:hover {
  border-color: #39e58f;
  text-decoration: underline;
  transform: translateY(-1px);
  background: rgba(20, 73, 50, 0.52);
  box-shadow: 0 0 10px rgba(57, 229, 143, 0.24);
}

.daily-viral-card {
  display: grid;
  gap: 8px;
}

.daily-viral-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-viral-links a {
  color: #c3ffdc;
  text-decoration: none;
  border: 1px solid #2f7a57;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.8rem;
  transition: transform 180ms var(--easing), border-color 180ms var(--easing), background 180ms var(--easing);
}

.daily-viral-links a:hover {
  border-color: #39e58f;
  text-decoration: underline;
  transform: translateY(-1px);
  background: rgba(20, 73, 50, 0.52);
  box-shadow: 0 0 10px rgba(57, 229, 143, 0.24);
}

.help-card {
  max-width: 900px;
  margin: 0 auto;
}

.quick-help {
  color: #d7ffe8;
}

.quick-idea {
  color: #d7ffe8;
}

.ask-counter {
  margin: 6px 0 12px;
  font-size: 0.9rem;
  color: #caffde;
}

.ask-counter.limit-reached {
  color: #fda4af;
}

.gemini-shell {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 24, 17, 0.82);
  overflow: hidden;
  transition: border-color 240ms var(--easing), box-shadow 240ms var(--easing), transform 240ms var(--easing);
}

.gemini-shell:hover {
  border-color: #39e58f;
  box-shadow: 0 0 0 1px rgba(57, 229, 143, 0.42), 0 0 20px rgba(57, 229, 143, 0.26);
  transform: translateY(-2px);
}

.gemini-messages {
  min-height: 260px;
  max-height: 430px;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.gemini-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.gemini-message.user {
  justify-content: flex-end;
}

.gemini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: #1f5c42;
  color: #d9ffe8;
  border: 1px solid #45a378;
}

.gemini-bubble {
  max-width: min(760px, 90%);
  border: 1px solid #317a58;
  background: #113827;
  border-radius: 14px;
  padding: 10px 12px;
  color: #e9f1ff;
  animation: bubbleIn 240ms var(--easing);
}

.gemini-message.user .gemini-bubble {
  background: linear-gradient(135deg, #12aa62, #168850);
  border-color: #3be18f;
}

.gemini-bubble ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.gemini-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #2e7152;
  background: rgba(8, 35, 24, 0.95);
}

.gemini-send {
  min-width: 96px;
}

.rank-layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 36px;
}

.rank-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(9, 18, 13, 0.8);
  border-radius: 12px;
  padding: 12px;
}

.rank-item:hover {
  border-color: #39e58f;
  box-shadow: 0 0 16px rgba(57, 229, 143, 0.22);
}

.rank-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.rank-title {
  font-size: 1rem;
  font-weight: 700;
}

.rank-position {
  color: var(--primary);
  font-weight: 700;
}

.rank-link {
  color: #c9ffe0;
  text-decoration: none;
}

.rank-link:hover {
  text-decoration: underline;
  color: #e3ffef;
  transform: translateX(1px);
}

.muted-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.wc-section {
  margin-top: 28px;
}

.wc-section h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bgFloat {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 1.5%, 0) scale(1.03);
  }
}

@media (max-width: 800px) {
  .topbar {
    position: static;
    padding: 14px 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  .topbar p {
    font-size: 0.86rem;
  }

  .brand-name {
    white-space: normal;
    flex-wrap: wrap;
    gap: 6px;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .link-btn,
  .topbar-actions button {
    flex: 1 1 calc(50% - 8px);
    min-height: 40px;
    text-align: center;
    justify-content: center;
  }

  .layout {
    padding: 12px 10px 24px;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .rank-layout {
    padding: 12px 10px 24px;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  .card:hover {
    transform: none;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .search-controls {
    grid-template-columns: 1fr;
  }

  .tool-buttons-grid {
    grid-template-columns: 1fr;
  }

  .tool-button {
    width: 100%;
  }

  .funk-player-controls select,
  .funk-player-controls button {
    width: 100%;
    flex: 1 1 100%;
  }

  #funkPlayerFrame {
    height: 300px;
  }

  .hero-card {
    min-height: 220px;
  }

  .hero-image {
    min-height: 220px;
  }

  .hero-overlay {
    padding: 12px;
  }

  .hero-overlay h2 {
    font-size: 1.12rem;
  }

  .hero-overlay p {
    font-size: 0.86rem;
    margin: 8px 0 12px;
  }

  .hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gemini-composer {
    grid-template-columns: 1fr;
  }

  .tool-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .auth-gate {
    padding: 12px;
  }

  .auth-card {
    padding: 14px;
  }

  .auth-form {
    gap: 8px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .link-btn,
  .topbar-actions button {
    flex: 1 1 100%;
    min-height: 42px;
    padding: 9px 10px;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }

  .kpi-box {
    padding: 8px;
  }

  .kpi-box strong {
    font-size: 1.25rem;
  }

  .search-controls input,
  .search-controls select,
  .search-controls button {
    min-height: 42px;
  }

  .gemini-messages {
    min-height: 220px;
    padding: 10px;
  }

  .gemini-bubble {
    max-width: 100%;
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .gemini-composer {
    padding: 8px;
    gap: 6px;
  }

  .gemini-send {
    width: 100%;
  }

  .tool-player {
    width: 100%;
    border-radius: 12px;
    justify-content: flex-start;
  }

  .tool-player span {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .rank-item {
    padding: 10px;
  }

  .rank-title {
    font-size: 0.94rem;
    line-height: 1.3;
  }

  #funkPlayerFrame {
    height: 260px;
  }
}

@media (max-width: 360px) {
  .layout,
  .rank-layout {
    padding: 10px 8px 20px;
  }

  .card {
    padding: 10px;
    border-radius: 10px;
  }

  .card-header h2 {
    font-size: 1rem;
  }

  .card-header p,
  .muted-note,
  label {
    font-size: 0.82rem;
  }

  .brand-name img {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .brand-trophy-fallback {
    font-size: 1rem;
  }

  #funkPlayerFrame {
    height: 230px;
  }
}
