@font-face {
  font-family: "Apex Mk3";
  src: url("../assets/fonts/Apex Mk3-Medium.otf") format("truetype");
  font-weight: 500;
  font-style: normal;
}

* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  margin: 0;
  padding: 0;
}

html {
  height: -webkit-fill-available;
}

#landscape-warning {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a0a15;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

@media (orientation: landscape) and (max-height: 500px) {
  #landscape-warning {
    display: flex !important;
  }

  #game-container {
    display: none !important;
  }
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: #0a0a15;
}

#preloader.hidden {
  display: none;
}

.preloader-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.preloader-content {
  position: relative;
  z-index: 1;
  width: 80%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 60px;
}

.preloader-text-box {
  background: rgba(6, 15, 31, 0.7);
  border: 2px solid #f9fcff;
  box-shadow: 0px 0px 6.5px #d3fead;
  border-radius: 4px;
  padding: 20px 24px;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

.preloader-text {
  color: #ffffff;
  font-family: "ABeeZee", sans-serif;
  font-size: 16px;
}

.preloader-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #d3fead;
  margin-bottom: 10px;
}

.preloader-bar-fill {
  height: 100%;
  width: 0%;
  background: #fbcf67;
  border-radius: 5px;
  transition: width 0.1s linear;
}

.preloader-percent {
  color: #d3fead;
  font-family: "ABeeZee", sans-serif;
  font-size: 20px;
  font-weight: bold;
}

#game-container {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 44px;
}

#top-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 100%;
}

.multiplier-wrapper {
  background: linear-gradient(180deg, #2f2871 0%, #041538 100%);
  padding: 2px;
  width: 100%;
  border-radius: 7px;
}

.multiplier-inner {
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    #2a3a4f 0%,
    #384357 35.19%,
    #2a354e 72.73%
  );
  border-radius: 5px;
  padding: 4px;
}

.multiplier-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: "ABeeZee", sans-serif;
  background: linear-gradient(180deg, #2a3a4f 0%, #384357 48.38%, #2a354e 100%);
  border-radius: 3px;
  padding: 3px 8px;
  border: 1px solid #ffffff;
  box-shadow:
    0 0 1px #d3fead,
    0 0 3px #d3fead,
    0 0 6.5px #d3fead;
  position: relative;
  margin: 2px 1px;
}

.mult-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mult-item.side {
  background: #060f1f;
  border: 1px solid #ffffff;
  box-shadow: 0px 0px 6.5px #d3fead;
  border-radius: 7px;
  padding: 2px 8px;
  min-width: 60px;
  min-height: 28px;
}

.mult-item.current {
  background: #060f1f;
  border: 1px solid #ffffff;
  box-shadow: 0px 0px 6.5px #d3fead;
  border-radius: 7px;
  padding: 2px 12px;
  min-width: 80px;
  min-height: 28px;
}

.mult-label {
  display: block;
  font-size: 8px;
  color: #fbcf67;
  text-transform: uppercase;
  margin-top: 1px;
  letter-spacing: 1px;
}

.mult-item.side .mult-value {
  font-weight: bold;
  font-size: 15px;
  color: #fbcf67;
}

.mult-item.current .mult-value {
  font-weight: bold;
  font-size: 24px;
  color: #d3fead;
  text-shadow: 0 0 10px rgba(211, 254, 173, 0.5);
}

.mult-message {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "ABeeZee", sans-serif;
  font-size: 16px;
  font-weight: bold;
  color: #fbcf67;
  text-shadow: 0 0 10px rgba(251, 207, 103, 0.5);
  z-index: 4;
  padding: 0 12px;
}

.mult-message.visible {
  display: flex;
  background-color: #060f1f;
  font-size: clamp(16px, 5vw, 25px);
  border-radius: 5px;
}

.banner-notify {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-family: "ABeeZee", sans-serif;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
  z-index: 5;
}

.banner-notify.show {
  display: flex;
}

.banner-notify.win {
  background: #060f1f;
  border: 2px solid #d3fead;
  box-shadow: 0 0 6px rgba(211, 254, 173, 0.4);
}

.banner-notify.win #banner-notify-label {
  color: #fbcf67;
  text-shadow: 0 0 7px rgba(251, 207, 103, 0.6);
}

.banner-notify.win #banner-notify-amount {
  color: #d3fead;
  text-shadow: 0 0 7px rgba(211, 254, 173, 0.6);
  margin-left: 8px;
}

.banner-notify.lose {
  background: #060f1f;
  border: 2px solid #fbcf67;
  box-shadow: 0 0 6px rgba(251, 207, 103, 0.4);
}

.banner-notify.lose #banner-notify-label {
  color: #fbcf67;
  text-shadow: 0 0 7px rgba(251, 207, 103, 0.6);
}

#center-section {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#crocodile-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  object-fit: cover;
}

#crocodile-container {
  width: 100%;
  max-width: 800px;
  transform-style: preserve-3d;
  perspective: 1000px;
  position: relative;
  margin-left: 4px;
  z-index: 1;
  transform-origin: center top;
}

@media (min-width: 800px) {
  #game-container {
    padding-bottom: 0;
  }
}

/* Desktop view */
@media (min-width: 1100px) {
  body {
    background:
      linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
      url("../assets/svg/desktop_background.svg") center / cover no-repeat
        #0f0f23;
  }

  #preloader {
    max-width: 430px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }

  #game-container {
    max-width: 430px;
    margin: 0 auto;
    padding-bottom: 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  }
}

#crocodile-animate {
  position: relative;
}

#crocodile-wrapper {
  width: 100%;
  height: auto;
  pointer-events: none;
}

#crocodile-wrapper svg,
#crocodile-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

#laugh-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  display: none;
}

#smeh-canvas {
  position: absolute;
  top: -3px;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  display: none;
}

#naklon-canvas {
  position: absolute;
  top: -3px;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  display: none;
}

#no-canvas {
  position: absolute;
  top: -3px;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  display: none;
}

#zub-canvas {
  position: absolute;
  z-index: 9;
  pointer-events: none;
  display: none;
}

#ukus-niz-canvas {
  position: absolute;
  top: 10%;
  left: 0;
  width: 100%;
  height: 90%;
  /* niz3 frame: 681x851, SVG: 681x946 */
  z-index: 5;
  pointer-events: none;
  display: none;
}

#ukus-verh-canvas {
  position: absolute;
  top: -2.9%;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
  display: none;
}

#teeth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#touch-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: none;
}

#teeth-overlay .tooth {
  pointer-events: none;
  cursor: pointer;
}

.tooth {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.tooth:active:not(.pressed) {
  transform: translateY(5px);
}

.tooth.pressed {
  pointer-events: none;
}

.tooth.disabled {
  pointer-events: none;
}

#bottom-section {
  padding: 4px;
  font-family: "ABeeZee", sans-serif;
}

.panel-frame {
  background: linear-gradient(180deg, #2f2871 0%, #041538 100%);
  border: 2px solid #4169e1;
  border-radius: 2px;
  padding: 6px;
  box-shadow: 0 0 15px rgba(65, 105, 225, 0.4);
  margin: 0;
}

.bet-panel {
  display: flex;
  gap: 8px;
}

.bet-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, #2a3a4f 0%, #384357 48.38%, #2a354e 100%);
  /* border: 1px solid #FFFFFF; */
  border-radius: 5px;
  padding: 4px;
  box-shadow: 0px 0px 6.5px #d3fead;
}

.bet-amount-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #060f1f;
  border: 1px solid #ffffff;
  border-radius: 2px;
  /* padding: 2px 6px; */
  box-shadow: 0px 0px 6.5px #d3fead;
}

.ctrl-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fbcf67;
  font-size: 38px;
  font-weight: bold;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ctrl-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

.ctrl-btn.minus {
  color: #fbcf67;
  text-shadow: 0px 0px 4px rgba(251, 207, 103, 0.5);
}

.ctrl-btn.plus {
  color: #fbcf67;
  text-shadow: 0px 0px 4px rgba(251, 207, 103, 0.5);
}

#current-bet-display {
  color: #d3fead;
  font-size: 24px;
  font-weight: bold;
  flex: 1;
  text-align: center;
  text-shadow: 0px 0px 4px rgba(211, 254, 173, 0.5);
}

.quick-bets {
  display: flex;
  gap: 4px;
}

.quick-bet-btn {
  flex: 1;
  background: #060f1f;
  border: 1px solid #ffffff;
  color: #d3fead;
  font-size: 24px;
  font-weight: bold;
  /* padding: 6px 6px; */
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0px 0px 4px rgba(211, 254, 173, 0.4);
  text-shadow: 0px 0px 4px rgba(211, 254, 173, 0.5);
}

.quick-bet-btn:active {
  transform: scale(0.95);
  background: #0a1a2f;
}

.action-row {
  display: flex;
  gap: 4px;
}

.action-btn {
  flex: 1;
  background: #060f1f;
  border: 1px solid #ffffff;
  /* padding: 6px; */
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0px 0px 4px rgba(211, 254, 173, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn img {
  width: 28px;
  height: 28px;
}

.action-btn:active {
  transform: scale(0.95);
  background: #0a1a2f;
}

#bet-button {
  width: 100px;
  background: linear-gradient(180deg, #060f1f 0%, #1a8557 100%);
  border: 1px solid #ffffff;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0px 0px 4px rgba(211, 254, 173, 0.4);
  font-family: "ABeeZee", sans-serif;
}

#bet-button .bet-text {
  font-family: "Apex Mk3", "ABeeZee", sans-serif;
  color: #d3fead;
  font-size: 42px;
  font-weight: bold;
  line-height: 0.85;
  text-shadow: 0px 0px 4px rgba(211, 254, 173, 0.5);
}

#bet-button .bet-subtext {
  font-family: "Apex Mk3", "ABeeZee", sans-serif;
  color: #d3fead;
  font-size: 42px;
  font-weight: bold;
  line-height: 0.85;
  text-shadow: 0px 0px 6px rgba(211, 254, 173, 0.5);
}

#bet-button .cashout-amount {
  display: none;
  color: #d3fead;
  font-family: "ABeeZee", sans-serif;
  font-size: 22px;
  font-weight: bold;
  text-shadow: 0px 0px 4px rgba(211, 254, 173, 0.5);
  background: #060f1f;
  border: 1px solid #ffffff;
  box-shadow: 0px 0px 4px rgba(211, 254, 173, 0.4);
  border-radius: 3px;
  padding: 2px 8px;
  margin-top: 2px;
}

#bet-button:active {
  transform: scale(0.98);
}

#bet-button.active {
  background: linear-gradient(180deg, #060f1f 0%, #1a8557 100%);
  border: 1px solid #ffffff;
  box-shadow: 0px 0px 6.5px #d3fead;
  animation: none;
}

#bet-button.active .bet-text {
  font-family: "Apex Mk3", "ABeeZee", sans-serif;
  color: #fbcf67;
  font-size: 30px;
  text-shadow: 0px 0px 9px #f65858;
  line-height: 0.85;
}

#bet-button.active .bet-subtext {
  font-family: "Apex Mk3", "ABeeZee", sans-serif;
  color: #fbcf67;
  font-size: 30px;
  text-shadow: 0px 0px 9px #f65858;
  line-height: 0.85;
}

#bet-button.active .cashout-amount {
  display: block;
  margin-top: 4px;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
  }

  50% {
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.7);
  }
}

#nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1a1a35 0%, #0f0f23 100%);
  border-top: 2px solid #3d3d6b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

@media (min-width: 600px) {
  #nav-bar {
    position: static;
  }
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:active {
  transform: scale(0.9);
}

.nav-btn.disabled {
  opacity: 0.3;
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-balance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-balance .balance-label {
  color: #d3fead;
  font-size: 16px;
  font-weight: bold;
}

#balance {
  color: #d3fead;
  font-size: 18px;
  font-weight: bold;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(180deg, #252547 0%, #1a1a35 100%);
  border: 3px solid #3d3d6b;
  border-radius: 20px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-content h2 {
  color: #fff;
  font-size: 22px;
  text-align: center;
  margin: 0 0 12px 0;
}

.modal-desc {
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  margin: 0 0 16px 0;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item {
  background: #1a1a2e;
  border: 2px solid #3d3d6b;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-item:active {
  transform: scale(0.98);
  background: #2a2a4e;
}

.shop-item .price {
  color: #fbbf24;
}

.modal-close {
  width: 100%;
  background: #374151;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  padding: 14px;
  margin-top: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:active {
  transform: scale(0.98);
  background: #4b5563;
}

.info-list {
  color: #d1d5db;
  font-size: 14px;
  line-height: 1.8;
  padding-left: 20px;
  margin: 0;
}

.history-panel {
  width: 100%;
}

.history-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.history-scroll-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.history-grid {
  display: flex;
  gap: 4px;
}

.history-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.history-tooth-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #060f1f;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  padding: 6px 4px;
}

.history-tooth-row svg {
  flex-shrink: 0;
}

.history-tooth-row span {
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  font-family: "ABeeZee", sans-serif;
}

.history-amount-row {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  padding: 5px 4px;
  font-size: 13px;
  font-weight: bold;
  font-family: "ABeeZee", sans-serif;
}

.history-amount-row.won {
  background: linear-gradient(180deg, #060f1f 0%, #1a8557 100%);
  color: #d3fead;
}

.history-amount-row.lost {
  background: linear-gradient(180deg, #060f1f 0%, #702a2a 100%);
  color: #fbcf67;
}

.history-slider-track {
  height: 3px;
  background: #1a1a35;
  border-radius: 2px;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}

.history-slider-thumb {
  height: 100%;
  background: #fbcf67;
  border-radius: 2px;
  position: absolute;
  left: 0;
  min-width: 20px;
  cursor: pointer;
}

@media ((max-width: 321px) and (max-height: 570px)) {
  #bottom-section {
    padding: 2px;
  }

  .panel-frame {
    padding: 4px;
  }

  .bet-panel {
    gap: 4px;
  }

  .bet-controls {
    gap: 2px;
    padding: 2px;
  }

  .ctrl-btn {
    width: 24px;
    height: 24px;
    font-size: 28px;
  }

  #current-bet-display {
    font-size: 17px;
  }

  .quick-bet-btn {
    font-size: 16px;
    padding: 3px;
  }

  .action-btn img {
    width: 20px;
    height: 20px;
  }

  #bet-button {
    width: 75px;
    padding: 4px 2px;
  }

  #bet-button .bet-text,
  #bet-button .bet-subtext {
    font-size: 28px;
  }

  #bet-button.active .bet-text,
  #bet-button.active .bet-subtext {
    font-size: 22px;
  }

  #bet-button.active .cashout-amount {
    font-size: 15px;
    padding: 1px 4px;
  }
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}
