/**
 * 15 Puzzle Pro — Mobile-First B2B Lead Generation Styles
 */

:root {
  /* Dynamic Theme Variables (overridden by config presets in JS) */
  --theme-primary: #FF4757;
  --theme-primary-hover: #EE3344;
  --theme-accent: #FFA502;
  --theme-bg: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 50%, #FECDD3 100%);
  --theme-card-bg: #FFFFFF;
  --theme-text-primary: #0F172A;
  --theme-text-muted: #64748B;
  --theme-tile-border: rgba(255, 71, 87, 0.25);
  --theme-tile-shadow: 0 6px 18px rgba(255, 71, 87, 0.22);
  --bg-image: none;

  /* Layout constants */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--theme-bg);
  color: var(--theme-text-primary);
  line-height: 1.5;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  user-select: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(48px, env(safe-area-inset-top, 48px)) 10px 16px;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto;
}

/* --- TOP UTILITY & I18N BAR --- */
.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.b2b-engine-tag {
  display: none;
}

.quick-win-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #D97706;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.quick-win-btn .quick-win-label {
  white-space: nowrap;
}

.quick-win-btn:hover {
  background: #F59E0B;
  color: #FFFFFF;
  border-color: #D97706;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

.quick-win-btn:active {
  transform: translateY(0);
}

.quick-win-btn .bolt {
  font-size: 11px;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--theme-text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.lang-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--theme-text-primary);
}

.lang-btn.active {
  background: var(--theme-primary);
  color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* --- DEMO SWITCHER BAR (4 EQUAL PRESETS IN 1 CAPSULE) --- */
.demo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.demo-presets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--theme-text-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}

.preset-btn .btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--theme-text-primary);
}

.preset-btn.active {
  background: var(--theme-primary);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon {
  font-size: 12px;
  flex-shrink: 0;
}

/* --- MAIN GAME CARD --- */
.game-card {
  background: var(--theme-card-bg);
  border-radius: var(--radius-lg);
  padding: 12px 14px 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.3s ease;
}

/* Brand Header */
.brand-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.brand-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--theme-primary);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.campaign-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--theme-text-primary);
  margin-top: 1px;
  line-height: 1.2;
}

.campaign-subtitle {
  font-size: 12px;
  color: var(--theme-text-muted);
  max-width: 380px;
  line-height: 1.25;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  font-size: 16px;
}

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted);
}

.stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--theme-text-primary);
  line-height: 1.1;
}

/* Hint Thumbnail Trigger */
.hint-preview-container {
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.hint-preview-container:hover {
  transform: scale(1.05);
}

.hint-thumb-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 2px solid var(--theme-primary);
}

.hint-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hint-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  padding: 1px 0;
  backdrop-filter: blur(2px);
}

/* --- THE 4x4 PUZZLE BOARD --- */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.board-container {
  position: relative;
  width: min(100%, calc(100dvh - 280px));
  max-width: 390px;
  max-height: 52vh;
  max-height: 52dvh;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  touch-action: none; /* Предотвращает зум и прокрутку страницы при свайпе */
}

/* Single Tile Element */
.tile {
  position: absolute;
  width: calc(100% / 4);
  height: calc(100% / 4);
  transform: translate3d(calc(var(--col) * 100%), calc(var(--row) * 100%), 0);
  transition: transform var(--transition-normal);
  will-change: transform;
  cursor: pointer;
}

.tile-inner {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  margin: 3px;
  border-radius: 10px;
  background-image: var(--bg-image);
  background-size: 400% 400%;
  /* Динамическая нарезка: точное процентное смещение для 4 колонок/строк */
  background-position: calc(var(--target-col) * (100% / 3)) calc(var(--target-row) * (100% / 3));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid var(--theme-tile-border);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-fast), filter var(--transition-fast);
}

.tile:active .tile-inner {
  filter: brightness(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Semi-transparent Corner Tile Number */
.tile-number {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

/* Hide numbers when toggled */
.hide-numbers .tile-number {
  opacity: 0;
  pointer-events: none;
}

/* Controls under board */
.board-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, calc(100dvh - 280px));
  max-width: 390px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  color: var(--theme-text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.control-btn:active {
  transform: scale(0.98);
}

.ctrl-icon {
  font-size: 15px;
}

/* Game Footer */
.game-footer {
  text-align: center;
  font-size: 12px;
  color: var(--theme-text-muted);
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 16px 20px;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--theme-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Hint Modal */
.hint-modal-card {
  max-width: 360px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--theme-text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--theme-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--theme-text-primary);
}

.hint-modal-body {
  padding: 14px;
}

.hint-full-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

/* Lead Gate Modal */
.lead-modal-card {
  position: relative;
  padding: 24px 20px;
  text-align: center;
}

.lead-modal-card .modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--theme-text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lead-modal-card .modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--theme-text-primary);
  transform: scale(1.1);
}

.hidden {
  display: none !important;
}

.lead-step.hidden {
  display: none !important;
}

.congrats-icon-wrapper,
.success-icon-wrapper {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.congrats-icon,
.success-icon {
  font-size: 30px;
}

.lead-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--theme-text-primary);
}

.lead-desc {
  font-size: 13px;
  color: var(--theme-text-muted);
  margin-top: 4px;
}

/* Stats Box in Modal */
.lead-stats-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 16px 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.lead-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--theme-text-muted);
  text-transform: uppercase;
}

.lead-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--theme-text-primary);
}

.prize-tag {
  color: var(--theme-primary);
  font-weight: 800;
}

.lead-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(0, 0, 0, 0.08);
}

/* Lead Form */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--theme-text-primary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 15px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 12px 38px 12px 38px;
  font-family: var(--font-sans);
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.15);
}

.form-input.valid {
  border-color: #10B981;
}

.form-input.invalid {
  border-color: #EF4444;
}

.validation-icon {
  position: absolute;
  right: 12px;
  font-size: 14px;
  font-weight: 800;
}

.validation-icon.valid::before {
  content: '✓';
  color: #10B981;
}

.validation-icon.invalid::before {
  content: '✗';
  color: #EF4444;
}

.error-msg {
  display: none;
  font-size: 11px;
  color: #EF4444;
  margin-top: 2px;
}

.error-msg.visible {
  display: block;
}

/* GDPR Checkbox */
.gdpr-group {
  margin: 2px 0 4px;
}

.gdpr-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--theme-text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.gdpr-checkbox {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--theme-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.gdpr-text a {
  color: var(--theme-primary);
  text-decoration: underline;
}

/* Submit Lead Button */
.submit-lead-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--theme-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
}

.submit-lead-btn:hover:not(:disabled) {
  background: var(--theme-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.submit-lead-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Step 2: Promo Code Box */
.promo-code-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.promo-code-box {
  background: rgba(0, 0, 0, 0.04);
  border: 2px dashed var(--theme-primary);
  border-radius: var(--radius-md);
  padding: 14px;
}

.promo-code-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--theme-primary);
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--theme-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: var(--theme-primary-hover);
}

.promo-hint {
  font-size: 12px;
  color: var(--theme-text-muted);
  margin-bottom: 16px;
}

.play-again-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--theme-text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.play-again-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* --- TOAST NOTIFICATION --- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 200;
  animation: toastSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.toast-notification.hidden {
  display: none;
}

@keyframes toastSlideUp {
  0% { transform: translate(-50%, 20px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

/* Mobile Responsiveness adjustments */
@media (max-width: 400px) {
  body {
    padding: max(48px, env(safe-area-inset-top, 48px)) 6px 12px;
  }
  .campaign-title {
    font-size: 18px;
  }
  .preset-btn {
    padding: 5px 4px;
    font-size: 10.5px;
    gap: 3px;
  }
  .btn-icon {
    font-size: 11px;
  }
  .quick-win-btn {
    padding: 3px 8px;
    font-size: 10px;
  }
  .lang-btn {
    padding: 2px 4px;
    font-size: 9.5px;
  }
}

@media (max-width: 360px) {
  .preset-btn {
    padding: 4px 2px;
    font-size: 9.5px;
    gap: 2px;
  }
  .btn-icon {
    font-size: 10px;
  }
  .quick-win-btn {
    padding: 3px 6px;
    font-size: 9.5px;
  }
}



/* Viewport Height Adaptation for Laptops and Small Screens */
@media (max-height: 720px) {
  body {
    padding: 46px 8px 8px;
  }
  .app-container {
    gap: 6px;
  }
  .game-card {
    padding: 10px 12px 8px;
    gap: 6px;
  }
  .campaign-title {
    font-size: 16px;
  }
  .campaign-subtitle {
    font-size: 11.5px;
  }
  .stats-bar {
    padding: 4px 8px;
  }
  .board-container,
  .board-controls {
    width: min(100%, calc(100dvh - 240px));
  }
}




/* --- CUSTOM PHOTO UPLOAD & 16-TH TILE MERGE EXTENSION --- */



.preset-btn.custom-upload-btn {

  border: 1px dashed rgba(0, 0, 0, 0.25);

  color: var(--theme-primary);

}



.preset-btn.custom-upload-btn:hover {

  background: rgba(255, 71, 87, 0.08);

  border-color: var(--theme-primary);

}



.preset-btn.custom-upload-btn.active {

  background: var(--theme-primary);

  color: #FFFFFF;

  border-style: solid;

}



/* 16th Missing Tile (Victory Reveal & Merge) */

.tile.tile-16 {

  opacity: 0;

  pointer-events: none;

  transform: translate3d(calc(var(--col) * 100%), calc(var(--row) * 100%), 0) scale(0.7);

  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  z-index: 5;

}



.tile.tile-16.revealed {

  opacity: 1;

  pointer-events: auto;

  transform: translate3d(calc(var(--col) * 100%), calc(var(--row) * 100%), 0) scale(1);

}



.tile.tile-16 .tile-inner {

  border-color: var(--theme-accent, #FFA502);

  box-shadow: 0 0 16px rgba(255, 165, 2, 0.45), 0 4px 10px rgba(0, 0, 0, 0.15);

}



/* Seamless picture merge on victory */

.board-container.victory-merged {

  box-shadow: 0 0 28px rgba(255, 165, 2, 0.5), 0 10px 30px rgba(0, 0, 0, 0.2);

  border-radius: var(--radius-md);

  overflow: hidden;

  transition: all 0.6s ease;

}



.board-container.victory-merged .tile-inner {

  margin: 0;

  width: 100%;

  height: 100%;

  border-radius: 0;

  border: none;

  box-shadow: none;

  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

}



.board-container.victory-merged .tile-number {

  opacity: 0 !important;

  transition: opacity 0.3s ease;

}



/* Drag and Drop visual feedback */

.board-container.drag-over {

  outline: 2px dashed var(--theme-primary);

  outline-offset: -4px;

}



.board-container.drag-over::after {

  content: '📁 Отпустите фото для загрузки';

  position: absolute;

  inset: 4px;

  display: flex;

  align-items: center;

  justify-content: center;

  font-family: var(--font-sans);

  font-size: 14px;

  font-weight: 700;

  color: var(--theme-primary);

  background: rgba(255, 255, 255, 0.92);

  border-radius: var(--radius-md);

  z-index: 50;

  backdrop-filter: blur(4px);

  pointer-events: none;

  animation: pulseDrop 1.2s infinite ease-in-out;

}



@keyframes pulseDrop {

  0%, 100% { opacity: 0.95; transform: scale(1); }

  50% { opacity: 0.85; transform: scale(0.99); }

}



/* Hint Modal Slicing Grid Overlay */

.hint-image-wrapper {

  position: relative;

  width: 100%;

  aspect-ratio: 1 / 1;

  border-radius: var(--radius-md);

  overflow: hidden;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);

}



.hint-slicing-grid {

  position: absolute;

  inset: 0;

  display: grid;

  grid-template-columns: repeat(4, 1fr);

  grid-template-rows: repeat(4, 1fr);

  pointer-events: none;

  background: rgba(0, 0, 0, 0.12);

  transition: opacity var(--transition-fast);

}



.hint-slicing-grid.hidden {

  display: none;

}



.hint-grid-cell {

  border: 1px dashed rgba(255, 255, 255, 0.75);

  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 13px;

  font-weight: 800;

  font-family: var(--font-mono);

  color: #FFFFFF;

  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);

}



.hint-grid-cell.cell-16 {

  background: rgba(245, 158, 11, 0.4);

  color: #FFA502;

  position: relative;

}



.hint-modal-footer {

  padding: 8px 14px 14px;

  display: flex;

  justify-content: center;

}

