/* --- GLOBAL STYLES (Telegram-like Light Look) --- */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  background: #F0F2F5; /* Very light gray for the main background */
  color: #1A1A1A; /* Default dark text */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-bottom: 60px; /* Space for fixed bottom nav */
  margin: 0;
  -webkit-tap-highlight-color: transparent; /* Убираем синюю подсветку при тапе на iOS */
}
*, *::before, *::after {
  box-sizing: inherit;
}
main {
  flex-grow: 1;
  background: #F0F2F5; /* Ensure main content area is also light gray */
  padding-top: 56px; /* Space for fixed header */
}

/* --- HEADER STYLES --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: #FFFFFF;
  border-bottom: 1px solid #E0E0E0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 0.5rem 1rem;
}
header .max-w-md {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
}

header .logo-and-support {
  display: flex;
  align-items: center;
  gap: 8px;
}
header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0;
}
.star-icon {
  color: #007bff; /* Gold for stars */
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Класс для вращения звездочки во время загрузки */
.star-icon.star-icon--loading {
    animation: spin 1s linear infinite;
    animation-name: spin !important;
    animation-duration: 1s !important;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
}

/* Класс для звездочки после загрузки (пульсация) */
.star-icon.star-icon--idle {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation-name: pulse !important;
    animation-duration: 3s !important;
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1) !important;
    animation-iteration-count: infinite !important;
}

/* Base styles for header buttons */
.header-action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 4px 8px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* Убираем подсветку при тапе */
}

/* Specific styling for Support button (light gray) */
#support-header-button {
    background: #E8ECEF; /* Light gray */
    color: #1A1A1A; /* Dark text */
    margin-left: auto; /* Pushes itself and recharge button to the right */
}
#support-header-button:hover {
  background: #DDE3E7;
  transform: scale(1.02);
}
#support-header-button:active {
  transform: scale(0.98);
}


/* Specific styling for Recharge button (blue) */
#recharge-header-button {
    background: #3390EC; /* Telegram blue */
    color: #fff; /* White text on blue */
    box-shadow: 0 4px 10px rgba(51, 144, 236, 0.2);
}
#recharge-header-button:hover {
  background: #2A79CC;
  transform: scale(1.02);
  box-shadow: 0 6px 14px rgba(51, 144, 236, 0.3);
}
#recharge-header-button:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  #support-header-button span {
    display: none;
  }
  #support-header-button {
    padding: 4px 6px;
  }
  #support-header-button .fa-headset {
      margin-right: 0;
  }
  header h1 {
      font-size: 1rem;
  }
  header .logo-and-support {
      gap: 4px;
  }
}

/* --- Loading Overlay for Cards --- */
.loading-overlay {
    position: fixed; /* Changed to fixed for full screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    display: flex; /* Changed to flex */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* Higher z-index to cover everything */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}
.loading-overlay .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #3390EC; /* Telegram Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}
.loading-overlay span {
    color: #667788;
    font-size: 1rem;
    font-weight: 500;
}

/* Анимации */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #3390EC; }
}

/* --- MAIN CONTENT LAYOUT --- */
main .max-w-md {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  text-align: center;
}
.main-title-section {
  text-align: center;
  margin-bottom: 1rem;
  padding-top: 1rem;
}
.main-title-section h2 {
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  display: block;
}
.main-title-section h2.typing-active {
    border-right: 0.15em solid #3390EC;
    animation: blink-caret .75s step-end infinite;
}
.main-title-section h2.typing-finished {
    border-right: none;
    animation: none;
}
.main-title-section h2 {
    transition: opacity 0.3s ease-out;
}
.main-title-section h2.fade-out-text {
    opacity: 0;
}

/* --- DYNAMIC INPUT CARD (NEW MAIN INTERFACE - index.html) --- */
.dynamic-input-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 1.5rem 1.2rem;
  margin: 0 auto 2rem auto;
  color: #1A1A1A;
  max-width: 420px;
}
.form-group {
    margin-bottom: 0.7rem;
}
.form-group:last-of-type {
    margin-bottom: 0;
}
.dynamic-input-card label {
  color: #667788;
  font-weight: 500;
  margin-bottom: 0.3rem;
  display: block;
}
/* --- UPDATED STYLE FOR INPUTS (WITH ICONS & BOLD TEXT) --- */
.modal-content input[type="number"],
.dynamic-input-card input[type="number"],
.dynamic-input-card input[type="text"],
.modal-content input[type="text"],
.admin-section textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  padding-left: 35px;
  border: 1px solid #C4CDD4;
  border-radius: 8px;
  background: #F0F2F5;
  color: #1A1A1A;
  font-size: 1.05rem;
  font-weight: bold;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}
.modal-content input[type="number"]::-webkit-outer-spin-button,
.modal-content input[type="number"]::-webkit-inner-spin-button,
.dynamic-input-card input[type="number"]::-webkit-outer-spin-button,
.dynamic-input-card input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.modal-content input[type="number"]:focus,
.dynamic-input-card input[type="number"]:focus,
.dynamic-input-card input[type="text"]:focus,
.modal-content input[type="text"]:focus,
.admin-section textarea:focus {
  outline: none;
  border-color: #3390EC;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.25);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.input-icon {
    position: absolute;
    left: 10px;
    color: #667788;
    font-size: 1rem;
    z-index: 2;
}

.dynamic-input-card .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-input-card .input-group button {
    flex-shrink: 0;
    padding: 0.7rem 1rem;
    background: #E8ECEF;
    color: #1A1A1A;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dynamic-input-card .input-group button:hover {
    background: #DDE3E7;
    transform: scale(1.02);
}
.dynamic-input-card .input-group button:active {
    transform: scale(0.98);
}

/* Avatar styling */
.avatar-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
}
.avatar-area .avatar-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #C4CDD4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-area .avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-area .avatar-container .fa-user {
  font-size: 2.5rem;
  color: #667788;
}
.avatar-area .username-display {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1A1A1A;
}
.avatar-area .username-display .blue-name {
    color: #3390EC;
}

/* Main "Buy" Button */
.telegram-button {
  background: #3390EC;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 0;
  margin-top: 0.5rem;
  box-shadow: 0 4px 10px rgba(51, 144, 236, 0.2);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.telegram-button .fa-spinner {
    margin-left: 8px;
    display: none;
}
.telegram-button:hover {
  background: #2A79CC;
  transform: scale(1.02);
  box-shadow: 0 6px 14px rgba(51, 144, 236, 0.3);
}
.telegram-button:active {
  transform: scale(0.98);
}
.buy-button-spinner {
    margin-left: 8px;
    color: #fff;
}
.telegram-button .buy-button-spinner.active {
    display: inline-block !important;
}
/* Disabled state for main button */
.telegram-button:disabled {
  background: #C4CDD4;
  color: #8C9BA8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.7;
}

/* --- INFO SECTION (index.html) --- */
.info-section {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #667788;
}
.info-section a {
  color: #3390EC;
  text-decoration: none;
  transition: color 0.15s;
}
.info-section a:hover {
  color: #2A79CC;
  text-decoration: underline;
}

/* --- POLICY LINKS SECTION (index.html) --- */
.policy-links-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0 10px;
  overflow-x: hidden;
}
.policy-links-section .policy-button {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background: transparent;
    color: #3390EC;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
    box-shadow: none;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
}
.policy-links-section .policy-button i {
    margin-right: 0.25rem;
    font-size: 0.85rem;
}
.policy-links-section .policy-button:hover {
    background: #F0F2F5;
    color: #2A79CC;
    border-color: #E0E0E0;
    transform: none;
    box-shadow: none;
}
.policy-links-section .policy-button:active {
    background: #E8ECEF;
    transform: translateY(1px);
}

/* --- MODAL WINDOWS --- */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}
.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 16px;
  padding: 28px 20px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
  text-align: left;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
.modal-backdrop.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}
.modal-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #1A1A1A;
  text-align: center;
}
.modal-content .modal-description {
    font-size: 0.95rem;
    color: #667788;
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.modal-content .modal-row {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #667788;
  border-bottom: 1px solid #E0E0E0;
}
.modal-content .modal-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.modal-content .modal-row span:last-child {
  font-weight: 600;
  color: #3390EC;
}
.modal-content .modal-row span#modal-balance-after.negative {
    color: #EF4444;
}

.modal-content .modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
}
.modal-content button {
  flex: 1 1 0;
  padding: 10px 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
/* Modal Confirm Button */
.modal-content .confirm-btn {
  background: #3390EC;
  color: #fff;
  box-shadow: 0 2px 8px rgba(51, 144, 236, 0.15);
}
.modal-content .confirm-btn:hover {
  background: #2A79CC;
}
/* Modal Cancel Button */
.modal-content .cancel-btn {
  background: #E8ECEF;
  color: #1A1A1A;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.modal-content .cancel-btn:hover {
  background: #DDE3E7;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #8C9BA8;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.modal-close:hover {
  color: #1A1A1A;
}

/* Modal Checkbox (index.html) */
.modal-checkbox-row {
    display: flex;
    align-items: flex-start;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #667788;
}
.modal-checkbox-row input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: #3390EC;
    cursor: pointer;
}
.modal-checkbox-row label a {
    color: #3390EC;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}
.modal-checkbox-row label a:hover {
    text-decoration: underline;
}

/* Notification Popups */
.fixed-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  background: #4CAF50;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.95rem;
  animation: slideInFromRight 0.3s ease-out forwards, fadeOut 0.3s ease-in 2.7s forwards;
}
.fixed-notification.error {
  background: #EF4444;
}
.fixed-notification.info {
    background-color: #2196F3;
}

@keyframes slideInFromRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    90% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* --- Browser Mode Info Section (index.html, mines.html) --- */
.browser-mode-info {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 1.5rem 1.2rem;
    margin: 2rem auto;
    color: #1A1A1A;
    max-width: 420px;
    text-align: center;
}
.browser-mode-info h4 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.8rem;
    color: #FBBE24;
}
.browser-mode-info p {
    color: #667788;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.browser-mode-info .get-link-button {
    background: #3390EC;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    box-shadow: 0 4px 10px rgba(51, 144, 236, 0.2);
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.browser-mode-info .get-link-button:hover {
    background: #2A79CC;
    transform: scale(1.02);
}
.browser-mode-info .get-link-button:active {
    transform: scale(0.98);
}
/* NEW: Default CSS Variables for Case Tags */
:root {
    --tag-bg-color-default: #8B5CF6; /* Default purple */
    --tag-glow-color-default: rgba(139, 92, 246, 0.3); /* Default purple glow (transparent) */

    --tag-bg-color-discount: #5CB65C; /* Green */
    --tag-glow-color-discount: rgba(92, 182, 92, 0.5); /* Green glow */

    --tag-bg-color-new: #17A2B8; /* Blue */
    --tag-glow-color-new: rgba(23, 162, 184, 0.5); /* Blue glow */

    --tag-bg-color-popular: #FFD700; /* Gold */
    --tag-glow-color-popular: rgba(255, 215, 0, 0.5); /* Gold glow */
}

/* NEW: Styles for Case Tags */
.case-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    min-height: 20px;
}

.case-tag {
    background-color: var(--tag-bg-color-default);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 8px var(--tag-glow-color-default);
    animation: tagGlow 1.5s infinite alternate;
}

/* Specific tag styles - эти классы теперь будут использовать CSS-переменные */
.case-tag[data-tag-type="discount"] {
    background-color: var(--tag-bg-color-discount);
    box-shadow: 0 0 8px var(--tag-glow-color-discount);
}
.case-tag[data-tag-type="new"] {
    background-color: var(--tag-bg-color-new);
    box-shadow: 0 0 8px var(--tag-glow-color-new);
}
.case-tag[data-tag-type="popular"] {
    background-color: var(--tag-bg-color-popular);
    box-shadow: 0 0 8px var(--tag-glow-color-popular);
    color: #333;
}

@keyframes tagGlow {
    0% { box-shadow: 0 0 5px var(--tag-glow-color, rgba(139, 92, 246, 0.3)); }
    50% { box-shadow: 0 0 15px var(--tag-glow-color, rgba(139, 92, 246, 0.6)); }
    100% { box-shadow: 0 0 5px var(--tag-glow-color, rgba(139, 92, 246, 0.3)); }
}
/* --- BOTTOM NAVIGATION BAR --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #FFFFFF;
    border-top: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    z-index: 100;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1); /* Stronger shadow */
    padding: 5px 0; /* Vertical padding */
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #667788;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    flex-grow: 1;
    height: 100%;
    transition: all 0.2s ease-in-out;
    border-radius: 8px; /* Rounded corners for highlight */
    margin: 0 4px; /* Small horizontal margin for items */
    padding-top: 5px; /* Adjust padding */
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.bottom-nav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    transition: all 0.2s ease-in-out;
}

.bottom-nav .nav-item span {
    transition: all 0.2s ease-in-out;
}

.bottom-nav .nav-item:hover:not(.active) {
    background: #F0F2F5;
    color: #1A1A1A;
    transform: translateY(-2px);
}

/* Active state for the current page */
.bottom-nav .nav-item.active {
    color: #3390EC;
    background-color: #E8ECEF;
    box-shadow: 0 -2px 8px rgba(51, 144, 236, 0.2); /* Blue shadow on top */
    border-bottom: 2px solid #3390EC; /* Blue bottom border for active */
    padding-bottom: 3px;
}

.bottom-nav .nav-item.active i {
    color: #3390EC;
    transform: translateY(-2px);
}
.bottom-nav .nav-item.active span {
    font-weight: 600;
}

/* --- Styles for Mines Game (mines.html) --- */
.mines-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mines-grid {
    display: grid;
    gap: 4px;
    margin-bottom: 1rem;
}

.mines-cell {
    width: 40px;
    height: 40px;
    background: #E8ECEF;
    border-radius: 6px;
    color: #1A1A1A;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.mines-cell:hover:not(.revealed):not(:disabled) {
    background: #DDE3E7;
    transform: scale(1.05);
}

.mines-cell.revealed {
    cursor: default;
    transform: none;
}

.mines-cell.safe {
    background: #4CAF50;
    color: #fff;
}

.mines-cell.mine {
    background: #EF4444;
    color: #fff;
}

.mines-status {
    color: #667788;
    font-size: 1rem;
    margin-bottom: 1rem;
}
.mines-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mines-actions button {
    width: 100%;
    margin: 5px 0;
}
.mines-cell:not(.revealed):not(:disabled){
  cursor: pointer;
}
.mines-cell:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.main-title-section {
    margin-bottom: 0px !important;
}
.mines-actions #demo-spin-section{
    margin-top: 0;
}
.mines-cell.mine-near{
  font-size:15px;
  font-weight: bold;
}
/* Styles for the "Начать игру" button */
#start-game-button {
    background: #3390EC;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 0;
    margin-top: 1rem;
    box-shadow: 0 4px 10px rgba(51, 144, 236, 0.2);
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
#start-game-button:hover:not(:disabled) {
    background: #2A79CC;
    transform: scale(1.02);
    box-shadow: 0 6px 14px rgba(51, 144, 236, 0.3);
}
#start-game-button:active:not(:disabled) {
    transform: scale(0.98);
}
#start-game-button:disabled {
    background: #C4CDD4;
    color: #8C9BA8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}
.hidden-button {
	display: none !important;
}
/* НОВЫЙ СТИЛЬ ДЛЯ КНОПКИ ДЕМО */
.demo-spin-button {
    background: #E8ECEF;
    color: #1A1A1A;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 0;
    margin-top: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.demo-spin-button:hover:not(:disabled) {
    background: #DDE3E7;
    transform: scale(1.02);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}
.demo-spin-button:active:not(:disabled) {
    transform: scale(0.98);
}
.demo-spin-button:disabled {
    background: #C4CDD4;
    color: #8C9BA8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* --- Profile Card (profile.html) --- */
.profile-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin: 1rem auto 2rem auto;
    color: #1A1A1A;
    max-width: 450px;
    text-align: center;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}
.profile-avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #C4CDD4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 12px;
    border: 3px solid #3390EC;
    box-shadow: 0 0 15px rgba(51, 144, 236, 0.2);
}
.profile-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar-container .fa-user {
    font-size: 4rem;
    color: #667788;
}
.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 6px;
}
.profile-fullname {
    font-size: 1rem;
    color: #667788;
}

.profile-stats-section, .referral-section {
    text-align: left;
    margin-bottom: 1.5rem;
}
.profile-stats-section h3, .referral-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3390EC;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-stat-item, .referral-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #E0E0E0;
    font-size: 1rem;
    color: #667788;
}
.profile-stat-item:last-child, .referral-stat-item:last-child {
    border-bottom: none;
}
.profile-stat-item span:last-child, .referral-stat-item span:last-child {
    font-weight: 600;
    color: #1A1A1A;
}

/* --- Referral Program Specific Styles (profile.html) --- */
.referral-link-container {
    background: #E8ECEF;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.95rem;
    color: #1A1A1A;
}
.referral-link-container input {
    flex-grow: 1;
    background: none;
    border: none;
    color: #1A1A1A;
    font-size: 0.95rem;
    outline: none;
    padding: 0;
    cursor: pointer;
}
.referral-link-container button {
    background: #3390EC;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
}
.referral-link-container button:hover {
    background: #2A79CC;
}
.referral-link-container button:active {
    transform: scale(0.95);
}

/* Progress bars for referral milestones */
.milestone-progress {
    margin-top: 1.5rem;
}
.milestone-item {
    margin-bottom: 1.2rem;
}
.milestone-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.milestone-item .progress-bar-container {
    width: 100%;
    background-color: #C4CDD4;
    border-radius: 8px;
    overflow: hidden;
    height: 18px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}
.milestone-item .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2E8B57);
    border-radius: 8px;
    transition: width 0.5s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.milestone-item .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform: translateX(-100%);
    animation: shine 2.5s infinite;
}
@keyframes shine {
    0% { transform: translateX(-100%); }
    60% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}
.milestone-item .progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 18px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    z-index: 1;
}
.milestone-item .status-icon {
    font-size: 1.1em;
    margin-left: auto;
    color: #667788;
}
.milestone-item.completed .status-icon {
    color: #4CAF50;
}
/* Style for active tab button (profile.html) */
.tab-button.active {
    background: #007bff;
}

/* --- CONTAINER STYLES (roulette.html) --- */
.roulette-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
}
.roulette-container h2 {
    font-size: 1.8rem;
    color: #1A1A1A;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.roulette-container p {
    color: #667788;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Cost Display (roulette.html) */
.cost-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
}
.cost-display .original-cost {
    color: #667788;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 0.9em;
}
.cost-display .discounted-cost {
    color: #FBBE24;
}
/* NEW: Freespin display */
.freespin-info {
    font-size: 1.05rem;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.freespin-info i {
    margin-right: 5px;
}

/* --- CASE SELECTION STYLES (roulette.html) --- */
.case-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}

.case-button {
    background: #E8ECEF;
    border: 2px solid transparent;
    border-radius: 12px;
    color: #667788;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    min-width: 80px;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.case-button:hover {
    background: #DDE3E7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.case-button.active {
    background: linear-gradient(45deg, #0088cc, #3390EC);
    border-color: #3390EC; /* Changed to match blue theme */
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(51, 144, 236, 0.25);
    z-index: 1;
}

.case-button i {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: #3390EC; /* Blue for icons */
    transition: color 0.2s;
}

.case-button.active i {
    color: #fff;
}

.case-button .case-cost {
    font-size: 0.9em; /* Slightly larger for overall cost */
    font-weight: 500;
    margin-top: 3px;
    color: #8C9BA8; /* Muted light gray */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Small gap between Ruble and Stars */
}
.case-button.active .case-cost {
    color: #fff;
}
.case-button .case-cost .stars-price {
    font-size: 0.8em; /* Make stars part smaller */
    color: #A1A1AA; /* Even more muted color for stars if not active */
    display: flex;
    align-items: center;
    gap: 3px;
}
.case-button.active .case-cost .stars-price {
    color: rgba(255, 255, 255, 0.8); /* Slightly transparent white when active */
}
.case-button .case-cost .stars-price i {
    font-size: 0.9em; /* Make the star icon smaller as well */
    color: inherit; /* Inherit color from parent span */
}


/* --- CASE OPENING SPECIFIC STYLES (roulette.html) --- */
.case-strip-container {
    width: 100%;
    max-width: 400px;
    height: 120px;
    margin: 0 auto 1.5rem auto;
    border-radius: 12px;
    background: #E8ECEF;
    border: 4px solid #DDE3E7;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
}

.case-strip {
    display: flex;
    height: 100%;
    will-change: transform;
}
.case-strip.spinning {
    transition: transform 5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.case-strip.spinning.quick {
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.case-strip.stopped {
    transition: transform 0.5s ease-out;
}

.case-item {
    min-width: 100px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #F0F2F5;
    border-right: 1px solid rgba(0,0,0,0.05);
    color: #1A1A1A;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: default;
    user-select: none;
}
.case-item:last-child {
    border-right: none;
}
.case-item .item-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: #3390EC;
}
.case-item .item-text {
    font-size: 0.9rem;
    color: #667788;
}

/* The winning item after stop */
.case-item.active-prize {
    background: #FFFFFF;
    border-color: #FBBE24;
    transform: scale(1.05);
    transition: transform 0.2s ease-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(251, 190, 36, 0.6);
}

/* Subtle glow effect for winning item */
.case-item.active-prize::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    animation: pulseGlow 1.5s infinite alternate;
    z-index: 1;
}

@keyframes pulseGlow {
    0% { transform: scale(0.8) rotate(0deg); opacity: 0.5; }
    100% { transform: scale(1.2) rotate(360deg); opacity: 0.8; }
}

.case-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #0088cc;
    z-index: 10;
    box-shadow: 0 0 10px rgba(51, 144, 236, 0.25);
}

/* Adjustments for spin button */
.spin-button {
    background: linear-gradient(45deg, #0088cc, #3390EC);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(51, 144, 236, 0.25);
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.spin-button:hover:not(:disabled) {
    background: linear-gradient(45deg, #007bbd, #2a79cc);
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(51, 144, 236, 0.3);
}
.spin-button:active:not(:disabled) {
    transform: scale(0.98);
}
.spin-button:disabled {
    background: #C4CDD4;
    color: #8C9BA8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* NEW: Demo button styles */
.demo-spin-button {
    background: #E8ECEF;
    color: #1A1A1A;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.demo-spin-button:hover:not(:disabled) {
    background: #DDE3E7;
    transform: scale(1.01);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}
.demo-spin-button:active:not(:disabled) {
    transform: scale(0.99);
}
.demo-spin-button:disabled {
    background: #C4CDD4;
    color: #8C9BA8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Result Area (repurposed for hidden state of modal content) */
.result-area {
    display: none;
}

/* --- New: Win Animation Overlay (roulette.html) --- */
#win-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 4rem; /* Увеличим размер текста */
    font-weight: bold;
    color: #fff; /* Белый цвет для лучшей видимости */
    text-shadow: 0 0 20px rgba(0,0,0,0.6); /* Более выраженная тень */
    opacity: 0;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.7); /* Полупрозрачный фон */
}

#win-animation-overlay.active {
    animation: winAnimation 2s ease-out forwards;
}

#win-animation-overlay i {
    font-size: 8rem;
    animation: bounceIn 0.8s forwards;
    margin-bottom: 20px;
    color: #FFD700; /* Gold for crown */
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

#win-animation-overlay span {
    animation: fadeInText 1s 0.5s forwards;
    opacity: 0;
    color: #FFD700; /* Gold for text */
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes fadeInText {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Анимация победы */
@keyframes winAnimation {
    0% {
        opacity: 0;
        visibility: visible;
        transform: scale(0.5);
    }
    30% {
        opacity: 1;
        transform: scale(1.3);
    }
    70% {
        opacity: 1;
        transform: scale(1.0);
    }
    100% {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.8);
    }
}

/* Specific styles for the Multi-Prize Modal (roulette.html) */
.prizes-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Темный полупрозрачный фон */
    justify-content: center;
    align-items: center;
}

.prizes-modal-content {
    background-color: #FFFFFF; /* Белый фон контента модального окна */
    margin: auto;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Более мягкая тень */
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    max-height: 80vh; /* Limit height to enable scrolling */
    overflow-y: auto; /* Allow scrolling for many prizes */
    color: #333; /* Темный текст */
}

.close-button {
    position: fixed; /* Зафиксировать относительно окна браузера */
    top: 27px;        /* Отступ от верхнего края */
    right: 20px;      /* Отступ от правого края */
    width: 30px;      /* Ширина кнопки */
    height: 30px;     /* Высота кнопки */
    cursor: pointer;  /* Курсор в виде указателя */
    z-index: 1000;    /* Убедиться, что кнопка поверх других элементов */
    background: none; /* Убираем фон кнопки */
    border: none;     /* Убираем рамку кнопки */
    display: flex;    /* Для центрирования линий */
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: transform 0.2s ease-in-out; /* Анимация при наведении */
}

/* Стили для линий крестика */
/* Изменение цвета и небольшой сдвиг при наведении */
.close-button:hover .line {
    background-color: #ff9999; /* **Цвет линий при наведении (например, более светлый красный)** */
    transform: scale(1.1) rotate(var(--line-rotate)); /* Увеличение и поворот */
}

.close-button:hover .line-1 {
    --line-rotate: 45deg;
}

.close-button:hover .line-2 {
    --line-rotate: -45deg;
}

.close-button:active {
    transform: scale(0.95); /* Немного уменьшить при нажатии */
}

.prizes-modal-content h3 {
    color: #0F0F0F; /* Темный заголовок */
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Responsive grid for prizes */
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.prize-item {
    background-color: #EFEFEF; /* Светлый фон для элемента приза */
    border-radius: 10px;
    padding: 0.8rem;
    border: 1px solid #E0E0E0; /* Светлая рамка */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* Мягкая тень */
    position: relative;
    overflow: hidden;
    color: #333; /* Темный текст */
}

.prize-item .prize-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #8B5CF6; /* Default icon color (Purple) */
}
.prize-item .prize-icon.rub { color: #28a745; } /* Green for RUB */
.prize-item .prize-icon.stars { color: #FFD700; } /* Gold for Stars */

.prize-item .prize-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: #0F0F0F; /* Темный текст для суммы приза */
    margin-bottom: 0.5rem;
}

.prize-item .prize-type-label {
    font-size: 0.8rem;
    color: #777; /* Серый текст для типа приза */
}

.prize-item .case-name-label {
    font-size: 0.75rem;
    color: #999; /* Светло-серый текст */
    margin-top: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.total-winnings {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333; /* Темный текст */
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #DDD; /* Светлая пунктирная линия */
}

.total-winnings .rub-won { color: #28a745; } /* Green */
.total-winnings .stars-won { color: #FFD700; } /* Gold */

.claim-sell-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.claim-sell-buttons button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.claim-sell-buttons .claim-button {
    background-color: #8B5CF6; /* Purple */
    color: #fff;
}
.claim-sell-buttons .claim-button:hover { background-color: #7C3AED; transform: translateY(-1px); }

.claim-sell-buttons .sell-button {
    background-color: #EF4444; /* Red for sell */
    color: #fff;
}
.claim-sell-buttons .sell-button:hover { background-color: #DC2626; transform: translateY(-1px); }

.claim-sell-buttons button:disabled {
    background-color: #B0B0B0; /* Светлее для отключенной кнопки */
    cursor: not-allowed;
    transform: none;
    color: #666; /* Темный текст на отключенной кнопке */
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7); /* Светлый полупрозрачный фон */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    flex-direction: column;
    color: #333; /* Темный текст */
    font-size: 1.2rem;
    font-weight: bold;
    display: none; /* Hidden by default */
}

.loading-overlay .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1); /* Легкий серый для спиннера */
    border-top: 4px solid #8B5CF6; /* Фиолетовый для анимированной части */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
/* Style for modal backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dimmed background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    visibility: hidden; /* Hidden by default */
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease-out;
}

.modal-backdrop.active {
    visibility: visible;
    opacity: 1;
}

@keyframes modalFadeIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-description {
    font-size: 0.95rem;
    color: #bbb;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #ccc;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 10px;
    color: #888;
    font-size: 1.1rem;
}

.input-field {
    width: 100%;
    padding: 10px 10px 10px 40px; /* Adjust padding for icon */
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #333;
    color: #eee;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* NEW: Styles for the Payment Option Grid */
.payment-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Telegram-style button */
.telegram-button {
    background-color: #8B5CF6;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.telegram-button:hover {
    background-color: #7C3AED;
    transform: translateY(-1px);
}
.telegram-button:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
}

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-gray-600 { color: #888; }
.font-bold { font-weight: 700; }
.text-blue-500 { color: #60A5FA; }
.mt-2 { margin-top: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.mr-2 { margin-right: 0.5rem; }

/* General styles for the modal structure */
.modal-backdrop.active .modal-content {
    animation: modalFadeIn 0.3s ease-out forwards;
}

/* Claim Username Modal specific styles */
#claim-username-modal .modal-content {
    width: 350px;
}
#claim-username-modal input {
    margin-top: 10px;
    text-align: center;
}
#claim-username-modal .modal-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    gap: 10px;
}
#claim-username-modal .modal-actions button {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
#claim-username-modal .confirm-btn {
    background-color: #8B5CF6;
    color: white;
    border: none;
}
#claim-username-modal .confirm-btn:hover {
    background-color: #7C3AED;
}
#claim-username-modal .cancel-btn {
    background-color: #444;
    color: white;
    border: none;
}
#claim-username-modal .cancel-btn:hover {
    background-color: #555;
}

/* NEW: Quantity Selection */
.quantity-selection {
    margin-bottom: 1rem;
}

.quantity-selection label {
    display: block;
    font-weight: 600;
    color: #667788;
    margin-bottom: 0.5rem;
}

.quantity-buttons {
    display: flex;
    justify-content: space-around;
    gap: 8px;
}

.qty-btn {
    flex-grow: 1; /* Allow buttons to grow and fill space */
    background: #E8ECEF;
    color: #1A1A1A;
    border: none;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.qty-btn:hover:not(.active) {
    background: #DDE3E7;
    transform: scale(1.02);
}

.qty-btn.active {
    background: #3390EC;
    color: white;
    box-shadow: 0 4px 8px rgba(51, 144, 236, 0.2);
    transform: scale(1); /* No scale up for active to prevent shift on click */
}

/* NEW: Currency Selection */
.currency-selection {
    margin-bottom: 1rem;
}

.currency-selection label {
    display: block;
    font-weight: 600;
    color: #667788;
    margin-bottom: 0.5rem;
}

.currency-options {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.currency-options input[type="radio"] {
    display: none; /* Hide default radio buttons */
}

.currency-options label {
    display: inline-flex; /* Use flex for icon and text alignment */
    align-items: center;
    justify-content: center; /* Center content within label */
    flex-grow: 1; /* Allow labels to grow and fill space */
    padding: 0.6rem 0.8rem;
    background: #E8ECEF;
    color: #1A1A1A;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.currency-options label i {
    margin-left: 5px; /* Space between text and icon */
    font-size: 1em; /* Ensure icon scales with text */
}

.currency-options label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #F0F2F5; /* Lighter background for disabled */
    color: #8C9BA8; /* Muted text for disabled */
    box-shadow: none;
    transform: none;
}

.currency-options input[type="radio"]:checked + label {
    background: #3390EC;
    color: white;
    box-shadow: 0 4px 8px rgba(51, 144, 236, 0.2);
}
.currency-options input[type="radio"]:checked + label i {
    color: white; /* Ensure icon color is white when checked */
}


/* Quick Spin Checkbox */
.quick-spin-option {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #667788;
    font-weight: 600;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.quick-spin-option input[type="checkbox"] {
    margin-right: 8px;
    width: 20px;
    height: 20px;
    accent-color: #3390EC;
    cursor: pointer;
}

.payment-option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 1.5rem;
}

@media (min-width: 480px) {
    .payment-option-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Карточка одной опции оплаты */
.payment-option-card {
    background: #E8ECEF;
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    border: 1px solid #E0E0E0;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.payment-option-card:hover:not(.disabled) {
    background: #DDE3E7;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.payment-option-card:active:not(.disabled) {
    transform: translateY(0);
}

.payment-option-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #F0F2F5;
    box-shadow: none;
    transform: none;
}

/* Иконки в карточках оплаты */
.payment-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #3390EC;
}

/* Логотипы (для СБП) */
.payment-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 8px;
}

/* Заголовок опции */
.payment-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 5px;
}

/* Описание опции */
.payment-description {
    font-size: 0.85rem;
    color: #667788;
    line-height: 1.4;
}