/* ===== HOME PAGE SPECIFIC STYLES ===== */

/* Fixed Side Ads - Simple Solution */
.ad-rail-left {
  position: fixed !important;
  left: 20px !important;
  top: 100px !important;
  width: 160px !important;
  height: 600px !important;
  z-index: 100 !important;
}

.ad-rail-right {
  position: fixed !important;
  right: 20px !important;
  top: 100px !important;
  width: 160px !important;
  height: 600px !important;
  z-index: 100 !important;
}

/* Large screens */
@media (min-width: 1600px) {
  .ad-rail-left {
    width: 300px !important;
  }
  .ad-rail-right {
    width: 300px !important;
  }
  .ad-rail-left ins,
  .ad-rail-right ins {
    width: 300px !important;
  }
}

/* Hide on mobile */
@media (max-width: 1200px) {
  .ad-rail-left,
  .ad-rail-right {
    display: none !important;
  }
}


/* Main heading */
.main-heading {
  font-family: 'Inter', sans-serif;
  font-size: 45px;
  line-height: 1.08;
  letter-spacing: -0.042em;
  font-weight: 600;
  text-align: center;
  margin: 0 auto 10px auto;
  margin-top: 15px;
  max-width: 1080px;
}

.main-heading .gray-text {
  color: #3f3f3f;
}

.main-heading .blue-text {
  color: #416bff;
}

/* === simple fade-in-up === */
@keyframes fadeInUp {
  0%   { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* apply on load (1 s, ease-out) */
.animate-fadeInUp {
  animation: fadeInUp 1s ease-out forwards;
}

/* ------------------------------------------------------------------
   FULL-SCREEN GRADIENT OVERLAY + CENTER BAR LOADER (with logo on top)
-------------------------------------------------------------------*/

/* 1) Overlay that blanks the page and centers content */
.result-loader{
  /* hidden by default – JS sets `style.display = "flex"` */
  display:none;

  /* full viewport cover */
  position:fixed;
  inset:0;

  /* same bluish gradient as site */
  background: linear-gradient(150deg, #e0f2ff, #ffffff);

  /* center the stack */
  display:none;                 /* <-- IMPORTANT */
  align-items:center;
  justify-content:center;
  flex-direction:column;        /* <-- logo UP, bar DOWN */
  gap:16px;                     /* space between logo & bar */

  z-index:15000;                /* above everything */
}

/* logo style */
.result-logo{
  width:90px; height:auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.3));
  animation: rlFade .35s ease-out both;
}

@keyframes rlFade{
  from{ transform:translateY(-6px); opacity:.0 }
  to  { transform:translateY(0);    opacity:1 }
}


/* 2) Actual bar loader (your original, just centered) */
.loader{
  /* variables */
  --height-of-loader: 5px;     /* bar thickness  */
  --loader-color: #416bff;     /* moving color   */

  width:170px;                 /* bar length     */
  height:var(--height-of-loader);
  display:block;
  position:relative;
  border-radius:30px;
  background:rgb(230, 230, 230);  /* track color    */
  overflow:hidden;             /* hide overflow  */
  margin:0 auto;               /* keep perfectly centered */
}

/* animated fill */
.loader::before{
  content:"";
  position:absolute;
  top:0; left:0;
  height:100%;
  width:0%;
  background:var(--loader-color);
  border-radius:30px;
  animation:moving 1s ease-in-out infinite;
}

@keyframes moving{
  50%  { width:100%; }         /* expand to full */
  100% { width:0; left:unset; right:0; }  /* shrink from right */
}




/* ===== MODERN TIMER SELECTION (REFINED) ===== */
.timer-section {
  display: flex;
  justify-content: center;
  gap: 8px; /* Thoda kam gap */
  background-color: #e9eef2; /* Thoda different grey */
  padding: 6px; /* Thoda kam padding */
  border-radius: 10px; /* Thoda kam rounded */
  margin-bottom: 20px;
  border: none; /* Border hata denge, background hi kaafi hai */
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); /* Andar ki taraf halka shadow */
}

.timer-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #4a5568; /* Thoda muted color */
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease-in-out;
}

.timer-btn:hover:not(.active) { /* Active state par hover effect nahi chahiye */
  background-color: rgba(0, 0, 0, 0.05); /* Hover par halka dark tint */
}

.timer-btn.active {
  background: #ffffff;
  color: #132bff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); /* Thoda behtar shadow */
}

/* Input row */
.input-row {
  display: flex;
  gap: 20px;
  margin: 20px auto 20px;
  justify-content: center;
  align-items: center;
}

.input-group {
  position: relative;
}

/* Username field (Material/Google style) */
.input {
  width: 230px;
  padding: 1.05rem 0.75rem 0.35rem;
  font-size: 1rem;
  border: 1.6px solid var(--input-border-light);
  border-radius: 4px;
  background: var(--input-bg-light);
  color: inherit;
  transition: border .2s cubic-bezier(.4,0,.2,1);
}

.user-label {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #000000;
  pointer-events: none;
  background: var(--input-bg-light);
  transition:
    top .15s cubic-bezier(.4,0,.2,1),
    transform .15s cubic-bezier(.4,0,.2,1),
    font-size .15s,
    color .15s,
    padding .15s;
}

/* focus or non‑empty */
.input:focus,
.input:valid {
  outline: none;
  border: 2px solid #1a73e8;
}

.input:focus~.user-label,
.input:valid~.user-label {
  top: -0.55rem;
  transform: none;
  font-size: .75rem;
  color: #1a73e8;
  background: var(--input-bg-light);
  padding: 0 .25rem;
}

:root {
  --input-bg-light: #ffffff;
  --input-border-light: #dadce0;
}

.input-row input,
.input-row select {
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  width: 230px;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus,
.input-row select:focus {
  border-color: #5500ff;
}



/* Quote + overlay */
.quote-wrapper {
  position: relative;
  max-width: 900px;
  margin-bottom: 0px;
}

#quote {
  font-family: 'Inter', sans-serif;
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: -0.01em;
  word-spacing: 0.50em;
  height: calc(1.9em * 3.5);   /* 4 full visible lines */
  padding: 23px 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 1 2px 8px rgba(0,0,0,0.08);
  filter: blur(4px);
  transition: filter 0.4s ease;
  overflow: hidden;
  position: relative;
  word-break: break-word;
  white-space: pre-wrap;
  margin: 0;
  display: flex;
  align-items: flex-start;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 0%, black 85%, transparent 100%);
}

.quote-content {
  transition: transform 0.3s ease;
  will-change: transform;
}

.quote-wrapper.unblur #quote {
  filter: none;
}

.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Button styles */
button {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  outline-offset: 4px;
  transition: filter 250ms;
  user-select: none;
  touch-action: manipulation;
}

.shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: hsl(0deg 0% 0% / 0.10);
  will-change: transform;
  transform: translateY(2px);
  transition: transform 600ms cubic-bezier(.3, .7, .4, 1);
}

.edge {
  position: absolute;
  top: 0;
  left: 0;
  width: 99.5%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(
    to left,
    #e6a100 0%,
    #FFb000 8%,
    #FFb000 92%,
    #e6a100 100%
  );
}

.front {
  display: block;
  position: relative;
  padding: 12px 27px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: #2e2e2e;
  background: #FFFC03;
  will-change: transform;
  transform: translateY(-4px);
  transition: transform 600ms cubic-bezier(.3, .7, .4, 1);
}

button:hover {
  filter: brightness(110%);
}

button:hover .front {
  transform: translateY(-6px);
  transition: transform 250ms cubic-bezier(.3, .7, .4, 1.5);
}

button:active .front {
  transform: translateY(-2px);
  transition: transform 34ms;
}

button:hover .shadow {
  transform: translateY(4px);
  transition: transform 250ms cubic-bezier(.3, .7, .4, 1.5);
}

button:active .shadow {
  transform: translateY(1px);
  transition: transform 34ms;
}

button:focus:not(:focus-visible) {
  outline: none;
}

/* Typing area */
#input {
  width: 900px;
  height: 120px;
  font-family: 'Source Code Pro', monospace;
  font-size: 1.5rem;
  padding: 20px;
  margin-bottom: 30px;
  border: 2px solid #5500ff;
  border-radius: 8px;
  outline: none;
  resize: none;
  display: none;
}

/* Show Result Button for Free Typing */
.show-result-btn {
  position: absolute;
  bottom: 15px;
  right: 20px;
  z-index: 5;
  background-color: #416bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.show-result-btn.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.show-result-btn:hover {
  background-color: #264aff;
}

.show-result-btn.hidden {
    display: none;
}

/* Caps Lock Warning Popup */
.caps-warning {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border: 2px solid #ff4444;
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: 0 10px 40px rgba(255, 68, 68, 0.3);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  text-align: center;
  max-width: 320px;
}

.caps-warning.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.caps-warning-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

.caps-warning-icon svg {
  width: 32px;
  height: 32px;
  fill: white;
}

.caps-warning h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.caps-warning p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* Dark mode support */
body.dark-mode .caps-warning {
  background: #2a2a2a;
  border-color: #ff6b6b;
}

body.dark-mode .caps-warning h3 {
  color: #f5f5f5;
}

body.dark-mode .caps-warning p {
  color: #aaa;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .caps-warning {
    max-width: 280px;
    padding: 20px 25px;
  }
  
  .caps-warning-icon {
    width: 50px;
    height: 50px;
  }
  
  .caps-warning-icon svg {
    width: 28px;
    height: 28px;
  }
  
  .caps-warning h3 {
    font-size: 18px;
  }
  
  .caps-warning p {
    font-size: 13px;
  }
}

/* Character styling */
.char {
  border-left: 3px solid transparent;
  position: relative;
}

.char.correct{
  color: #22c55e !important;
}

.char.incorrect {
  background-color: #fecaca;
  color: #7f1d1d;
}

.char.current {
}

/* Smooth Floating Caret */
.caret {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 38px; /* Isko apni font size ke hisaab se adjust kar sakte ho */
    background-color: #5500ff;
    border-radius: 2px;
    transition: transform 0.12s ease-out; /* Yahi hai smoothness ka jaadu! */
    will-change: transform;
    pointer-events: none; /* Taaki yeh mouse click ko block na kare */
}

.char.pending {
  color: #000;
}

.blur {
  filter: blur(6px);
}

.unblur {
  filter: none;
}


/* The switch - the box around the speaker*/
.toggleSwitch {
  width: 35px;
  height: 35px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #416bff;
  border-radius: 50%;
  cursor: pointer;
  transition-duration: .3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.13);
  overflow: hidden;
}

/* Hide default HTML checkbox */
#checkboxInput {
  display: none;
}

.bell {
  width: 18px;
}

.bell path {
  fill: white;
}

.speaker {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition-duration: .3s;
}

.speaker svg {
  width: 18px;
}

.mute-speaker {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 3;
  transition-duration: .3s;
}

.mute-speaker svg {
  width: 18px;
}

#checkboxInput:checked +.toggleSwitch .speaker {
  opacity: 0;
  transition-duration: .3s;
}

#checkboxInput:checked +.toggleSwitch .mute-speaker {
  opacity: 1;
  transition-duration: .3s;
}

#checkboxInput:active + .toggleSwitch {
  transform: scale(0.7);
}

#checkboxInput:hover + .toggleSwitch {
  background-color: rgb(61, 61, 61);
}

/* ===== Ads layout ===== */
.page-row{
  display:flex;
  gap:24px;
  align-items:flex-start;
  justify-content:center;
  max-width: 1400px;       /* page width */
  margin: 0 auto;
  padding: 0 16px;
}

.center-col{
  width:min(980px, 100%);  /* your typing area max width */
}

/* Skyscraper containers (left/right) */
.ad-sky{
  flex: 0 0 160px;         /* default: 160-wide tower */
  min-height: 600px;
}
@media (min-width: 1400px){
  .ad-sky{ flex-basis: 300px; }   /* large screens: 300×600 */
}

/* Small/medium screens: hide side ads */
@media (max-width: 1200px){
  .ad-sky{ display:none; }
}

/* Bottom ad block spacing */
.ad-bottom{
  margin: 28px 0 8px;
}

#topLottieContainer {
  display: none;
}

body {
  overflow-y: auto; /* Scrolling enable */
}


/* ============================================================= */
/* ===== FINAL, CLEAN RESULTS PAGE STYLES (REPLACE OLD CSS) ===== */
/* ============================================================= */

.results-page {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #edf2ff 0%, #edf2ff 100%);
  z-index: 1000;
  font-family: 'Inter', sans-serif;
}

/* Is rule ko FIND karke EDIT karo */
.results-page.show {
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center; /* Page ko vertically center karega */
  padding: 40px;
}

#topLottieContainer {
  width: 130px;
  height: 130px;
  margin: 0 auto;
}
.results-headline {
  font-weight: 600;
  text-align: center;
  line-height: 1.08;
  font-size: 40px;
  letter-spacing: -0.042em;
  margin: 15px auto 10px auto;
  max-width: 1200px;
}
.results-headline .gray-text { color: #4e4e4e; }
.results-headline .blue-text { color: #416bff; }
.highlightedBadge {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: #fff600;
  color: #4e4e4e;
  display: inline-block;
  padding: 0 20px;
  border-radius: 6px;
}
.stats-container {
  display: flex;
  justify-content: flex-start; 
  gap: 40px;
  margin-right: auto; /* Right side se push karega */
  padding-left: 20px; /* Extra left padding */
  width: 100%;
}
.stat-box {
  /* Purani saari styling hata di */
  color: inherit;
  width: auto;
  text-align: left;
}
/* In dono rules ko REPLACE kar do */
.stat-label {
  font-size: 20px;
  font-weight: 600;
  color: #416bff;
}
.stat-value {
  font-size: 50px;
  line-height: 1;
  font-weight: 700;
  color: #1a1a1a;
}

.buttons-container {
  display: flex;
  justify-content: flex-end;
  gap: 30px;
  margin-top: 30px;
}
/* Is rule ko REPLACE kar do */
.reset-button {
  width: 48px;
  height: 48px;
  cursor: pointer;
  background: white;
  border: 1px solid #ddd;
  border-radius: 50%;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.reset-button:hover {
    border-color: #416bff;
}

.reset-button:active {
    transform: rotate(360deg) scale(1.05);
    border-color: #416bff;
}

.certificate-message {
  font-size: 18px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: #dc3545; /* Red for warnings */
  text-align: center;
  margin-top: 20px;
  min-height: 25px;
}

/* Is code se purane .fancy-button.blue ke styles ko REPLACE kar do */

.fancy-button.blue .edge {
  background: #0d229e; /* Dark blue shade for 3D effect */
}

.fancy-button.blue .front {
  background: #416bff; /* Aapka bataya gaya main blue color */
  color: white;
}
.fancy-button .front {
    white-space: nowrap; /* Text ko ek line mein rakhega */
}

.results-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1050px; /* Graph ke width se match karega */
  padding: 0 20px; /* Left-right padding */
  margin: 5px auto; /* 'auto' left-right center karega */
  transform-origin: center; /* Zoom karne par center se scale hoga */
}

.divider-vertical {
  width: 2px;
  height: 60px;
  background-color: #000;
}

body.dark-mode .divider-vertical {
  background-color: #444;
}

/* Dark Mode Overrides */
body.dark-mode .results-page { background: #212121; }
body.dark-mode .results-headline .gray-text { color: #f4f4f4; }
body.dark-mode .stat-value { color: #f4f4f4; }
body.dark-mode .stat-label { color: #416bff; }

body.dark-mode #resultsRefreshBtn .restart-icon {
  color: #000000; /* Icon ko black kiya taki white button par dikhe */
}

body.dark-mode .certificate-message {
    color: #ff243a;
  }

/* Mobile responsive for results page */
@media (max-width: 768px) {
  .results-page.show { 
    padding: 20px 15px; 
  }
  
  .results-headline { 
    font-size: 28px !important; 
    line-height: 1.3;
    margin: 10px auto 15px auto;
  }
  
  .chart-container {
    height: 180px;
    margin: 15px auto 10px auto;
    padding: 10px;
    max-width: calc(100% - 20px);
  }
  
  /* Results summary ko mobile ke liye stack karo */
  .results-summary {
    flex-direction: column;
    gap: 20px;
    margin-top: 5px;
    max-width: 100%;
  }
  
  /* Stats container ko 2x2 grid banao */
  .stats-container {
    display: flex; /* Grid se flex kiya */
    justify-content: center; /* Center mein rakha */
    align-items: center;
    gap: 20px;
    width: 95%; /* Poori width di */
}
  
  .stat-box {
    text-align: center;
  }
  
  .stat-label { 
    font-size: 16px; 
  }
  
  .stat-value { 
    font-size: 40px; 
  }
  
  /* Divider ko vertical rakho */
  .divider-vertical {
    height: 50px;
    width: 1.5px;
    color: ##545454;
  }
  
  /* Buttons container ko horizontal rakho */
  .buttons-container {
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    width: 100%;
    align-items: center;
  }
  
  #certificateBtn {
    flex: 1;
    max-width: 200px;
    min-width: 160px;
  }
  
  .reset-button {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: 1px solid #416bff;
  }
  
  .certificate-message {
    margin-top: 15px;
    font-size: 14px;
    padding: 0 10px;
  }
}

/* Get Certificate button ko mobile par normal banane ke liye */
#certificateBtn.fancy-button {
  min-width: 160px; /* Ek minimum width de di */
  flex-grow: 1;
  max-width: 220px;
}

#certificateBtn.fancy-button .front {
  transform: none; /* 3D effect ka transform hataya */
  padding: 14px 20px;
  font-size: 16px;
  box-shadow: 0 4px rgb(19, 52, 236); /* Thoda sa shadow add kiya */
  transition: all 0.2s ease;
}

#certificateBtn.fancy-button .edge,
#certificateBtn.fancy-button .shadow {
  display: none; /* 3D effect waale extra parts ko hide kar diya */
}

#certificateBtn.fancy-button:active .front {
  transform: translateY(2px); /* Click par halka sa effect */
  box-shadow: 0 2px rgba(0, 0, 0, 0.2);
}

/* Extra small screens */
@media (max-width: 480px) {
  .results-headline { 
    font-size: 20px !important;
  }
  
  .chart-container {
    height: 160px;
    padding: 8px;
  }
  
  .stats-container {
    gap: 15px;
  }
  
  .stat-label { 
    font-size: 14px; 
  }
  
  .stat-value { 
    font-size: 28px; 
  }
  
  .divider-vertical {
    height: 40px;
  }
  
  .buttons-container {
    gap: 10px;
  }
  
  #certificateBtn {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  .reset-button {
    width: 40px;
    height: 40px;
  }
}

/* parent strip should not clip */
#liveMetrics, .live-score-group { overflow: visible !important; }

/* anchor element */
.has-tooltip{
  position: relative !important;
  display: inline-block !important;
  z-index: 3;

  /* easy tuning */
  --tip-gap: 7px;                               /* icon aur tooltip ke beech ka gap */
  --tip-bg: rgba(0,0,0,.92);                     /* bubble + arrow ka color */
  --tip-radius: 4px;
  --tip-shadow: 0 10px 24px rgba(0,0,0,.22);
}

/* bubble — now BELOW the icon */
.has-tooltip::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(80% + var(--tip-gap));              /* bottom ki jagah top use — niche place */
  transform: translateX(-50%) translateY(6px);   /* start slightly down */
  background: var(--tip-bg);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.055em;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--tip-radius);
  white-space: nowrap;
  box-shadow: var(--tip-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

/* diamond arrow — same timing & transform so lag na aaye */
.has-tooltip::before{
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);                         /* bubble se thoda upar */
  width: 10px; height: 10px;
  background: var(--tip-bg);
  transform: translateX(-50%) rotate(45deg) translateY(6px);
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

/* show states — dono par SAME transition so they appear together */
.has-tooltip:hover::after,
.has-tooltip:focus-visible::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.has-tooltip:hover::before,
.has-tooltip:focus-visible::before{
  opacity: 0;
  transform: translateX(-50%) rotate(45deg) translateY(0);
}

/* Control Bar - Mobile Responsive */
.control-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 20px auto;
  width: fit-content;
  max-width: 400px;
}

/* Mobile Control Bar Fixes */
@media (max-width: 768px) {
  .control-bar {
    /* Center alignment and proper sizing */
    margin: 15px auto;
    padding: 8px 12px;
    gap: 6px;
    width: calc(100% - 30px); /* Full width minus 15px padding each side */
    max-width: none; /* Remove max-width restriction */
    justify-content: center; /* Center all elements */
    flex-wrap: nowrap; /* Don't wrap elements */
  }
  
  .control-select {
    min-width: 90px; /* Smaller select */
    font-size: 13px;
    padding: 6px 8px;
    flex-shrink: 0;
  }
  
  .timer-display {
    font-size: 14px;
    min-width: 40px;
    flex-shrink: 0;
  }
  
  .divider {
    height: 18px;
    flex-shrink: 0;
  }
  
  #refreshBtn {
    padding: 3px;
    flex-shrink: 0;
  }
  
  .restart-icon {
    width: 18px;
    height: 18px;
  }
  
  .toggleSwitch {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  
  .toggleSwitch svg {
    width: 14px;
  }
}

/* Quote Block - Mobile Full Width */
@media (max-width: 768px) {
  /* Main container adjustments */
  body {
    padding: 15px 5px; /* Reduce side padding */
    padding-top: 100px;
  }
  
  /* Quote wrapper - full width with minimal padding */
  .quote-wrapper {
    max-width: none; /* Remove max-width */
    width: calc(100% - 10px); /* Full width minus 5px each side */
    margin: 0 auto 15px auto;
    height: 130px;
  }
  
  /* Quote block styling */
  #quote {
    padding: 10px 40px; /* Reduce horizontal padding */
    margin: 0;
    border-radius: 8px; /* Slightly smaller border radius */
    font-size: 2rem; /* Smaller font for mobile */
    line-height: 1.8; /* Adjust line height */
    height: calc(1.7em * 4); /* Adjust height for new line height */
  }
  
  .caret {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 20px; /* Isko apni font size ke hisaab se adjust kar sakte ho */
    background-color: #5500ff;
    border-radius: 2px;
    transition: transform 0.12s ease-out; /* Yahi hai smoothness ka jaadu! */
    will-change: transform;
    pointer-events: none; /* Taaki yeh mouse click ko block na kare */
}
  
  /* Main heading adjustments */
  .main-heading {
    font-size: 35px;
    margin-bottom: 20px;
    padding: 0 10px; /* Add some padding */
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .control-bar {
    padding: 6px 8px;
    gap: 4px;
    width: calc(100% - 20px); /* Even more space usage */
  }
  
  .control-select {
    min-width: 80px;
    font-size: 12px;
    padding: 5px 6px;
  }
  
  .timer-display {
    font-size: 13px;
    min-width: 35px;
  }
  
  #quote {
    padding: 15px 8px;
    font-size: 1.2rem;
  }
  
  .main-heading {
    font-size: 24px;
  }
}

/* Dark mode support */
body.dark-mode .control-bar {
  background: #313131;
  border: 1px solid #414141;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .control-select {
  background: #333333;
  color: #e0e0e0;
  border-color: #595959;
}

body.dark-mode .divider {
  background: #595959;
}

body.dark-mode .timer-display {
  color: #e0e0e0;
}

body.dark-mode #refreshBtn:hover {
  background: #404040;
}

body.dark-mode .restart-icon {
  color: #e0e0e0;
}



/* ===== Inline Auth Modal (Google-style) ===== */
.si-hidden{display:none !important;}
.si-modal.si-hidden{display:none !important;}
.si-modal{position:fixed;inset:0;z-index:9999;display:grid;place-items:center}
.si-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.28);backdrop-filter:blur(2px)}
.si-card{position:relative;z-index:1;width:min(420px,75vw)}
.si-auth{background:#fff;border-radius:15px;box-shadow:0 10px 30px rgba(0,0,0,.1);padding:35px;text-align:center;font-family:'Inter',sans-serif}

.si-auth h2 {
  margin: .50rem 2rem; /* pehle 1rem tha, ab kam */
  font-size: 30px;
  font-weight: 900;
  color: #132bff;
}

.si-auth p.si-sub {
  margin-top: 10px; /* pehle 30px tha, ab kam */
  font-size: 14px;
}


/* Google-style Input Groups for Popup */
.si-input-group {
    position: relative;
    margin: 25px 0;
}



.si-input {
    border: solid 1.5px #9e9e9e;
    border-radius: 0.5rem;
    background: #ffffff;
    padding: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #1a1a1a;
    transition: border 150ms cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

.si-user-label {
    position: absolute;
    left: 15px;
    color: #888;
    pointer-events: none;
    transform: translateY(1rem);
    transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.si-input:focus,
.si-input:valid {
    outline: none;
    border: 1.5px solid #416bff;
}

.si-input:focus ~ .si-user-label,
.si-input:valid ~ .si-user-label {
    transform: translateY(-50%) scale(0.8);
    background-color: #ffffff;
    padding: 0 .2em;
    color: #416bff;
}

/* Browser autofill handling for popup */
.si-input:-webkit-autofill,
.si-input:-webkit-autofill:hover,
.si-input:-webkit-autofill:focus,
.si-input:-webkit-autofill:active {
    -webkit-text-fill-color: #1a1a1a;
    box-shadow: 0 0 0 30px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.si-input:-webkit-autofill ~ .si-user-label {
    transform: translateY(-50%) scale(0.8);
    background-color: #ffffff;
    padding: 0 .2em;
    color: #416bff;
}

/* Email validation warning for popup */
.si-email-warning {
    color: #e74c3c;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    margin-top: 5px;
    text-align: left;
    padding-left: 15px;
}

/* Button styling */
.si-btn {
    background: #416bff;
    color: #fff;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1px solid #000 !important;
    padding: 12px;
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px #000;
    margin-top: 15px;
    transition: all 0.1s ease-out;
    min-height: 35px; /* Button ki height fix ki */
    display: flex; /* Loader ko center karne ke liye */
    justify-content: center;
    align-items: center;
}

.si-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px #000;
}

/* Password wrapper for popup */
.si-pw-wrap{position:relative}

/* Hide browser default password reveal */
.si-input[type="password"]::-ms-reveal,
.si-input[type="password"]::-webkit-password-reveal-button {
    display: none !important;
    -webkit-appearance: none;
    appearance: none;
}

/* === NAYE EYE ICON KI STYLING === */
.si-eye {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 14px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}
.si-eye svg {
    width: 20px;
    height: 20px;
}
.si-eye .hidden {
    display: none;
}

/* === TOAST KI STYLING (Z-INDEX ADD KIYA) === */
.si-toast{
    position:fixed;
    top:18px;
    right:18px;
    background:#4caf50;
    color:#fff;
    font-family: 'Inter', sans-serif;
    padding:10px 16px;
    border-radius:8px;
    display:none;
    z-index: 10000; /* Sabse upar dikhane ke liye */
}

/* Google Button ki styling */
.google-btn {
    background: #fff;
    color: #444;
    font-family: 'Inter', sans-serif;
    border: 1px solid #000 !important;
    box-shadow: 0 4px #000;
    min-height: 35px; /* Button ki height fix ki */
    font-weight: 600;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}
.google-btn img {
    width: 18px;
    height: 18px;
}

/* OR Divider ki styling */

.divider-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: #444;
  margin: 20px 0; /* Upar-neeche space */
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  border-bottom: 2px solid #ccc;
}

/* --- Dark Mode --- */
body.dark-mode .divider-or {
  color: #9e9e9e;
}
body.dark-mode .divider-or::before,
body.dark-mode .divider-or::after {
  border-bottom-color: #9e9e9e;
}


/* Forgot Password ki styling */
.forgot-password {
    text-align: right;
    margin-top: -15px;
    margin-bottom: 25px;
    font-size: 13px;
}
.forgot-password a {
    color: #888;
    text-decoration: none;
}

.forgot-password a:hover {
    color: #416bff;
    text-decoration: none;
}


 #siGoSignup {
    color: #416bff;
}
 #siGoSignup:hover {
    color: #000;
}

 #siGoLogin {
    color: #416bff;
}
 #siGoLogin:hover {
    color: #000;
}

/* --- Dark Mode --- */

body.dark-mode .divider-or { color: #777; }
body.dark-mode .divider-or::before,
body.dark-mode .divider-or::after {
  border-bottom-color: #444;
}

body.dark-mode .forgot-password a {
    color: #aaa;
}

body.dark-mode #siGoSignup {
    color: #416bff;
}
body.dark-mode #siGoSignup:hover {
    color: #fff;
}

body.dark-mode #siGoLogin {
    color: #416bff;
}
body.dark-mode #siGoLogin:hover {
    color: #fff;
}

/* button busy (disable clicks) */
.btn-busy{pointer-events:none}

/* sub-headline under modal title */
.si-sub{margin:-6px 0 10px;color:#6b7280;font-size:14px}

/* dark mode, optional */
body.dark-mode .has-tooltip::after,
body.dark-mode .has-tooltip::before{
  background: #0b0b0b;
}


body.dark-mode .main-heading .gray-text {
  color: #f4f4f4;
}

body.dark-mode .main-heading .blue-text {
  color: #416bff;
}

body.dark-mode #quote {
  background: #313131;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}



body.dark-mode .char.pending {
  color: #e8e8e8;
}

body.dark-mode .char.correct {
  color: #22c55e;
  background: none;
}

body.dark-mode .char.incorrect {
  background: #5a0013;
  color: #ff8080;
}

body.dark-mode .live-timer-box,
body.dark-mode .input {
  background: #1a1a1d;
  color: #e8e8e8;
  border-color: #444;
}

body.dark-mode input[type="text"],
body.dark-mode select {
  background: #1a1a1d;
  color: #e8e8e8;
  border: 2px solid #444;
}

body.dark-mode select option {
  background: #1a1a1d;
  color: #e8e8e8;
}

body.dark-mode .user-label {
  color: #bdbdbd;
  background: #1a1a1d;
  padding: 0 .15rem;
}

body.dark-mode .input:focus~.user-label,
body.dark-mode .input:valid~.user-label {
  color: #416bff;
  background: #1a1a1d;
  padding: 0 .45rem;
}

body.dark-mode .timer-btn {
  background: #1a1a1d;
  color: #8ab4ff;
  border-color: #8ab4ff;
}

body.dark-mode .timer-btn.active,
body.dark-mode .timer-btn:hover {
  background: #8ab4ff;
  color: #fff;
}

body.dark-mode .start-overlay,
body.dark-mode #resumeOverlay {
  background: rgba(0,1,1,0.55);
}



/* Light mode override (agar zaroorat ho) */
body:not(.dark-mode) .results-headline {
  color: #4e4e4e;
}

body.dark-mode .results-headline .blue-text {
  color: #416bff;
}

/* Dark mode mein gray-text ko white banao */
body.dark-mode .results-headline .gray-text {
  color: #f4f4f4 !important; /* White color for dark mode */
}

/* ===== DARK MODE FOR INLINE AUTH MODAL ===== */

/* Dark mode for popup */
body.dark-mode .si-auth {
    background: #313131;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid #414141;
}

body.dark-mode .si-auth h2 {
    color: #fff;
    text-shadow: none;
}

body.dark-mode .si-sub {
    color: #aaa;
}

/* Dark mode fix for Name field background */
body.dark-mode .si-input {
    background: #313131 !important;
    color: #ffffff;           /* white text */
    border: 2px solid #414141;
}

body.dark-mode .si-input:focus,
body.dark-mode .si-input:valid {
  border: 2px solid #416bff !important; /* blue border */
  color: #ffffff;
  background-color: #313131;
}

body.dark-mode .si-user-label {
    color: #e8e8e8;
}

/* FIX: Dark mode mein focused label ka background theek karne ke liye */
body.dark-mode .si-input:focus ~ .si-user-label,
body.dark-mode .si-input:valid ~ .si-user-label {
    background-color: #313131;
    color: #2196f3;
}

/* FIX: Dark mode mein autofill ka background theek karne ke liye */
body.dark-mode .si-input:-webkit-autofill,
body.dark-mode .si-input:-webkit-autofill:hover,
body.dark-mode .si-input:-webkit-autofill:focus,
body.dark-mode .si-input:-webkit-autofill:active {
    -webkit-text-fill-color: #f5f5f5 !important;
    box-shadow: 0 0 0 30px #313131 inset !important;
}

body.dark-mode .si-input:-webkit-autofill ~ .si-user-label {
    background-color: #313131;
    color: #2196f3;
}

body.dark-mode .si-auth p {
    color: #aaa;
}
body.dark-mode .si-auth a {
    color: #416bff;
}

body.dark-mode .si-btn {
    background: #264aff;
    box-shadow: 0 4px rgba(0, 0, 0, 0.5);
}

body.dark-mode .si-btn:active {
    box-shadow: 0 2px rgba(0, 0, 0, 0.5);
}

body.dark-mode .si-eye {
    color: #aaa;
}


/* ─────  ADD THESE LINES  ───── */
body.dark-mode .result-loader{
  background: #212121;
}
body.dark-mode .loader{
  --track:#f2f2f2;      /* faint grey */
  --bar:#416bff;          /* cyan accent for dark bg */
}

/* Modern Control Bar */
.control-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 20px auto;
  width: fit-content;
  max-width: 400px;
}

.control-select {
  padding: 8px 16px;
  border: 1.5px solid #b2b2b2;
  border-radius: 10px;
  background: white;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  min-width: 130px;
}

.control-select:hover {
  border-color: #416bff
}

.divider {
  width: 1px;
  height: 24px;
  background: #e0e0e0;
}

.timer-display {
  font-size: 18px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: #1a1a1a;
  min-width: 60px;
  text-align: center;
}

/* Dark mode support for control bar */
body.dark-mode .control-bar {
  background: #313131;
  border: 1px solid #414141;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}


body.dark-mode .control-select {
  background: #333333;
  color: #e0e0e0;
  border-color: #414141;
  border-radius: 10px;
}

body.dark-mode .control-select:hover {
  border-color: #416bff;
}

body.dark-mode .divider {
  background: #595959;
}

body.dark-mode .timer-display {
  color: #e0e0e0;
}


/* === NAYE RESTART ICON KI STYLING (UPDATED) === */

#refreshBtn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s; /* Sirf background ke liye transition */
}

#refreshBtn:hover {
    background: #f0f0f0;
}

.restart-icon {
  color: #1a1a1a;
  transition: color 0.3s ease; /* Sirf color ke liye transition */
}

.rotate-animation {
  animation: rotate360 0.6s ease-in-out;
}

@keyframes rotate360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

body.dark-mode #refreshBtn:hover {
    background: #404040;
}

body.dark-mode .restart-icon {
  color: #e0e0e0;
}

/* Is poore block ko apne purane .chart-container ke code se REPLACE kar do */

.chart-container {
  width: 100%;
  max-width: 1150px; /* Width ko kam kiya aapke design jaisa */
  height: 250px;    /* Height ko badhaya aapke design jaisa */
  margin: 30px auto; /* 30px se 20px, 30px se 15px */
  padding: 5px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: 'Inter', sans-serif;
}

body.dark-mode .chart-container {
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .chart-container {
    height: 250px;
    margin: 20px auto;
    padding: 10px;
    /* Mobile par ye poori available width le lega */
    max-width: calc(100% - 20px); 
  }
}

/* Signup/Login button aur neeche ke link ke beech mein space */
.si-btn + p {
  margin-top: 25px;
}

/* Button ke front part ko flex container banaya */
.fancy-button .front {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    position: relative; /* Position relative add kiya pseudo-elements ke liye */
}

/* JAB LOADING CLASS LAGE: */
.fancy-button.loading .front {
    /* Text ko hide karo but structure maintain rakho */
    color: transparent !important;
}

.fancy-button.loading .front::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfect center positioning */
    
    /* Loader ka size aur style */
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    z-index: 1;
}

.fancy-button.loading .front::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Moving part */
    width: 24px; /* 40% of 60px */
    height: 4px;
    background: white;
    border-radius: 10px;
    z-index: 2;
    animation: slideLoader 1s ease-in-out infinite;
}

/* New animation jo smoothly slide kare */
@keyframes slideLoader {
    0% { transform: translate(-150%, -50%); }
    50% { transform: translate(-50%, -50%); }
    100% { transform: translate(50%, -50%); }
}

/* Loading state mein button ko stable rakho */
.fancy-button.loading:hover .front,
.fancy-button.loading:active .front {
    transform: translateY(-4px) !important; /* Same position maintain karo */
    transition: none !important; /* Animation rok do */
}