/* --- GLOBAL STYLES (Telegram-like Light Look with falling stars) --- */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  background-color: #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 */
  overflow-x: hidden; /* Prevent horizontal scroll from stars */
  position: relative; /* For pseudo-elements */
}

/* Falling Stars Background */
body::before, body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind content */
    pointer-events: none;
    background-repeat: repeat;
    opacity: 0.8; /* Slightly reduce opacity for a subtle effect on light background */
}

/* Layer 1: Small, fast, numerous stars (subtle white on light background) */
body::before {
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 10% 90%, rgba(255,255,255,0.7), transparent);
    background-size: 150px 150px, 120px 120px, 180px 180px, 100px 100px, 160px 160px;
    animation: starsFall1 60s linear infinite;
}

/* Layer 2: Larger, slower, fewer stars for depth (subtle white on light background) */
body::after {
    background-image: 
        radial-gradient(3px 3px at 40% 60%, rgba(255,255,255,0.6), transparent),
        radial-gradient(2.5px 2.5px at 80% 20%, rgba(255,255,255,0.7), transparent),
        radial-gradient(3.5px 3.5px at 15% 50%, rgba(255,255,255,0.6), transparent);
    background-size: 250px 250px, 200px 200px, 300px 300px;
    animation: starsFall2 120s linear infinite;
    opacity: 0.6;
}

@keyframes starsFall1 {
    from { background-position: 0 0; }
    to { background-position: 0 15000px; } /* Adjust for desired fall distance */
}

@keyframes starsFall2 {
    from { background-position: 0 0; }
    to { background-position: 0 25000px; } /* Longer fall distance for slower effect */
}


*, *::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; /* Telegram Blue 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 .main-subtitle {
    color: #667788; /* Muted color for subtitle */
    font-size: 1rem;
}
#main-description {
    color: #667788;
    margin-bottom: 1.5rem;
}

.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: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;
    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; /* Green */
  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; /* Red */
}
.fixed-notification.info {
    background-color: #2196F3; /* Blue */
}

@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; /* Yellow for attention */
}
.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;
    opacity: 0.7;
}

/* 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.5); /* 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: #8C9BA8; /* Muted close button */
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1A1A1A;
}

.modal-description {
    font-size: 0.95rem;
    color: #667788;
    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: #667788;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 10px;
    color: #667788;
    font-size: 1.1rem;
}

.input-field {
    width: 100%;
    padding: 10px 10px 10px 40px; /* Adjust padding for icon */
    border: 1px solid #C4CDD4;
    border-radius: 8px;
    background-color: #F0F2F5;
    color: #1A1A1A;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    border-color: #3390EC;
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.3);
}

/* NEW: Styles for the Payment Option Grid */
.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;
}

/* --- ONBOARDING MODAL SPECIFIC STYLES --- */
.onboarding-content {
    max-width: 380px;
    padding: 35px 25px;
    background: #FFFFFF; 
    color: #1A1A1A;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.onboarding-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    color: #1A1A1A; /* Dark text */
}

.onboarding-content p {
    font-size: 1.05rem;
    color: #667788; /* Muted dark text */
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.onboarding-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}

/* Base styles for secondary buttons (now universal) */
.secondary-button {
    background: #E8ECEF; /* Light gray */
    color: #1A1A1A; /* Dark text */
    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);
    display: flex; /* Ensure flex for icon+text alignment if needed */
    align-items: center;
    justify-content: center;
    gap: 6px; /* Gap for icon+text if any */
}
.secondary-button:hover {
    background: #DDE3E7; /* Slightly darker on hover */
    transform: scale(1.02);
}
.secondary-button:active {
    transform: scale(0.98);
}
.secondary-button:disabled {
    background: #C4CDD4;
    color: #8C9BA8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* Specific padding for onboarding action buttons */
.onboarding-action-buttons .telegram-button,
.onboarding-action-buttons .secondary-button {
    padding: 0.85rem 0; /* Larger vertical padding */
}

.onboarding-skip-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #667788; /* Muted dark text */
}

.onboarding-skip-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #3390EC; /* Telegram blue */
    cursor: pointer;
}

/* --- ONBOARDING TOOLTIP STYLES --- */
.onboarding-tooltip {
    position: fixed;
    z-index: 1002; /* Higher than tutorial overlay and modal backdrop */
    background: #FFFFFF; /* Light background */
    border-radius: 12px;
    padding: 1rem 1.2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2); /* Soft shadow */
    color: #1A1A1A; /* Dark text */
    text-align: center;
    width: 90%;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: auto; /* Allow clicks on tooltip buttons */
}

.onboarding-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

.onboarding-tooltip p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.4;
    color: #667788; /* Muted dark text */
}

/* Исправленные стили для стрелки тултипа */
.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    /* Базовый стиль стрелки: для тултипа, который находится ПОД ЦЕЛЬЮ (position: 'bottom' в JS) */
    border-bottom: 10px solid #FFFFFF; /* Стрелка указывает ВВЕРХ */
    top: -10px; /* Позиционируется у ВЕРХНЕГО края тултипа */
    left: 50%;
    transform: translateX(-50%);
}

.onboarding-tooltip.top .tooltip-arrow { /* Для тултипа, который находится НАД ЦЕЛЬЮ (position: 'top' в JS) */
    border-bottom: none; /* Убираем базовый стиль */
    border-top: 10px solid #FFFFFF; /* Стрелка указывает ВНИЗ */
    top: auto; /* Сбрасываем top */
    bottom: -10px; /* Позиционируется у НИЖНЕГО края тултипа */
}

.onboarding-tooltip.left .tooltip-arrow { /* Для тултипа, который находится СПРАВА от ЦЕЛИ (position: 'left' в JS) */
    border: none; /* Сбрасываем все border */
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #FFFFFF; /* Стрелка указывает ВЛЕВО */
    left: -10px; /* Позиционируется у ЛЕВОГО края тултипа */
    right: auto;
    top: 50%;
    transform: translateY(-50%);
}
.onboarding-tooltip.right .tooltip-arrow { /* Для тултипа, который находится СЛЕВА от ЦЕЛИ (position: 'right' в JS) */
    border: none; /* Сбрасываем все border */
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid #FFFFFF; /* Стрелка указывает ВПРАВО */
    right: -10px; /* Позиционируется у ПРАВОГО края тултипа */
    left: auto;
    top: 50%;
    transform: translateY(-50%);
}


.tooltip-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
/* Specific padding and font size for tooltip nav buttons */
.tooltip-nav .telegram-button,
.tooltip-nav .secondary-button {
    padding: 0.6rem 0.8rem; /* Smaller padding */
    font-size: 0.9rem; /* Smaller font */
}


/* --- HIGHLIGHT CLASS FOR TUTORIAL --- */
.highlight-element {
    position: relative;
    z-index: 1003; /* Higher than tooltip */
    animation: pulseHighlight 1.5s infinite alternate;
    box-shadow: 0 0 0 4px #3390EC; /* Visible blue border */
    border-radius: 12px; /* Match element's border-radius where possible */
}

@keyframes pulseHighlight {
    0% { box-shadow: 0 0 0 2px #3390EC, 0 0 0 6px rgba(51, 144, 236, 0.3); }
    100% { box-shadow: 0 0 0 4px #3390EC, 0 0 0 10px rgba(51, 144, 236, 0.6); }
}

/* --- NEW: TUTORIAL OVERLAY STYLES --- */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
    z-index: 1001; /* Lower than tooltip, higher than main content */
    display: none; /* Hidden by default */
    /* pointer-events: auto; /* Позволяет кликам проходить только на подсвеченные элементы */
}

/*
   Когда tutorial-overlay активен, все, что под ним, не должно быть интерактивным,
   кроме подсвеченного элемента.
   Однако, сам tutorial-overlay не должен перехватывать клики, если они не направлены
   на подсвеченный элемент.
   Для этого мы делаем его pointer-events: none; и возвращаем pointer-events: auto;
   только для подсвеченного элемента и тултипа.
*/
#tutorial-overlay.active {
    pointer-events: none; /* По умолчанию оверлей не перехватывает клики */
}