:root {
  --pointer-color: #d72323;
  --panel-bg: #ffffff;
  --panel-border: #dbdbdb;
  --text: #212121;
}

* { box-sizing: border-box; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 70% 20%, #e8f0ff, #f0f4ff 40%, #fafaff);
  font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
}

.logo {
  display: flex;
  align-items: center;
  height: 40px;
}

.logo-img { height: 26px; width: auto; display: block; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.topnav {
  display: flex;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #1a1a2e;
}
.nav-item:hover { background: rgba(0, 0, 0, 0.05); }

.icon-only {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: #1a1a2e;
}
.icon-only:hover { background: rgba(0, 0, 0, 0.05); }

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #1a1a2e;
  flex-shrink: 0;
}

.my-wheels-btn {
  background: #fff;
  border: 1.5px solid #1a1a2e;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- layout ---------- */
.layout {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  padding: 20px;
}

.wheel-area {
  display: flex;
  justify-content: center;
}

.wheel-wrapper {
  position: relative;
  width: min(85vw, 460px);
  height: min(85vw, 460px);
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: pointer;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.16)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

.pointer {
  position: absolute;
  top: 50%;
  right: -2px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-right: 20px solid var(--pointer-color);
  z-index: 3;
  filter: drop-shadow(1px 0 2px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.zone-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  display: none;
}
.zone-overlay.visible { display: block; }

.result {
  text-align: center;
  min-height: 1.6em;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 10px;
}

/* ---------- side panel ---------- */
.panel {
  position: relative;
  width: 350px;
  max-width: 90vw;
}

.panel-tabs {
  display: flex;
  min-width: 300px;
}

.tab {
  flex: 1;
  height: 32px;
  background: #fff;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #000000de;
}
.tab:first-child { border-radius: 8px 0 0; }
.tab:last-child { border-radius: 0 8px 0 0; }
.tab.active { border-color: #37474f; }
.tab .badge {
  position: absolute;
  top: -3px;
  right: 10px;
  background: #ff253a;
  color: #fff;
  font-size: 10px;
  border-radius: 10px;
  padding: 1px 5px;
  line-height: 1.3;
}
.tab-colors .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(red, orange, yellow, green, blue, indigo, violet, red);
}

.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.tool-btn {
  background: #d7dadd;
  border: none;
  height: 28px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #212121;
}
.tool-btn:hover { background: #c7cbd0; }

.settings-btn { position: relative; }
.settings-btn .dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
}

.options-wrapper { position: relative; }

.options-box {
  width: 100%;
  min-height: 30vh;
  max-height: 380px;
  overflow-y: auto;
  background: #ffffff7e;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: #363636;
  line-height: 1.8;
  font-size: 16px;
  font-family: inherit;
  padding: 1rem;
  outline: none;
  transition: max-height 0.25s ease;
}
.options-box.expanded { max-height: 60vh; }

.emoji-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666;
}

.panel-footer { text-align: right; padding: 5px 0; }
.entries-chip {
  background-color: #5072a7;
  border-radius: 15px;
  font-size: 12px;
  color: #fff;
  padding: 5px 10px;
}

.close-btn {
  margin-top: 14px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: #1a1a2e;
  color: #fff;
  cursor: pointer;
}
.close-btn.active { background: #d72323; }

.collapse-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #555;
  transition: transform 0.2s ease;
}
.collapse-btn.expanded { transform: rotate(180deg); }

/* ---------- bloque de información (SEO) ---------- */
.info-box {
  max-width: 1100px;
  margin: 10px auto 30px;
  padding: 0 10px;
}

.info-box article {
  border: 1px solid #e2e2e6;
  border-radius: 6px;
  background: #fff;
  padding: 24px 28px;
  font-size: 15px;
  line-height: 1.7;
  color: #333;
}

.info-box h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: #1a1a2e;
}
.info-box section:first-of-type h2 { margin-top: 8px; }

.info-box p { margin: 0 0 12px; }

.info-box ul,
.info-box ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.info-box li { margin-bottom: 10px; }

.store-badges {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}
.store-badge { height: 48px; width: auto; display: block; }

/* ---------- footer ad strip ---------- */
.ad-bar {
  height: 60px;
  background: #d9d9d9;
}

@media (max-width: 860px) {
  .layout { flex-direction: column; align-items: center; }
  .nav-item span:not(.badge) { display: none; }
}

/* ---------- móvil: header colapsado a hamburguesa, rueda a todo lo ancho ---------- */
@media (max-width: 700px) {
  .topbar { justify-content: flex-start; padding: 8px 10px; }
  .hamburger-btn { display: flex; }
  .logo { flex: 1; justify-content: center; }
  .topnav,
  .icon-only,
  .my-wheels-btn { display: none; }

  .layout { gap: 18px; padding: 12px 8px; }
  .wheel-wrapper { width: min(96vw, 460px); height: min(96vw, 460px); }
  .panel { width: 100%; max-width: 100%; }
  .panel-tabs { min-width: 0; }
}
