/* ==========================================================
   CONCEPT RUN — Estilos
   Tudo fica dentro de #concept-run para facilitar a incorporação no site.
   Os tamanhos usam cqw (largura do palco) para escalar com o jogo.
   ========================================================== */
:root {
  --cr-black: #0b0b0d;
  --cr-ink: #141417;
  --cr-white: #f4f4f4;
  --cr-red: #d7262e;
  --cr-red-bright: #ff3b44;
  --cr-red-dark: #8f1419;
  --cr-gray: #8a8a92;
  --cr-gray-light: #bdbdc4;
  --cr-font: 'Press Start 2P', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cr-black);
  color: var(--cr-white);
}

body { overflow: hidden; }

.cr-root {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-family: var(--cr-font);
  background:
    radial-gradient(ellipse at 50% 40%, #1a1418 0%, var(--cr-black) 70%);
}

.cr-stage {
  position: relative;
  width: min(100%, calc((100vh - 16px) * 16 / 9));
  width: min(100%, calc((100dvh - 16px) * 16 / 9));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 0 2px #26262c, 0 0 0 6px #000, 0 18px 50px rgba(0, 0, 0, .7);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#cr-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}

.hidden { display: none !important; }

/* ---------- Telas ---------- */
.cr-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6cqw;
  padding: 2cqw;
  text-align: center;
  font-size: max(7px, 1.45cqw);
  line-height: 1.6;
  background: rgba(8, 8, 10, .66);
  overflow: auto;
}

.cr-screen-menu {
  background: linear-gradient(180deg, rgba(8, 8, 10, .82) 0%, rgba(8, 8, 10, .45) 60%, rgba(8, 8, 10, .2) 100%);
  justify-content: flex-start;
  padding-top: 4.5cqw;
}

.cr-logo { display: flex; flex-direction: column; align-items: center; gap: 1.2cqw; }

.cr-logo-title {
  margin: 0;
  font-size: max(18px, 6.4cqw);
  font-weight: normal;
  line-height: 1;
  letter-spacing: .1em;
  color: var(--cr-white);
  text-shadow: .5cqw .5cqw 0 #000, 0 0 2cqw rgba(215, 38, 46, .35);
}
.cr-logo-title span { color: var(--cr-red); }

/* faixa preta com ponteira vermelha e 4 graus */
.cr-logo-belt {
  position: relative;
  width: 44cqw;
  height: 1.6cqw;
  background: #1c1c20;
  box-shadow: 0 0 0 .3cqw #000, inset 0 -.4cqw 0 rgba(0, 0, 0, .4);
}
.cr-logo-belt::after {
  content: '';
  position: absolute;
  right: 4cqw;
  top: 0;
  width: 9cqw;
  height: 100%;
  background: var(--cr-red);
}
.cr-logo-belt i {
  position: absolute;
  top: 0;
  z-index: 1;
  width: .8cqw;
  height: 100%;
  background: var(--cr-white);
}
.cr-logo-belt i:nth-child(1) { right: 5cqw; }
.cr-logo-belt i:nth-child(2) { right: 7cqw; }
.cr-logo-belt i:nth-child(3) { right: 9cqw; }
.cr-logo-belt i:nth-child(4) { right: 11cqw; }

.cr-logo-sub {
  margin: 0;
  font-size: max(8px, 1.8cqw);
  letter-spacing: .35em;
  color: var(--cr-gray-light);
}

.cr-tagline {
  margin: 0;
  font-size: max(7px, 1.4cqw);
  color: var(--cr-white);
}

.cr-best {
  margin: 0;
  font-size: max(7px, 1.2cqw);
  color: var(--cr-gray);
}
.cr-best span { color: var(--cr-white); }

.cr-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4cqw;
}

/* ---------- Botões ---------- */
.cr-btn {
  font-family: inherit;
  font-size: max(7px, 1.35cqw);
  line-height: 1.2;
  color: var(--cr-white);
  background: #1a1a1f;
  border: none;
  border-radius: 0;
  padding: 1.1cqw 1.8cqw;
  cursor: pointer;
  box-shadow: inset 0 0 0 max(2px, .3cqw) var(--cr-white), max(3px, .45cqw) max(3px, .45cqw) 0 #000;
  transition: transform .06s steps(1);
}
.cr-btn:hover,
.cr-btn:focus-visible {
  outline: none;
  background: #2a2a31;
  transform: translate(-1px, -1px);
  box-shadow: inset 0 0 0 max(2px, .3cqw) var(--cr-red-bright), max(4px, .55cqw) max(4px, .55cqw) 0 #000;
}
.cr-btn:active {
  transform: translate(max(2px, .3cqw), max(2px, .3cqw));
  box-shadow: inset 0 0 0 max(2px, .3cqw) var(--cr-white);
}

.cr-btn-primary {
  font-size: max(11px, 2.8cqw);
  padding: 1.6cqw 5cqw;
  background: var(--cr-red);
  box-shadow: inset 0 0 0 max(2px, .35cqw) var(--cr-white), max(4px, .6cqw) max(4px, .6cqw) 0 #000;
  animation: cr-pulse 1.4s steps(2) infinite;
}
.cr-btn-primary:hover,
.cr-btn-primary:focus-visible {
  background: #ec3540;
  box-shadow: inset 0 0 0 max(2px, .35cqw) var(--cr-white), max(5px, .7cqw) max(5px, .7cqw) 0 #000;
}
.cr-btn-sm { font-size: max(8px, 1.6cqw); padding: 1.2cqw 2.6cqw; }

@keyframes cr-pulse {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.15); }
}

/* ---------- Painéis ---------- */
.cr-panel {
  width: 100%;
  max-width: 66cqw;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4cqw;
  padding: 2.4cqw 3cqw;
  background: rgba(14, 14, 17, .95);
  box-shadow: inset 0 0 0 max(2px, .35cqw) var(--cr-white), 0 0 0 max(2px, .35cqw) #000, 1cqw 1cqw 0 rgba(0, 0, 0, .5);
}
.cr-panel-sm { max-width: 40cqw; }

.cr-panel h2 {
  margin: 0;
  font-size: max(10px, 2.4cqw);
  font-weight: normal;
  letter-spacing: .08em;
}
.cr-red { color: var(--cr-red-bright); }
.cr-muted { color: var(--cr-gray); }

.cr-text { margin: 0; max-width: 52cqw; }

.cr-keys { display: flex; flex-direction: column; gap: 1cqw; }
.cr-key-row { display: flex; align-items: center; justify-content: center; gap: 1cqw; }
.cr-key-row b { font-weight: normal; color: var(--cr-red-bright); margin-left: 1cqw; }
.cr-kbd {
  display: inline-block;
  padding: .6cqw 1cqw;
  background: var(--cr-white);
  color: #000;
  box-shadow: 0 .4cqw 0 var(--cr-gray);
}
.cr-keys-touch { display: none; }
.cr-is-touch .cr-keys-touch { display: flex; }
.cr-is-touch .cr-keys-desktop { display: none; }

.cr-list {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .6cqw;
}
.cr-list li::before { content: '▸ '; color: var(--cr-red); }

.cr-grau-icon {
  display: inline-block;
  width: 3cqw;
  height: 1.2cqw;
  vertical-align: middle;
  background: linear-gradient(90deg, #151517 0 25%, var(--cr-white) 25% 42%, #151517 42%);
  box-shadow: 0 0 0 max(1px, .2cqw) var(--cr-red);
}

/* ---------- Fim de treino ---------- */
.cr-record {
  margin: 0;
  color: var(--cr-red-bright);
  animation: cr-blink .5s steps(2) infinite;
}
@keyframes cr-blink { 50% { color: var(--cr-white); } }

.cr-stats {
  margin: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.2cqw 2cqw;
}
.cr-stats dt { color: var(--cr-gray); font-size: .8em; }
.cr-stats dd { margin: .3cqw 0 0; font-size: 1.15em; }
.cr-stats .cr-stat-score dd { color: var(--cr-red-bright); }

.cr-save { display: flex; gap: 1cqw; align-items: stretch; }
.cr-input {
  font-family: inherit;
  font-size: max(8px, 1.4cqw);
  width: 22cqw;
  padding: 1cqw;
  color: var(--cr-white);
  background: #000;
  border: none;
  border-radius: 0;
  box-shadow: inset 0 0 0 max(2px, .3cqw) var(--cr-gray);
  text-transform: uppercase;
}
.cr-input:focus { outline: none; box-shadow: inset 0 0 0 max(2px, .3cqw) var(--cr-red-bright); }
.cr-saved { margin: 0; color: var(--cr-red-bright); }

/* ---------- Ranking ---------- */
.cr-ranking {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  max-width: 46cqw;
  display: flex;
  flex-direction: column;
  gap: .5cqw;
}
.cr-ranking li {
  display: grid;
  grid-template-columns: 3.5em 3.4cqw 1fr auto;
  align-items: center;
  gap: 1cqw;
  padding: .4cqw .8cqw;
  text-align: left;
}
.cr-ranking li:nth-child(odd) { background: rgba(255, 255, 255, .05); }
.cr-ranking li:first-child .cr-rank-score { color: var(--cr-red-bright); }
.cr-rank-pos { color: var(--cr-gray); }
.cr-rank-belt {
  height: 1cqw;
  background: linear-gradient(90deg, var(--belt) 0 55%, var(--bar) 55% 85%, var(--belt) 85%);
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #444;
}
.cr-rank-empty { display: block !important; text-align: center !important; color: var(--cr-gray); }

/* ---------- Botões flutuantes do HUD ---------- */
.cr-hud-btns {
  position: absolute;
  right: 1.2cqw;
  bottom: 1.2cqw;
  z-index: 5;
  display: flex;
  gap: .8cqw;
}
.cr-icon-btn {
  position: relative;
  width: max(26px, 3.8cqw);
  height: max(26px, 3.8cqw);
  padding: 0;
  font-family: inherit;
  font-size: max(8px, 1.3cqw);
  color: var(--cr-white);
  background: rgba(0, 0, 0, .55);
  border: none;
  border-radius: 0;
  box-shadow: inset 0 0 0 2px rgba(244, 244, 244, .7);
  cursor: pointer;
}
.cr-icon-btn:hover, .cr-icon-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--cr-red-bright); }
.cr-icon-btn.is-off { color: var(--cr-gray); }
.cr-icon-btn.is-off::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  top: 50%;
  height: 2px;
  background: var(--cr-red-bright);
  transform: rotate(-45deg);
}

/* ---------- Celular em pé ---------- */
.cr-rotate { display: none; }
@media (orientation: portrait) and (max-width: 760px) {
  .cr-rotate {
    display: block;
    margin: 14px 0 0;
    font-size: 9px;
    line-height: 1.8;
    color: var(--cr-gray);
    text-align: center;
  }
}
