
/* Vars (safe areas, header, colors) */
:root {
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --header: 60px; /* fixed header height */

  --colorPrimary: #1976D2;    /* Blue */
  --colorAccent:  #FFC107;    /* Yellow */
  --colorText:    #333333;    /* Very Dark Grey */
  --colorDivider: #BDBDBD;    /* Light Grey Divider */
}

/* Full-screen, app-like page */
html, body {
    height: 100dvh;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    background-color: #FFF8DC; /* Light Yellow Background */
    color: #333333;            /* Very Dark Grey Text */
    text-align: center;
    overscroll-behavior: contain;
    overflow: hidden;          /* app-like by default */
    touch-action: none;        /* you chose to disable gestures */
    -webkit-text-size-adjust: 100%;
}

/* Allow scroll only when space is tight (landscape/short devices) */
@media (orientation: landscape), (max-height: 700px) {
  html, body { overflow: auto; }
  .lite-container:first-of-type { overflow: auto; }
}

/* Header */
.header {
    background-color: var(--colorPrimary);
    color: white;
    /* include safe top so timer never hits the notch */
    padding: calc(15px + var(--safe-top)) 0 15px;
    font-size: 24px;
    font-weight: bold;
    text-transform: lowercase;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* If anything else targets .header earlier, keep this helper too */
.header-title.flash { animation: flash-glow 2s ease-in-out; }
@keyframes flash-glow {
    0% { filter: brightness(1); }
    50% { filter: brightness(2.5); }
    100% { filter: brightness(1); }
}

/* Unified container setup
   - All containers get padding that respects the header + safe areas
   - Only the first one fills the screen (the “hero” section)
*/
.lite-container {
  padding-top: calc(var(--header) + var(--safe-top));
  padding-bottom: var(--safe-bottom);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* First lite-container = single-screen hero */
.lite-container:first-of-type {
  height: calc(100dvh - (var(--header) + var(--safe-top)));
  overflow: hidden; /* keeps the app feel on normal phones */
}

/* Tight headings used above/below QR */
.tight { margin: 4px 0; }

/* QR is clickable; make rendered canvas/img responsive and scannable */
#qrcode { cursor: pointer; }
#qrcode canvas,
#qrcode img {
  width: min(72vw, 50vh);
  max-width: 360px;  /* cap for tablets/large screens */
  height: auto !important;
  display: block;
}

/* Language buttons under the QR; vertical stack variant */
.language-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}
.language-row.column {
    flex-direction: column;
    gap: 10px;
}

/* Logo: smaller cap so it always fits above toolbars */
.logo-image {
  max-height: 14vh;
  max-width: 60vw;
  height: auto;
  width: auto;
  object-fit: contain;
  margin-top: 6px;
}

/* (Kept for other places using a captioned logo) */
.logo-caption {
    font-size: 20px;
    color: #555;
    margin-top: 12px;
    object-fit: contain;
}

/* Compact button (kept) */
.compact-button {
    background-color: var(--colorAccent);
    color: black;
    border: none;
    padding: 6px 6px;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0px;
    max-width: 80px;    
    white-space: normal;
    line-height: 1.1;
}
.language-button-wrapper { margin-top: 0px; }

/* Titles (kept) */
.lite-title {
    font-size: 28px;
    color: var(--colorPrimary);
    margin-bottom: 10px;
}
.lite-subtitle {
    font-size: 18px;
    color: var(--colorText);
    margin-bottom: 10px;
}

/* Divider (kept) */
.lite-divider {
    width: 80%;
    height: 2px;
    background-color: var(--colorDivider);
    margin: 10px auto;
}

/* Buttons (kept; slightly reduced top margin via layout, but keep original) */
.lite-button {
    background-color: var(--colorAccent);
    color: black;
    border: none;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 15px;
}
.lite-button:hover {
    background-color: var(--colorPrimary);
    color: white;
}

/* Language Picker Overlay (kept) */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 10;
}
#languagePicker {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-height: 80vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 999;
}
#language-list { list-style-type: none; padding-left: 0; }

.blue-button { background-color: #004BA0; color: white; }
.gold-button { background-color: #FFC107; color: black; }

.language-box {
    background: #ffffff;
    color: var(--colorPrimary);
    border-radius: 12px;
    text-align: center;
}
.language-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f0f0f0;
    padding: 10px;
    margin-top: 10px;
}
.language-scroll li {
    padding: 10px;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}
.language-scroll li:nth-child(odd) { background-color: #f9f9f9; }
.language-scroll li:nth-child(even){ background-color: #eeeeee; }
.language-scroll li.selected { background-color: var(--colorAccent); font-weight: bold; }
.language-scroll li:hover    { background-color: #e0e0e0; }

/* Fixed-bottom utility (kept) */
.fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    font-size: 20px;
    border-radius: 0;
    z-index: 20;
}

/* Snackbar (kept) */
.snackbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(25,118,210,0.95);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
  z-index: 2000;
}
.snackbar.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease;
}

/* Timer as a button */
.session-timer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  color: #333;
  cursor: pointer;
  user-select: none;
}
.session-timer-btn .spinner {
  font-weight: 700;
}
.session-timer-btn[disabled] {
  opacity: 0.6;
  cursor: default;
}
.session-timer-btn.expired {
  background: #ffe8e8;
  border-color: #ffc0c0;
}
