/* freetypingmaster.com - Kids & Arcade Typing Games Theme */
:root {
  --primary-orange: #f97316;
  --primary-violet: #8b5cf6;
  --accent-yellow: #fde047;
  --bg-color: #faf5ff;
  --card-bg: #ffffff;
  --text-dark: #1e1b4b;
  --text-muted: #6b7280;
  --border: #e9d5ff;
  --radius: 16px;
  --shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Quicksand", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  padding-bottom: 60px;
}

/* Header */
.arcade-header {
  background: #ffffff;
  border-bottom: 2px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.arcade-logo {
  text-decoration: none;
  font-size: 24px;
  font-weight: 900;
  color: var(--primary-violet);
  display: flex;
  align-items: center;
  gap: 8px;
}

.arcade-logo span.spark {
  color: var(--primary-orange);
}

.arcade-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.arcade-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 15px;
  transition: color 0.2s;
}

.arcade-nav a:hover, .arcade-nav a.active {
  color: var(--primary-orange);
}

/* Container */
.arcade-container {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 16px;
}

/* Hero */
.arcade-hero {
  text-align: center;
  margin-bottom: 28px;
}

.arcade-hero h1 {
  font-size: 34px;
  font-weight: 900;
  color: var(--primary-violet);
  margin-bottom: 8px;
}

.arcade-hero p {
  color: var(--text-muted);
  font-size: 16px;
}

/* Game Stage Card */
.arcade-card {
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.arcade-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdf4ff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 20px;
}

.arcade-hud-item {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.arcade-hud-item span {
  color: var(--primary-violet);
}

/* HTML5 Canvas */
#meteor-canvas {
  background: #0f172a;
  border-radius: 12px;
  width: 100%;
  height: 400px;
  display: block;
}

/* Input Row */
.arcade-input-wrap {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.arcade-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 20px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  color: var(--text-dark);
}

.arcade-input:focus {
  border-color: var(--primary-violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.arcade-btn {
  background: linear-gradient(135deg, var(--primary-orange), #ea580c);
  color: #ffffff;
  border: none;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  transition: transform 0.1s;
}

.arcade-btn:hover {
  transform: translateY(-2px);
}

/* Article */
.arcade-article {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 30px;
}

.arcade-article h2 {
  font-size: 24px;
  color: var(--primary-violet);
  margin-bottom: 12px;
}

.arcade-article p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 15px;
}

/* Footer */
.arcade-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.arcade-footer a {
  color: var(--primary-violet);
  text-decoration: none;
  margin: 0 8px;
}

.arcade-footer a:hover {
  text-decoration: underline;
}



/* ========================================================
   10-FINGER TOUCH TYPING COURSE & ON-SCREEN KEYBOARD
   ======================================================== */
.tt-arena-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  margin-bottom: 30px;
}

.tt-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: #fdf4ff;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #f5d0fe;
}

.tt-controls-bar select {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #d8b4fe;
  border-radius: 4px;
  background: #ffffff;
  color: #581c87;
}

.tt-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tt-hud-tile {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 6px;
  padding: 10px 14px;
  text-align: center;
}

.tt-hud-tile .lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #7e22ce;
}

.tt-hud-tile .val {
  font-size: 26px;
  font-weight: 900;
  color: #3b0764;
}

.tt-prompt-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  padding: 16px;
  font-size: 20px;
  letter-spacing: 2px;
  min-height: 80px;
  max-height: 140px;
  overflow-y: auto;
  font-family: monospace;
  margin-bottom: 16px;
  user-select: none;
}

.tt-char {
  display: inline-block;
  padding: 2px 4px;
  margin: 1px;
  border-radius: 3px;
}

.tt-char.active {
  background: #fde047;
  color: #000;
  font-weight: 900;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

.tt-char.correct {
  color: #16a34a;
}

.tt-char.incorrect {
  color: #dc2626;
  background: #fee2e2;
  text-decoration: line-through;
}

.tt-input-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tt-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 18px;
  font-family: inherit;
  border: 2px solid var(--primary-violet);
  border-radius: 6px;
  outline: none;
}

.tt-btn-reset {
  padding: 12px 18px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

/* Color-Coded On-Screen Keyboard */
.virtual-keyboard {
  background: #1e1b4b;
  padding: 16px;
  border-radius: 10px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 16px;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.kb-key {
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  background: #312e81;
  color: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
  box-shadow: 0 3px 0 #1e1b4b;
  transition: all 0.1s;
}

/* Zone colors for fingers */
.kb-key.zone-pinky { background: #ec4899; }
.kb-key.zone-ring  { background: #f97316; }
.kb-key.zone-mid   { background: #10b981; }
.kb-key.zone-idx-l { background: #3b82f6; }
.kb-key.zone-idx-r { background: #06b6d4; }
.kb-key.zone-thumb { background: #8b5cf6; min-width: 240px; }

.kb-key.target-key {
  background: #facc15 !important;
  color: #000000 !important;
  font-weight: 900;
  box-shadow: 0 0 16px #facc15;
  transform: translateY(-2px);
}

.kb-key.pressed {
  transform: translateY(2px);
  filter: brightness(1.3);
}

.tt-finger-indicator {
  background: #fef08a;
  border: 1px solid #eab308;
  color: #854d0e;
  padding: 10px 16px;
  border-radius: 6px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  margin-top: 10px;
}

/* Certificate Modal */
.tt-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.tt-modal-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  overflow: hidden;
  text-align: center;
  animation: popIn 0.25s ease-out;
}

.tt-cert-header {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tt-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.tt-cert-body {
  padding: 24px;
}

.tt-cert-stars {
  font-size: 28px;
  margin-bottom: 8px;
}

.tt-cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.tt-cert-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
}

.tt-cert-tile .val {
  font-size: 24px;
  font-weight: 900;
  color: #7c3aed;
  display: block;
}

.tt-cert-tile .lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.tt-modal-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tt-btn-primary {
  background: var(--primary-violet);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.tt-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}
