/* ============================================================
   OLIMPO DORADO — Barra de menú superior (mármol + oro)
   ------------------------------------------------------------
   Gráficos generados con estudio a partir del marco oficial
   (public/olimpodorado/ui/*.webp). La barra se construye en 5 piezas
   (capitel izq · tramo repetible · ornamento central · tramo · capitel
   der) para estirarse a cualquier anchura sin deformar los detalles.
   La altura reservada se publica en --od-bar-h, que fullscreen-bg.css
   usa para desplazar el escenario del juego (nada queda tapado).
   ============================================================ */

:root {
  --od-bar-h: 64px;                 /* alto visible del cuerpo de la barra */
  /* El sprite mide 160px de alto; el cuerpo de mármol ocupa las filas
     14..136 (122px). Escalamos para que el cuerpo = --od-bar-h. */
  --od-bar-img-h: calc(var(--od-bar-h) * 160 / 122);
  --od-bar-img-top: calc(var(--od-bar-h) * -14 / 122);
  --od-bar-btn: 44px;
  --od-gold: #ffd56a;
  --od-gold-dark: #b8860b;
  --od-plum: #2a1446;
}

#od-menubar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--od-bar-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* los grupos empiezan tras los capiteles (104/160 del alto del sprite) */
  padding: 0 calc(var(--od-bar-img-h) * 104 / 160 + 6px);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--od-gold);
  user-select: none;
  -webkit-user-select: none;
  /* sombra sobre el juego para separar planos */
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
}

/* ---------- Fondo de la barra (5 piezas) ---------- */
#od-menubar-skin {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--od-bar-img-top);
  height: var(--od-bar-img-h);
  display: flex;
  pointer-events: none;
  z-index: 0;
}
#od-menubar-skin > span {
  display: block;
  height: 100%;
  background-repeat: no-repeat;
  background-size: auto 100%;
}
#od-menubar-skin .od-cap-l   { width: calc(var(--od-bar-img-h) * 104 / 160); background-image: url("./ui/bar_cap_left.webp"); }
#od-menubar-skin .od-cap-r   { width: calc(var(--od-bar-img-h) * 104 / 160); background-image: url("./ui/bar_cap_right.webp"); }
#od-menubar-skin .od-center  { width: calc(var(--od-bar-img-h) * 219 / 160); background-image: url("./ui/bar_center.webp"); }
#od-menubar-skin .od-tile {
  flex: 1 1 0;
  min-width: 0;
  background-image: url("./ui/bar_tile.webp");
  background-repeat: repeat-x;
  background-size: auto 100%;
  /* El tramo repetible se corta ~2px en los extremos para evitar el
     filete claro del borde del recorte. */
  margin: 0 -2px;
}
#od-menubar-skin .od-tile.od-tile-r { background-position: right center; }

/* ---------- Contenido ---------- */
.od-group {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(6px, .8vw, 12px);
}

/* Botones redondos (medallones) */
.od-btn {
  position: relative;
  width: var(--od-bar-btn);
  height: var(--od-bar-btn);
  padding: 0;
  border: 0;
  background: transparent center / 100% 100% no-repeat;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}
.od-btn:hover  { filter: brightness(1.22) drop-shadow(0 0 8px rgba(255, 213, 106, .55)); }
.od-btn:active { transform: scale(.9); }
.od-btn:focus-visible { outline: 2px solid var(--od-gold); outline-offset: 2px; border-radius: 50%; }
.od-btn[data-state="off"] { filter: grayscale(.85) brightness(.65); }
.od-btn[data-state="off"]:hover { filter: grayscale(.4) brightness(.9); }
.od-btn[data-state="on"]  { filter: brightness(1.15) drop-shadow(0 0 10px rgba(255, 215, 0, .8)); }

.od-btn-home       { background-image: url("./ui/btn_home.webp"); }
.od-btn-balance    { background-image: url("./ui/btn_balance.webp"); }
.od-btn-info       { background-image: url("./ui/btn_info.webp"); }
.od-btn-sound      { background-image: url("./ui/btn_sound.webp"); }
.od-btn-settings   { background-image: url("./ui/btn_settings.webp"); }
.od-btn-fullscreen { background-image: url("./ui/btn_fullscreen.webp"); }
.od-btn-turbo      { background-image: url("./ui/btn_bolt.webp"); }

/* Tooltip simple */
.od-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff3c4;
  background: rgba(20, 8, 40, .92);
  border: 1px solid rgba(212, 160, 23, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.od-btn[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Placas (mármol púrpura con marco dorado): etiqueta arriba, valor abajo.
   9-slice con border-image: el marco dorado conserva su grosor real aunque
   la placa sea baja, y el contenido tiene un padding interior constante. */
.od-plaque {
  position: relative;
  height: calc(var(--od-bar-btn) + 4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 9px solid transparent;
  border-image: url("./ui/plaque_wide.webp") 9 9 9 9 fill stretch;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}
.od-plaque-balance { min-width: 176px; }
.od-plaque-sm      { min-width: 126px; border-image-source: url("./ui/plaque_small.webp"); border-image-slice: 10 fill; border-width: 10px; }
.od-plaque-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #c9a7ff;
  opacity: .9;
}
.od-plaque-value {
  font-family: ui-monospace, "SF Mono", Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 800;
  color: #ffe9a0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 10px rgba(255, 215, 0, .25);
}
.od-plaque-balance .od-plaque-value { font-size: 16px; }
.od-plaque-value.od-win-positive { color: #ffd700; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 14px rgba(255, 215, 0, .7); }
#od-win-value:not(.od-win-positive) { color: #b9a3d9; opacity: .8; }
.od-plaque-value.od-flash { animation: od-flash .6s ease; }
@keyframes od-flash {
  0%   { color: #fff; text-shadow: 0 0 14px #ffd700; }
  100% { color: #ffe9a0; }
}

/* Reloj + chip demo */
.od-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #efdcae;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
  min-width: 46px;
}
.od-chip {
  font-size: 8px;
  letter-spacing: 1.4px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #1a0a30;
  background: linear-gradient(180deg, #ffe9a0, #d4a017);
  box-shadow: 0 0 6px rgba(255, 215, 0, .5);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --od-bar-h: 54px; --od-bar-btn: 38px; }
  .od-plaque-sm { display: none; }
  .od-plaque-balance { min-width: 130px; padding: 0 10px; }
  .od-plaque-balance .od-plaque-value { font-size: 14px; }
  .od-meta { display: none; }
}
@media (max-width: 560px) {
  :root { --od-bar-h: 48px; --od-bar-btn: 34px; }
  #od-menubar-skin .od-center { display: none; }
  .od-btn-balance, .od-plaque { display: none; }
  .od-group { gap: 5px; }
}
/* Pantallas muy bajas en horizontal (móvil landscape): barra compacta */
@media (max-height: 420px) {
  :root { --od-bar-h: 44px; --od-bar-btn: 32px; }
  .od-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .od-btn, .od-btn::after, .od-plaque-value { transition: none; animation: none; }
}
