* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #F5F5F5;
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
  padding-top: 60px; /* space for fixed top bar */
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical centering */
  padding-top: 20px;
  padding-bottom: 40px;
}

@media (max-width: 768px) {
  .page-content {
    justify-content: flex-start;
  }
}

/* ========================= */
/* ======= TOP BAR ========= */
/* ========================= */

#topBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background-color: #F5F5F5;   
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);

  display: flex;
  justify-content: space-between;
  align-items: center;
  
  padding: 12px 24px;
  margin-top: 0px;

  overflow: visible; /* instead of hidden */
  box-sizing: border-box;
}

#appTitle {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

#userSection {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.lang-switcher {
  position: relative;
  color: #000;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;

  background: transparent; /* 👈 default */
  border: none;
  color: #111;

  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}

.lang-switcher.open .lang-toggle {
  background: #eee;
}


/* chevron */
.chevron {
  transition: transform 0.2s ease;
}

/* rotate when open */
.lang-switcher.open .chevron {
  transform: rotate(180deg);
}

/* dropdown container */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px); /* DROP DOWN, not pushing */
  right: 0;

  background: white;
  border-radius: 8px;
  overflow: hidden;

  z-index: 2000;
  min-width: 60px;
}

/* rows */
.lang-item {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  background: white;
  color: #000;
}

/* hover */
.lang-item:hover {
  background: #eee;
}

/* active language */
.lang-item.active {
  font-weight: 600;
}

/* hidden state */
.hidden {
  display: none;
}

/* ========================= Shared pill button base ========================= */

#dashboardBtn,
#authBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  background-color: #eee;
  border: 1px solid transparent;
  border-radius: 100px;

  padding: 6px 12px 6px 6px;
  cursor: pointer;

  font-size: 0.9rem;
  color: #010101;
  transition: all 0.2s ease;
}

#dashboardBtn:hover,
#authBtn:hover {
  background-color: #fff;
}

/* ========================= Shared icon circle ========================= */

.icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ========================= Shared SVG styling ========================= */

#dashboardBtn svg,
#authBtn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  shape-rendering: crispEdges;
}

/* ========================= Auth button (no icon state) ========================= */

#authBtn:not(:has(.icon-circle)) {
  padding: 10px 12px;
}

.page-content {
  width: 90%;           /* content width relative to viewport */
  max-width: 1200px;    /* optional max width */
  margin: 0 auto;       /* centers the content horizontally */
  display: flex;
  flex-direction: column;
  align-items: center;  /* centers h1, subtitle, buttons */
}

/* ========================= */
/* ======= PAGE TITLE ====== */
/* ========================= */

h1 {
  margin-top: 1rem;
  font-size: 1.8rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 10px;
}

p.subtitle {
  text-align: center;
  max-width: 600px;
  margin: 0rem 1rem 0.5rem;
  color: #666;
  line-height: 1.4;
}

/* ========================= */
/* ======= WHEEL AREA ====== */
/* ========================= */

#wheel-container {
  width: 90%;
  max-width: 1200px;

  height: 65vh;      /* was 50vh */
  min-height: 450px; /* ensures it's never tiny */

  max-height: 700px; /* optional upper cap */
  position: relative;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ========================= */
/* ======= CONTROLS ======== */
/* ========================= */

.controls {
  margin-top: 0.5rem;
}

button#saveBtn {
  background-color: #111;
  color: white;
  border: none;
  border-radius: 100px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 40px; /* 👈 adds space from bottom */
}

button#saveBtn:hover {
  background-color: #333;
}

/* ========================= */
/* ======= RESPONSIVE ====== */
/* ========================= */

@media (max-width: 600px) {
  #topBar {
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    justify-content: space-between;
  }

  #appTitle {
    font-size: 17px;
    line-height: 1.1;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    margin-right: 8px;
  }

  #userSection {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
    margin-top: 0;
  }

  #dashboardBtn svg,
  #authBtn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  shape-rendering: crispEdges;
  }

  .page-content {
    padding-top: 1rem;
  }

   h1 {
    font-size: 1.8rem;
    text-align: center;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem; /* space to subtitle */
    max-width: 3000px;         /* ⬅️ width that forces line break */
    width: 90%;               /* optional: relative to viewport */
    margin-left: auto;
    margin-right: auto;       /* centers h1 */
  }

  p.subtitle {
    font-size: 0.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
  }

  #wheel-container {
    width: 95vw;
    height: 45vh;     /* smaller on phones */
    min-height: 360px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    aspect-ratio: 1 / 1;   /* always square */
  }

  .controls {
    margin-top: 0.5rem;
  }

  /* Hide text labels on mobile when logged in */
  body.logged-in #dashboardBtn .btn-label,
  body.logged-in #authBtn .btn-label {
    display: none;
  }

  body.logged-in #dashboardBtn,
  body.logged-in #authBtn {
    padding: 6px;
    width: 44px;
    height: 44px;
    justify-content: center;
  }

    body.logged-in .auth-text {
    display: none;
  }

}
/* ========================= */
/* ===== HEIGHT-BASED ====== */
/* ========================= */

/* Apply only for desktop/tablet (avoid overriding mobile) */
@media (min-width: 601px) and (max-height: 700px) {
  p.subtitle {
    margin-bottom: 0.5vh;
  }

  .controls {
    margin-top: 1vh;
  }

  button#saveBtn {
    margin-bottom: 1vh;
  }
}

@media (min-width: 601px) and (min-height: 701px) {
  p.subtitle {
    margin-bottom: 3vh; 
  }

  .controls {
    margin-top: 4vh;
  }

  button#saveBtn {
    margin-bottom: 4vh;
  }
}

/* ========================= */
/* ===== POPUP STYLES ====== */
/* ========================= */

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px; /* ensures spacing on small screens */
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  padding: 24px 20px;
  border-radius: 16px;
  max-width: 90%;
  width: 500px;
  text-align: center;
  position: relative;
  box-sizing: border-box;
  word-wrap: break-word;
}

/* Close (X) button */
.popup-content .popup-close {
  all: unset;                /* removes all inherited styles */
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;           /* icon size */
  line-height: 1;
  cursor: pointer;
  color: #111;               /* subtle grey */
  display: inline-block;
  text-align: center;
  width: 32px;               /* clickable area */
  height: 32px;              /* clickable area */
  user-select: none;         /* prevents text selection on tap */
  z-index: 10;
  background: transparent;   /* explicit transparent */
  border: none;              /* no border */
  border-radius: 50%;        /* optional, keeps tap area round */
  padding: 0;                /* no padding */
  transition: color 0.2s ease, transform 0.2s ease;
}

.popup-content .popup-close:hover {
  color: #333;
}
/*   <!-- Success icon -->*/
.success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  animation: successPop 0.4s ease-out;
}

@keyframes successPop {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Popup text styles */
.popup-title {
  font-weight: 600;
  font-size: clamp(16px, 2vw, 20px); /* adaptive size */
  margin-bottom: 2px;
}

.popup-text {
  color: #555;
  margin-bottom: 26px;
  font-size: clamp(12px, 1.5vw, 16px);
}

/* CTA button */
.popup-content button#goDashboardBtn {
  padding: clamp(8px, 1.5vw, 12px) clamp(12px, 3vw, 16px);
  border-radius: 100px;
  border: none;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: clamp(12px, 1.5vw, 14px);
  transition: background 0.2s ease;
}
button#goDashboardBtn:hover {
  background-color: #333;
}
.redirect-note {
  margin-top: 10px;
  font-size: clamp(10px, 1.2vw, 12px); /* keeps it small */
  color: #999;                         /* grey */
  line-height: 1.2;
}

/* Popup actions layout */
.popup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Primary button (reuse existing CTA look) */
.popup-actions button {
  padding: clamp(8px, 1.5vw, 12px) clamp(14px, 3vw, 18px);
  border-radius: 100px;
  border: none;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: clamp(12px, 1.5vw, 14px);
  transition: background 0.2s ease;
}

.popup-actions button:hover {
  background: #333;
}

/* Secondary (stroke) button */
.popup-actions .secondary-btn {
  background: transparent;
  color: #111;
  border: 1.5px solid #111;
}

.popup-actions .secondary-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ========================= */
/* ===== AUTH MODAL ======== */
/* ========================= */

.auth-modal-content {
  width: 360px;
  max-width: 90%;
  text-align: left;
}

.auth-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px;
  color: #111;
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1.5px solid #ddd;
  border-radius: 100px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.google-btn:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: #aaa;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.auth-field {
  margin-bottom: 10px;
}

.auth-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #111;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: #111;
}

.auth-error {
  color: #e53e3e;
  font-size: 13px;
  margin: 4px 0 10px;
  min-height: 18px;
}

#emailAuthSubmit {
  width: 100%;
  padding: 10px 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

#emailAuthSubmit:hover {
  background: #333;
}

#emailAuthSubmit:disabled {
  background: #888;
  cursor: not-allowed;
}

.auth-toggle {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 13px;
  color: #666;
  text-align: center;
}

.auth-toggle button {
  background: none;
  border: none;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fff;
  color: #111;
  padding: 8px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px; /* 3x smaller than default */
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cookie-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.cookie-btn.primary {
  background: #eee;
  font-size: 10;
  color: #111;
  border: none;
  padding: 4px 8px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 12px;
}

