.crossyroad-container {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}
.game-section {
  display: flex;
  gap: 3rem;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}
.crossy-container {
  width: 100%;
  max-width: 900px;
  min-width: 400px;
  background: var(--secondary-bg);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
}
.game-area {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  background-color: #333;
  border-radius: 16px;
  margin-bottom: 1.5rem;
}
.betting-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
}
.betting-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.bet-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  width: 100%;
}
.input-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.bet-input-field {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: 10px;
  align-items: center;
}
.bet-input-field i {
  color: var(--accent-color);
  font-size: 16px;
}
.bet-input-field input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 16px;
  padding: 0.25rem;
  width: 50px;
}
.bet-input-field input:focus {
  outline: none;
}
.quick-actions {
  display: flex;
  gap: 0.25rem;
}
.quick-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.quick-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.difficulty-selector {
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.difficulty-options {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
}
.difficulty-option {
  flex: 1;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: var(--text-secondary);
}
.difficulty-option.active {
  background: var(--accent-color);
  color: #000;
  font-weight: 500;
}
.bet-button {
  padding: 0.75rem 1.5rem;
  background: var(--accent-color);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 15px;
}
.bet-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.bet-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.game-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 14px;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.info-value {
  color: var(--text-color);
  font-weight: 500;
}

.game-canvas {
  display: flex;
  flex-direction: row;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.game-canvas:active {
  cursor: grabbing;
}

.sidewalk {
  width: 120px;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 60px;
  position: relative;
  flex: 0 0 120px;
  z-index: 20;
  background: linear-gradient(
    to bottom,
    #2d5a27 0%,
    #2d5a27 10%,
    #1e3d1a 10%,
    #1e3d1a 20%,
    #2d5a27 20%,
    #2d5a27 30%,
    #1e3d1a 30%,
    #1e3d1a 40%,
    #2d5a27 40%,
    #2d5a27 50%,
    #1e3d1a 50%,
    #1e3d1a 60%,
    #2d5a27 60%,
    #2d5a27 70%,
    #1e3d1a 70%,
    #1e3d1a 80%,
    #2d5a27 80%,
    #2d5a27 90%,
    #1e3d1a 90%,
    #1e3d1a 100%
  );
}

.sidewalk-block {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.sidewalk-block.light {
  background-color: #8e8a7e;
}

.sidewalk-block.dark {
  background-color: #5d5d5d;
}

.roads-container {
  display: flex;
  flex-direction: row;
  height: 100%;
  gap: 2px;
  position: relative;
  transition: transform 0.3s ease-out;
}

.road {
  flex: 0 0 150px;
  height: 100%;
  background-color: #444;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeInRoad 0.3s ease-out forwards;
}

@keyframes fadeInRoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.road::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 6px;
  height: calc(100% + 40px);
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.2) 0px,
    rgba(255, 255, 255, 0.2) 40px,
    transparent 40px,
    transparent 80px
  );
  transform: translateX(-50%) scaleY(0);
  animation: showLines 0.3s ease-out 0.2s forwards;
}

@keyframes showLines {
  from {
    transform: translateX(-50%) scaleY(0);
  }
  to {
    transform: translateX(-50%) scaleY(1);
  }
}

.platform {
  width: 100px;
  height: 100px;
  background-image: url("/cdn/circle.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  animation: showPlatform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
  transition: filter 0.2s ease;
}

@keyframes showPlatform {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.platform:hover {
  filter: brightness(0.8);
}

.platform.used {
  cursor: default;
  opacity: 0;
  pointer-events: none;
}

.brick {
  width: 100px;
  height: 100px;
  position: absolute;
  z-index: 5;
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brick::before {
  content: "";
  position: absolute;
  top: calc(70% - 30px);
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/cdn/cracks.png");
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center top;
  opacity: 0;
  z-index: 4;
  transform: scale(0.9);
  transition: opacity 0.3s ease 0.2s,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.brick::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/cdn/brick.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 5;
}

.brick.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.brick.show::before {
  opacity: 0.3;
  transform: scale(1);
}

.road.blocked {
  pointer-events: none;
}

.road.blocked::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 7;
  transform-origin: bottom;
  animation: blockRoad 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes blockRoad {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.character {
  width: 78px;
  height: 78px;
  background-image: url("/cdn/chicken.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  position: absolute;
  transition: left 0.3s linear, top 0.3s linear;
  z-index: 12;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.6));
}

.character.on-sidewalk {
  z-index: 25;
}

.character.walking {
  transition: left 0.15s linear, top 0.15s linear;
}

.character.moving {
  animation: hopAnimation 0.3s steps(2) 3;
}

@keyframes hopAnimation {
  0% {
    background-image: url("/cdn/chicken.png");
    background-position: center bottom;
    transform: translate(-50%, -50%);
  }
  25% {
    background-image: url("/cdn/chickennoleg.png");
    background-position: center bottom;
    transform: translate(-50%, calc(-50% - 10px));
  }
  50% {
    background-image: url("/cdn/chicken.png");
    background-position: center bottom;
    transform: translate(-50%, -50%);
  }
  75% {
    background-image: url("/cdn/chickennoleg.png");
    background-position: center bottom;
    transform: translate(-50%, calc(-50% + 10px));
  }
  100% {
    background-image: url("/cdn/chicken.png");
    background-position: center bottom;
    transform: translate(-50%, -50%);
  }
}

.car {
  width: 90px;
  height: 180px;
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 5;
  filter: none;
  box-shadow: none;
}

.car.car3 {
  background-image: url("/cdn/car3.png");
  z-index: 11;
}

.car.car1 {
  background-image: url("/cdn/car1.png");
  width: 135px;
  height: 270px;
  z-index: 6;
}

.car.car2 {
  background-image: url("/cdn/car2.png");
}

.car {
  transform-origin: center;
  transform: rotate(0deg);
}

.car.flip {
  transform: rotate(180deg);
}

.game-ui {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-size: 24px;
  z-index: 100;
}

.game-over-modal {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  color: white;
  z-index: 1000;
}

.game-over-modal.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.restart-button {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #4caf50;
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.restart-button:hover {
  background-color: #45a049;
}

.restart-button i {
  margin-right: 8px;
}

.restart-button:hover i {
  animation: spinRetry 0.5s ease;
}

@keyframes spinRetry {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.character.dead {
  animation: deathAnimation 0.7s ease forwards;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
}

@keyframes deathAnimation {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  20% {
    transform: translate(-40%, -60%) scale(1.3) rotate(45deg);
  }
  40% {
    transform: translate(-60%, -40%) scale(1.2) rotate(90deg);
  }
  70% {
    transform: translate(-50%, -50%) scale(1.1) rotate(270deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(360deg);
    opacity: 0.7;
  }
}

.coin {
  width: 80px;
  height: 80px;
  position: absolute;
  background-image: url("/cdn/coin.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%);
  z-index: 12;
  animation: coinAnimation 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes coinAnimation {
  0% {
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.5) rotate(90deg);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1.5) rotate(270deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

.final-sidewalk {
  position: relative;
  left: auto;
  margin: 0;
  flex: 1;
  opacity: 0;
  animation: fadeInRoad 0.3s ease-out forwards;
}

.decoration {
  position: absolute;
  z-index: 21;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.6));
}

.decoration.bush {
  width: 260px;
  height: 260px;
  background-image: url("/cdn/plantdecoration.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.8));
}

.decoration.hydrant {
  width: 60px;
  height: 80px;
  background-image: url("/cdn/firehydrantdecoration.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 15px 20px rgba(0, 0, 0, 0.7));
}

.decoration.circle {
  width: 80px;
  height: 80px;
  background-image: url("/cdn/circle.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.3;
  z-index: 19;
}

.decoration.final-circle {
  z-index: 25;
  opacity: 0.5;
  cursor: pointer;
}

.road.sidewalk-styled {
  background-color: var(--primary-bg);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 60px;
  position: relative;
  height: 100%;
  width: 120px !important;
  flex: none !important;
}

.road.sidewalk-styled .platform {
  z-index: 26;
  position: absolute;
}

.road.sidewalk-styled .sidewalk-block {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.road.sidewalk-styled .sidewalk-block.light {
  background-color: #8e8a7e;
}

.road.sidewalk-styled .sidewalk-block.dark {
  background-color: #5d5d5d;
}

.road.sidewalk-styled::before {
  display: none;
}

.road.sidewalk-styled.blocked::after {
  background-color: rgba(0, 0, 0, 0.7);
}

.road.sidewalk-styled .decoration {
  z-index: 24;
}

.road.victory-road {
  background: linear-gradient(
    45deg,
    #2c2c2c 0%,
    #2c2c2c 10%,
    #1a1a1a 10%,
    #1a1a1a 20%,
    #2c2c2c 20%,
    #2c2c2c 30%,
    #1a1a1a 30%,
    #1a1a1a 40%,
    #2c2c2c 40%,
    #2c2c2c 50%,
    #1a1a1a 50%,
    #1a1a1a 60%,
    #2c2c2c 60%,
    #2c2c2c 70%,
    #1a1a1a 70%,
    #1a1a1a 80%,
    #2c2c2c 80%,
    #2c2c2c 90%,
    #1a1a1a 90%,
    #1a1a1a 100%
  );
  position: relative;
  overflow: visible !important;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.road.victory-road::before {
  display: none;
}

.road.victory-road::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.1),
    transparent 70%
  );
  pointer-events: none;
}

.platform.victory-platform {
  z-index: 26;
  transform: scale(1.2);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.road.victory-road .victory-circle {
  width: 100px;
  height: 100px;
  background-image: url("/cdn/circle.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  opacity: 0.5;
  animation: victoryPlatformPulse 2s ease-in-out infinite;
}

@keyframes victoryPlatformPulse {
  0% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3)) brightness(1);
    transform: translate(-50%, -50%) scale(1.2);
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.4)) brightness(1.2);
    transform: translate(-50%, -50%) scale(1.3);
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3)) brightness(1);
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.road.victory-road .decoration {
  z-index: 24;
}

.road.victory-road.blocked::after {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent 70%);
}

.road.victory-road .decoration.circle {
  display: none;
}

.victory-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  z-index: 1000;
  transition: opacity 0.3s ease-out;
}

.victory-overlay.show {
  opacity: 1;
}

.victory-overlay.fade-out {
  opacity: 0;
}

.victory-content {
  background: #1a1a1a;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.3s ease forwards;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 2px solid #444;
  min-width: 280px;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.victory-content h2 {
  color: white;
  font-family: "Press Start 2P", monospace;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.victory-score {
  color: white;
  font-family: "Press Start 2P", monospace;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  background: #222;
  padding: 1rem;
  border-radius: 10px;
}

.retry-button {
  background: #333;
  border: none;
  padding: 0.8rem 1.5rem;
  color: white;
  font-family: "Press Start 2P", monospace;
  font-size: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.retry-button:hover {
  background: #444;
}

.retry-button i {
  margin-right: 8px;
}

.retry-button:hover i {
  animation: spinRetry 0.5s ease;
}

@keyframes spinRetry {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.car.moving-car {
  position: absolute;
  width: 40px;
  height: 80px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 15;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
  animation: carBobbing 1s infinite ease-in-out;
  transition: none;
  will-change: transform, top;
}

.car.moving-car.car1 {
  width: 135px;
  height: 270px;
}

.car.moving-car.car2,
.car.moving-car.car3 {
  width: 90px;
  height: 180px;
}

@keyframes carBobbing {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -2px);
  }
}

.car.death-car {
  z-index: 999 !important;
  filter: blur(0.5px) brightness(1.1) !important;
  box-shadow: none !important;
  will-change: transform, top, filter;
  animation: deathCarPulse 0.3s infinite alternate;
  pointer-events: none;
}

@keyframes deathCarPulse {
  from {
    filter: blur(0.5px) brightness(1.1);
  }
  to {
    filter: blur(0.5px) brightness(1.3);
  }
}

.impact-flash {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 998;
  pointer-events: none;
  animation: flashAnimation 0.5s ease-out forwards;
}

@keyframes flashAnimation {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

.impact-effect {
  position: absolute;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 997;
  animation: impactAnimation 0.5s ease-out forwards;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 150, 150, 0.7) 30%,
    rgba(255, 50, 50, 0.5) 60%,
    rgba(255, 0, 0, 0) 80%
  );
}

@keyframes impactAnimation {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.scroll-btn {
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.scroll-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.scroll-btn:active {
  transform: translateY(-50%) scale(0.95);
}
