@font-face {
  font-family: 'Matt';
  src: url('/assets/Matt-Light-BF670897ed27830-MlI_Zl_d.ttf') format('truetype');
  font-weight: 300;
}

@font-face {
  font-family: 'Matt';
  src: url('/assets/Matt-Regular-BF670897ed2b9ca-BGocEC68.ttf') format('truetype');
  font-weight: 400;
}

@font-face {
  font-family: 'Matt';
  src: url('/assets/Matt-Medium-BF670897ed27608-CXbF1z5x.ttf') format('truetype');
  font-weight: 500;
}

@font-face {
  font-family: 'Matt';
  src: url('/assets/Matt-Bold-BF670897ed2aebd-e5jpm6do.ttf') format('truetype');
  font-weight: 700;
}

@font-face {
  font-family: 'Matt';
  src: url('/assets/Matt-ExtraBold-BF670897ed28442-BTEwhrQx.ttf') format('truetype');
  font-weight: 800;
}

@font-face {
  font-family: 'Designer Signature';
  src: url('/assets/Designer%20Signature-B_pfliXY.otf') format('opentype');
}

html {
  font-size: clamp(12px, 0.75vw + 8px, 16px);
}

:root {
  --bg-dark: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --accent-rgb: 189, 246, 216;
  --accent: #bdf6d8;
  --accent-hover: #a3eec4;
  --accent-gradient: linear-gradient(135deg, #e8fbf0 0%, #bdf6d8 100%);
  --accent-glow: rgba(189, 246, 216, 0.35);
  --radius-lg: 1rem;
  --radius-md: 1.25rem;
  --transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Matt', 'Inter', sans-serif;
  background-color: transparent;
  color: var(--text-primary);

  position: relative;
}

#site-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg-dark);
  background-image: url('/assets/background-B7KxoNJw.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  flex-direction: row;
  filter: hue-rotate(10deg) brightness(0.6) contrast(0.95);
  transition: filter 0.8s ease-in-out;
}




#app {
  display: flex;
  height: 100%;
  width: 100%;
  position: relative;
}

/* Glass Panel Styling (Liquid Glassmorphism) */
.glass-panel {
  width: 20rem;
  min-width: 20rem;
  scrollbar-width: none;
  position: relative;

  /* Restored liquid glass texture */
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.02) 100%),
    rgba(39, 39, 39, 0.068);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);

  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  will-change: top, left, transform;
}

.glass-panel::-webkit-scrollbar {
  width: 0.375rem;
}

.glass-panel::-webkit-scrollbar-track {
  background: transparent;
}

.glass-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.625rem;
}

.glass-panel::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar {
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 1.5rem;
  margin: auto 0;
  height: calc(100% - 3rem);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: -10px auto 15px auto;
  cursor: grab;
  flex-shrink: 0;
  transition: background 0.2s, background-color 0.2s;
  display: block;
}

.panel-drag-handle:hover {
  background: rgba(255, 255, 255, 0.4);
}

.panel-drag-handle:active {
  cursor: grabbing;
  background: var(--accent);
}

header {
  margin-bottom: 2rem;
  position: sticky;
  top: -2rem;
  z-index: 100;
  /* Black gradient fading down to fuse with glass */
  background: linear-gradient(to bottom, rgb(0 0 0) 0%, rgba(0, 0, 0, 0.562) 65%, rgba(0, 0, 0, 0.244) 85%, rgb(1 1 1 / 0%) 100%);
  padding: 1.5rem;
  margin: -2rem -1.5rem 0.9375rem -1.5rem;
  margin-bottom: 0;
  /* offset sidebar padding */
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
}

.lang-toggle {
  position: absolute;
  top: 1.7rem;
  right: 1.7rem;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: 'Matt', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 110;
  padding: 0.2rem;
}

.logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container:active {
  transform: scale(0.98);
}

.logo-container svg {
  width: 100%;
  max-width: 13.75rem;
  height: auto;
  display: block;
}

/* Map logo text fonts explicitly to our loaded premium 'Matt' font */
.logo-container .cls-5 {
  font-family: 'Matt', 'Inter', sans-serif !important;
  font-weight: 700 !important;
}

.logo-container .cls-6,
.logo-container .cls-7 {
  font-family: 'Matt', 'Inter', sans-serif !important;
  font-weight: 800 !important;
}

/* Sidebar scroll lock when info panel is open */
.sidebar.info-open {
  overflow: hidden !important;
}

/* Info overlay styling */
.info-overlay {
  position: absolute;
  top: 7.2rem;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  background: rgb(23, 23, 23);
  /* Deep slate semi-transparent */
  backdrop-filter: blur(12px);
  /* Sleek backdrop blur */
  -webkit-backdrop-filter: blur(12px);
  border-radius: 2rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2rem 1.5rem 1.5rem 1.5rem;
  box-sizing: border-box;
  transform-origin: top center;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  will-change: transform, opacity, border-radius;
}

.info-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.info-title {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: 'Matt', 'Inter', sans-serif;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.info-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

.info-text.contact-text {
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.911);
}

.info-email {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(189, 246, 216, 0.5);
  transition: color 0.2s, border-color 0.2s;
}

.info-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.768);
  font-family: 'Matt', 'Inter', sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.9rem;
}

.info-linkedin {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.info-linkedin:hover {
  color: var(--accent);
}

.controls-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.controls-section h2 {
  font-size: 1.7rem;
  margin-left: 0.3125rem;
  font-weight: 900;
  color: var(--text-secondary);
  margin-bottom: 0.625rem;
}

/* Effect Grid */
.effect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.effect-card-label {
  cursor: pointer;
}

.effect-card-label input[type="radio"] {
  display: none;
}

.effect-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition);
}

.effect-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.preview-none {
  background-image: url('/assets/original-CgzfQBx6.jpg');
}

.preview-gaussian {
  background-image: url('/assets/glaussian-2XTcpoDs.jpg');
}

.preview-motion {
  background-image: url('/assets/motion-Bd3d5bQb.jpg');
}

.preview-spin {
  background-image: url('/assets/spin-eBcsTesV.jpg');
}

.preview-zoom {
  background-image: url('/assets/zoom-D7GdX8Hh.jpg');
}

.preview-fluted {
  background-image: url('/assets/fluted%20glass-BPfnL6Om.jpg');
}

.preview-frosted {
  background-image: url('/assets/frosted%20glass-CBHRtu40.jpg');
}

.effect-name {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.effect-card-label input[type="radio"]:checked~.effect-card {
  background: rgba(var(--accent-rgb), 0.15);
}

.effect-card-label input[type="radio"]:checked~.effect-card .effect-name {
  color: var(--text-primary);
}

/* Custom Select */
.custom-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-primary);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem top 50%;
  background-size: 0.75rem auto;
}

.custom-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.custom-select:focus {
  box-shadow: 0 0 12px var(--accent-glow);
}

.custom-select option {
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

/* Shape Selector Buttons */
.shape-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.shape-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  width: 100%;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.shape-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.shape-btn.active {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
}

/* Target Selector (Apply Effect To) */
.target-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.target-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  height: 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  gap: 0.25rem;
}

.target-btn svg {
  opacity: 0.8;
}

.target-btn span {
  font-size: 0.625rem;
  font-weight: 500;
  text-align: center;
}

.target-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.target-btn.active {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
}

/* Sliders */
.control-group {
  margin-bottom: 1.25rem;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.control-group span {
  color: var(--accent);
  font-weight: 500;
}

/* --- Liquid Glass Slider --- */
.slider-wrapper {
  position: relative;
  width: calc(100% - 2rem);
  /* 16px margin each side to avoid cutoff -> 1rem */
  margin: 0 1rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
}

/* The native input is invisible but stays on top to handle all interaction */
.slider-wrapper input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
  margin: 0;
}

/* Custom Visual Track */
.slider-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 0.375rem;
  background: #a3eec329;
  border-radius: 0.1875rem;
  overflow: hidden;
  pointer-events: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.16);
}

.slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--slider-fill, 0%);
  background: var(--accent-gradient);
  border-radius: 0.1875rem;
}

/* The Glass Lens (Thumb) */
.slider-lens {
  position: absolute;
  top: 50%;
  left: calc(var(--slider-fill, 0%) - 1rem); /* Center align width offset (2rem lens width -> 1rem offset) */
  transform: translateY(-50%) translateZ(0);
  width: 2rem;
  height: 1.5rem;
  border-radius: 0.625rem; /* Smoother rounded droplet shape */

  /* Volumetric 3D water droplet radial-gradient highlight */
  background: radial-gradient(circle at 35% 30%, 
    rgba(255, 255, 255, 0.648) 0%, 
    rgba(255, 255, 255, 0.12) 25%, 
    rgba(40, 40, 40, 0.116) 65%, 
    rgba(0, 0, 0, 0.23) 100%
  );
  
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);

  box-shadow:
    inset 0 1.5px 0 0 rgba(255, 255, 255, 0.768), /* Top bright rim reflection */
    inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.15),   /* Bottom shadow contour */
    inset 0 0 0 1px rgba(255, 255, 255, 0.074),   /* Inner boundary ring */
    0 4px 10px rgba(0, 0, 0, 0.22);             /* Soft drop shadow */
    
  border: 0.5px solid rgba(255, 255, 255, 0.352);
  pointer-events: none;
  z-index: 5;
  will-change: left, transform, backdrop-filter;
  transition: left 0.1s linear, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.25), box-shadow 0.3s ease, background 0.3s ease;
}

.slider-wrapper input[type="range"]:hover~.slider-lens {
  transform: translateY(-50%) scale(1.1) translateZ(0);
  background: radial-gradient(circle at 35% 30%, 
    rgba(255, 255, 255, 0.6) 0%, 
    rgba(255, 255, 255, 0.18) 35%, 
    rgba(255, 255, 255, 0.04) 65%, 
    rgba(0, 0, 0, 0.15) 100%
  );
  box-shadow:
    inset 0 1.5px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 6px 14px rgba(0, 0, 0, 0.26);
}

.slider-wrapper input[type="range"]:active~.slider-lens {
  transform: translateY(-50%) scaleX(1.22) scaleY(0.85) translateZ(0);
}



.hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

/* Buttons */
.actions-section {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  border-radius: 1.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}

.primary-btn {
  background: var(--accent-gradient);
  color: #0b3c21;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px) saturate(1.1);
  -webkit-backdrop-filter: blur(4px) saturate(1.1);
}

.secondary-btn {
  background: transparent;
  color: var(--text-primary);
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* Removed padding so canvas spans full screen */
  position: relative;
  width: 100%;
  height: 100%;
}

.canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

#canvas-pan-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.75rem !important;
  height: 1.75rem !important;
  min-width: 1.75rem;
  min-height: 1.75rem;
  border-radius: 0.5rem;
  display: none; /* will be changed to flex by JS */
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 100;
  padding: 0;
  color: #0f172a;
  border: none;
  background: var(--accent);
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.3);
  transition: opacity 0.2s, background-color 0.2s;
}
#canvas-pan-handle:hover {
  background: var(--accent-hover);
}
#canvas-pan-handle:active {
  cursor: grabbing;
  background: var(--accent-hover);
}

.canvas-container.dragover {
  background: rgba(var(--accent-rgb), 0.15);
}

.empty-state {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  transition: opacity 0.3s;
  z-index: 2;
}

.upload-area {
  position: relative;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.02) 100%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  border-radius: 1.5rem;
  padding: 3rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
}

.upload-icon-gif {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.5rem;
  filter: invert(1);
}

.upload-area h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.upload-area p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  cursor: crosshair;
}

canvas.has-image {
  opacity: 1;
}

.center-marker {
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 0.125rem solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.center-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.25rem;
  height: 0.25rem;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.center-marker.visible {
  opacity: 1;
}

.center-hint {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.875rem;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(8px);
}

/* Category List and Button Styles */
.category-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 4px;
}
.category-list::-webkit-scrollbar {
  width: 4px;
}
.category-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1.25rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.category-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.category-btn.active {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.category-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.875rem;
  bottom: 0.875rem;
  width: 0.25rem;
  background: var(--accent-gradient);
  border-radius: 0.125rem;
}

.category-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.category-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  transition: var(--transition);
  overflow: hidden;
}

.category-gif,
.category-static {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1.8rem;
  height: 1.8rem;
  transition: opacity 0.3s ease, filter var(--transition);
}

.category-gif {
  opacity: 0;
  filter: invert(1);
}

.category-static {
  opacity: 1;
  filter: invert(1);
}

.category-btn:hover .category-gif,
.category-btn.active .category-gif {
  opacity: 1;
}

.category-btn:hover .category-static,
.category-btn.active .category-static {
  opacity: 0;
}

.category-btn.active .category-icon {
  background: var(--accent-gradient);
  border-radius: 10px;
}

.category-btn.active .category-gif {
  filter: invert(0);
}

.soon-text {
  font-family: 'Designer Signature', cursive;
  font-weight: 450;
  color: var(--accent);
  margin-left: auto;
  transform: rotate(-10deg);
  opacity: 0.85;
  display: inline-block;
  pointer-events: none;
  line-height: 1;
}
html[lang="fr"] .soon-text {
  font-size: 1.5rem;
}
html[lang="en"] .soon-text {
  font-size: 1.9rem;
}

/* Right Panel Container (unified) */
.right-panel {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  height: auto !important;
  max-height: calc(100% - 3rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.96) 0%,
      rgba(0, 0, 0, 0) 25%),

    linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.02) 100%),
    rgba(39, 39, 39, 0.068);
}

/* Accordion Styles */
.accordion-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 0 0 auto;
}

.accordion-item.active {
  flex: 1 1 auto;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0 !important;
  padding: 1rem 0;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  margin: 0;
  border-bottom: none;
}

.accordion-header h2 {
  font-size: 1.7rem;
  font-weight: 900 !important;
  color: var(--text-primary);
  margin: 0;
}

.accordion-header .chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-secondary);
}

.accordion-item.active .chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.accordion-content {
  overflow-y: auto;
  scrollbar-width: none;
  transition: opacity 0.3s ease;
}

.accordion-content::-webkit-scrollbar {
  display: none;
}

/* Ensure the Models Grid inside the accordion is scrollable */
.right-panel .effect-grid {
  padding-bottom: 1rem;
  margin-top: 0.5rem;
}

.params-section-gradient {
  /* Soft background for parameters */
  margin: 0.5rem 0 0 0;
  padding: 0.5rem 0 0 0;
}

/* Navigator Toolbar */
.navigator-toolbar {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-width: 0;
  width: max-content;
  border-radius: 2rem;
  z-index: 100;
  cursor: default;

  /* Liquid glass styling */
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.02) 100%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
}

.drag-handle {
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  color: var(--text-secondary);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.nav-btn.active {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.nav-divider {
  width: 1px;
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.41);
  margin: 0 0.25rem;
}

/* Fullscreen button appearing on hover over the eye button */
.nav-eye-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Invisible bridge that extends the hover zone above the button into the gap */
.nav-eye-wrapper::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: -0.5rem;
  right: -0.5rem;
  height: 25px;
}

.fullscreen-popup {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.3);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  color: white;
  isolation: isolate;

  /* Glass background gradient */
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.06) 50%,
      rgba(255, 255, 255, 0.03) 100%);
  box-shadow:
    0 0.5rem 2rem rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Simulated glass displacement texture - high opacity and contrast to make the glass detail clearly visible */
.fullscreen-popup::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url('/map.webp') center / 48px 48px repeat;
  filter: grayscale(1) contrast(6) blur(8px) opacity(0.5) invert(1);
  mix-blend-mode: normal;
  z-index: -1;
  pointer-events: none;
}

.nav-eye-wrapper:hover .fullscreen-popup {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

.fullscreen-popup:active {
  transform: translateX(-50%) scale(0.92);
}



/* Placeholder Panel Styles */
.placeholder-panel {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  height: calc(100% - 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  z-index: 100;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
}

.placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 50%;
  color: var(--accent);
  margin-bottom: 0.5rem;
  box-shadow: 0 0.5rem 2rem rgba(var(--accent-rgb), 0.15);
}

.placeholder-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.placeholder-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 16.25rem;
}

/* Glass Toggle Switch - Faithful to Progressbar */
.glass-toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 2.75rem;
  height: 1.25rem;
  cursor: pointer;
}

.glass-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.glass-slider {
  position: absolute;
  left: 0;
  right: 0;
  height: 0.375rem;
  background: rgba(255, 22, 45, 0.667);
  /* Red background when disabled */
  border-radius: 0.1875rem;
  transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* Hollow channel groove look */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.glass-knob {
  position: absolute;
  z-index: 1000;
  height: 1.5rem;
  width: 1.75rem;
  left: -6px;
  top: 50%;
  transform: translateY(-50%) translateZ(0);
  border-radius: 0.625rem; /* Smoother rounded droplet shape */
  
  /* Volumetric 3D water droplet radial-gradient highlight */
  background: radial-gradient(circle at 35% 30%, 
    rgba(255, 255, 255, 0.689) 0%, 
    rgba(255, 255, 255, 0.348) 25%, 
    rgba(255, 255, 255, 0.02) 65%, 
    rgba(0, 0, 0, 0.268) 100%
  );
  
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  
  /* Specular reflections & contours */
  box-shadow:
    inset 0 1.5px 0 0 rgba(255, 255, 255, 0.875), /* Top bright rim reflection */
    inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.15),   /* Bottom shadow contour */
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),   /* Inner boundary ring */
    0 4px 10px rgba(0, 0, 0, 0.22);             /* Soft drop shadow */
    
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.25), box-shadow 0.3s ease, background 0.3s ease;
  will-change: transform, box-shadow, backdrop-filter;
}

.glass-toggle:hover .glass-knob {
  transform: translateY(-50%) scale(1.1) translateZ(0);
  background: radial-gradient(circle at 35% 30%, 
    rgba(255, 255, 255, 0.763) 0%, 
    rgba(255, 255, 255, 0.351) 35%, 
    rgba(255, 255, 255, 0.152) 65%, 
    rgba(0, 0, 0, 0.15) 100%
  );
  box-shadow:
    inset 0 1.5px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 6px 14px rgba(0, 0, 0, 0.26);
}

.glass-toggle input:active ~ .glass-knob {
  transform: translateY(-50%) scaleX(1.22) scaleY(0.85) translateZ(0);
}

.glass-toggle input:checked+.glass-slider {
  background: var(--accent-gradient);
}

.glass-toggle input:checked ~ .glass-knob {
  transform: translate(1.25rem, -50%) translateZ(0);
}

.glass-toggle:hover input:checked ~ .glass-knob {
  transform: translate(1.25rem, -50%) scale(1.1) translateZ(0);
}

/* Water tension squish effect when clicking/active in checked state */
.glass-toggle input:checked:active ~ .glass-knob {
  transform: translate(1.25rem, -50%) scaleX(1.22) scaleY(0.85) translateZ(0);
}

/* Glass Color Picker */
.glass-color-picker {
  position: relative;
  width: 100%;
  height: 3rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.glass-color-picker input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: inherit;
}

.glass-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.glass-color-picker input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.086);
  border-radius: inherit;
}

.glass-color-picker input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.099);
  border-radius: inherit;
}

.glass-color-picker .glass-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.205) 0%, rgba(255, 255, 255, 0.0) 100%);
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.158),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.2),
    0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}

/* Glass Select Custom Dropdowns */
.glass-select {
  position: relative;
  width: 100%;
  margin-top: 0.5rem;
  user-select: none;
  font-family: inherit;
  font-size: 0.875rem;
}

.glass-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1rem;
  /* Premium liquid glass background matching panel style */
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.03) 100%),
    url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC42NSIgbnVtT2N0YXZlcz0iMyIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNuKSIgb3BhY2l0eT0iMC4wOCIvPjwvc3ZnPg==');

  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-radius: 0.875rem;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.glass-select-trigger:hover {
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.111),
    0 6px 18px rgba(0, 0, 0, 0.25);
}

.glass-select.open .glass-select-trigger {
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.06) 100%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.108),
    0 0 15px rgba(255, 255, 255, 0.1);
}

.glass-select-trigger svg.chevron {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.7;
}

.glass-select.open .glass-select-trigger svg.chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.glass-select-options {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  scrollbar-width: none;
  width: calc(100% - 16px);
  margin-left: 8px;
  /* Offset the dropdown box to the right by 8px using margin */
  /* Very dark premium glass panel, no colors */
  background:
    linear-gradient(135deg,
      rgba(10, 10, 12, 0.85) 0%,
      rgba(20, 20, 25, 0.9) 100%),
    url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC42NSIgbnVtT2N0YXZlcz0iMyIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNuKSIgb3BhY2l0eT0iMC4wNiIvPjwvc3ZnPg==');

  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 1.25rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform-origin: top center;
  /* Origin for GSAP scale animation */

  max-height: 12.5rem;
  /* Scrollable height limit */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  /* Hide scrollbar for Firefox */

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.077);
  padding: 0.375rem;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.glass-select-options::-webkit-scrollbar {
  display: none;
}

.glass-select-option {
  padding: 0.625rem 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 0.75rem;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.glass-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  margin-left: 0.5rem;
}

.glass-select-option.selected {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
    0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);
}

/* Curve Tabs styling */
.curve-tabs-container {
  display: flex;
  gap: 0.375rem;
  width: 100%;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.curve-tab {
  flex: 1;
  padding: 0.5rem 0.625rem;
  border-radius: 0.625rem;
  border: none;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  position: relative;
}

/* Base text color / states per channel */
.curve-tab[data-channel="master"] {
  color: rgba(255, 255, 255, 0.6);
}

.curve-tab[data-channel="red"] {
  color: rgba(255, 69, 58, 0.65);
}

.curve-tab[data-channel="green"] {
  color: rgba(50, 215, 75, 0.65);
}

.curve-tab[data-channel="blue"] {
  color: rgba(10, 132, 255, 0.65);
}

/* Hover states */
.curve-tab:hover {
  background: rgba(255, 255, 255, 0.03);
}

.curve-tab[data-channel="master"]:hover {
  color: #ffffff;
}

.curve-tab[data-channel="red"]:hover {
  color: #ff453a;
}

.curve-tab[data-channel="green"]:hover {
  color: #32d74b;
}

.curve-tab[data-channel="blue"]:hover {
  color: #0a84ff;
}

/* Active states */
.curve-tab.active {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

.curve-tab[data-channel="master"].active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.curve-tab[data-channel="red"].active {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 69, 58, 0.15),
    0 2px 8px rgba(255, 69, 58, 0.1);
}

.curve-tab[data-channel="green"].active {
  background: rgba(50, 215, 75, 0.15);
  color: #32d74b;
  box-shadow:
    inset 0 1px 0 0 rgba(50, 215, 75, 0.15),
    0 2px 8px rgba(50, 215, 75, 0.1);
}

.curve-tab[data-channel="blue"].active {
  background: rgba(10, 132, 255, 0.15);
  color: #0a84ff;
  box-shadow:
    inset 0 1px 0 0 rgba(10, 132, 255, 0.15),
    0 2px 8px rgba(10, 132, 255, 0.1);
}

/* Bullet indicator inside tabs */
.curve-tab::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  will-change: transform, opacity;
  opacity: 0.6;
}

.curve-tab[data-channel="master"]::before {
  background: #ffffff;
}

.curve-tab[data-channel="red"]::before {
  background: #ff453a;
}

.curve-tab[data-channel="green"]::before {
  background: #32d74b;
}

.curve-tab[data-channel="blue"]::before {
  background: #0a84ff;
}

.curve-tab.active::before {
  opacity: 1;
  transform: scale(1.2);
  box-shadow: 0 0 0.5rem currentColor;
}

/* Mobile Warning Overlay */
.mobile-warning-overlay {
  display: none;
}

@media (max-width: 767px) {
  #app {
    display: none !important;
  }
  
  .mobile-warning-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 999999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
  }

  .mobile-warning-glass-card {
    background:
      linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 40%),
      linear-gradient(to right, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 25%),
      linear-gradient(to left, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 25%),
      linear-gradient(135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2rem;
    padding: 3rem 2.5rem;
    max-width: 32rem;
    width: 100%;
    box-shadow: 
      0 25px 50px -12px rgba(0, 0, 0, 0.5),
      0 0 40px rgba(189, 246, 216, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    animation: warningCardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transform: translate(var(--drag-x, 0px), var(--drag-y, 0px));
  }

  .mobile-warning-logo {
    width: 100%;
    max-width: 15rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .mobile-warning-logo-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
  }

  .mobile-warning-gif-container {
    width: 100%;
    max-width: 10rem;
    display: flex;
    filter: invert();
    justify-content: center;
    align-items: center;
  }

  .mobile-warning-gif {
    width: 50%;
    height: auto;
    display: block;
  }

  .mobile-warning-content p {
    font-family: 'Matt', 'Inter', sans-serif;
    font-size: 1.45rem;
    line-height: 1.1;
    color: #ffffff;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.015em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .mobile-warning-overlay .lang-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--accent);
    font-family: 'Matt', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000000;
  }

  .mobile-warning-overlay .lang-toggle:hover {
    transform: translateY(-1px);
  }

  @keyframes warningCardEntrance {
    from {
      opacity: 0;
      transform: translate(var(--drag-x, 0px), calc(var(--drag-y, 0px) + 20px)) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(var(--drag-x, 0px), var(--drag-y, 0px)) scale(1);
    }
  }

  @keyframes warningLogoGlow {
    from {
      filter: drop-shadow(0 0 2px rgba(189, 246, 216, 0));
    }
    to {
      filter: drop-shadow(0 0 8px rgba(189, 246, 216, 0.15));
    }
  }

  @keyframes phoneShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: rotate(5deg); }
  }
}

.webkit-glass-fallback .glass-panel::before,
.webkit-glass-fallback .upload-area::before,
.webkit-glass-fallback .navigator-toolbar::before,
.webkit-glass-fallback .info-overlay::before,
.webkit-glass-fallback .mobile-warning-glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  
  background: url('/map.webp') center / 400px repeat;
  filter: grayscale(1) contrast(2) brightness(0.3);
  mix-blend-mode: normal;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}
/* --- Video Layout Modifications --- */
#app.layout-video #canvas-container {
  padding-bottom: 12.5rem;
}

/* Timeline Track Styles */
.timeline-track {
  height: 1.875rem; /* 30px */
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 0.25rem;
  position: relative;
  border-radius: 0.25rem;
}
.timeline-track-label {
  position: sticky;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6.25rem; /* 100px */
  background: rgb(0 0 0 / 40%);
  z-index: 10;
  display: flex;
  align-items: center;
  padding-left: 0.625rem;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 5;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.timeline-layer {
  position: absolute;
  top: 0.0625rem; /* 1px */
  bottom: 0.0625rem;
  background: var(--accent);
  border-radius: 0.25rem;
  cursor: grab;
  opacity: 0.8;
  display: flex;
  align-items: center;
  padding: 0 0.625rem;
  font-size: 0.7rem;
  white-space: nowrap;
  color: #0b3c21;
  overflow: visible !important; /* Allow action popup to overflow */
  box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.3);
}

.timeline-layer:active {
  cursor: grabbing;
}
.timeline-layer .resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0.5rem;
  background: rgba(255,255,255,0.3);
  cursor: ew-resize;
}
.timeline-layer .resize-handle.left { left: 0; }
.timeline-layer .resize-handle.right { right: 0; }

/* Timeline Wrapper Container */
.timeline-container {
  position: absolute;
  bottom: 1.5rem;
  left: 27.5vw; 
  width: 45vw; 
  height: 11rem;
  min-width: 35vw;
  max-width: 100vw;
  min-height: 11rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow: hidden;
  background: 
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.266) 45%,
      rgba(0, 0, 0, 0) 90%),
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.02) 100%),
    rgba(39, 39, 39, 0.068);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Timeline Resize Edges */
.resize-edge {
  position: absolute;
  z-index: 210;
}
.resize-edge.top { top: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; }
.resize-edge.bottom { bottom: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; }
.resize-edge.left { top: 0; bottom: 0; left: -4px; width: 8px; cursor: ew-resize; }
.resize-edge.right { top: 0; bottom: 0; right: -4px; width: 8px; cursor: ew-resize; }

.resize-edge.top-left { top: -4px; left: -4px; width: 8px; height: 8px; cursor: nwse-resize; }
.resize-edge.top-right { top: -4px; right: -4px; width: 8px; height: 8px; cursor: nesw-resize; }
.resize-edge.bottom-left { bottom: -4px; left: -4px; width: 8px; height: 8px; cursor: nesw-resize; }
.resize-edge.bottom-right { bottom: -4px; right: -4px; width: 8px; height: 8px; cursor: nwse-resize; }

.timeline-drag-handle {
  color: rgb(255, 255, 255);
  transition: var(--transition);
  opacity: 1 !important;
}
.timeline-drag-handle:active {
  cursor: grabbing !important;
}

/* Timeline Ruler Styles */
.timeline-ruler-track {
  height: 0.75rem;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.25rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  border-radius: 0.25rem;
}

.timeline-ruler-label {
  position: sticky;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6.25rem; /* 100px */
  z-index: 15;
  height: 100%;
}

.ruler-tick {
  position: absolute;
  top: 0.25rem;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.ruler-tick::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
}

.ruler-tick-label {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: monospace;
  pointer-events: none;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

#app.layout-video .timeline-header {
  justify-content: space-between;
}

#app.layout-video .timeline-header .navigator-toolbar {
  position: static;
  transform: none;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
}

#app.layout-video .timeline-header .navigator-toolbar .drag-handle {
  display: none !important;
}

.timeline-play-btn {
  background: var(--accent-gradient);
  color: #0b3c21;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px) saturate(1.1);
  -webkit-backdrop-filter: blur(4px) saturate(1.1);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.timeline-play-btn svg {
  display: block;
  width: 1rem;
  height: 1rem;
  margin: 0;
}

#icon-play {
  transform: translateX(1px);
}

.timeline-time {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.timeline-tracks-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  padding-right: 0.25rem;
  padding-top: 0.5rem;
  isolation: isolate;
}

.timeline-tracks-container::-webkit-scrollbar {
  width: 0.375rem;
}

.timeline-tracks-container::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-tracks-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.625rem;
}

.timeline-playhead {
  position: absolute;
  top: 4rem; 
  bottom: 1.25rem; 
  left: calc(1.25rem + 6.25rem);
  width: 0.12rem;
  background: #ffffff;
  z-index: 200; 
  pointer-events: all !important;
  cursor: ew-resize;
  transition: transform 0.1s linear;
}

.timeline-playhead::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: -0.40625rem;
  width: 0.875rem;
  height: 0.875rem;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  transition: transform 0.1s ease;
  cursor: grab;
}

.timeline-playhead::after {
  content: attr(data-time);
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0b3c21;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#app.layout-video .timeline-header .navigator-toolbar .nav-eye-wrapper {
  display: contents; 
}

#app.layout-video .timeline-header .navigator-toolbar .fullscreen-popup {
  position: static;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: all !important;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  color: var(--text-secondary);
  transition: var(--transition);
  order: -2; /* Place at the beginning of the toolbar */
  display: flex;
  align-items: center;
  justify-content: center;
}

#app.layout-video .timeline-header .navigator-toolbar .fullscreen-popup::before {
  display: none !important; /* Remove glass map image */
}

#app.layout-video .timeline-header .navigator-toolbar .fullscreen-popup:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

#app.layout-video .timeline-header .navigator-toolbar .nav-eye-wrapper::before {
  display: none !important;
}

/* Selected Timeline Layer & Floating Toolbar */
.timeline-layer {
  outline: 0px solid var(--accent);
  transition: outline-width 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: visible !important;
}

.layer-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  pointer-events: none;
}

.timeline-layer.selected {
  outline: 2px solid var(--accent) !important;
  box-shadow: 0 0 10px rgba(189, 246, 216, 0.5) !important;
  background: rgba(255, 255, 255, 0.25) !important;
  z-index: 300 !important;
}

/* Floating Actions Popup */
.layer-actions-popup {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -100%) scale(0.8);
  margin-top: -0.5rem; /* Offset spacing above the layer */
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5000;
}

.layer-actions-popup.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -100%) scale(1);
}

.layer-action-btn {
  background: transparent;
  border: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
}

.layer-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.layer-action-btn.delete-btn:hover {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
}

.timeline-playhead:active::before {
  cursor: grabbing;
  transform: scale(1.2);
}

