* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Arial, Helvetica, sans-serif;
  background: url("./background.jpg") center / cover no-repeat fixed;
  color: #111;
}

[hidden] {
  display: none !important;
}

.casino {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 14px 14px 28px;
}

.top-tools {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.search-payment {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.db-suche {
  display: flex;
  justify-content: flex-end;
}

.db-suche img {
  display: block;
  width: auto;
  height: 34px;
  max-width: 100%;
  border: 2px solid #000;
  border-radius: 6px;
  background: #fff;
}

#bahnbonus {
  min-height: 32px;
  padding: 5px 9px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  border: 2px solid #000;
  border-radius: 7px;
}

#bahnbonus:hover {
  filter: brightness(0.96);
}

#bahnbonus:disabled {
  cursor: wait;
  opacity: 0.6;
}

.credit-card {
  width: 205px;
  padding: 7px;
  text-align: center;
  background: rgba(228, 225, 210, 0.96);
  border: 2px solid #222;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 4px 9px rgba(0, 0, 0, 0.16);
}

.credit-card h2,
.counter-card h2 {
  margin: 0 0 7px;
  font-size: 0.76rem;
  letter-spacing: 0.11em;
}

.casino-header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 78px;
  margin-bottom: 12px;
}

.casino-header img {
  display: block;
  width: min(230px, 66vw);
  max-height: 96px;
  height: auto;
  object-fit: contain;
}

.slot-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.slot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.6vw, 22px);
  width: min(100%, 620px);
}

.fruechte-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 136px;
  padding: clamp(6px, 1.7vw, 12px);
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #000;
  border-radius: 16px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.img {
  display: block;
  width: 100%;
  max-width: 130px;
  height: auto;
  object-fit: contain;
}

#spin {
  min-width: 150px;
  min-height: 42px;
  padding: 8px 22px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: #228b22;
  border: 2px solid #000;
  border-radius: 14px;
}

#spin:hover {
  filter: brightness(1.08);
}

#spin:active {
  transform: translateY(1px);
}

#spin:disabled {
  cursor: wait;
  opacity: 0.65;
}

.result-message {
  min-height: 1.5em;
  margin: 0;
  padding: 8px 14px;
  text-align: center;
  font-size: 0.96rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #000;
  border-radius: 12px;
}

.counter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(100%, 620px);
  margin: 20px auto 0;
}

.counter-card {
  min-width: 0;
  padding: 12px;
  text-align: center;
  background: rgba(228, 225, 210, 0.96);
  border: 3px solid #222;
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.18);
}

.flip-counter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  perspective: 700px;
}

.flip-digit {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 54px;
  overflow: hidden;
  color: #f6f3df;
  background: linear-gradient(
    to bottom,
    #242424 0%,
    #121212 48%,
    #050505 50%,
    #181818 52%,
    #262626 100%
  );
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.16),
    inset 0 -1px 2px rgba(0, 0, 0, 0.8);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  font-weight: 700;
  line-height: 1;
  transform-origin: center;
  backface-visibility: hidden;
}

.compact-counter .flip-digit {
  height: 34px;
  font-size: 1.35rem;
}

.flip-digit::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.flip-digit.flip-active {
  animation: flap 0.12s linear;
}

@keyframes flap {
  0% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
  45% {
    transform: rotateX(-78deg);
    filter: brightness(0.52);
  }
  55% {
    transform: rotateX(72deg);
    filter: brightness(0.62);
  }
  100% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
}

.casino-footer {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#qualitätsoffensive {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  border: 2px solid #000;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.fullscreen-overlay {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.fullscreen-overlay img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#flying-layer {
  position: fixed;
  z-index: 999;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.flying-item {
  position: absolute;
  bottom: -180px;
  width: clamp(70px, 14vw, 150px);
  height: auto;
  animation: fly-across 3.2s linear forwards;
}

.spinning {
  animation: pulse-slot 0.18s linear infinite alternate;
}

@keyframes pulse-slot {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2px);
  }
}

@keyframes fly-across {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.9);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform:
      translate3d(var(--fly-x, 0px), -120vh, 0)
      rotate(var(--fly-rotate, 360deg))
      scale(1.15);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .casino {
    padding: 10px 10px 20px;
  }

  .top-tools {
    gap: 6px;
  }

  .db-suche img {
    height: 29px;
  }

  #bahnbonus {
    font-size: 0.66rem;
    padding-inline: 6px;
  }

  .credit-card {
    width: min(178px, 48vw);
    padding: 6px;
  }

  .credit-card h2 {
    font-size: 0.65rem;
  }

  .compact-counter {
    gap: 2px;
  }

  .compact-counter .flip-digit {
    height: 31px;
    font-size: 1rem;
  }

  .casino-header img {
    width: min(205px, 64vw);
  }

  .slot-row {
    gap: 8px;
  }

  .fruechte-box {
    min-height: 110px;
    padding: 6px;
    border-radius: 12px;
  }

  .img {
    max-width: 95px;
  }

  #spin {
    min-width: 132px;
    min-height: 40px;
  }

  .result-message {
    font-size: 0.9rem;
  }

  .counter-panel {
    gap: 8px;
  }

  .counter-card {
    padding: 8px 6px;
  }

  .counter-card h2 {
    font-size: 0.7rem;
  }

  .flip-counter {
    gap: 2px;
  }

  .flip-digit {
    height: 43px;
    font-size: clamp(1.15rem, 7vw, 1.8rem);
  }

  #qualitätsoffensive {
    width: min(180px, 62vw);
  }
}

@media (max-width: 420px) {
  .top-tools {
    flex-wrap: wrap;
  }

  .search-payment {
    flex: 1 1 135px;
  }

  .credit-card {
    flex: 1 1 160px;
    width: auto;
  }

  .img {
    max-width: 80px;
  }

  .fruechte-box {
    min-height: 95px;
  }

  .counter-card {
    padding-inline: 4px;
  }

  .flip-digit {
    height: 38px;
  }
}
