
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.wrapper {
  max-width: 1200px; 
  margin: 0 auto;
  /* padding: 160px 20px; */
  padding-top: 160px;
  padding-bottom: 40px;
}

.store-page-background {
  background-image: url('../../main/site_banner.jpg');
  background-size: cover;
  background-position: center;
  width: 100%;
  background-attachment: fixed;
  flex-grow: 1;
}

.styled-input {
  font-family: "Geologica", serif;
  background-color: #191919;
  color: rgb(255, 255, 255);
  padding: 15px 15px;
  text-align: left;
  border-radius: 10px;
  font-size: 16px;
  display: block;
  border: 1px solid #4a4a4a;
  width: 100%;
}

.styled-input:focus {
  border-color: #686868;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.styled-input::placeholder {
  color: #aaa;
}

.button-store {
  font-family: "Geologica", serif;
  text-decoration: none;
  background-color: #4c5fc7;
  color: white;
  padding: 10px 20px;
  text-align: center;
  border-radius: 20px;
  font-size: 22px;
  transition: background-color 0.3s ease;
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  border: none;
  width: 100%;
}

.button-store:hover {
  background-color: #2c3fa9;
  cursor: pointer;
}

.button-store:active {
  background-color: #414aa3;
}

.agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: "Geologica", serif;
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
}

.agreement input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #4c5fc7;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 3px;
}

.agreement label {
  cursor: pointer;
  flex-grow: 1;
}

.agreement a {
  color: #4c5fc7;
  text-decoration: none;
  font-weight: bold;
}

.agreement a:hover {
  color: #5d73f5;
}

.payment-menu {
  display: none;
  position: absolute;
  top: 50px;
  left: 0;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px;
  width: 200px;
  z-index: 10;
}

.payment-menu ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.payment-menu li {
  margin: 10px 0;
}

.payment-options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  justify-content: center;
}

.payment-option {
  flex: 0 0 calc(33.333% - 10px);
  aspect-ratio: 1 / 1;
  font-family: "Geologica", serif;
  background-color: #191919;
  color: rgb(255, 255, 255);
  padding: 15px;
  text-align: left;
  border-radius: 10px;
  font-size: 16px;
  border: 1px solid #4a4a4a;
  box-sizing: border-box;
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
}

.payment-option:hover {
  background-color: #303030;
}

.payment-option:disabled {
  background-color: #292929;
  cursor: not-allowed;
  filter: brightness(55%);
}

.payment-form {
  display: none;
  flex-direction: column;
  gap: 15px;
}

#tooltip {
  display: none;
  position: absolute;
  background-color: #282828;
  color: white;
  padding: 5px;
  border-radius: 5px;
  pointer-events: none;
  max-width: 270px;
  z-index: 999;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.amount-button {
  font-family: "Geologica", serif;
  background-color: #191919;
  color: rgb(255, 255, 255);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 16px;
  border: 1px solid #4a4a4a;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex: 1 1 auto;
  text-align: center;
  min-width: 60px;
}

.amount-button:hover {
  background-color: #303030;
}

.amount-button.active {
  background-color: #4c5fc7;
  border-color: #4c5fc7;
}

.custom-amount-input {
  flex: 1;
  font-family: "Geologica", serif;
  background-color: #191919;
  color: rgb(255, 255, 255);
  padding: 0px 10px;
  border-radius: 10px;
  font-size: 16px;
  border: 1px solid #4a4a4a;
  outline: none;
  text-align: center;
  transition: border-color 0.3s ease;
  min-width: 30%;
}

.custom-amount-input:focus {
  border-color: #4c5fc7;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.info-box {
  display: flex;
  align-items: flex-start;
  background-color: #4c5fc7;
  color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.icon img {
  width: 80px;
  margin-right: 20px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.info-box .text {
  flex: 1;
  min-width: 0; 
}

.text p {
  font-size: 14px;
}

.custom-amount-wrapper {
  position: relative;
  display: flex;
  flex: 1 1 auto; 
  min-width: 120px;
}

.custom-amount-input {
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  font-size: 16px;
}

.custom-amount-input::placeholder {
  text-align: center;
}

.bonus-tooltip {
  position: absolute;
  right: 0px;
  top: 25%; 
  transform: translateY(-50%);
  background: #4c5fc7;
  color: white;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 6px;
  display: none;
  white-space: nowrap;
  pointer-events: none;
}

.demo-bonus-tooltip {
  position: absolute;
  color: white;
  font-weight: bold;
  white-space: nowrap;
  pointer-events: none;
  font-size: 8px;
  padding: 2px 2px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  bottom: 0;
  width: 100%;
}

.top-donators {
  order: 1;
}

.last-purchases {
  order: 3;
}

.top-donators,
.last-purchases {
  flex-basis: 300px;
  flex-grow: 0;
  flex-shrink: 0;
  height: fit-content;
  padding: 0 10px;
  box-sizing: border-box; 
  width: 100%;
}

div.store_form {
  display: flex;
  flex-wrap: wrap; 
  gap: 20px;
  justify-content: center; 
  align-items: flex-start;
  width: 100%;
  /*margin: 0 auto;*/
}

.main-content-block {
  flex-basis: 500px;
  flex-grow: 1; 
  max-width: 600px;
  padding: 0 0px;
  box-sizing: border-box;
  display: flex; 
  flex-direction: column; 
  gap: 15px;
  order: 2;
}

.user_form { 
  margin-top: 0; 
  width: 100%;
  max-width: 500px; 
  padding: 0; 
  box-sizing: border-box;
}

/* Purchase History Styling */
.purchases-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.purchases-title {
  font-size: 24px;
  margin: 0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Geologica", serif;
}

.purchases-title i {
  color: #4c5fc7;
  font-size: 20px;
}

.purchases-count {
  font-size: 14px;
  color: #bbb;
  background: rgba(76, 95, 199, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(76, 95, 199, 0.5);
}

.refresh-btn {
  background: none;
  border: 1px solid #4c5fc7;
  color: #4c5fc7;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.refresh-btn:hover {
  background: #4c5fc7;
  color: white;
  transform: rotate(180deg);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.refresh-success {
  font-size: 12px;
  color: #4caf50;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: fadeIn 0.3s ease;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 18, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 10;
}

.loading-spinner {
  color: #4c5fc7;
  font-size: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.purchases-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.last-purchases .purchases-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
  overflow-x: hidden;
}

.purchases-container::-webkit-scrollbar {
  width: 6px;
}

.purchases-container::-webkit-scrollbar-track {
  background: #191919;
  border-radius: 3px;
}

.purchases-container::-webkit-scrollbar-thumb {
  background: #4c5fc7;
  border-radius: 3px;
}

.purchases-container::-webkit-scrollbar-thumb:hover {
  background: #2c3fa9;
}

.purchase-card {
  background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.purchase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #4c5fc7, #2c3fa9);
}

.purchase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 95, 199, 0.2);
  border-color: #4a4a4a;
}

.purchase-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.player-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4c5fc7, #2c3fa9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.player-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.player-name {
  font-weight: bold;
  color: #fff;
  font-size: 16px;
  font-family: "Geologica", serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-time {
  font-size: 12px;
  color: #bbb;
  font-family: "Geologica", serif;
}

.coins-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.coins-amount {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin-icon {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}

.coins-value {
  font-weight: bold;
  color: #4c5fc7;
  font-size: 18px;
  font-family: "Geologica", serif;
}

.coins-label {
  font-size: 12px;
  color: #aaa;
  font-family: "Geologica", serif;
}

.empty-purchases {
  text-align: center;
  padding: 40px 20px;
  color: #bbb;
}

.empty-icon {
  font-size: 48px;
  color: #555;
  margin-bottom: 15px;
}

.empty-purchases h3 {
  font-size: 20px;
  margin: 0 0 10px 0;
  color: #aaa;
  font-family: "Geologica", serif;
}

.empty-purchases p {
  font-size: 14px;
  margin: 0;
  color: #888;
  font-family: "Geologica", serif;
  line-height: 1.5;
}

/* МЕДИА-ЗАПРОСЫ */
@media (max-width: 1200px) {
  div.store_form {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
  }

  .main-content-block,
  .last-purchases,
  .top-donators {
    flex-basis: auto;
    margin: 0 auto;
    width: 80%; 
    max-width: 600px;
    order: 0;
  }
  
  .user_form { 
    width: 100%; 
    max-width: unset; 
  }

  .info-box {
    padding: 15px;
  }

  .icon img {
    width: 60px;
    margin-right: 15px;
  }

  .purchases-title {
    font-size: 22px;
  }

  .purchase-info {
    gap: 10px;
  }

  .player-avatar {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .coins-value {
    font-size: 16px;
  }

  .purchases-header {
    align-items: center; 
  }

  .purchases-header .purchases-title {
    flex-basis: 100%; 
    order: 1; 
  }

  .purchases-header .purchases-count {
    order: 2;
    margin-right: auto;
  }

  .purchases-header .refresh-success {
    order: 3;
  }

  .purchases-header .refresh-btn {
    order: 4;
  }
}

@media (max-width: 580px) {
  .wrapper {
    padding: 100px 15px; 
  }

  .button-group {
    flex-direction: column; 
  }

  .amount-button {
    width: 100%; 
    padding: 12px 15px;
    font-size: 14px;
  }

  .custom-amount-wrapper {
    width: 100%; 
    margin-top: 5px;
  }

  .custom-amount-input {
    min-width: unset;
    font-size: 14px;
    padding: 12px 15px;
  }

  .payment-option {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }

  /*.main-content-block,
  .last-purchases,
  .top-donators {
    width: 95%; 
    margin: 10px auto; 
  }

  .main-content-block,
  .last-purchases,
  .top-donators {
    flex-basis: auto;
    margin: 0 auto;
    width: 90%; 
    max-width: 600px;
  }*/

  .main-content-block {
    padding-top: 40px;
  }

  .button-store {
    font-size: 18px;
    padding: 8px 15px;
  }

  .agreement {
    font-size: 12px;
  }

  .info-box .text p {
    font-size: 12px;
  }

  .info-box {
    margin-bottom: 10px;
  }

  .bonus-tooltip {
    font-size: 10px;
    padding: 2px 5px;
  }

  .purchases-title {
    font-size: 20px;
  }

  .purchases-title i {
    font-size: 18px;
  }

  .purchases-count {
    font-size: 12px;
    padding: 3px 6px;
  }

  .purchase-card {
    padding: 15px;
  }

  .purchase-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .player-info {
    gap: 10px;
  }

  .player-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .player-name {
    font-size: 14px;
  }

  .purchase-time {
    font-size: 11px;
  }

  .coins-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
  }

  .coins-value {
    font-size: 16px;
  }

  .coin-icon {
    width: 18px;
    height: 18px;
  }

  .empty-purchases {
    padding: 30px 15px;
  }

  .empty-icon {
    font-size: 36px;
  }

  .empty-purchases h3 {
    font-size: 18px;
  }

  .empty-purchases p {
    font-size: 13px;
  }
}

#promocode_button {
  color: #4c5fc7;
}

#promocode_button:hover {
  color: #5d73f5;
}