* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #fff0f5;
  color: #333;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.8s ease, color 0.8s ease;
}

/* Dark punishment themes */
body.punish-1 { background: #1a0f14; color: #ddd; }
body.punish-2 { background: #2e1d27; color: #ddd; }
body.punish-3 { background: #000000; color: #ffcccc; }

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 40, 80, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.8s ease;
}

body.punish-2::before { opacity: 0.15; }
body.punish-3::before { opacity: 0.25; }

.container { 
  max-width: 920px; 
  margin: 0 auto; 
  padding: 20px; 
}

header { 
  text-align: center; 
  margin-bottom: 25px; 
}

h1 {
  font-size: 3rem;
  color: #f8819f;
  text-shadow: 0 4px 20px rgba(255, 77, 122, 0.5);
  transition: color 0.8s ease;
}

body.punish-1 h1,
body.punish-2 h1,
body.punish-3 h1 {
  color: #ff8ab3;
}

body.punish-3 h1 {
  color: #ff4d7a;
  text-shadow: 0 4px 25px rgba(255, 26, 77, 0.7);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 45px;
  font-size: 1.35rem;
  color: #aaa;
  font-weight: 500;
}

.paragraph-box {
  background: #fff;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(255, 77, 122, 0.12);
  border: 3px solid #ff99bb;
  min-height: 290px;
  margin-bottom: 30px;
  line-height: 1.75;
  font-size: 1.12rem;
  color: #444;
  transition: all 0.8s ease;
}

body.punish-1 .paragraph-box,
body.punish-2 .paragraph-box,
body.punish-3 .paragraph-box {
  background: #1a1a1a;
  border-color: #ff4d7a;
  color: #ccc;
}

.highlight {
  background: #3a1a24;
  color: #ff8ab3;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 77, 122, 0.4);
}

.question-area h2 {
  margin-bottom: 12px;
  color: #ff4d7a;
  font-size: 1.5rem;
}

body.punish-3 .question-area h2 { 
  color: #ff1a4d; 
}

.feedback {
  height: 32px;
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.options { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 14px; 
}

.option {
  background: #fff;
  padding: 20px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 1.08rem;
  border: 3px solid #ff99bb;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  color: #333;
}

.option:hover {
  transform: translateY(-4px);
  border-color: #ff4d7a;
}

.option.correct {
  background: #fff0f5;
  border-color: #ff4d7a;
  color: #ff4d7a;
  animation: correctPop 0.6s ease forwards;
}

.option.wrong {
  background: #ffe6e6;
  border-color: #ff6666;
  animation: wrongShake 0.4s ease;
}

@keyframes correctPop { 
  0% { transform: scale(0.85); } 
  50% { transform: scale(1.12); } 
  100% { transform: scale(1); } 
}

@keyframes wrongShake { 
  0%,100% { transform: translateX(0); } 
  25% { transform: translateX(-8px); } 
  75% { transform: translateX(8px); } 
}

button {
  background: linear-gradient(135deg, #ff4d7a, #c0266e);
  color: white;
  border: none;
  padding: 16px 38px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 77, 122, 0.4);
  transition: all 0.3s;
}

button:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 30px rgba(255, 77, 122, 0.6);
}

/* ==================== VIETNAMESE HINT - FIXED READABILITY ==================== */
#viet-hint {
  background: linear-gradient(135deg, #ffe6f0, #fff0f5);
  border: 4px solid #ff4d7a;
  border-radius: 18px;
  padding: 25px;
  margin: 25px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(255, 77, 122, 0.35);
  color: #333;
}

#viet-hint strong {
  font-size: 1.35rem;
  color: #e04a7e;
}

#viet-hint span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c0266e;
  line-height: 1.4;
}

#viet-hint p {
  margin: 10px 0;
  font-weight: 500;
  color: #555;
}

/* English & Vietnamese labels */
#viet-hint p:nth-of-type(1) { color: #e04a7e; }
#viet-hint p:nth-of-type(2) { color: #c0266e; }

/* Meaning text inside hint (English & Vietnamese values) */
.hint-meaning-text {
  color: #333;
}

/* Input field */
#viet-hint input {
  width: 100%;
  max-width: 420px;
  padding: 16px 20px;
  font-size: 1.25rem;
  border: 3px solid #ff4d7a;
  border-radius: 14px;
  outline: none;
  background: white;
  color: #333;
  font-weight: 600;
}

#viet-hint input:focus {
  border-color: #ff8ab3;
  box-shadow: 0 0 0 4px rgba(255, 77, 122, 0.25);
  transform: scale(1.02);
}

/* Submit button */
#viet-hint button {
  background: linear-gradient(135deg, #ff4d7a, #c0266e);
  color: white;
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 77, 122, 0.5);
  margin-top: 15px;
}

#viet-hint button:hover {
  transform: translateY(-2px);
}

/* Punishment theme overrides - High contrast */
body.punish-1 #viet-hint,
body.punish-2 #viet-hint,
body.punish-3 #viet-hint {
  background: linear-gradient(135deg, #1a0f14, #0f0a0d);
  border-color: #ff6699;
  color: #ffe6ee;
}

body.punish-1 #viet-hint strong,
body.punish-2 #viet-hint strong,
body.punish-3 #viet-hint strong {
  color: #ffb3d1;
}

body.punish-1 #viet-hint span,
body.punish-2 #viet-hint span,
body.punish-3 #viet-hint span {
  color: #ff99bb;
}

body.punish-1 .hint-meaning-text,
body.punish-2 .hint-meaning-text,
body.punish-3 .hint-meaning-text {
  color: #f0d0dc !important;
}

body.punish-1 #viet-hint input,
body.punish-2 #viet-hint input,
body.punish-3 #viet-hint input {
  background: #2a1520;
  color: #ffe6ee;
  border-color: #ff6699;
}

body.punish-3 #viet-hint {
  background: linear-gradient(135deg, #0f0508, #000);
  border-color: #ff4d7a;
  color: #ffdddd;
}

body.punish-3 #viet-hint p {
  color: #ffbbcc;
}

/* Correct answer hint */
#viet-hint.correct-hint {
  background: linear-gradient(135deg, #ffe6f0, #fff0f5);
  border-color: #ff4d7a;
  color: #333;
}

#viet-hint.correct-hint strong {
  color: #e04a7e;
}

#viet-hint.correct-hint span {
  color: #c0266e;
}

/* Disable text selection */
body, 
.paragraph-box, 
#paragraph, 
.highlight,
.question-area,
.option {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#word-input {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ==================== FLASHCARD ==================== */

.flashcard-outer {
  width: 100%;
  height: 260px;
  perspective: 1200px;
  cursor: pointer;
  margin: 0 auto;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-outer.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 12px 40px rgba(255, 77, 122, 0.18);
}

.flashcard-front {
  background: linear-gradient(135deg, #fff0f5, #ffe6f0);
  border: 3px solid #ff99bb;
}

.flashcard-back {
  background: linear-gradient(135deg, #3a1a24, #1a0f14);
  border: 3px solid #ff4d7a;
  transform: rotateY(180deg);
}

.flashcard-word {
  font-size: 2.4rem;
  font-weight: 800;
  color: #c0266e;
  text-align: center;
  line-height: 1.2;
}

.flashcard-tap-hint {
  margin-top: 16px;
  font-size: 0.95rem;
  color: #bbb;
  font-weight: 500;
}

.flashcard-viet {
  font-size: 2rem;
  font-weight: 800;
  color: #ff8ab3;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.2;
}

.flashcard-english {
  font-size: 1rem;
  color: #ddd;
  text-align: center;
  line-height: 1.5;
  font-weight: 500;
  max-width: 480px;
}

/* Flashcard buttons */
.fc-btn-skip {
  background: linear-gradient(135deg, #888, #555) !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25) !important;
  padding: 14px 32px;
  font-size: 1.1rem;
}

.fc-btn-known {
  background: linear-gradient(135deg, #ff4d7a, #c0266e) !important;
  box-shadow: 0 6px 20px rgba(255, 77, 122, 0.45) !important;
  padding: 14px 32px;
  font-size: 1.1rem;
}

/* Punishment theme overrides */
body.punish-1 .flashcard-front,
body.punish-2 .flashcard-front,
body.punish-3 .flashcard-front {
  background: linear-gradient(135deg, #1a0f14, #0f0a0d);
  border-color: #ff6699;
}

body.punish-1 .flashcard-word,
body.punish-2 .flashcard-word,
body.punish-3 .flashcard-word {
  color: #ff8ab3;
}

body.punish-3 .flashcard-front {
  background: linear-gradient(135deg, #0f0508, #000);
}

/* ==================== FILL IN THE BLANK ==================== */

.fill-sentence-box {
  background: #fff;
  border: 2px solid #ffd6e7;
  border-radius: 18px;
  padding: 30px 32px;
  font-size: 1.18rem;
  line-height: 2;
  color: #333;
  box-shadow: 0 8px 24px rgba(255, 77, 122, 0.1);
  margin-bottom: 28px;
}

body.punish-1 .fill-sentence-box,
body.punish-2 .fill-sentence-box,
body.punish-3 .fill-sentence-box {
  background: #1a1a1a;
  border-color: #ff4d7a;
  color: #ccc;
}

.fill-blank {
  display: inline-block;
  min-width: 110px;
  border-bottom: 3px solid #ff4d7a;
  background: #fff0f5;
  color: transparent;
  padding: 0 10px 2px;
  border-radius: 4px 4px 0 0;
  font-size: 1.15rem;
  user-select: none;
}

/* Multiple choice options grid */
.fill-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}

.fill-option {
  background: #fff;
  border: 2px solid #ffd6e7;
  border-radius: 14px;
  padding: 18px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255, 77, 122, 0.08);
  /* override global button styles */
  background-image: none;
  letter-spacing: 0;
}

.fill-option:hover:not(:disabled) {
  border-color: #ff4d7a;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 77, 122, 0.2);
}

.fill-option.fill-opt-correct {
  background: #fff0f5;
  border-color: #ff4d7a;
  color: #c0266e;
  animation: correctPop 0.5s ease forwards;
}

.fill-option.fill-opt-wrong {
  background: #ffe6e6;
  border-color: #ff6666;
  color: #cc3333;
  animation: wrongShake 0.4s ease;
}

body.punish-1 .fill-option,
body.punish-2 .fill-option,
body.punish-3 .fill-option {
  background: #1a1a1a;
  border-color: #ff4d7a44;
  color: #ccc;
}

/* ==================== SUMMARY CARDS ==================== */

.summary-card {
  background: #fff;
  border: 2px solid #ffd6e7;
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(255, 77, 122, 0.1);
  text-align: center;
}

.summary-card-title {
  font-size: 1.1rem;
  color: #c0266e;
  margin-bottom: 18px;
  font-weight: 700;
}

.summary-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.summary-stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.summary-stat-label {
  font-size: 0.8rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.btn-small {
  padding: 12px 28px;
  margin: 8px 10px;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.05rem;
}