* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #11141d;
  color: #f5f6fa;
}

:root {
  --game-left: 0px;
  --game-top: 0px;
  --game-width: 0px;
  --game-height: 0px;
}

#app {
  max-width: 980px;
  height: 100%;
  margin: 0 auto;
  padding: 16px;
}

body[data-screen="loader"] #app {
  max-width: none;
  width: 100%;
  padding: 0;
}

.main {
  margin-top: 0;
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  padding: 24px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

.screen.fade-out {
  animation: screenFadeOut 0.4s ease forwards;
}

.screen.fade-in {
  animation: screenFadeIn 0.5s ease;
}

.loader-screen {
  padding: 0;
  background: #0a0d16;
}

.loader-screen::before {
  content: "";
  position: absolute;
  inset: -80px;
  background-image: url("assets/start_bg_day.png");
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.12);
  z-index: 0;
}

.loader-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.55);
  z-index: 1;
}

.loader-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.loader-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  filter: blur(12px);
  opacity: 0.9;
  z-index: -1;
}

.loader-logo {
  width: min(460px, 90vw);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.9));
}

.loader-start {
  border: none;
  background: transparent;
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.6);
  cursor: pointer;
  animation: loaderBlink 1.2s ease-in-out infinite;
}

@keyframes loaderBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes screenFadeOut {
  to {
    opacity: 0;
    transform: scale(1.02);
  }
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.screen.dialog {
  background: rgba(7, 9, 16, 0.6);
  backdrop-filter: blur(6px);
  z-index: 10;
}

body[data-dialog="true"] .screen.active:not(.dialog) {
  filter: blur(6px);
  pointer-events: none;
}

#screen-start {
  min-height: 0;
  border-radius: 0;
  padding: 0;
  background-image: url("assets/start_bg_day.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body[data-start-theme="night"] #screen-start {
  background-image: url("assets/start_bg_night.png");
}

.theme-toggle {
  position: absolute;
  top: 28px;
  right: 180px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.theme-toggle img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.how-to-play-toggle {
  position: absolute;
  top: 28px;
  left: 180px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.how-to-play-toggle img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

#screen-game {
  justify-content: center;
  align-items: center;
  padding: 0;
  background: none;
}

#screen-fortune {
  justify-content: center;
  align-items: center;
  padding: 0;
  background: #2d324c;
}

.fortune-screen {
  position: absolute;
  width: 1920px;
  height: 1080px;
  background: #2d324c;
  overflow: hidden;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--fortune-scale, 1));
  transform-origin: center;
}

.fortune-frame {
  position: absolute;
  top: 0;
  height: 1080px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
}

.fortune-frame-left {
  left: 0;
}

.fortune-frame-right {
  right: 0;
  transform: scaleX(-1);
  transform-origin: center;
}

.fortune-content {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.fortune-scene {
  position: absolute;
  width: 1920px;
  height: 1080px;
  left: 0;
  top: 0;
}

.fortune-wall {
  position: absolute;
  width: 131px;
  height: 1083px;
  top: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: 5;
}

.fortune-wall-left {
  left: 0;
  background-image: url("assets/bonus/fortune_wall_left-200bc1.png");
}

.fortune-wall-right {
  right: 0;
  background-image: url("assets/bonus/fortune_wall_right-3c7a37.png");
}

.fortune-arch-outer {
  position: absolute;
  width: 925.12px;
  height: 851.66px;
  left: 697px;
  top: 64px;
  border: 20px solid #191b28;
  border-radius: 328px 328px 0 0;
  box-sizing: border-box;
}

.fortune-arch-inner {
  position: absolute;
  width: 892.08px;
  height: 843.47px;
  left: 713.52px;
  top: 126.75px;
  background: #191b28;
  border: 20px solid #3e4464;
  border-radius: 318px 318px 0 0;
  box-sizing: border-box;
}

.fortune-wheel {
  position: absolute;
  left: 1028px;
  top: 0;
  width: 759px;
  height: 969.95px;
  pointer-events: none;
}

.fortune-wheel-disk {
  position: absolute;
  left: 49px;
  top: 92px;
  width: 645px;
  height: 648px;
  transform-origin: 50% 50%;
  z-index: 2;
}

.fortune-wheel-frame {
  position: absolute;
  left: 7.29px;
  top: -8px;
  width: 743.95px;
  height: 780.73px;
  pointer-events: none;
  z-index: 3;
}

.fortune-wheel-clicker {
  position: absolute;
  left: 101.92px;
  top: 710.57px;
  width: 559.2px;
  height: 243.38px;
  pointer-events: none;
  z-index: 1;
}

.fortune-floor-base {
  position: absolute;
  width: 1920px;
  height: 189px;
  left: 0;
  top: 934px;
  background: #161824;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortune-result {
  display: none;
  align-items: center;
  gap: 14px;
  font-size: 36px;
  font-weight: 800;
  color: #fefbec;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
  pointer-events: none;
  transform: translate(-100px, -16px);
}

.fortune-result.show {
  display: inline-flex;
}

.fortune-result-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.fortune-floor-seg {
  position: absolute;
  width: 365.25px;
  height: 55.35px;
  top: 878.77px;
}

.fortune-floor-seg-1 {
  left: 111.77px;
  background: #3a3d51;
}

.fortune-floor-seg-2 {
  left: 477.02px;
  background: #333647;
}

.fortune-floor-seg-3 {
  left: 843.26px;
  top: 875.91px;
  width: 369.24px;
  background: #3a3d51;
}

.fortune-floor-seg-4 {
  left: 1211.5px;
  background: #333647;
}

.fortune-floor-seg-5 {
  left: 1577px;
  background: #3a3d51;
  width: 343px;
  height: 55px;
}

.fortune-floor-line {
  position: absolute;
  width: 1808px;
  height: 10px;
  left: 112px;
  background: #1f212d;
}

.fortune-floor-line-1 {
  top: 869px;
}

.fortune-floor-line-2 {
  top: 925px;
  height: 9px;
}

.fortune-free-label {
  position: absolute;
  top: 200px;
  left: 420px;
  transform: translateX(-50%);
  font-size: 60px;
  font-weight: 900;
  text-align: center;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
  letter-spacing: 1px;
  color: #fefbec;
  z-index: 6;
  pointer-events: none;
}

.fortune-free-label-count {
  display: block;
  font-size: 96px;
  line-height: 1;
  margin-bottom: 6px;
}

.fortune-free-label-count.is-zero {
  color: #ff4d4d;
}

.fortune-free-label-text {
  display: block;
}

.fortune-free-label-timer {
  display: none;
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
}

.fortune-free-label-time {
  display: block;
  margin-top: 6px;
  font-size: 56px;
  font-weight: 900;
  color: #ff9f1a;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
}

.fortune-chicken {
  position: absolute;
  width: 535px;
  height: 517px;
  left: 98px;
  top: 370px;
  height: auto;
  transform: scale(1.15);
  transform-origin: top left;
}

.fortune-btn {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 900;
  color: #fefbec;
  text-transform: uppercase;
  z-index: 6;
}

.fortune-btn-icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.fortune-btn-face {
  position: absolute;
  inset: 0;
  border-radius: 82px;
}

.fortune-btn-label {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
  letter-spacing: 1px;
}

.fortune-btn-count {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 120px;
  line-height: 1;
  z-index: 1;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
  transform: translate(-50%, -50%);
}

.fortune-btn-free {
  left: 170px;
  top: 150px;
  width: 441px;
  height: 193.46px;
}

.fortune-btn-free .fortune-btn-face {
  display: none;
}

.fortune-btn-free .fortune-btn-label {
  display: none;
}

.fortune-btn-free .fortune-btn-count {
  left: auto;
  right: 52px;
  top: 44%;
  transform: translateY(-50%);
  display: none;
}

.fortune-btn-home {
  left: 170px;
  top: 24px;
  width: 190px;
  height: 70px;
}

.fortune-btn-home .fortune-btn-face {
  border-radius: 18px;
  background: #f29a2e;
  border: 6px solid #c76c12;
  box-shadow: inset 0 -10px 0 rgba(198, 104, 16, 1);
}

.fortune-btn-home .fortune-btn-icon {
  width: 84px;
  height: 84px;
  margin-right: 8px;
  transform: matrix(-1, 0, 0, 1, 0, 0) scaleX(-1);
}

.fortune-btn-home-label {
  position: relative;
  z-index: 1;
  font-size: 22px;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(27, 25, 88, 0.6);
  margin-top: -8px;
  margin-left: -15px;
  margin-right: 26px;
}

.fortune-btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.fortune-btn-spin {
  left: 1209px;
  top: 815px;
  width: 415px;
  height: 167px;
}

.fortune-btn-spin .fortune-btn-face {
  background: #5fb858;
  border: 8px solid #19582c;
  box-shadow: inset 0 -18px 0 rgba(41, 130, 79, 1);
}

.fortune-btn-spin:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.fortune-btn-spin .fortune-btn-label {
  font-size: 60px;
  margin-top: -16px;
}

.fortune-free-label-text {
  font-size: 24px;
}

body[data-lang="ru"] .fortune-free-label-text {
  font-size: 28px;
}

body[data-lang]:not([data-lang="ru"]) .fortune-free-label-text {
  font-size: 48px;
}


body[data-game-mode="bonus"] #screen-game {
  background: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 14, 0.6);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.overlay.active {
  display: flex;
}

.modal-window {
  width: min(420px, 90%);
  padding: 24px;
  border-radius: 18px;
  background: rgba(28, 33, 50, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.modal-hero {
  width: min(220px, 70%);
  margin: 0 auto 8px;
  display: block;
}

.modal-stats {
  width: 100%;
  margin: 12px auto 6px;
  border-collapse: collapse;
  display: none;
  color: #f5f6fa;
}

.modal-stats td {
  padding: 6px 4px;
  vertical-align: middle;
}

.modal-stats .stat-icon {
  width: 36px;
}

.modal-stats .stat-icon img {
  width: 28px;
  height: 28px;
  display: block;
}

.modal-stats .stat-label {
  text-align: left;
  font-weight: 600;
}

.modal-stats .stat-value {
  text-align: right;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  width: 100%;
}

.modal-subactions {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
}

.panel {
  background: rgba(33, 39, 56, 0.92);
  padding: 20px 22px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  position: relative;
}

.dialog-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.dialog-close img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.panel h1,
.panel h2 {
  margin-top: 0;
}

.story {
  line-height: 1.5;
  opacity: 0.9;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.start-menu {
  width: min(520px, 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.start-logo {
  width: min(360px, 90%);
  height: auto;
  margin-top: -12px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.start-buttons {
  display: grid;
  gap: 12px;
  width: fit-content;
  max-width: 90%;
}

.start-play-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: fit-content;
}

.start-play-row .start-btn.primary {
  min-width: 64px;
  height: 64px;
  padding-left: 85px;
  padding-right: 75px;
}

.start-btn {
  border: none;
  padding: 10px 18px;
  margin-left: 6px;
  margin-right: 6px;
  height: 64px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 18px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
}

.start-btn.primary {
  background: #7ccf6a;
}

.start-btn.secondary {
  background: #67b95a;
  font-size: 16px;
  width: 100%;
}

.start-icons {
  display: flex;
  gap: 18px;
  margin-top: 6px;
}

.icon-timer {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.icon-btn {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.icon-btn--timer {
  position: relative;
  padding-bottom: 14px;
}

.icon-btn--timer.no-timer {
  padding-bottom: 0;
}

.icon-btn--timer .icon-timer {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
}

.icon-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.icon-text {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.icon-text--big {
  font-size: 28px;
  letter-spacing: 1px;
  font-weight: 900;
  background: linear-gradient(180deg, #ffb34d 0%, #ff8a1f 100%);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.level-badge-inline {
  width: 64px;
  height: 64px;
}

.level-badge {
  position: relative;
  display: inline-block;
  background-image: url("assets/level_badge.png");
  background-size: 135% 135%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 14px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
}

.level-badge[role="button"] {
  cursor: pointer;
}

.level-badge-number {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.icon-btn--disabled {
  pointer-events: none;
  opacity: 0.7;
}

.modal-actions .icon-btn {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
}

.modal-actions .next-btn {
  width: 196px;
  height: 48px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: left;
  font-size: 14px;
}

.modal-actions .next-btn img {
  width: 60px;
  height: 60px;
  margin-left: 0;
  transform: rotate(180deg);
}

.modal-actions .next-btn::before {
  content: none;
}

.modal-actions .icon-btn img {
  width: 44px;
  height: 44px;
}

.btn {
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  color: #f5f6fa;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  position: relative;
  min-height: 52px;
  width: 107px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/ui_button.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: -1;
}

.btn:hover::before {
  filter: brightness(1.12);
}

.btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.tips {
  font-size: 14px;
  opacity: 0.85;
}

.levels,
.shop {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.level-card,
.shop-card {
  background: #343b52;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
}

.level-card .btn {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 14px;
}

.level-card .level-btn {
  width: 84px;
  height: 84px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffb34d 0%, #ff8a1f 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.level-card .level-btn:disabled {
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.1);
  filter: grayscale(1);
  cursor: not-allowed;
}

.level-card .level-btn:disabled .level-btn-number,
.level-card .level-btn:disabled .level-btn-label {
  color: rgba(255, 255, 255, 0.65);
}

.level-card .level-btn::before {
  content: none;
}

.level-btn-number {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.level-btn-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.9;
}

.shop-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.shop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.shop-card {
  width: 170px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.shop-coins {
  margin-bottom: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shop-coins-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.buy-btn {
  border: none;
  background: transparent;
  color: #f5f6fa;
  font-weight: 700;
  min-height: 40px;
  width: 112px;
  height: 87px;
  padding: 8px 12px;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.buy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.buy-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/buy_button.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
}

.shop-card .buy-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.settings-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 5px;
  padding-bottom: 5px;
}

.settings-lang {
  margin-top: 6px;
  margin-bottom: 12px;
}

.settings-audio {
  margin-top: 33px;
  margin-bottom: 12px;
}

.settings-audio-row {
  margin-bottom: 12px;
}

.toggle {
  position: relative;
  width: 54px;
  height: 30px;
  display: inline-flex;
  align-items: center;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider {
  background: rgba(95, 184, 88, 0.6);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.settings-lang-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lang-btn {
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lang-btn img {
  width: 48px;
  height: 48px;
  display: block;
}

.lang-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-btn.is-active {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.settings-link {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f6fa;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 13px;
  margin-top: 5px;
  margin-bottom: 5px;
  cursor: pointer;
  text-align: center;
}

.settings-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.policy-frame {
  width: min(720px, 85vw);
  height: 60vh;
  border: none;
  border-radius: 12px;
  background: #0b0f1a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.howto-content {
  padding: 20px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #f5f6fa;
  line-height: 1.6;
  overflow: auto;
}

.howto-content h2 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.howto-content p {
  margin: 0 0 10px;
  color: #cfd6e6;
}

.howto-content ul {
  margin: 0 0 10px 18px;
  padding: 0;
  color: #cfd6e6;
}

.howto-content .section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.howto-content .icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.howto-content .icon-row img {
  width: 32px;
  height: 32px;
}

.howto-content .logo {
  width: 180px;
  height: auto;
  display: block;
  margin: 8px auto 16px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

.game-hud {
  position: absolute;
  inset: 0;
  font-weight: 700;
  pointer-events: none;
}

.timer-bar {
  position: absolute;
  top: calc(var(--game-top) + 28px);
  left: calc(var(--game-left) + (var(--game-width) / 2));
  transform: translateX(-50%);
  width: 320px;
  height: 12px;
  background: rgba(10, 12, 18, 0.6);
  border-radius: 999px;
  overflow: visible;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  display: none;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #49d66b, #b5e85a);
  transition: width 0.1s linear;
}

.timer-fill[data-state="warn"] {
  background: linear-gradient(90deg, #f6c343, #f19b2c);
}

.timer-fill[data-state="danger"] {
  background: linear-gradient(90deg, #ff6b6b, #e53935);
}

.timer-text {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: #f5f6fa;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

body[data-game-mode="bonus"] .timer-bar {
  display: block;
}

body[data-screen="game"] .hud-home,
body[data-screen="game"] .hud-level,
body[data-screen="game"] .hud-coins,
body[data-screen="game"] .hud-bonus {
  display: none;
}

.hud-item {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 26, 40, 0.78);
  padding: 10px 14px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.hud-score {
  top: 18px;
  left: 18px;
}

.hud-home {
  top: calc(var(--game-top) + 18px);
  left: var(--game-left);
  transform: translateX(-110%);
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: #f5f6fa;
  pointer-events: auto;
}

.hud-home-icon {
  width: 22px;
  height: 22px;
  transform: rotate(180deg);
}

.hud-level {
  top: calc(var(--game-top) + var(--game-height) - 54px);
  left: calc(var(--game-left) + var(--game-width));
  transform: translateX(10%);
}

.hud-coins {
  top: calc(var(--game-top) + 18px);
  left: calc(var(--game-left) + var(--game-width));
  transform: translateX(10%);
}

.hud-coin {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hud-bonus {
  position: absolute;
  top: calc(var(--game-top) + var(--game-height) - 96px);
  left: calc(var(--game-left) + var(--game-width));
  transform: translateX(10%);
  background: rgba(22, 26, 40, 0.78);
  padding: 8px 12px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

canvas {
  width: 640px;
  height: 704px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
}

body[data-screen="start"] #app {
  max-width: none;
  padding: 0;
}

body[data-screen="game"] #app {
  max-width: none;
  padding: 0;
}

body[data-screen="fortune"] #app {
  max-width: none;
  padding: 0;
}

body[data-screen="game"] #screen-game {
  background-image: var(--game-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
