/* Game Details & Purchase Page Styles */
/* Extends the Neon Theme */

.game-purchase-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
  position: relative;
}

@media (min-width: 768px) {
  .game-purchase-container {
    grid-template-columns: 350px 1fr;
    padding: 40px 24px;
  }
}

@media (min-width: 1024px) {
  .game-purchase-container {
    grid-template-columns: 380px 1fr;
  }
}

/* Glass/Neon Card */
.neon-card {
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.neon-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--banana-1), transparent);
  opacity: 0.5;
}

/* Game Info Column */
.game-info {
  text-align: center;
}

.game-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
  margin-bottom: 20px;
  border: 1px solid var(--banana-1);
}
.game-cover[src$="Honor%20of%20king.webp"], .game-cover[src$="Honor of king.webp"] { object-position: center; }

.game-title {
  font-family: var(--font-gaming);
  font-size: 24px;
  font-weight: 800;
  color: var(--banana-1);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.delivery-badge {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 213, 79, 0.12);
  border: 1px solid var(--banana-1);
  border-radius: 20px;
  color: var(--banana-1);
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 16px;
}

/* Form Sections */
.purchase-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--neon-2);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: var(--font-gaming);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.game-purchase-container .section-title {
  font-family: var(--font-gaming);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-0);
  margin: 0;
}

/* Inputs */
.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .input-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.neon-input {
  width: 100%;
  padding: 14px;
  background: #0a1329;
  border: 2px solid var(--border-0);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-gaming);
  font-size: 16px;
  transition: all 0.2s;
}

.neon-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

select.neon-input {
  color-scheme: dark;
  height: auto;
  min-height: 48px;
  padding: 12px 40px 12px 14px;
  line-height: 1.2;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

select.neon-input option {
  background-color: #0a1329;
  color: #fff;
}

select.neon-input:invalid {
  color: rgba(148, 163, 184, 0.9);
}

.neon-input:focus {
  outline: none;
  border-color: var(--banana-1);
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.25);
}

/* Package Grid */
.package-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .package-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .package-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.package-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-0);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .package-item:hover {
    background: rgba(255, 213, 79, 0.08);
    border-color: var(--banana-1);
    transform: translateY(-2px);
  }
}

.package-item.selected {
  background: rgba(255, 213, 79, 0.12);
  border-color: var(--banana-1);
  box-shadow: 0 0 16px rgba(255, 213, 79, 0.25);
}

.package-amount {
  font-weight: 700;
  color: var(--text-0);
  font-size: 16px;
}

.package-sell-price {
  color: var(--banana-1);
  font-weight: bold;
  font-size: 14px;
}

.package-price {
  color: var(--banana-1);
  font-weight: bold;
  font-size: 14px;
}

body[data-page="game_p_mlid"] .package-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

body[data-page="game_p_mlid"] .package-item {
  background: rgba(10, 19, 41, 0.70);
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
  min-height: 52px;
}

body[data-page="game_p_mlid"] .package-amount {
  font-weight: 900;
}

body[data-page="game_p_mlid"] .package-sell-price {
  color: var(--banana-1);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
}

/* Payment Button */
.payment-bar {
  position: relative;
  background: rgba(15, 22, 48, 0.88);
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  width: 100%;
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.55), 0 0 18px rgba(255,213,79,0.08);
  overflow: visible;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.payment-bar::before {
  content: none;
}

.payment-bar .btn-neon-auth {
  min-width: 108px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(10, 19, 41, 0.92);
  border: 2px solid rgba(255, 213, 79, 0.55);
  color: var(--banana-1);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(34, 211, 238, 0.12);
  text-shadow: 0 0 16px rgba(255, 213, 79, 0.40);
}

.payment-bar .btn-neon-auth::before {
  content: none;
}

.payment-bar .btn-neon-auth:hover {
  background: rgba(255, 213, 79, 0.12);
  border-color: rgba(255, 213, 79, 0.70);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.50), 0 0 18px rgba(255, 213, 79, 0.20);
}

.total-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--banana-1);
}

.total-label {
  font-size: 12px;
  color: var(--text-1);
  display: block;
}

/* Helper Text */
.helper-text {
  font-size: 12px;
  color: var(--text-1);
  margin-top: 8px;
  line-height: 1.4;
}

/* Professional Select Styling */
.select-wrapper {
  position: relative;
}

.neon-select {
  width: 100%;
  padding: 12px 40px 12px 14px;
  background: #0a1329;
  border: 2px solid var(--border-0);
  border-radius: 10px;
  color: #e6e9f1;
  font-family: var(--font-mono);
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s;
}

.neon-select:focus {
  outline: none;
  border-color: var(--banana-1);
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.25);
}

.select-wrapper::after {
  content: '\\25BC';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--banana-1);
  pointer-events: none;
}
@media (max-width: 767px) {
  .payment-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(10px + env(safe-area-inset-bottom) + 74px);
    width: calc(100% - (32px + env(safe-area-inset-left) + env(safe-area-inset-right)));
    max-width: 520px;
    margin: 0;
    padding: 12px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 22, 48, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.55), 0 0 18px rgba(255,213,79,0.10);
    z-index: 96;
  }
  .payment-bar .selected-packages-container { display: none; }
  .payment-bar[data-expanded="1"] .selected-packages-container {
    display: block;
    grid-column: 1 / -1;
    max-height: 96px;
    overflow: auto;
  }
  .selected-packages {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.45;
  }
  .selected-packages-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .total-container .total-price { font-size: 18px; }
  .payment-bar .btn-neon-auth {
    min-width: 92px;
    min-height: 40px;
    justify-self: end;
  }
  .package-grid { gap: 8px; }
  .game-purchase-container { justify-items: center; }
  .game-purchase-container > .section-header { justify-self: stretch; width: 100%; }
  .game-info { width: 100%; display: flex; justify-content: center; }
  .purchase-form { width: 100%; display: flex; flex-direction: column; align-items: center; padding-bottom: calc(var(--payment-bar-fixed-space, 96px) + 16px); }
  .game-info .neon-card, .purchase-form .neon-card { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 360px) {
  .payment-bar .btn-neon-auth {
    min-width: 82px;
    padding: 0 12px;
  }
}

@media (min-width: 768px) {
  .payment-bar {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    grid-template-columns: 1fr auto auto;
    grid-auto-rows: auto;
    align-items: center;
    gap: 16px;
  }

  .payment-bar .selected-packages-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .payment-bar .total-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-self: end;
    min-width: 0;
    justify-self: end;
    text-align: right;
  }

  .payment-bar .btn-neon-auth {
    justify-self: end;
    min-width: 140px;
  }

  .payment-bar .selected-packages-title {
    margin: 0;
    white-space: nowrap;
  }

  .payment-bar .selected-packages {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
    overflow: hidden;
  }

  .payment-bar .selected-packages li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
  }
}

@media (max-width: 424px) {
  .game-purchase-container { padding-left: 12px; padding-right: 12px; }
  .game-info .neon-card, .purchase-form .neon-card { width: 100%; max-width: 480px; margin: 0 auto; }
}
