@layer game, base, scoreboard, hotdog, start-button;
@layer base {
  /*
  body ::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
  }

  body {
    -ms-overflow-style: none;
    overflow: hidden;
    background: #ddeef8;
    font-family: sans-serif;
  }

  html {
    scrollbar-width: none;
  }
*/
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  html,
  body {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100vh;
    position: relative;
  }
}
body {
  background-color: #001030;
}
@layer game {
  #gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
  }
  #hud {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #1a3a5c;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    line-height: 1.7;
  }
  #hud #highScoreDisplay {
    color: #cc8800;
  }
  #hud #levelDisplay {
    color: #1a6aaa;
    font-weight: 700;
    font-size: 15px;
  }
  #lives {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    pointer-events: none;
    letter-spacing: 4px;
  }
  #controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
  }
  #controls button {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #aac;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #1a3a5c;
    font-family: sans-serif;
  }
  #levelBanner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #1a3a5c, #1a6aaa);
    color: white;
    padding: 20px 40px;
    border-radius: 16px;
    text-align: center;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  #levelBanner.show {
    transform: translate(-50%, -50%) scale(1);
  }
  #levelBanner h3 {
    font-size: 22px;
    margin-bottom: 4px;
  }
  #levelBanner p {
    font-size: 14px;
    opacity: 0.85;
  }
  #progressBar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    pointer-events: none;
  }
  #progressBar .label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #1a3a5c;
    margin-bottom: 4px;
    font-weight: 500;
  }
  #progressBar .track {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    border: 1px solid #aac;
  }
  #progressBar .fill {
    height: 100%;
    background: linear-gradient(90deg, #1a6aaa, #44aaff);
    border-radius: 8px;
    transition: width 0.2s;
  }
  #overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(200, 230, 245, 0.95);
    color: #1a3a5c;
    text-align: center;
    overflow-y: auto;
    padding: 20px;
  }
  #overlay h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  #overlay .sub {
    font-size: 14px;
    color: #3a6a8c;
    margin-bottom: 4px;
  }
  #overlay .highscore-banner {
    font-size: 13px;
    color: #cc8800;
    font-weight: 600;
    margin-bottom: 14px;
    min-height: 18px;
  }
  #overlay p.tip {
    font-size: 13px;
    color: #3a6a8c;
    margin-bottom: 10px;
  }
  #levelList {
    font-size: 11px;
    color: #5a8aac;
    margin-bottom: 12px;
    max-width: 480px;
    line-height: 1.6;
  }
  .gender-select {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #1a3a5c;
    font-weight: 500;
  }
  .gender-select label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
  }
  .gender-select input {
    cursor: pointer;
    accent-color: #1a6aaa;
  }
}
h2 {
  margin: 0;
  text-indent: -10000px;
  width: 100%;
  max-width: 2146px;
  max-height: 733px;
  aspect-ratio: 2146/733;
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(0deg, #001030 0%, #001030 3%, rgba(0, 16, 48, 0) 15%, rgba(0, 16, 48, 0) 100%), url(images/timber-valley.png);
  background-repeat: no-repeat;
  background-size: 100%;
}
#gameContainer {
  overflow: hidden;
}
#overlay {
  background: #001030;
  padding: 20px !important;
  width: 100vw;
  height: 100vh;
}
#overlay > div {
  z-index: 100;
}
#overlay p {
  font-family: "VT323", serif !important;
  font-size: 1rem !important;
}
:root {
  --glow-color: rgba(186, 11, 202, 0.5);
  --arcade-font: "PressStart2P-Regular", "Press Start 2P", monospace;
}
.char-grid {
  --n: 7;
  --v-w: min(calc(100vw - 40px), 900px);
  --col: calc(var(--v-w) / var(--n));
  --ring: clamp(2px, calc(var(--col) * 0.035), 5px);
  display: grid;
  grid-template-columns: repeat(var(--n), var(--col));
  grid-template-rows: repeat(4, calc(var(--col) * 0.5));
  width: var(--v-w);
  max-width: none;
  gap: 0;
  margin: 1.5em 0 0.5em;
  padding-bottom: calc(var(--col) * 0.45);
  position: relative;
  z-index: 100;
}
@media (max-width: 1023px) {
  .char-grid {
    --n: 5;
    --v-w: min(calc(100vw - 40px), 640px);
    grid-template-rows: repeat(3, calc(var(--col) * 0.5));
  }
  .char-grid .char-card:nth-child(3),
  .char-grid .char-card:nth-child(7) {
    display: none;
  }
  .char-grid .char-card:nth-child(1) {
    grid-area: 1 / 1;
  }
  .char-grid .char-card:nth-child(2) {
    grid-area: 2 / 2;
  }
  .char-grid .char-card:nth-child(4) {
    grid-area: 3 / 3;
  }
  .char-grid .char-card:nth-child(5) {
    grid-area: 2 / 4;
  }
  .char-grid .char-card:nth-child(6) {
    grid-area: 1 / 5;
  }
  .char-grid .char-caption {
    grid-area: 1 / 2 / 2 / 5;
  }
}
@media (max-width: 599px) {
  .char-grid {
    --n: 3;
    --v-w: min(calc(100vw - 40px), 360px);
    grid-template-rows: repeat(2, calc(var(--col) * 0.5));
    padding-bottom: 0;
  }
  .char-grid .char-card:nth-child(2),
  .char-grid .char-card:nth-child(6) {
    display: none;
  }
  .char-grid .char-card:nth-child(1) {
    grid-area: 1 / 1;
  }
  .char-grid .char-card:nth-child(4) {
    grid-area: 2 / 2;
  }
  .char-grid .char-card:nth-child(5) {
    grid-area: 1 / 3;
  }
  .char-grid .char-caption {
    grid-area: 3 / 1 / 4 / 4;
    margin-top: calc(var(--col) * 0.55);
  }
}
.char-card {
  position: relative;
  justify-self: center;
  width: calc(var(--col) * 0.86);
  aspect-ratio: 1;
  padding: 0;
  border: var(--ring) solid #fff;
  border-radius: 50%;
  background: #0a1a40;
  overflow: clip;
  cursor: pointer;
  opacity: 0;
  animation: charDrop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0ms) forwards;
  transition: scale 400ms ease, filter 400ms ease;
}
.char-card .char-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}
.char-card:focus-visible {
  outline: 3px dashed #fff;
  outline-offset: 4px;
}
.char-card:nth-child(1) {
  grid-area: 1 / 1;
}
.char-card:nth-child(2) {
  grid-area: 2 / 2;
}
.char-card:nth-child(3) {
  grid-area: 3 / 3;
}
.char-card:nth-child(4) {
  grid-area: 4 / 4;
}
.char-card:nth-child(5) {
  grid-area: 3 / 5;
}
.char-card:nth-child(6) {
  grid-area: 2 / 6;
}
.char-card:nth-child(7) {
  grid-area: 1 / 7;
}
@media (hover: hover) {
  .char-card:hover {
    scale: 1.5;
    z-index: 3;
  }
  .char-card.button:hover {
    scale: 1.2;
  }
}
@media (hover: hover) {
  .char-grid:has(.char-card:not(.button):hover) .char-card:not(:hover) {
    filter: blur(1px) brightness(0.75);
    scale: 0.85;
  }
}
.char-card.selected {
  z-index: 2;
  box-shadow: 0 0 2px #fff, 0 0 5px #fff, 0 0 10px var(--glow-color), 0 0 15px var(--glow-color), 0 0 20px var(--glow-color), 0 0 25px var(--glow-color);
  animation: charDrop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0ms) forwards, charBlink 0.7s ease-in-out infinite alternate;
}
.char-caption {
  grid-area: 1 / 3 / 3 / 6;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  text-align: center;
  z-index: 1;
}
.char-caption .cap-title {
  font-family: var(--arcade-font);
  font-size: clamp(8px, calc(var(--col) * 0.11), 15px);
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 0 8px var(--glow-color);
}
.char-caption .cap-title .nowrap {
  white-space: nowrap;
}
.char-caption .gender-select {
  white-space: nowrap;
  justify-content: center;
  gap: 1.4em;
  margin: 0;
  font-family: "VT323-Regular", "VT323", monospace;
  font-size: clamp(18px, calc(var(--col) * 0.17), 26px);
  color: #b8cbe8;
}
.char-caption .gender-select label {
  cursor: pointer;
  gap: 0.35em;
}
.char-caption .gender-select label:has(input:checked) {
  color: #fff;
}
.char-caption .gender-select input {
  width: 1em;
  height: 1em;
  margin: 0;
}
.start-game {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 16px 28px;
  border: none;
  border-radius: 100vw;
  background-color: #ccc;
  box-shadow: 0 -2px 0 3px #bbb inset, 0 5px 5px rgba(0, 0, 0, 0.17), 0 15px rgba(255, 255, 255, 0.32) inset;
  color: #333;
  font-family: var(--arcade-font);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.start-game:hover,
.start-game:focus-visible {
  background-color: #0ec518;
  box-shadow: 0 -2px 0 3px #0b9512 inset, 0 5px 5px rgba(0, 7, 1, 0.17), 0 15px rgba(255, 255, 255, 0.25) inset;
  color: #fff;
  outline: none;
}
.char-card.button {
  cursor: default;
}
.char-card.button .start-game {
  width: 100%;
  height: 100%;
  padding: 0;
  font-size: clamp(7px, calc(var(--col) * 0.1), 14px);
}
#overlay {
  justify-content: safe center;
  padding-top: calc(min(100vw, 2146px) * 733 / 2146 * 0.78) !important;
}
#overlay .sub,
#overlay .gender-select,
#overlay #levelList,
#overlay p.tip {
  color: #b8cbe8;
}
#overlay .gender-select input {
  accent-color: #ba0bca;
}
@keyframes charDrop {
  from {
    opacity: 0;
    translate: 0 -30px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes charBlink {
  to {
    box-shadow: 0 0 2px #fff, 0 0 10px #fff, 0 0 15px var(--glow-color), 0 0 20px var(--glow-color), 0 0 25px var(--glow-color), 0 0 30px var(--glow-color);
  }
}
@media (prefers-reduced-motion: reduce) {
  .char-card,
  .char-card.selected {
    animation: none;
    opacity: 1;
  }
}
:root {
  --color-01: #000;
  --color-02: #0000ff;
  --color-03: #ff0000;
  --color-04: #eee;
  --color-05: #ccc;
  --color-06: #ff00fe;
  --color-07: #00ff00;
  --color-08: #00ffff;
  --font-size: 16px;
}
@keyframes show {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes hide {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@font-face {
  src: url(fonts/PressStart2P-Regular.ttf) format("truetype");
  font-family: "PressStart2P-Regular";
  font-optical-sizing: auto;
  font-style: normal;
}
@font-face {
  src: url(fonts/VT323-Regular.ttf) format("truetype");
  font-family: "VT323-Regular";
  font-weight: 200;
  font-style: normal;
}

