/* Typing feedback colors */
.char-correct {
  background: #3cb371 !important;
  color: #fff !important;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}
.char-corrected {
  background: #ffe066 !important;
  color: #333 !important;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}
body {
  background: linear-gradient(180deg, #0d6efd, #4aa3ff);
}

.char-flash{position:absolute;pointer-events:none;background:#ff3b3b;border-radius:3px;opacity:0.95;z-index:9999;transition:opacity 0.5s ease-out}
#sampleDisplay {
	font-family: monospace;
	font-size: 1.2em;
	margin-bottom: 10px;
	user-select: none;
	word-break: break-all;
}
.sample-char {
  display: inline;
  white-space: pre;
  vertical-align: baseline;
  font-family: Arial, Helvetica, sans-serif !important;
}
#input,textarea, #input{width:100%}
textarea{height:220px;padding:12px;border:1px solid #e0e6ef;border-radius:6px;font-size:1rem;resize:vertical}
.controls{display:flex;gap:8px;margin-top:12px}
button{padding:8px 12px;border-radius:6px;border:1px solid #cbd7ee;background:#fff;cursor:pointer}
button#stop{background:#ffeced;border-color:#ffb3b8}
button#reset{background:#eef7ff;border-color:#bcdcff}
@media(max-width:520px){.stats{flex-direction:column;gap:6px}}

.sample{background:#fbfdff;border:1px solid #eef6ff;padding:12px;border-radius:8px;margin-bottom:12px}
.sample h2{margin:0 0 6px;font-size:1rem}
.sample-controls{display:flex;gap:8px;margin-top:8px}
.word-group {
  display: inline-block;
  white-space: nowrap;
}

/* Modal styles */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(10,12,20,0.45);z-index:1200}
.modal[aria-hidden="false"]{display:flex}
.modal-content{background:#fff;padding:18px;border-radius:10px;max-width:420px;width:92%;box-shadow:0 10px 30px rgba(10,20,40,0.15);position:relative}
.modal-close{position:absolute;right:10px;top:8px;border:0;background:transparent;font-size:20px;cursor:pointer}
.modal-row{margin:8px 0;font-weight:600}
.modal-message{color:#d9534f;font-weight:700}
.modal-actions{display:flex;justify-content:flex-end;margin-top:12px}
.modal-actions button{padding:8px 12px;border-radius:6px;border:1px solid #d0dbe9;background:#f6fbff}

/* Confetti pieces */
.confetti-piece{position:fixed;top:-10vh;width:10px;height:14px;pointer-events:none;border-radius:2px;opacity:0.98;transform-origin:center;z-index:9999}
@keyframes confetti-fall{
	0%{top:-10vh;transform:rotate(0deg);opacity:1}
	80%{opacity:1}
	100%{top:110vh;transform:rotate(720deg);opacity:0}
}

/* Emoji pieces (falling crying emojis) */
.emoji-piece{position:fixed;top:-10vh;pointer-events:none;font-size:28px;line-height:1;z-index:9999;opacity:0.98}

/* Error flash overlay */
.error-overlay{position:fixed;inset:0;background:#ff3b3b;opacity:0.9;pointer-events:none;z-index:9998;animation:errorFade 0.5s ease-out forwards}
@keyframes errorFade{0%{opacity:0.9}100%{opacity:0}}
.char-flash{position:absolute;pointer-events:none;background:#ff3b3b;border-radius:3px;opacity:0.95;z-index:9999;transition:opacity 0.5s ease-out}

/* Leaderboard styles */
.leaderboard {
  margin-left: 2em;
  min-width: 220px;
  background: #f8f8f8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1em;
}
.leaderboard h2 {
  font-size: 1.2em;
  margin-bottom: 0.5em;
}
.leaderboard table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard th, .leaderboard td {
  text-align: center;
  padding: 0.3em 0.5em;
  border-bottom: 1px solid #ddd;
}
.leaderboard tr:last-child td {
  border-bottom: none;
}
.leaderboard .up { color: green; }
.leaderboard .down { color: red; }

.flash-red {
  background: #ff3b3b !important;
  color: #fff !important;
  border-radius: 3px;
  box-shadow: 0 0 8px 2px #ff3b3b;
  transition: background 0.1s, color 0.1s;
  z-index: 10;
}




