/* Trap Fighter Brasil — intro Gueto/TFB e menus de Opcoes, Controles e Creditos.
   Paleta tirada da logo e do menu de modos: ouro, roxo, verde e ciano. */
:root {
  --tfbx-ink: #07060d;
  --tfbx-panel: rgba(13, 10, 26, 0.96);
  --tfbx-cell: #15112a;
  --tfbx-cell-hi: #241a3f;
  --tfbx-gold: #e8b347;
  --tfbx-gold-dim: #7a5a22;
  --tfbx-purple: #7b2cff;
  --tfbx-purple-dim: #3b2a66;
  --tfbx-green: #3ddc57;
  --tfbx-cyan: #2fe0ff;
}

/* ---------------- Intro ---------------- */
#tfb-intro {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}
#tfb-intro.is-leaving { opacity: 0; pointer-events: none; }
#tfb-intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tfbx-intro-ui { position: absolute; inset: 0; pointer-events: none; }
.tfbx-intro-load {
  position: absolute;
  left: 50%;
  bottom: max(7vh, 28px);
  width: min(420px, 70vw);
  transform: translate(-50%, calc((1 - var(--tfbx-load-in, 0)) * 10px));
  opacity: var(--tfbx-load-in, 0);
  display: grid;
  gap: 10px;
  justify-items: center;
}
.tfbx-intro-bar {
  width: 100%;
  height: 12px;
  padding: 2px;
  border: 2px solid var(--tfbx-gold);
  background: var(--tfbx-ink);
  box-shadow: 0 0 0 2px var(--tfbx-ink), 0 0 18px rgba(232, 179, 71, 0.25);
}
.tfbx-intro-bar > i {
  display: block;
  height: 100%;
  transform-origin: left center;
  background: repeating-linear-gradient(90deg, var(--tfbx-gold) 0 10px, #ffd76a 10px 12px);
  transition: transform 0.18s linear;
}
.tfbx-intro-skip {
  position: absolute;
  right: max(3vw, 16px);
  top: max(3vh, 14px);
  opacity: calc(var(--tfbx-skip-in, 0) * 0.75);
  transition: opacity 0.4s ease;
  animation: tfbx-blink 1.4s steps(2, end) infinite;
}
@media (max-width: 640px) {
  .tfbx-intro-skip { left: 16px; right: 16px; display: flex; justify-content: center; }
}

/* ---------------- Paineis ---------------- */
.tfbx-host { position: absolute; inset: 0; z-index: 60; display: none; }
.tfbx-host.is-open { display: grid; place-items: center; }
.tfbx-backdrop {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 45%, rgba(40, 18, 70, 0.55), rgba(3, 2, 8, 0.9) 70%);
}
.tfbx-backdrop.is-open { animation: tfbx-fade 0.18s ease-out both; }
.tfbx-panel {
  position: relative;
  width: min(calc(700px * var(--tfb-ui-scale, 1) + 80px), calc(100% - 32px));
  grid-template-columns: minmax(0, 1fr);
  max-height: calc(100% - 32px);
  overflow: auto;
  display: grid;
  gap: calc(14px * var(--tfb-ui-scale, 1));
  padding: calc(22px * var(--tfb-ui-scale, 1)) calc(30px * var(--tfb-ui-scale, 1)) calc(16px * var(--tfb-ui-scale, 1));
  background:
    linear-gradient(180deg, rgba(123, 44, 255, 0.10), transparent 30%),
    var(--tfbx-panel);
  border: 2px solid var(--tfbx-gold);
  box-shadow:
    0 0 0 4px var(--tfbx-ink),
    0 0 0 6px var(--tfbx-purple-dim),
    0 0 48px rgba(123, 44, 255, 0.35),
    inset 0 0 0 1px var(--tfbx-gold-dim);
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--tfbx-gold-dim) transparent;
}
/* Cantos em L, como as molduras de selecao do jogo. */
.tfbx-panel::before,
.tfbx-panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid var(--tfbx-cyan);
  pointer-events: none;
}
.tfbx-panel::before { top: 5px; left: 5px; border-right: 0; border-bottom: 0; }
.tfbx-panel::after { bottom: 5px; right: 5px; border-left: 0; border-top: 0; }
.tfbx-panel.is-open { animation: tfbx-pop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.tfbx-panel.is-swap { animation: tfbx-swap 0.16s ease-out both; }
.tfbx-head {
  display: flex;
  justify-content: center;
  padding-bottom: calc(14px * var(--tfb-ui-scale, 1));
  border-bottom: 2px solid var(--tfbx-purple-dim);
  background: linear-gradient(90deg, transparent, rgba(232, 179, 71, 0.10), transparent) bottom / 100% 2px no-repeat;
}
.tfbx-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(14px * var(--tfb-ui-scale, 1)); }
.tfbx-body > *, .tfbx-sheet > * { min-width: 0; }
.tfbx-note { overflow: hidden; }
.tfbx-list { display: grid; gap: calc(6px * var(--tfb-ui-scale, 1)); }
.tfbx-list.is-inline { grid-auto-flow: column; justify-content: center; }

.tfbx-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: calc(48px * var(--tfb-ui-scale, 1));
  padding: calc(6px * var(--tfb-ui-scale, 1)) calc(16px * var(--tfb-ui-scale, 1));
  background: var(--tfbx-cell);
  border: 2px solid var(--tfbx-purple-dim);
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  transition: border-color 0.12s, background-color 0.12s, transform 0.12s;
}
.tfbx-list.is-inline .tfbx-item { min-width: calc(200px * var(--tfb-ui-scale, 1)); min-height: calc(40px * var(--tfb-ui-scale, 1)); justify-content: center; }
.tfbx-item.is-selected {
  background: var(--tfbx-cell-hi);
  border-color: var(--tfbx-gold);
  box-shadow: 0 0 0 2px var(--tfbx-ink), 0 0 22px rgba(232, 179, 71, 0.28), inset 4px 0 0 var(--tfbx-gold);
}
/* Brilho passando no item selecionado. */
.tfbx-item.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 215, 106, 0.14) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: tfbx-shine 1.8s ease-in-out infinite;
  pointer-events: none;
}
.tfbx-item:active { transform: translateY(1px); }
.tfbx-item:focus-visible { border-color: var(--tfbx-cyan); }
.tfbx-item-name { display: flex; align-items: center; }
.tfbx-item-arrow { opacity: 0; transform: translateX(-6px); transition: 0.15s; }
.tfbx-item.is-selected .tfbx-item-arrow { opacity: 1; transform: none; animation: tfbx-nudge 0.9s ease-in-out infinite; }
.tfbx-item-value { display: flex; align-items: center; gap: calc(12px * var(--tfb-ui-scale, 1)); }
.tfbx-item-value > i {
  display: grid;
  place-items: center;
  width: calc(30px * var(--tfb-ui-scale, 1));
  height: calc(30px * var(--tfb-ui-scale, 1));
  border: 1px solid var(--tfbx-purple-dim);
  background: var(--tfbx-ink);
}
.tfbx-item.is-selected .tfbx-item-value > i { border-color: var(--tfbx-gold-dim); }
.tfbx-item-value > i:hover { border-color: var(--tfbx-gold); }
.tfbx-choice { min-width: calc(120px * var(--tfb-ui-scale, 1)); justify-content: center; }
.tfbx-volume { display: flex; align-items: center; gap: calc(12px * var(--tfb-ui-scale, 1)); }
.tfbx-volume > .tfb-bitmap-text { min-width: calc(54px * var(--tfb-ui-scale, 1)); justify-content: flex-end; }
.tfbx-meter { display: flex; gap: 3px; align-items: flex-end; }
.tfbx-meter > b {
  width: calc(9px * var(--tfb-ui-scale, 1) + 2px);
  height: calc(8px + var(--h, 0px) * var(--tfb-ui-scale, 1));
  background: #241d3c;
  box-shadow: inset 0 0 0 1px #34295a;
}
.tfbx-meter > b.on { background: var(--tfbx-green); box-shadow: 0 0 8px rgba(61, 220, 87, 0.5); }
.tfbx-meter > b.on:nth-child(n + 7) { background: var(--tfbx-gold); box-shadow: 0 0 8px rgba(232, 179, 71, 0.5); }
.tfbx-meter > b.on:nth-child(n + 9) { background: #ff4d3d; box-shadow: 0 0 8px rgba(255, 77, 61, 0.5); }
.tfbx-meter > b:nth-child(1) { --h: 0px; } .tfbx-meter > b:nth-child(2) { --h: 2px; }
.tfbx-meter > b:nth-child(3) { --h: 4px; } .tfbx-meter > b:nth-child(4) { --h: 6px; }
.tfbx-meter > b:nth-child(5) { --h: 8px; } .tfbx-meter > b:nth-child(6) { --h: 10px; }
.tfbx-meter > b:nth-child(7) { --h: 12px; } .tfbx-meter > b:nth-child(8) { --h: 14px; }
.tfbx-meter > b:nth-child(9) { --h: 16px; } .tfbx-meter > b:nth-child(10) { --h: 18px; }

.tfbx-note { margin: 0; min-height: calc(22px * var(--tfb-ui-scale, 1)); display: flex; justify-content: center; }
.tfbx-help {
  display: flex;
  justify-content: center;
  padding-top: calc(12px * var(--tfb-ui-scale, 1));
  border-top: 1px solid var(--tfbx-purple-dim);
  opacity: 0.85;
  overflow: hidden;
}

/* Controles */
.tfbx-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tfbx-tabs > button {
  padding: calc(10px * var(--tfb-ui-scale, 1)) 6px;
  background: var(--tfbx-ink);
  border: 2px solid var(--tfbx-purple-dim);
  border-bottom-width: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
}
.tfbx-tabs > button.is-active { border-color: var(--tfbx-gold); background: var(--tfbx-cell-hi); }
.tfbx-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(14px * var(--tfb-ui-scale, 1));
  padding: calc(16px * var(--tfb-ui-scale, 1));
  background: rgba(7, 6, 13, 0.7);
  border: 1px solid var(--tfbx-purple-dim);
}
.tfbx-move { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tfbx-caps { display: flex; gap: 6px; flex-wrap: wrap; }
.tfbx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px calc(28px * var(--tfb-ui-scale, 1)); }
.tfbx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(123, 44, 255, 0.35);
}
.tfbx-panel kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(40px * var(--tfb-ui-scale, 1) + 8px);
  padding: calc(6px * var(--tfb-ui-scale, 1)) calc(8px * var(--tfb-ui-scale, 1));
  background: linear-gradient(#2a2148, #191331);
  border: 2px solid #4e3d86;
  border-bottom-width: 4px;
  font: inherit;
}
.tfbx-panel kbd.is-plain { background: none; border-color: transparent; min-width: 0; }

/* Creditos */
.tfbx-credits { display: grid; justify-items: center; gap: calc(12px * var(--tfb-ui-scale, 1)); padding: 6px 0 4px; }
.tfbx-gueto-logo { width: min(420px, 80%); height: auto; filter: drop-shadow(0 0 14px rgba(255, 10, 16, 0.35)); margin-bottom: 4px; }

/* Se a fonte bitmap falhar, o texto continua legivel. */
.tfbx-text-fallback {
  font: 700 var(--tfbx-fallback-size, 16px) / 1.2 "Courier New", monospace;
  letter-spacing: 0.08em;
  color: #f1e6c8;
}
.tfbx-text-fallback.tfbx-text-selected, .tfbx-text-fallback.tfbx-text-title { color: var(--tfbx-gold); }
.tfbx-text-fallback.tfbx-text-muted { color: #9a8fb8; }
.tfbx-text-fallback.tfbx-text-success { color: var(--tfbx-green); }
.tfbx-text-fallback.tfbx-text-danger { color: #ff4d3d; }

@media (max-width: 700px) {
  .tfbx-grid { grid-template-columns: 1fr; }
  .tfbx-panel { padding: 18px 16px 14px; }
  .tfbx-list.is-inline { grid-auto-flow: row; }
  .tfbx-list.is-inline .tfbx-item { min-width: 0; }
  .tfbx-item { min-height: 40px; }
  .tfbx-item-value > i { width: 30px; height: 30px; }
}

@keyframes tfbx-pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tfbx-swap { from { opacity: 0.4; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes tfbx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tfbx-shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes tfbx-nudge { 0%, 100% { transform: none; } 50% { transform: translateX(4px); } }
@keyframes tfbx-blink { 50% { opacity: 0.2; } }

@media (prefers-reduced-motion: reduce) {
  .tfbx-panel, .tfbx-backdrop, .tfbx-sheet { animation: none; }
  .tfbx-item.is-selected::after, .tfbx-item.is-selected .tfbx-item-arrow, .tfbx-intro-skip { animation: none; }
}

.pack-logo{aspect-ratio:980/650;height:auto!important;background-size:400% 100%}
@media (max-aspect-ratio:3/4){.pack-logo-start{left:6%!important;width:88%!important}}
