:root {
  --bg-color: #000000;
  --card-bg: #141414;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.5);
  --font-family-title: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-body: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --card-width: 350px;
  --card-height: 467px;
  --card-gap: 55px;
  --card-radius: 22px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection, ::-moz-selection {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family-body);
  font-weight: 400;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.hero-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-family-title);
  font-size: clamp(3.8rem, 8.5vw, 6.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  opacity: 0.95;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.9);
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.gallery-viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: grab;
  outline: none;
  z-index: 2;
}

.gallery-viewport.is-dragging {
  cursor: grabbing !important;
}

.gallery-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.gallery-canvas.is-ready {
  opacity: 1;
}

.gallery-card {
  position: absolute;
  background-color: var(--card-bg);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition: box-shadow 0.3s ease, filter 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  border-radius: var(--card-radius);
  transform: scale(1);
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

.gallery-card:hover .card-media {
  transform: scale(1.05);
}

.vignette-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.75) 0%, transparent 200px, transparent calc(100% - 200px), rgba(0, 0, 0, 0.75) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, transparent 180px, transparent calc(100% - 180px), rgba(0, 0, 0, 0.75) 100%);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.9, 0, 0.1, 1);
}

.modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.expanded-container {
  position: fixed;
  z-index: 60;
  perspective: 2000px;
  transform-origin: center center;
  will-change: transform, left, top, width, height;
}

.card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-flipper.is-flipped {
  transform: rotateY(180deg);
}

.card-flipper.is-flipped .card-front {
  opacity: 0;
  pointer-events: none;
}

.card-flipper.is-flipped .card-front .info-button {
  display: none !important;
}

.card-flipper:not(.is-flipped) .card-back {
  opacity: 0;
  pointer-events: none;
}

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0.3s ease;
}

.card-front {
  background-color: var(--card-bg);
  cursor: pointer;
}

.expanded-media-wrapper {
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.expanded-media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--card-radius);
}

.info-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.33, 1, 0.68, 1), background-color 0.2s;
  z-index: 5;
}

.info-button.theme-blue { color: #256fe0; }
.info-button.theme-pink { color: #ec5591; }
.info-button.theme-admin { color: #8b5cf6; }

.info-button:hover {
  transform: scale(1.08);
  background: #ffffff;
}

.info-button:hover svg {
  transform: translateX(2px);
}

.info-button:active {
  transform: scale(0.95);
}

.card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #0c0c0c;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  font-family: 'Figtree', sans-serif;
  border-radius: var(--card-radius);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--card-radius);
  z-index: 1;
}

.card-back-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: clamp(36px, 6vw, 56px) clamp(28px, 5vw, 44px);
  color: #ffffff;
  font-family: 'Figtree', sans-serif;
}

.card-back-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}

.card-back-welcome {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.welcome-label {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(17px, 2.5vw, 24px);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.welcome-username {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.card-back-chevron-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.2s ease;
  opacity: 0.95;
}

.card-back-chevron-btn:hover {
  transform: translateX(5px) scale(1.1);
  opacity: 1;
}

.card-back-body-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: auto;
  margin-bottom: clamp(36px, 6vw, 60px);
}

.claim-line, .return-line {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(15px, 2.2vw, 20px);
  line-height: 1.45;
  color: #ffffff;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.claim-line strong { font-weight: 700; }
.return-line strong { font-weight: 600; }

.claim-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3.5px;
  text-decoration-thickness: 1.8px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.claim-link:hover { opacity: 0.82; }

.card-back-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-name {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-transform: lowercase;
}

.brand-flower {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-flower-img {
  width: clamp(38px, 5vw, 48px);
  height: auto;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.floating-hud {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  pointer-events: auto;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.hud-search-form {
  display: flex;
  align-items: center;
}

.hud-search-pill {
  pointer-events: auto !important;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.hud-search-pill:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(28, 28, 28, 0.92);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.hud-search-pill .search-icon {
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.hud-search-pill:focus-within .search-icon {
  color: #ffffff;
}

.hud-search-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Figtree', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #ffffff;
  width: 175px;
  transition: width 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

.hud-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.hud-search-input:focus {
  width: 215px;
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 5px 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.hud-btn.is-active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
  :root {
    --card-width: 300px;
    --card-height: 400px;
    --card-gap: 45px;
  }
}

@media (max-width: 768px) {
  :root {
    --card-width: 240px;
    --card-height: 320px;
    --card-gap: 30px;
    --card-radius: 16px;
  }

  .vignette-overlay {
    background:
      linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, transparent 60px, transparent calc(100% - 60px), rgba(0, 0, 0, 0.8) 100%),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 60px, transparent calc(100% - 60px), rgba(0, 0, 0, 0.8) 100%);
  }

  .hud-search-input { width: 125px; }
  .hud-search-input:focus { width: 155px; }
  .card-back-content { padding: 24px 20px 20px 20px; }
}
