/* ════════════════════════════════════════════════════════════════════════════
   TOAST & MODAL STYLES
   ════════════════════════════════════════════════════════════════════════════ */

/* Toast Notification */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #151515;
  border: 2px solid #d4af37;
  border-radius: 12px;
  padding: 15px 25px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  animation: slideIn 0.3s;
  max-width: 400px;
}

.toast.show {
  display: block;
}

.toast.success {
  border-color: #00cc66;
  background: rgba(0, 204, 102, 0.1);
}

.toast.error {
  border-color: #ff4d4d;
  background: rgba(255, 77, 77, 0.1);
}

.toast.warning {
  border-color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
}

.admin-support-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: #1db954;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.setting-footer-row {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-top: 12px;
  gap: 0;
  box-sizing: border-box;
}

.setting-half-btn {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 8px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setting-back-half {
  background: linear-gradient(135deg, #d4af37, #f5d76e);
  color: #000;
  border: none;
  border-radius: 8px 0 0 8px;
}

.setting-logout-half {
  background: #ff4d4d;
  color: #000;
  border: 1px solid #ff4d4d;
  border-left: none;
  border-radius: 0 8px 8px 0;
}

.profile-create-overlay {
  background: rgba(0, 0, 0, 0.92) !important;
  z-index: 3000;
}

.creator-notice-overlay {
  background: rgba(0, 0, 0, 0.94) !important;
  z-index: 3100;
  pointer-events: auto;
}

.creator-notice-card {
  max-width: 560px;
  width: min(92vw, 560px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 22px 18px;
}

.creator-notice-card .modal-header h2 {
  font-size: 1.15rem;
  line-height: 1.35;
  color: #d4af37;
}

.creator-notice-body {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-line;
  margin: 8px 0 18px;
}

.creator-notice-accept {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #111;
  background: linear-gradient(180deg, #f0d78c 0%, #d4af37 100%);
}

.creator-notice-accept:disabled {
  opacity: 0.55;
  cursor: wait;
}

.profile-create-card {
  max-height: 90vh;
  overflow-y: auto;
}

.profile-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-photo-preview,
.profile-view-photo img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d4af37;
}

.profile-view-photo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.profile-photo-btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #d4af37;
  border-radius: 8px;
  color: #d4af37;
  cursor: pointer;
  font-size: 13px;
}

.profile-error {
  color: #ff4d4d;
  font-size: 13px;
  min-height: 18px;
  margin: 8px 0 12px;
}

.profile-status {
  color: #d4af37;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
  margin: 8px 0 4px;
}

.indigenous-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.indigenous-row input {
  flex: 1;
  width: auto !important;
}

.indigenous-dot {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 2px solid #888;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.indigenous-dot.state-pending {
  border-color: #ff2d2d;
  background: #ff2d2d;
  box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.7);
  animation: indigenousBlink 1s ease-in-out infinite;
}

.indigenous-dot.state-skip {
  border-color: #ddd;
  background: #fff;
  box-shadow: none;
  animation: none;
}

.indigenous-dot.state-selected {
  border-color: #1db954;
  background: #1db954;
  box-shadow: none;
  animation: none;
}

@keyframes indigenousBlink {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.55);
  }
  50% {
    opacity: 0.35;
    box-shadow: 0 0 0 6px rgba(255, 45, 45, 0);
  }
}

.indigenous-hint {
  color: #888;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.35;
}

.admin-indigenous-cell {
  min-width: 220px;
  max-width: 300px;
  vertical-align: top;
}

.admin-indigenous-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  margin: 0 0 8px;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

.admin-indigenous-dot.state-on {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  border-color: #86efac;
}

.admin-indigenous-dot:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-indigenous-editor.is-collapsed .admin-indigenous-list[hidden] {
  display: none !important;
}

.admin-indigenous-editor.is-collapsed {
  gap: 4px;
}

.admin-indigenous-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.admin-indigenous-name-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-indigenous-name-input {
  flex: 1;
  min-width: 0;
  background: #111;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  font-size: 12px;
}

.admin-indigenous-remove {
  padding: 6px 8px !important;
  min-width: 32px;
  line-height: 1;
}

.admin-indigenous-add {
  align-self: flex-start;
  padding: 6px 10px !important;
  font-size: 12px !important;
}

.admin-indigenous-off {
  color: #777;
  font-size: 12px;
}

.profile-create-card .form-group {
  margin-bottom: 12px;
}

.profile-create-card .form-group label {
  display: block;
  color: #d4af37;
  font-size: 13px;
  margin-bottom: 6px;
}

.profile-create-card .form-group input,
.profile-create-card .form-group select,
#adminSupportModal .form-group select {
  width: 100%;
  padding: 10px;
  background: #000;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  box-sizing: border-box;
}


@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s;
}

.modal-content {
  background: #151515;
  border: 2px solid #d4af37;
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #d4af37;
}

.modal-header h2 {
  color: #d4af37;
  margin: 0;
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: 0.3s;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #ff4d4d;
  transform: rotate(90deg);
}

.modal-body {
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
}

.modal-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #333;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.card-item {
  background: #0a0a0a;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition: 0.3s;
}

.card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card-item.common {
  border-color: #888;
}

.card-item.joker-green {
  border-color: #00cc66;
  box-shadow: 0 0 10px rgba(0, 204, 102, 0.3);
}

.card-item.joker-red {
  border-color: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
}

.card-item.joker-gold {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.card-item .card-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.card-item .card-icon .game-icon-shield,
.card-item .card-icon .game-icon-starship,
.card-item .card-icon .game-icon-reaper,
.card-item .card-icon .game-icon-bust,
.card-item .card-icon .game-icon-crate {
  width: 36px;
  height: 36px;
  vertical-align: middle;
}

.card-item .card-count {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}

.card-item .card-name {
  font-size: 12px;
  color: #888;
}

/* History List */
.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #0a0a0a;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid #d4af37;
}

.history-item .time {
  color: #888;
  font-size: 12px;
}

.history-item .result {
  color: #fff;
  font-size: 14px;
  flex: 1;
  margin: 0 10px;
}

.history-item .multiplier {
  color: #d4af37;
  font-weight: bold;
  font-size: 14px;
}

@media (max-width: 768px) {
  .toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 14px;
    padding: 12px 20px;
  }
  
  .modal-content {
    padding: 20px;
    max-height: 90vh;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* บังคับอัปเดตเวอร์ชัน — ปิดไม่ได้จนกว่าจะกดยอมรับ */
.force-update-overlay {
  z-index: 99999 !important;
  background: rgba(0, 0, 0, 0.92) !important;
  pointer-events: auto !important;
  position: fixed !important;
  inset: 0 !important;
  display: none;
  justify-content: center !important;
  align-items: center !important;
}

.force-update-overlay.active {
  display: flex !important;
}

.force-update-modal {
  text-align: center;
  max-width: 420px;
  width: calc(100% - 40px);
}

.force-update-accept {
  width: 100%;
  padding: 14px 20px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  border-radius: 10px;
}
