/* ============================================================
   RWA NFT — interaction controls styling.

   Only this module's own .rwa-* selectors live here; the slides keep
   their existing faces, tracks, cards and CTAs untouched. Everything is
   a small permanent affordance: no endless blinking, no overlay above the
   track or the labels, reduced-motion aware.
   ============================================================ */

/* Shared bits */
.rwa-hidden { display: none !important; }

/* ---------- slide 06: action marker on the five real flip cards ---------- */

.rwa-action-host { position: relative; }

/* One explanation below the central card, outside every 3D face. */
.rwa-system-guidance {
  position: fixed;
  z-index: 27;
  width: min(calc(500px * var(--rwa-inv-scale, 1)), calc(100vw - 128px * var(--rwa-inv-scale, 1)));
  transform: translateX(-50%);
  color: rgba(245, 245, 247, 0.76);
  font: 400 calc(13px * var(--rwa-inv-scale, 1))/1.45 'DM Sans', system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
}
.rwa-system-next { color: rgba(245, 245, 247, 0.60); }
@media (pointer: coarse) { .rwa-system-mouse { display: none; } }

.rwa-action-host:focus-visible { outline: 2px solid rgba(240, 198, 116, 0.85); outline-offset: 4px; }

.rwa-flip-mark {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  max-width: calc(100% - 12px);
  padding: 0.3em 0.6em;
  pointer-events: none;
  border: 1px solid rgba(212, 168, 87, 0.35);
  border-radius: 999px;
  background: rgba(6, 6, 10, 0.72);
  color: rgba(240, 198, 116, 0.92);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: calc(clamp(8px, 0.68vw, 11px) * var(--rwa-inv-scale, 1));
  line-height: 1.15;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.rwa-flip-ico { font-size: 1.1em; opacity: 0.85; transition: transform 0.25s ease; }

/* A full action name belongs in the central explanation, not over a tiny tile. */
.rwa-flip-mark.rwa-flip-compact {
  left: 2px;
  bottom: 2px;
  max-width: calc(100% - 4px);
  box-sizing: border-box;
  padding: .2em .25em;
  font-size: calc(11px * var(--rwa-inv-scale, 1));
  letter-spacing: 0;
  gap: 0;
  overflow: hidden;
}
.rwa-flip-compact .rwa-flip-ico, .rwa-flip-compact .rwa-flip-txt { display: none; }
.rwa-flip-compact::after { content: attr(data-short); }

.rwa-action-host:hover .rwa-flip-mark { border-color: rgba(240, 198, 116, 0.7); color: #fff5df; background: rgba(20, 15, 8, 0.82); }

.rwa-action-host:hover .rwa-flip-ico { transform: rotate(-25deg); }

.rwa-action-host:active .rwa-flip-ico { transform: rotate(-60deg); }

/* ---------- slide 14: explicit action on the active card ---------- */

.rwa-card-action {
  position: absolute;
  left: 50%;
  top: 100%;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  width: max-content;
  padding: 0.85em 1.35em;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(212, 168, 87, 0.5);
  border-radius: 999px;
  background: rgba(6, 6, 10, 0.76);
  color: #f5f5f7;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: calc(clamp(12px, 0.78vw, 13px) * var(--rwa-inv-scale, 1));
  /* scaled frames: keep a real ~44px touch target in the upper viewport */
  min-height: calc(max(52px, var(--rwa-touch-min, 44px)) * var(--rwa-inv-scale, 1));
  max-width: min(calc(100% - 24px), calc(176px * var(--rwa-inv-scale, 1)));
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.05em;
  white-space: normal;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.rwa-card-action:hover { border-color: rgba(240, 198, 116, 0.95); background: rgba(48, 36, 16, 0.9); }

.rwa-card-action:focus-visible { outline: 2px solid rgba(240, 198, 116, 0.9); outline-offset: 3px; }

.rwa-card-action:active { transform: translate(-50%, -50%) scale(0.97); }

.rwa-card-action-ico { font-size: 1.05em; color: rgba(240, 198, 116, 0.95); }

/* ---------- ranges: one quiet group hint, never on the track ---------- */

.rwa-range-hint {
  display: block;
  margin: 0.25em 0 0.3em;
  pointer-events: none;
  color: rgba(212, 168, 87, 0.72);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: calc(clamp(9px, 0.7vw, 11px) * var(--rwa-inv-scale, 1));
  line-height: 1.3;
  letter-spacing: 0.03em;
  transition: opacity 0.4s ease;
}

/* ---------- slide 14: local progress + one-time swipe hint ---------- */

.rwa-nft-progress {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

/* Постоянный счётчик: левый верхний угол, ниже иконки полного экрана */
.rwa-nft-count {
  position: absolute;
  top: max(9.5vh, 86px);
  left: clamp(18px, 2.4vw, 40px);
  padding: 0.3em 0.9em;
  border: 1px solid rgba(212, 168, 87, 0.32);
  border-radius: 999px;
  background: rgba(6, 6, 10, 0.5);
  color: rgba(240, 198, 116, 0.95);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: calc(clamp(12px, 0.74vw, 13px) * var(--rwa-inv-scale, 1));
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rwa-nft-swipe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(26vh + 10px);
  text-align: center;
  color: rgba(245, 245, 247, 0.55);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: calc(clamp(12px, 0.7vw, 13px) * var(--rwa-inv-scale, 1));
  line-height: 1.3;
  letter-spacing: 0.03em;
  transition: opacity 0.4s ease;
}

/* Scaled landscape canvas: use an independent footer lane, not the tiny
   active card's dimensions, for the readable 44px action and swipe hint. */
.rwa-nft-compact .rwa-card-action {
  top: auto;
  bottom: calc(52px * var(--rwa-inv-scale, 1));
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  min-height: calc(44px * var(--rwa-inv-scale, 1));
  max-width: calc(260px * var(--rwa-inv-scale, 1));
  padding: calc(8px * var(--rwa-inv-scale, 1)) calc(16px * var(--rwa-inv-scale, 1));
  white-space: nowrap;
}
.rwa-nft-compact .rwa-card-action:active { transform: translateX(-50%) scale(.97); }
.rwa-nft-compact .rwa-nft-swipe {
  bottom: calc(28px * var(--rwa-inv-scale, 1));
  padding: 0 calc(12px * var(--rwa-inv-scale, 1));
  box-sizing: border-box;
}
.rwa-nft-compact #dots { bottom: calc(104px * var(--rwa-inv-scale, 1)); }

@media (pointer: coarse) {
  .rwa-flip-mark {
    left: 50%;
    transform: translateX(-50%);
    max-width: none;
    font-size: calc(12px * var(--rwa-inv-scale, 1));
    overflow: visible;
  }
}

@media (orientation: portrait) and (max-width: 620px) {
  /* Keep progress in the free footer lane: placing it under the fullscreen
     icon overlaps the subtitle on a native 390px phone viewport. */
  .rwa-nft-count {
    top: auto;
    bottom: max(44px, calc(env(safe-area-inset-bottom, 0px) + 28px));
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rwa-flip-mark { transition: none; }
  .rwa-flip-ico { transition: none; }
  .rwa-card-action { transition: none; }
  .rwa-range-hint { transition: none; }
  .rwa-nft-swipe { transition: none; }
  .rwa-action-host:hover .rwa-flip-ico { transform: none; }
  .rwa-action-host:active .rwa-flip-ico { transform: none; }
}
