:root {
  --footer-offset: 0px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  color: #fff;
  gap: 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(0, 136, 204, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(138, 125, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  display: block;
  width: 100%;
  height: var(--footer-offset);
  flex-shrink: 0;
}

.fortune-block {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#wheelOfFortune {
  display: inline-block;
  position: relative;
  overflow: visible;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

#wheel {
  display: block;
  height: 420px;
  width: 420px;
  transition: transform 0.1s linear;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1),
              0 0 0 8px rgba(0, 136, 204, 0.2),
              inset 0 0 30px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

#wheel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32%;
  height: 32%;
  margin: -16%;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

#spin {
  font: bold 1.4em/1 sans-serif;
  user-select: none;
  cursor: pointer;
  display: flex !important;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32%;
  height: 32%;
  margin: -16%;
  background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
  color: #fff !important;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2),
              0 0 0 12px rgba(0, 136, 204, 0.3),
              0 8px 20px rgba(0, 0, 0, 0.4),
              inset 0 2px 4px rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  z-index: 100;
  pointer-events: auto;
  visibility: visible !important;
  opacity: 1 !important;
}

#spin:hover:not(.spin-wait) {
  transform: scale(1.05);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3),
              0 0 0 12px rgba(0, 136, 204, 0.4),
              0 12px 30px rgba(0, 0, 0, 0.5),
              inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

#spin:active:not(.spin-wait) {
  transform: scale(0.95);
}

#spin::after {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border: 12px solid transparent;
  border-bottom-color: #fff;
  border-top: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  gap: 20px;
  margin: 20px auto 0;
  position: relative;
  z-index: 1;
  padding: 10px 20px;
  min-height: 110px;
  flex-shrink: 0;
}

.profile-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.profile-tg-avatar {
  object-fit: cover;
  height: 60px;
  width: 60px;
  border-radius: 50%;
  border: 3px solid rgba(0, 136, 204, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.profile-tg-avatar:hover {
  border-color: rgba(0, 136, 204, 0.6);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.profile-block-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-block-text h1,
.profile-block-text h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.profile-block-text-h1 {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

.profile-block-text-h2 {
  font-size: 18px;
  font-weight: 500;
  color: #0088cc;
}

.bonus-points-block {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  padding: 16px 24px;
  min-width: 120px;
  border-radius: 26px;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.bonus-points-block:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.bonus-points-count {
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bonus-points-icon {
  object-fit: contain;
  height: 25px;
}

.footer-panel {
  display: flex;
  z-index: 2;
  gap: 20px;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
  padding: 20px 40px;
  align-items: center;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 420px;
}

.icon-container {
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}

.icon-container:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.icon-container-active {
  background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
  padding: 16px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.footer-icon {
  object-fit: contain;
  height: 40px;
}

.inventory-block {
  display: flex;
  gap: 15px;
  justify-content: center;
  max-width: 600px;
  flex-wrap: wrap;
  height: 540px;
  overflow-y: auto;
  padding-bottom: 20px;
  margin-bottom: 20px;
  margin-top: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 136, 204, 0.3) transparent;
}

.gift-card-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.gift-card:hover .gift-card-img-container {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.15) 0%, rgba(0, 136, 204, 0.1) 100%);
  border-color: rgba(0, 136, 204, 0.3);
}

.gift-card-img {
  height: 120px;
}

.gift-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 26px;
  gap: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.gift-card-h1 {
  font-size: 23px;
}

.gift-card-main-button {
  background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  padding: 12px 24px;
  border-radius: 20px;
  max-width: 132px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gift-card-main-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.gift-card-main-button:active {
  transform: translateY(0);
}

.gift-card-main-button-p {
  font-weight: 550;
  font-size: 20px;
}

.gift-card-main-button-icon {
  height: 20px;
}

.gift-card-second-button {
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gift-card-second-button:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gift-card-second-button-img {
  height: 40px;
}

.gift-card-buttons-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(30, 30, 30, 0) 0%, rgba(30, 30, 30, 0.85) 40%, rgba(30, 30, 30, 1) 100%);
  z-index: 10;
}

.transfer-icon {
  margin: 15px auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.transfer-icon:hover {
  transform: scale(1.1) rotate(5deg);
}

.transfer-button {
  background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
  color: #fff;
  border: none;
  height: 70px;
  width: 100%;
  max-width: 420px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

.transfer-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.transfer-button:active {
  transform: translateY(0);
}

.transfer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
  max-width: 500px;
  position: relative;
  z-index: 1;
  padding: 0 20px;
}

.transfer-block-area {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.transfer-block-area-p {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 70px;
  padding: 0 20px;
  margin-top: -10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: rgba(0, 136, 204, 0.5);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;

  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 24px;
  font-family: Inter, sans-serif;
}

.bonus-points-transfer-icon {
  height: 25px;
}

/* SMALL LAPTOP — 769–1024px */
@media (max-width: 1024px) {
  body {
    gap: 30px;
    padding: 15px;
  }

  .profile-header {
    gap: 30px;
    padding: 0 15px;
  }

  #wheel {
    height: 380px;
    width: 380px;
  }

  .footer-icon {
    height: 32px;
  }

  .icon-container,
  .icon-container-active {
    padding: 14px;
  }

  .footer-panel {
    gap: 20px;
    padding: 18px 30px;
  }

  .transfer-button {
    max-width: 100%;
  }

  .input-wrapper {
    gap: 15px;
  }
}

/* TABLET — 481–768px */
@media (max-width: 768px) {
  body {
    gap: 25px;
    padding: 15px;
  }

  #wheel {
    height: 350px;
    width: 350px;
  }

  .profile-header,
  .profile-header2 {
    gap: 20px;
    padding: 0 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-panel {
    padding: 15px 25px;
    gap: 15px;
    border-radius: 40px;
  }

  .footer-icon {
    height: 28px;
  }

  .icon-container,
  .icon-container-active {
    padding: 12px;
  }

  .gift-card-main-button {
    max-width: 120px;
    padding: 10px 20px;
  }

  .gift-card-second-button-img {
    height: 30px;
  }

  .gift-card-img {
    height: 100px;
  }

  .inventory-block {
    max-width: 100%;
    width: 100%;
    padding: 0 10px;
  }

  .transfer-button {
    max-width: 100%;
  }

  .input-wrapper {
    gap: 15px;
  }
}

/* MOBILE — до 480px */
@media (max-width: 480px) {
  body {
    gap: 30px;
    padding: 10px;
  }

  .profile-block-text h1,
  .profile-block-text h2,
  .profile-block-text-h1,
  .profile-block-text-h2 {
    font-size: 16px;
  }

  .profile-tg-avatar {
    height: 50px;
    width: 50px;
  }

  .bonus-points-block {
    gap: 6px;
    min-width: 100px;
    padding: 12px 16px;
    border-radius: 20px;
  }

  .bonus-points-count {
    font-size: 20px;
  }

  .bonus-points-icon {
    height: 20px;
  }

  #wheel {
    height: 300px;
    width: 300px;
  }

  #spin {
    font-size: 1.1em;
    letter-spacing: 1px;
  }

  .profile-header,
  .profile-header2 {
    gap: 15px;
    margin-top: 10px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 10px;
  }

  .footer-panel {
    padding: 12px 20px;
    gap: 12px;
    border-radius: 35px;
  }

  .footer-icon {
    height: 28px;
  }

  .icon-container,
  .icon-container-active {
    padding: 10px;
  }

  .gift-card {
    padding: 15px;
  }

  .gift-card-img {
    height: 90px;
  }

  .gift-card-main-button-p {
    font-size: 16px;
  }

  .gift-card-h1 {
    font-size: 18px;
  }

  .gift-card-main-button-icon {
    height: 16px;
  }

  .gift-card-main-button {
    padding: 10px 18px;
    max-width: 120px;
  }

  .inventory-block {
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 0 10px;
    height: auto;
    max-height: calc(100vh - 300px);
  }

  .transfer-button {
    height: 60px;
    font-size: 16px;
  }

  .input-wrapper {
    height: 60px;
    padding: 0 15px;
  }

  .transfer-block {
    gap: 20px;
  }
}

@media (max-width: 380px) {
  body {
    gap: 25px;
    padding: 8px;
  }

  .profile-block-text h1,
  .profile-block-text h2,
  .profile-block-text-h1,
  .profile-block-text-h2 {
    font-size: 14px;
  }

  .profile-tg-avatar {
    height: 45px;
    width: 45px;
  }

  .bonus-points-block {
    gap: 5px;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 18px;
  }

  .bonus-points-count {
    font-size: 18px;
  }

  .bonus-points-icon {
    height: 18px;
  }

  #wheel {
    height: 280px;
    width: 280px;
  }

  #spin {
    font-size: 1em;
  }

  .profile-header,
  .profile-header2 {
    gap: 10px;
    margin-top: 10px;
  }

  .footer-panel {
    padding: 10px 15px;
    gap: 10px;
    border-radius: 30px;
  }

  .footer-icon {
    height: 24px;
  }

  .icon-container,
  .icon-container-active {
    padding: 8px;
  }
}

.error-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, rgba(255, 60, 60, 0.95) 0%, rgba(220, 40, 40, 0.95) 100%);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(255, 60, 60, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 90%;
  text-align: center;
}

.error-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.win-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.win-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.win-popup-content {
  background: linear-gradient(135deg, rgba(138, 125, 255, 0.98) 0%, rgba(102, 126, 234, 0.98) 100%);
  color: #fff;
  padding: 32px 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(138, 125, 255, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  min-width: 280px;
  max-width: 90%;
  animation: winPulse 0.6s ease-out;
}

@keyframes winPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.win-popup-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
  animation: bounce 0.6s ease-out 0.2s;
  transform-origin: center bottom;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

.win-popup-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.win-popup-text {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.win-popup-prize {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  color: #FFE66D;
  text-transform: uppercase;
  letter-spacing: 1px;
  word-break: break-word;
}

#spin.spin-wait {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

/* Дополнительные улучшения */
.profile-header2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  gap: 20px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
  padding: 0 20px;
  margin-bottom: 20px;
}

.fortune-block {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  position: relative;
  z-index: 1;
}

/* Улучшения для ссылок */
a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

/* Улучшения для скролла */
.inventory-block {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 136, 204, 0.3) transparent;
}

.inventory-block::-webkit-scrollbar {
  width: 6px;
}

.inventory-block::-webkit-scrollbar-track {
  background: transparent;
}

.inventory-block::-webkit-scrollbar-thumb {
  background: rgba(0, 136, 204, 0.3);
  border-radius: 3px;
}

.inventory-block::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 136, 204, 0.5);
}

/* Плавные переходы для всех интерактивных элементов */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Улучшения для placeholder */
input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

input::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

input:-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Улучшения для body с учетом z-index */
body > * {
  position: relative;
  z-index: 1;
}

