/* Gate page: loading state + overlay styles (subset of classroom.css) */
@font-face {
  font-family: 'MainFont';
  src: url('/assets/mainfont.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --app-font-family: 'MainFont', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  height: 100%;
  font-family: var(--app-font-family);
}

body.gate-page {
  font-family: var(--app-font-family);
  min-height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8f7f5 0%, #efece8 50%, #e8e4df 100%);
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

#gate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px;
}

#gate-loading.hidden {
  display: none !important;
}

.gate-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: gate-spin 0.9s linear infinite;
}

@keyframes gate-spin {
  to {
    transform: rotate(360deg);
  }
}

.gate-loading-text {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.6);
}

/* ── Class Alert Overlay (shared with classroom) ─────────────────────── */
.class-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  opacity: 0;
  transition: background 0.6s ease, backdrop-filter 0.6s ease, opacity 0.5s ease;
}

.class-alert-overlay--visible {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  opacity: 1;
}

.class-alert-card {
  position: relative;
  width: min(420px, 92vw);
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 24px 80px -12px rgba(0, 0, 0, 0.5),
    0 0 60px -10px rgba(99, 102, 241, 0.15);
}

.class-alert-overlay--visible .class-alert-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.class-alert-card__glow {
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 200%;
  pointer-events: none;
  border-radius: 50%;
}

.class-alert-card--no-class .class-alert-card__glow {
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.12) 0%, transparent 60%);
}

.class-alert-card--upcoming .class-alert-card__glow {
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.14) 0%, transparent 60%);
}

.class-alert-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 32px 32px;
}

.class-alert-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: alert-icon-pop 0.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.class-alert-card--no-class .class-alert-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
  box-shadow: 0 0 30px -5px rgba(239, 68, 68, 0.25);
}

.class-alert-card--upcoming .class-alert-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.08));
  box-shadow: 0 0 30px -5px rgba(99, 102, 241, 0.3);
}

.class-alert-icon svg {
  width: 34px;
  height: 34px;
}

.class-alert-card--no-class .class-alert-icon svg {
  color: #f87171;
}

.class-alert-card--upcoming .class-alert-icon svg {
  color: #818cf8;
}

@keyframes alert-icon-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.class-alert-title {
  font-size: 22px;
  font-weight: 700;
  color: #f9fafb;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.class-alert-message {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 28px;
  line-height: 1.55;
}

.class-alert-timer-ring {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.class-alert-timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.class-alert-timer-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
}

.class-alert-timer-ring__progress {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 157.08;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.class-alert-card--no-class .class-alert-timer-ring__progress {
  stroke: #f87171;
}

.class-alert-card--upcoming .class-alert-timer-ring__progress {
  stroke: #818cf8;
}

.class-alert-timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #f9fafb;
  font-variant-numeric: tabular-nums;
}

.class-alert-redirect-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 24px;
}

.class-alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #f9fafb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  text-decoration: none;
  margin-inline: 0.3rem;
}

.class-alert-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.class-alert-btn:active {
  transform: translateY(0);
}

.class-alert-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}