/* Root Variables */
:root {
  --text-dark: #333;
  --text-light: #666;
  --text-primary: #333;
  --btn-color: #ff4e68;
  --btn-hover: rgba(255, 94, 145, 0.4);
  --pink-primary: #e91e63;
  --pink-secondary: rgba(233, 30, 99, 0.1);
  --pink-hover: #c2185b;
  --pink-light: #f06292;
  --green-primary: #4CAF50;
  --green-light: #81C784;
  --upload-orange: #FF9800;
  --upload-orange-light: #FFB74D;
  --white: #ffffff;
  --border-color: #e0e0e0;
  --radius-md: 8px;
  --radius-lg: 15px;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --pink-gradient: linear-gradient(to right, #ff748d, #ff7daf);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Background */
.gradientBgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--pink-gradient);
  z-index: -1;
}

/* Layout & Containers */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.canvas-centered {
  max-width: 100vw;
  margin: 0;
  padding: 0.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.main-content-card {
  width: 100%;
  min-width: 92vw;
  max-width: 96vw;
  height: calc(100vh - 0.5rem);
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: pan-y pinch-zoom;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.main-content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  z-index: 2;
}

.glass-card {
  width: 100%;
  max-width: 900px;
  height: auto;
  min-height: 400px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(9px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 4px 2px rgba(255, 255, 255, 0.2);
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent, rgba(255, 255, 255, 0.3));
}

/* Typography */
.hero-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-light);
  margin: 0 auto;
  max-width: 500px;
}

.canvas-title-section {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.canvas-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.canvas-subtitle {
  color: rgba(51, 51, 51, 0.8);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
}

.direction-section {
  text-align: center;
  margin: 0.3rem 0 0.5rem;
  position: relative;
}

.direction-arrows {
  font-size: 1.2rem;
  color: var(--pink-primary);
  margin-bottom: 0.2rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

.direction-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pink-primary);
  margin: 0;
}

/* Buttons */
button:not(.buttonFrames):not(.buttonBgFrames) {
  padding: 10px 17px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: 0.3s;
}

button:not(.buttonFrames):not(.buttonBgFrames):hover {
  filter: brightness(1.1);
}

.start-btn {
  font-size: 1.5rem;
  padding: 0.75rem 2rem;
  margin-top: 30px;
  border: none;
  border-radius: 999px;
  background: var(--btn-color);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
}

.start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px var(--btn-hover);
}

.back-button {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pink-primary);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.back-button:hover {
  background: rgba(140, 7, 51, 0.3);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Timer Box */
.timer-box {
  background: rgba(226, 133, 133, 0.9);
  color: white;
  padding: 15px 20px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  z-index: 1000;
  text-align: center;
  box-shadow: 0 8px 25px rgba(226, 133, 133, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.timer-box #timer-display,
.timer-box #session-timer-display {
  font-size: 1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.timer-box p {
  margin: 0;
  font-size: 0.7rem;
  opacity: 0.9;
  font-weight: 500;
}

.timer-box.warning {
  background: rgba(255, 152, 0, 0.9);
  animation: timerPulse 1s infinite ease-in-out;
}

.timer-box.danger {
  background: rgba(244, 67, 54, 0.9);
  animation: timerUrgent 0.5s infinite ease-in-out;
}

/* Modal Base */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: modalBackdropFadeIn 0.3s ease;
}

@keyframes modalBackdropFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
}

@keyframes modalBackdropFadeOut {
  from {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}
