:root {
  --bg-canvas: #09090B;
  --bg-surface: #121216;
  --bg-well: #0D0D11;
  --border-crisp: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent-lime: #D4FF00;
  --accent-gold: #F5C84C;
  --accent-rec: #FF3B30;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background-color: var(--bg-canvas);
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: clip;
  overflow-y: visible;
}

.font-display {
  font-family: 'Syne', 'Plus Jakarta Sans', system-ui, sans-serif;
}

.font-mono-tech {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* Matte dark canvas with subtle film grain texture */
.backstage-bg {
  background-color: var(--bg-canvas);
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.surface-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-crisp);
}

.surface-well {
  background-color: var(--bg-well);
  border: 1px solid var(--border-crisp);
}

.header-glass {
  background-color: rgba(9, 9, 11, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-crisp);
}

.bottom-nav-glass {
  background-color: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-crisp);
}

/* Primary high-contrast Acid-Lime CTA */
.btn-accent {
  background-color: var(--accent-lime);
  color: #09090B;
  font-weight: 700;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), background-color 140ms ease, opacity 140ms ease;
}

.btn-accent:hover:not(:disabled) {
  background-color: #E2FF4D;
}

.btn-accent:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-accent:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* Press micro-interaction */
.pressable {
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), border-color 140ms ease, background-color 140ms ease;
}

.pressable:active:not(:disabled) {
  transform: scale(0.96);
}

/* Prevent iOS Safari zoom on input focus & eliminate 300ms tap delay */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
  font-size: 16px !important;
}

button,
a,
label.pressable,
[role="button"] {
  touch-action: manipulation;
}

/* Live indicator pulse */
.live-dot-pulse {
  animation: livePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(212, 255, 0, 0.55);
  }
  50% {
    opacity: 0.65;
    box-shadow: 0 0 0 6px rgba(212, 255, 0, 0);
  }
}

/* Bottom sheet & optimistic card transitions */
.sheet-enter {
  animation: sheetSlideUp 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.card-reveal {
  animation: cardReveal 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* VIP Backstage Pass perforation */
.pass-perforation {
  position: relative;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

.pass-perforation::before,
.pass-perforation::after {
  content: '';
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background-color: rgba(9, 9, 11, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pass-perforation::before {
  left: -34px;
}

.pass-perforation::after {
  right: -34px;
}

/* Polaroid / Editorial photo framing */
.polaroid-frame {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-crisp);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* Mobile viewport & safe-area utilities */
.min-h-dvh {
  min-height: 100dvh;
}

.safe-top-bar {
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.safe-bottom-nav {
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
}

.safe-bottom-sheet {
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.main-scroll-pad {
  padding-bottom: calc(7.5rem + env(safe-area-inset-bottom));
}

.admin-scroll-pad {
  padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
}

.scroll-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  white-space: nowrap;
}

/* Center camera shutter button */
.shutter-outer {
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background-color: #18181D;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), border-color 140ms ease;
}

.shutter-outer:active {
  transform: scale(0.92);
}

.shutter-inner {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background-color: var(--accent-lime);
  color: #09090B;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Press-and-hold Voice Note recorder */
.hold-mic-btn {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  background-color: #1C1C22;
  border: 2px solid rgba(212, 255, 0, 0.55);
  color: #D4FF00;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.hold-mic-btn.is-recording {
  background-color: var(--accent-rec) !important;
  border-color: #FF756E !important;
  color: #FFFFFF !important;
  animation: micPulse 1.15s infinite cubic-bezier(0.24, 0, 0.38, 1);
}

@keyframes micPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.75);
    transform: scale(1.02);
  }
  70% {
    box-shadow: 0 0 0 22px rgba(255, 59, 48, 0);
    transform: scale(1.06);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    transform: scale(1.02);
  }
}

/* Gallery locked pattern stripes */
.film-locked-pattern {
  background-color: #0D0D11;
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(245, 200, 76, 0.05) 0px,
      rgba(245, 200, 76, 0.05) 10px,
      transparent 10px,
      transparent 22px
    );
}

/* TV Slideshow Ken Burns & crossfade */
.tv-slide-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease-in-out;
  pointer-events: none;
}

.tv-slide-layer.is-active {
  opacity: 1;
}

.tv-ken-burns {
  animation: tvKenBurns 11s ease-in-out forwards;
}

@keyframes tvKenBurns {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.055) translate3d(0, -1%, 0);
  }
}

/* TV Live Roast Popup */
.tv-popup-enter {
  animation: tvPopupIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tvPopupIn {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* TV Seamless Marquee Ticker */
.tv-ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: tvTickerScroll var(--ticker-duration, 38s) linear infinite;
}

@keyframes tvTickerScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Clean utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
}

/* =========================================================================
   Family Feud / "Ce spun prietenii lui Chiștoc" TV Game Show Styles
   ========================================================================= */

.feud-stage {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(56, 118, 255, 0.32) 0%, transparent 56%),
    radial-gradient(ellipse at 50% 85%, rgba(245, 200, 76, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 45%, #16337A 0%, #0A1842 52%, #04091B 100%);
}

.feud-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(245, 200, 76, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
}

.feud-gold-border {
  border: 3px solid #F5C84C;
  box-shadow:
    0 0 0 2px rgba(10, 24, 66, 0.9),
    0 0 28px rgba(245, 200, 76, 0.28),
    inset 0 0 24px rgba(20, 62, 165, 0.65);
}

.feud-score-box {
  background: linear-gradient(180deg, #102B72 0%, #07153C 100%);
  border: 2px solid rgba(245, 200, 76, 0.78);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.55),
    inset 0 2px 10px rgba(96, 165, 250, 0.25);
}

.feud-slot {
  perspective: 1100px;
  height: 112px;
}

@media (min-width: 1280px) {
  .feud-slot {
    height: 124px;
  }
}

.feud-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.feud-card-inner.is-revealed {
  transform: rotateX(180deg);
}

.feud-card-front,
.feud-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.feud-card-front {
  background: linear-gradient(180deg, #1E4BB8 0%, #0E2B74 52%, #081A4B 100%);
  border: 2px solid rgba(245, 200, 76, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.4);
}

.feud-card-front.feud-slot-empty {
  background: linear-gradient(180deg, #0C1B47 0%, #071130 100%);
  border-color: rgba(245, 200, 76, 0.22);
  opacity: 0.45;
}

.feud-number-pill {
  width: 68px;
  height: 44px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #FFE07D 0%, #F5C84C 55%, #C99418 100%);
  border: 2px solid #FFF2B2;
  color: #071232;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.feud-card-back {
  transform: rotateX(180deg);
  background: linear-gradient(180deg, #183E9E 0%, #0C2364 100%);
  border: 2px solid #F5C84C;
  box-shadow:
    0 0 22px rgba(245, 200, 76, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.feud-votes-cell {
  background: linear-gradient(180deg, #FFE07D 0%, #E7B22A 100%);
  color: #06102C;
  border-left: 2px solid #FFF2B2;
}

@keyframes strikeSlam {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  20% {
    opacity: 1;
    transform: scale(1.08);
  }
  35% {
    opacity: 1;
    transform: scale(1);
  }
  82% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
  }
}

.animate-strike-slam {
  animation: strikeSlam 2.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.feud-strike-box {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.96) 0%, rgba(69, 10, 10, 0.98) 100%);
  border: 6px solid #EF4444;
  box-shadow:
    0 0 60px rgba(239, 68, 68, 0.8),
    inset 0 0 28px rgba(248, 113, 113, 0.4);
}
