/* Brightened theme with warmer tones */
:root {
  --bg-primary: #1c1814;
  --bg-secondary: #252019;
  --bg-card: #352c22;
  --bg-card-light: #3d3228;
  --gold: #c9a227;
  --gold-light: #e8c252;
  --gold-bright: #f5d76e;
  --text-primary: #f5f0e8;
  --text-muted: #a99275;
  --text-dim: #8a7560;
  --border: rgba(201, 162, 39, 0.4);
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.back-btn {
  font-size: 20px;
  padding: 8px 14px;
  background: linear-gradient(145deg, var(--bg-card-light) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--gold-light);
  transition: all 0.3s ease;
}

.back-btn:hover {
  border-color: var(--gold-light);
  transform: translateX(-3px);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.25);
}

h1 {
  font-size: 20px;
  color: var(--text-primary);
  margin: 0;
}

.game-header {
  background: linear-gradient(145deg, var(--bg-card-light) 0%, rgba(201, 162, 39, 0.15) 100%);
  color: white;
  border-radius: 16px;
  overflow: hidden;
  margin: 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.game-banner {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid var(--border);
}

.game-info {
  padding: 24px 20px;
}

.game-info h3 {
  margin: 0 0 8px;
  color: var(--gold-light);
  font-size: 20px;
}

.game-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.input-section {
  position: relative;
  background: linear-gradient(145deg, var(--bg-card-light) 0%, var(--bg-card) 100%);
  padding: 22px 18px;
  margin: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.input-section input[type="text"],
.input-section input[type="number"] {
  width: calc(100% - 32px);
}

/* Label row with flexbox */
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Rounded ? button */
.info-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-weight: bold;
  font-size: 16px;
  color: var(--bg-primary);
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.info-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.55);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 17, 14, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.guide-image {
  width: 90%;
  max-width: 350px;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border);
}

.input-section label {
  display: block;
  margin-top: 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-section input {
  width: 100%;
  padding: 14px 16px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: rgba(28, 24, 20, 0.6);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.input-section input:focus {
  outline: none;
  border-color: var(--gold-light);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.25);
}

.input-section input::placeholder {
  color: var(--text-dim);
}

.error-text {
  color: #f87171;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Fixed diamond card grid to show 2 columns properly */
.diamond-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.diamond-card {
  position: relative;
  display: flex;
  background: linear-gradient(145deg, var(--bg-card-light) 0%, var(--bg-card) 100%);
  border-radius: 14px;
  padding: 12px;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  /* Removed conflicting width properties */
  width: 100%;
  box-sizing: border-box;
}

/* Responsive grid columns */
@media (min-width: 600px) {
  .diamond-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.diamond-card.selected {
  border-color: var(--gold-light);
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.2) 0%, var(--bg-card) 100%);
  box-shadow: 0 8px 30px rgba(201, 162, 39, 0.3);
}

.diamond-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 162, 39, 0.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.discount-label {
  position: absolute;
  top: -8px;
  left: -8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.45);
}

.diamond-img {
  width: 42px;
  height: 42px;
  margin-right: 10px;
  filter: drop-shadow(0 2px 8px rgba(201, 162, 39, 0.35));
}

.diamond-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.diamond-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.diamond-bonus {
  font-size: 12px;
  color: var(--text-muted);
  margin: 3px 0;
}

.diamond-prices {
  display: flex;
  gap: 8px;
  align-items: center;
}

.old-price {
  text-decoration: line-through;
  color: var(--text-dim);
  font-size: 12px;
}

.new-price {
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 700;
}

.pay-button {
  text-align: center;
  margin: 32px 16px;
}

.pay-button button {
  width: 100%;
  padding: 16px 40px;
  font-size: 16px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--bg-primary);
  border: none;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(201, 162, 39, 0.45);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pay-button button:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-bright) 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(201, 162, 39, 0.55);
}

.pay-button button:active {
  transform: scale(0.98);
}

/* Confirm Popup */
.confirm-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 17, 14, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.confirm-popup {
  background: linear-gradient(145deg, var(--bg-card-light) 0%, var(--bg-card) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 28px 24px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(201, 162, 39, 0.15);
  width: 90%;
  max-width: 340px;
  min-height: 360px;
  animation: slideUp 0.3s ease-out;
  border: 1px solid var(--border);
}

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

.confirm-popup h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--gold-light);
}

.confirm-popup p {
  font-size: 15px;
  margin: 14px 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.confirm-popup p strong {
  color: var(--text-muted);
  font-weight: 600;
}

.popup-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}

.popup-buttons button {
  flex: 1;
  padding: 14px 0;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.popup-buttons .cancel {
  background: rgba(138, 117, 96, 0.3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.popup-buttons .cancel:hover {
  background: rgba(138, 117, 96, 0.5);
}

.popup-buttons .confirm {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--bg-primary);
}

.popup-buttons .confirm:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-bright) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.45);
}

/* Payment Note */
.payment-note {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
}

.input-section h3 {
  color: var(--gold-light);
  margin: 0 0 12px;
  font-size: 16px;
}

.input-section input[type="radio"] {
  accent-color: var(--gold-light);
  width: auto;
  margin-right: 8px;
}

/* Responsive */
@media (max-width: 480px) {
  .game-info {
    padding: 18px 16px;
  }
  .input-section {
    padding: 18px 14px;
    margin: 12px;
  }
  .diamond-card {
    padding: 10px;
  }
  .diamond-img {
    width: 36px;
    height: 36px;
  }
  .diamond-title {
    font-size: 13px;
  }
}
