:root {
  --water-deep: #0b3b4f;
  --water: #14657e;
  --water-light: #2b9db8;
  --sand: #f4c95d;
  --sand-dark: #e0a93e;
  --coral: #ff8fa3;
  --hippo: #b8b0c8;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-solid: #10485e;
  --text: #eaf6fa;
  --muted: #a8ccd8;
  --good: #7ee787;
  --bad: #ff7b7b;
  --border: rgba(255, 255, 255, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  background: linear-gradient(180deg, #7ec8e3 0%, var(--water-light) 30%, var(--water) 65%, var(--water-deep) 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 24px 16px 140px;
  overflow-x: hidden;
}

.hidden { display: none !important; }
.container { max-width: 900px; margin: 0 auto; position: relative; z-index: 2; }

/* ---------- Login ---------- */
.login-screen {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  min-height: 70vh;
}
.login-card {
  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  text-align: center;
  width: 100%;
  max-width: 380px;
}
.login-card input {
  width: 100%;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}
.login-card input:focus { border-color: var(--sand); }
.login-card input::placeholder { color: rgba(255, 255, 255, 0.55); }
.login-card h1 { font-size: 2rem; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.2); margin: 10px 0 4px; }
.login-card .subtitle { color: #eafcff; opacity: .9; margin-bottom: 10px; }
.hippo-face.big { font-size: 3.4rem; width: 80px; height: 80px; margin: 0 auto; }
.auth-msg { min-height: 1.4rem; margin-top: 12px; font-weight: 700; color: var(--bad); }
.auth-msg.ok { color: var(--good); }
.auth-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }

/* ---------- Header ---------- */
.hippo-header { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.hippo-face {
  font-size: 4.2rem;
  background: var(--hippo);
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  animation: bob 3s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
.header-text { flex: 1; min-width: 200px; }
h1 { font-size: 2.2rem; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.2); letter-spacing: 1px; }
.subtitle { color: #eafcff; opacity: .9; font-size: 1.05rem; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid var(--border);
  padding: 8px 12px; border-radius: 999px;
  font-weight: 700;
}

/* ---------- Tabs & panels ---------- */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 12px 20px; border-radius: 999px;
  border: 3px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.15); color: #fff;
  cursor: pointer; font-size: 1rem; font-weight: 700;
  transition: all .15s; backdrop-filter: blur(4px);
}
.tab:hover { transform: translateY(-2px); }
.tab.active { background: var(--sand); color: #5c3d00; border-color: var(--sand-dark); box-shadow: 0 5px 0 var(--sand-dark); }

.panel {
  display: none; background: var(--panel);
  border: 3px solid var(--border); border-radius: 24px;
  padding: 22px; backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.panel.active { display: block; }

/* ---------- List ---------- */
.list-header { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
input[type="text"], select {
  background: rgba(255,255,255,.14); border: 2px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 14px;
  font-size: .95rem; outline: none; font-family: inherit;
}
input::placeholder { color: rgba(255,255,255,.55); }
input[type="text"]:focus, select:focus { border-color: var(--sand); }
select option { color: #123; }
.btn {
  background: var(--sand); color: #5c3d00; border: none;
  padding: 10px 18px; border-radius: 999px; font-weight: 800;
  cursor: pointer; font-size: .95rem; font-family: inherit;
  box-shadow: 0 4px 0 var(--sand-dark);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sand-dark); }
.btn.secondary { background: rgba(255,255,255,.15); color: var(--text); border: 2px solid var(--border); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.btn.danger { background: transparent; color: var(--bad); border: 2px solid var(--bad); box-shadow: none; padding: 5px 12px; font-size: .85rem; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--sand); font-size: .9rem; padding: 8px 10px; border-bottom: 3px solid var(--border); }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
td input { width: 100%; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; font-size: 1.05rem; }

/* ---------- Quiz ---------- */
.quiz-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.quiz-controls label { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.quiz-box { text-align: center; padding: 26px 10px; }
.prompt { font-size: 2.1rem; font-weight: 800; margin-bottom: 8px; min-height: 2.6rem; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.hint { color: var(--muted); margin-bottom: 24px; min-height: 1.2rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; margin: 0 auto; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.choice {
  background: rgba(255,255,255,.14); border: 3px solid var(--border);
  color: var(--text); padding: 16px; border-radius: 18px;
  cursor: pointer; font-size: 1.1rem; font-weight: 700; font-family: inherit;
  transition: all .12s;
}
.choice:hover { border-color: var(--sand); transform: scale(1.03); }
.choice.correct { border-color: var(--good); background: rgba(126,231,135,.25); }
.choice.wrong { border-color: var(--bad); background: rgba(255,123,123,.25); }
.answer-input { font-size: 1.3rem; text-align: center; max-width: 420px; padding: 12px; border-radius: 16px !important; }
.feedback { min-height: 1.6rem; margin-top: 16px; font-weight: 800; font-size: 1.15rem; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.score-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--muted); font-weight: 700; font-size: .95rem; }
.progress { height: 12px; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; margin-bottom: 20px; border: 2px solid var(--border); }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--sand), var(--coral)); width: 0%; transition: width .3s; border-radius: 99px; }

/* ---------- Flashcards ---------- */
.flashcard { max-width: 480px; margin: 20px auto; perspective: 1000px; cursor: pointer; }
.flashcard-inner { position: relative; height: 220px; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-solid); border: 4px solid var(--sand); border-radius: 24px;
  font-size: 1.9rem; font-weight: 800; padding: 20px; text-align: center;
  backface-visibility: hidden; box-shadow: 0 10px 24px rgba(0,0,0,.3);
}
.face.back { transform: rotateY(180deg); border-color: var(--coral); background: #0d3d51; }
.flash-nav { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }

/* ---------- Bubbles & water ---------- */
.bubbles span {
  position: fixed; bottom: -60px;
  background: rgba(255,255,255,.35); border-radius: 50%;
  animation: rise linear infinite; z-index: 1;
}
.bubbles span:nth-child(1) { left: 10%; width: 22px; height: 22px; animation-duration: 9s; }
.bubbles span:nth-child(2) { left: 25%; width: 14px; height: 14px; animation-duration: 12s; animation-delay: 2s; }
.bubbles span:nth-child(3) { left: 45%; width: 30px; height: 30px; animation-duration: 11s; animation-delay: 1s; }
.bubbles span:nth-child(4) { left: 65%; width: 16px; height: 16px; animation-duration: 8s; animation-delay: 3s; }
.bubbles span:nth-child(5) { left: 80%; width: 24px; height: 24px; animation-duration: 13s; animation-delay: .5s; }
.bubbles span:nth-child(6) { left: 92%; width: 12px; height: 12px; animation-duration: 10s; animation-delay: 4s; }
@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: .7; }
  100% { transform: translateY(-110vh) scale(1.4); opacity: 0; }
}
.water { position: fixed; left: 0; right: 0; bottom: 0; height: 110px; z-index: 1; }
.water svg { width: 100%; height: 100%; display: block; }
.water path { fill: rgba(6,45,62,.85); }
