/* Verb Conjugation Trainer — cartoonish vibrant UI */

/* ====== Base ====== */
:root{
  --bg1:#fffbf0;
  --bg2:#f0fbff;
  --ink:#1e1e2a;
  --muted:#1e1e2a;;
  --card:#ffffffcc;
  --stroke:#1f2330;
  --shadow: 0 12px 0 rgba(0,0,0,.18);
  --shadow2: 0 10px 30px rgba(0,0,0,.12);

  --pink:#ff4d9d;
  --yellow:#ffd65a;
  --blue:#3aa9ff;
  --mint:#38e3c6;
  --purple:#9a6bff;
  --orange:#ff7a45;

  --radius: 22px;
  --radius2: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1100px 600px at 15% -10%, #ffe3f3 0%, transparent 55%),
    radial-gradient(1000px 700px at 115% 10%, #ddf6ff 0%, transparent 60%),
    radial-gradient(1200px 700px at 40% 120%, #e8fff8 0%, transparent 60%),
    linear-gradient(120deg, var(--bg1), var(--bg2));
  overflow-x:hidden;
}

.bg-sparkles{
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.55;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,77,157,.28) 0 10px, transparent 11px),
    radial-gradient(circle at 70% 10%, rgba(58,169,255,.25) 0 10px, transparent 11px),
    radial-gradient(circle at 90% 60%, rgba(56,227,198,.22) 0 10px, transparent 11px),
    radial-gradient(circle at 20% 80%, rgba(255,214,90,.25) 0 10px, transparent 11px);
  filter: blur(0.5px);
  mix-blend-mode:multiply;
}

/* ====== Layout ====== */
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.45));
  border-bottom: 4px solid var(--stroke);
  box-shadow: 0 10px 35px rgba(0,0,0,.08);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:260px;
}
.logo{
  width:54px;
  height:54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border:4px solid var(--stroke);
  box-shadow: var(--shadow);
  display:grid;
  place-items:center;
  font-weight:900;
  letter-spacing:.5px;
  color:white;
}
.brand-title{
  font-weight:900;
  font-size:18px;
  letter-spacing:.2px;
}
.brand-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.shell{
  width:min(1150px, 100%);
  margin:18px auto 0;
  padding: 10px 14px 40px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:16px;
}

@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .brand{ min-width:unset; }
}

/* ====== Inputs ====== */
.select-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 16px;
  border:4px solid var(--stroke);
  background: white;
  box-shadow: var(--shadow);
}
.select-wrap .label{
  font-weight:800;
  font-size:13px;
  color:var(--muted);
}
select{
  border:none;
  outline:none;
  font-weight:900;
  font-size:14px;
  background:transparent;
}

.pill{
  border:4px solid var(--stroke);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #fff7dc);
  font-weight:900;
  padding:10px 14px;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.pill:active{ transform: translateY(4px); box-shadow: 0 8px 0 rgba(0,0,0,.18); }

.panel{
  background: var(--card);
  border:4px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding:14px;
}

.section-title{
  font-weight:1000;
  letter-spacing:.2px;
  margin: 2px 0 10px;
}

.divider{
  height:1px;
  background: rgba(0,0,0,.12);
  margin: 14px 0;
}

/* ====== Tense buttons ====== */
.tense-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 520px){
  .tense-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tense-btn{
  text-align:left;
  border:4px solid var(--stroke);
  background: white;
  border-radius: 18px;
  padding:12px 12px;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease, filter .2s ease;
  position:relative;
}
.tense-btn .emoji{ font-size:22px; }
.tense-btn .t{ display:block; font-weight:1000; margin-top:3px; }
.tense-btn .s{ display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.tense-btn:hover{ transform: translateY(-2px); filter:saturate(1.05); }
.tense-btn:active{ transform: translateY(4px); }

.tense-btn.active{
  background: linear-gradient(135deg, #fff, #f6fbff);
  outline: 6px solid rgba(58,169,255,.25);
}
.tense-btn[data-tense="present"].active{ outline-color: rgba(255,214,90,.35); }
.tense-btn[data-tense="past"].active{ outline-color: rgba(255,122,69,.28); }
.tense-btn[data-tense="pastDesc"].active{ outline-color: rgba(58,169,255,.25); }
.tense-btn[data-tense="future"].active{ outline-color: rgba(56,227,198,.25); }
.tense-btn[data-tense="conditional"].active{ outline-color: rgba(154,107,255,.28); }
.tense-btn[data-tense="idioms"].active{ outline-color: rgba(255,77,157,.25); }

/* ====== Pronouns ====== */
.pronoun-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.pronoun-btn{
  border:4px solid var(--stroke);
  border-radius: 18px;
  background:white;
  padding:10px 12px;
  cursor:pointer;
  box-shadow: var(--shadow);
  min-width: 135px;
  transition: transform .08s ease;
}
.pronoun-btn:hover{ transform: translateY(-2px); }
.pronoun-btn:active{ transform: translateY(4px); }
.pronoun-btn .main{
  font-weight:1000;
  display:block;
}
.pronoun-btn .sub{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}
.pronoun-btn.active{
  background: linear-gradient(135deg, #fff, #fff1fb);
  outline: 6px solid rgba(255,77,157,.22);
}

/* ====== Controls ====== */
.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.toggle{
  display:flex;
  border:4px solid var(--stroke);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: var(--shadow);
  background:white;
}
.mini{
  border:none;
  background:transparent;
  padding:10px 12px;
  cursor:pointer;
  font-weight:1000;
  color:var(--ink);
  transition: background .15s ease, transform .08s ease;
}
.mini:hover{ background: rgba(0,0,0,.05); }
.mini:active{ transform: translateY(2px); }
.mini.active{
  background: linear-gradient(135deg, #fff, #eef8ff);
}
.mini.glow{
  border:4px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #fff, #e7fff8);
}
.mini.glow:hover{ filter:saturate(1.05); }

.scorebar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.score-pill{
  display:flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border:3px solid var(--stroke);
  border-radius: 999px;
  background:white;
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  font-size:13px;
}
.dot{
  width:10px;
  height:10px;
  border-radius: 50%;
  border:2px solid var(--stroke);
  background:#ddd;
}
.dot.ok{ background: var(--mint); }
.dot.bad{ background: var(--pink); }
.dot.info{ background: var(--yellow); }

/* ====== Quiz card ====== */
.quiz{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.quiz-card{
  background: rgba(255,255,255,.78);
  border:4px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding:16px;
}

.quiz-head{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border:3px solid var(--stroke);
  border-radius: 999px;
  background:white;
  font-size:12px;
  font-weight:1000;
}
.prompt{
  margin:0 0 12px;
  font-size:22px;
  line-height:1.15;
}

.question{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sentence{
  font-size:18px;
  background:#cdd0e83b;
  border:3px solid var(--stroke);
  border-radius: 16px;
  padding:12px;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
}
.blank{
  display:inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255,214,90,.35);
  border: 2px dashed rgba(31,35,48,.65);
  font-weight:1000;
}

.options{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
}
@media (max-width:520px){
  .options{ grid-template-columns: 1fr; }
}

.opt{
  border:4px solid var(--stroke);
  border-radius: 18px;
  padding:12px 12px;
  cursor:pointer;
  background:white;
  font-weight:1000;
  box-shadow: var(--shadow);
  text-align:left;
  transition: transform .08s ease;
}
.opt:hover{ transform: translateY(-2px); }
.opt:active{ transform: translateY(4px); }
.opt .k{
  display:inline-grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff, #eef8ff);
  border:3px solid var(--stroke);
  margin-right:10px;
}
.opt.correct{
  background: linear-gradient(135deg, #ffffff, #e8fff8);
  outline: 8px solid rgba(56,227,198,.22);
}
.opt.wrong{
  background: linear-gradient(135deg, #ffffff, #ffe6f1);
  outline: 8px solid rgba(255,77,157,.22);
}

.feedback{
  min-height: 26px;
  font-weight:1000;
  padding: 10px 12px;
  border-radius: 14px;
  border:3px solid var(--stroke);
  background:white;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
}
.feedback.good{
  background: linear-gradient(135deg, #fff, #e8fff8);
}
.feedback.bad{
  background: linear-gradient(135deg, #fff, #ffe6f1);
}

/* ====== Scramble ====== */
.scramble-wrap{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.word-bank, .answer-bank{
  border:3px solid var(--stroke);
  border-radius: 16px;
  padding:10px;
  background:white;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height:56px;
}

.word-tile{
  border:3px solid var(--stroke);
  border-radius: 14px;
  padding:8px 10px;
  font-weight:1000;
  cursor:pointer;
  background: linear-gradient(135deg, #fff, #fff7dc);
  box-shadow: 0 10px 0 rgba(0,0,0,.12);
  transition: transform .08s ease;
}
.word-tile:hover{ transform: translateY(-1px); }
.word-tile:active{ transform: translateY(3px); box-shadow: 0 6px 0 rgba(0,0,0,.12); }

.scramble-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.action-btn{
  border:4px solid var(--stroke);
  border-radius: 16px;
  background: white;
  font-weight:1000;
  padding:10px 12px;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.action-btn:active{ transform: translateY(4px); box-shadow: 0 8px 0 rgba(0,0,0,.18); }
.action-btn.primary{ background: linear-gradient(135deg, #fff, #e7fff8); }
.action-btn.danger{ background: linear-gradient(135deg, #fff, #ffe6f1); }

/* ====== Hint card ====== */
.hint-card{
  background: rgba(255,255,255,.65);
  border:4px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding:14px;
}
.hint-title{
  font-weight:1000;
  margin-bottom:6px;
}
.hint-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.hint-list .k{
  font-weight:1000;
  color: var(--ink);
}

/* ====== Footer ====== */
.footer{
  width:min(1150px, 100%);
  margin: 0 auto;
  padding: 10px 16px 30px;
  color: var(--muted);
  font-size: 12px;
}

/* ====== Accessibility ====== */
button:focus-visible, select:focus-visible{
  outline: 6px solid rgba(58,169,255,.35);
  outline-offset: 2px;
  border-radius: 16px;
}
/* ===== Phone fix: keep Language + Reset inside the screen ===== */
@media (max-width: 560px){
  .topbar{
    flex-wrap: wrap;
    padding: 10px 10px;
    gap: 10px;
  }

  .brand{
    width: 100%;
    min-width: 0; /* overrides the 260px */
  }

  /* optional: saves space on phones */
  .brand-sub{ display:none; }

  .logo{
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .brand-title{ font-size: 16px; }

  .topbar-actions{
    width: 100%;
    justify-content: space-between;
    max-width: 100%;
  }

  .select-wrap{
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
  }

  /* optional: hide the word "Language" on phone to make more room */
  .select-wrap .label{ display:none; }

  #langSelect{
    width: 100%;
  }
}

/* =========================================================
   BUTTON19 look + glow for ALL buttons
   (Paste at the very bottom of Verb Conjugation.css)
   ========================================================= */

:root{
  --btn19-a:#ff2aa3;          /* hot pink */
  --btn19-b:#7b2bff;          /* purple */
  --btn19-glowA: rgba(255,42,163,.55);
  --btn19-glowB: rgba(123,43,255,.35);
}

/* Style every button (and your button classes) */
:is(
  button,
  .pill,
  .tense-btn,
  .pronoun-btn,
  .mini,
  
  .opt,
  .word-tile,
  .action-btn
){
  -webkit-tap-highlight-color: transparent;
  position: relative;

  border: 0 !important;
  border-radius: 999px !important;

  background: linear-gradient(90deg, var(--btn19-a), var(--btn19-b)) !important;
  color: #fff !important;

  font-weight: 1000 !important;
  letter-spacing: .4px;
  text-shadow: 0 2px 0 rgba(0,0,0,.22);

  /* Glow + glassy highlight + depth */
  box-shadow:
    0 16px 28px rgba(0,0,0,.28),
    0 0 26px var(--btn19-glowA),
    0 0 46px var(--btn19-glowB),
    inset 0 0 0 2px rgba(255,255,255,.35),
    inset 0 12px 18px rgba(255,255,255,.18) !important;

  overflow: hidden; /* keeps the shine inside */
  cursor: pointer;
  transition: transform .12s ease, filter .2s ease, box-shadow .2s ease;
}

/* Make sure inner spans stay above the shine */
:is(button, .pill, .tense-btn, .pronoun-btn, .mini, .opt, .word-tile, .action-btn) > *{
  position: relative;
  z-index: 1;
}

/* Shiny sweep effect */
:is(button, .pill, .tense-btn, .pronoun-btn, .mini, .opt, .word-tile, .action-btn)::after{
  content:"";
  position:absolute;
  inset:-40%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255,255,255,.65) 46%,
    transparent 60%
  );
  transform: translateX(-140%) skewX(-18deg);
  transition: transform .7s ease;
  opacity: .55;
  pointer-events:none;
  z-index: 0;
  mix-blend-mode: screen;
}

:is(button, .pill, .tense-btn, .pronoun-btn, .mini, .opt, .word-tile, .action-btn):hover{
  transform: translateY(-2px);
  filter: saturate(1.2) contrast(1.05);
}
:is(button, .pill, .tense-btn, .pronoun-btn, .mini, .opt, .word-tile, .action-btn):hover::after{
  transform: translateX(140%) skewX(-18deg);
}
:is(button, .pill, .tense-btn, .pronoun-btn, .mini, .opt, .word-tile, .action-btn):active{
  transform: translateY(2px);
  filter: saturate(1.05);
  box-shadow:
    0 10px 18px rgba(0,0,0,.25),
    0 0 22px var(--btn19-glowA),
    0 0 38px var(--btn19-glowB),
    inset 0 0 0 2px rgba(255,255,255,.32),
    inset 0 10px 16px rgba(255,255,255,.14) !important;
}

/* Keep focus visible */
:is(button, .pill, .tense-btn, .pronoun-btn, .mini, .opt, .word-tile, .action-btn):focus-visible{
  outline: 4px solid rgba(58,169,255,.60);
  outline-offset: 4px;
}

/* OPTIONAL (recommended):
   Your .toggle wrapper currently has a thick border + overflow hidden.
   That can clip the glow. This makes the toggle wrapper "invisible". */
.toggle{
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* OPTIONAL: Your option letter box should stay readable on neon buttons */
.opt .k{
  background: rgba(255,255,255,.85) !important;
  color: #1e1e2a !important;
  border: 0 !important;
}
/* ============================
   Smaller/thinner "Choose a section" buttons
   Paste at BOTTOM of Verb Conjugation.css
   ============================ */

.tense-grid{
  gap: 8px;
}

.tense-btn{
  padding: 10px 10px;     /* thinner */
  border-width: 3px;      /* slightly thinner border */
  border-radius: 16px;
  min-height: 78px;       /* forces them shorter */
}

.tense-btn .emoji{ font-size: 18px; }
.tense-btn .t{ font-size: 14px; line-height: 1.05; }
.tense-btn .s{ font-size: 11px; margin-top: 2px; }

/* extra small on phones */
@media (max-width: 560px){
  .tense-grid{ gap: 8px; }

  .tense-btn{
    padding: 8px 9px;
    border-width: 3px;
    border-radius: 14px;
    min-height: 70px;
  }

  .tense-btn .emoji{ font-size: 16px; }
  .tense-btn .t{ font-size: 13px; }
  .tense-btn .s{ font-size: 10.5px; }
}
/* Fit the small subtitle text inside the tense pills */
.tense-btn{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 3px;                 /* controls spacing between lines */
  padding: 10px 12px 12px;  /* extra bottom room so subtitle doesn't clip */
  min-height: 86px;         /* a little taller so both lines fit */
}

.tense-btn .emoji{ line-height: 1; }
.tense-btn .t{ line-height: 1.05; margin: 0; }
.tense-btn .s{
  margin: 0;                /* removes the push-down that was clipping it */
  line-height: 1.1;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;

  /* keep it inside the pill (max 2 lines) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
 
  overflow: hidden;
}

/* Phone: slightly smaller */
@media (max-width: 560px){
  .tense-btn{ min-height: 78px; padding: 8px 10px 10px; }
  .tense-btn .t{ font-size: 13px; }
  .tense-btn .s{ font-size: 10.5px; }
}

#wrongOverlay{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
display:flex;
align-items:center;
justify-content:center;
font-size:180px;
color:red;
background:rgba(0,0,0,.4);
opacity:0;
pointer-events:none;
transition:opacity .2s;
z-index:9999;
}

#wrongOverlay.show{
opacity:1;
animation:shake .4s;
}

@keyframes shake{
0%{transform:translateX(0)}
25%{transform:translateX(-20px)}
50%{transform:translateX(20px)}
75%{transform:translateX(-20px)}
100%{transform:translateX(0)}
}

.loading .opt{
  pointer-events:none;
  opacity:0.6;
}