.typing-main {
  margin-top: 64px;
  min-height: calc(100vh - 64px);
  background: #f7f8fa;
}

.typing-hero {
  padding: 48px 0 32px;
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f3ff 100%);
  text-align: center;
}

.typing-hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 12px;
}

.typing-hero-sub {
  font-size: 16px;
  color: #4e5969;
  margin-bottom: 20px;
}

.typing-hero-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.badge-green { background: #e8ffea; color: #00B42A; }
.badge-blue { background: #e8f3ff; color: #165DFF; }
.badge-orange { background: #fff7e8; color: #FF7D00; }
.badge-purple { background: #f3e8ff; color: #722ED1; }

.level-section {
  padding: 40px 0;
}

.level-section h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 8px;
}

.level-section-desc {
  color: #86909c;
  font-size: 14px;
  margin-bottom: 24px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.level-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.level-card-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.level-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 4px;
}

.level-card-subtitle {
  font-size: 14px;
  color: #4e5969;
  margin-bottom: 8px;
}

.level-card-desc {
  font-size: 13px;
  color: #86909c;
  line-height: 1.5;
  margin-bottom: 16px;
}

.level-card-best {
  font-size: 12px;
  color: #86909c;
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-card-best strong {
  color: #165DFF;
}

.level-card-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.practice-workspace {
  padding: 24px 0 48px;
}

.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.practice-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
}

.practice-header-actions {
  display: flex;
  gap: 12px;
}

.stats-bar {
  display: flex;
  gap: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  min-width: 80px;
}

.stat-label {
  font-size: 12px;
  color: #86909c;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #1d2129;
}

.stat-value.accent {
  color: #165DFF;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e6eb;
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #165DFF, #4080ff);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.text-display {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 20px;
  line-height: 1.8;
  min-height: 80px;
  letter-spacing: 1px;
  position: relative;
}

.char {
  display: inline-block;
  padding: 2px 1px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.char-correct {
  color: #00B42A;
}

.char-error {
  color: #F53F3F;
  background: rgba(245, 63, 63, 0.1);
}

.char-current {
  color: #165DFF;
  background: rgba(22, 93, 255, 0.1);
  border-bottom: 2px solid #165DFF;
  animation: blink 1s ease-in-out infinite;
}

.char-pending {
  color: #c9cdd4;
}

.char-newline {
  color: #86909c;
  margin: 0 4px;
}

.line-preview {
  color: #c9cdd4;
  font-size: 16px;
  margin-left: 8px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.finger-hint {
  background: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  font-size: 14px;
  color: #4e5969;
  display: flex;
  align-items: center;
  gap: 8px;
}

.finger-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.hidden-input {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.kb-container {
  background: #fff;
  border-radius: 12px;
  padding: 16px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  user-select: none;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}

.kb-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 2.8rem;
  background: #f7f8fa;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.kb-key:hover {
  background: #e8f3ff;
  border-color: #bedaff;
}

.kb-key-char {
  font-size: 13px;
  font-weight: 600;
  color: #1d2129;
  line-height: 1;
}

.kb-key-shift {
  font-size: 10px;
  color: #86909c;
  position: absolute;
  top: 3px;
  left: 6px;
}

.kb-home-dot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 2px;
  background: #86909c;
  border-radius: 1px;
}

.kb-home {
  border-bottom-width: 3px;
}

.kb-highlight {
  background: #e8f3ff;
  border-color: #bedaff;
}

.kb-active {
  background: #165DFF !important;
  border-color: #165DFF !important;
  transform: scale(0.95);
}

.kb-active .kb-key-char,
.kb-active .kb-key-shift {
  color: #fff !important;
}

.kb-space .kb-key-char {
  font-size: 11px;
  color: #86909c;
}

.kb-wide .kb-key-char {
  font-size: 11px;
}

.result-panel {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: none;
}

.result-panel h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 20px;
  text-align: center;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.result-item {
  text-align: center;
  padding: 16px;
  background: #f7f8fa;
  border-radius: 8px;
}

.result-item-label {
  font-size: 12px;
  color: #86909c;
  margin-bottom: 4px;
}

.result-item-value {
  font-size: 28px;
  font-weight: 700;
  color: #165DFF;
}

.result-item-value.small {
  font-size: 22px;
}

.new-best {
  display: inline-block;
  background: linear-gradient(135deg, #FF7D00, #F53F3F);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 125, 0, 0.4); }
  50% { box-shadow: 0 0 16px rgba(255, 125, 0, 0.8); }
}

.heatmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.heatmap-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.heatmap-char {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.heatmap-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
}

.no-errors {
  text-align: center;
  font-size: 16px;
  padding: 16px;
}

.game-workspace {
  padding: 24px 0 48px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.game-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
}

.game-stats-bar {
  display: flex;
  gap: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.game-stat {
  text-align: center;
  min-width: 60px;
}

.game-stat-label {
  font-size: 11px;
  color: #86909c;
}

.game-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
}

.game-stat-value.score {
  color: #165DFF;
}

.game-stat-value.combo {
  color: #FF7D00;
}

.game-canvas-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
  height: 400px;
}

.game-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-text-area {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 18px;
  min-height: 120px;
}

.serial-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.serial-line {
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  letter-spacing: 2px;
}

.serial-done {
  color: #00B42A;
  opacity: 0.6;
}

.serial-current {
  background: #f7f8fa;
  font-size: 20px;
}

.serial-text {
  color: #86909c;
  font-size: 14px;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

.game-overlay h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 12px;
}

.game-overlay p {
  color: #86909c;
  font-size: 14px;
  margin-bottom: 24px;
  text-align: center;
  max-width: 320px;
}

.game-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  width: 280px;
}

.game-result-item {
  text-align: center;
  padding: 12px;
  background: #f7f8fa;
  border-radius: 8px;
}

.game-result-label {
  font-size: 11px;
  color: #86909c;
}

.game-result-value {
  font-size: 24px;
  font-weight: 700;
  color: #165DFF;
}

.mobile-notice {
  display: none;
  background: #fff7e8;
  border: 1px solid #ffdba6;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #874e00;
}

@media (max-width: 768px) {
  .typing-hero h1 {
    font-size: 24px;
  }

  .typing-hero-sub {
    font-size: 14px;
  }

  .level-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 12px;
    padding: 12px 16px;
  }

  .stat-value {
    font-size: 18px;
  }

  .text-display {
    font-size: 16px;
    padding: 20px;
  }

  .kb-key {
    height: 2.2rem;
  }

  .kb-key-char {
    font-size: 11px;
  }

  .kb-key-shift {
    font-size: 8px;
  }

  .game-canvas-wrap {
    height: 300px;
  }

  .mobile-notice {
    display: block;
  }
}

@media (max-width: 480px) {
  .typing-hero {
    padding: 32px 0 24px;
  }

  .typing-hero h1 {
    font-size: 20px;
  }

  .level-card {
    padding: 16px;
  }

  .stats-bar {
    gap: 8px;
  }

  .stat-item {
    min-width: 60px;
  }

  .stat-value {
    font-size: 16px;
  }

  .text-display {
    font-size: 14px;
    padding: 16px;
  }

  .kb-container {
    padding: 8px 4px;
  }

  .kb-row {
    gap: 2px;
  }

  .kb-key {
    height: 1.8rem;
  }

  .kb-key-char {
    font-size: 9px;
  }
}

/* ===== Practice Fullscreen Layout ===== */

.practice-fullscreen {
  --pf-bg: #1a1a2e;
  --pf-surface: #16213e;
  --pf-surface-border: rgba(255, 255, 255, 0.06);
  --pf-text: #e8e8e8;
  --pf-text-dim: #c9cdd4;
  --pf-text-muted: #6b7280;
  --pf-text-faint: #4b5563;
  --pf-text-fainter: #374151;
  --pf-accent: #60a5fa;
  --pf-accent-bg: rgba(96, 165, 250, 0.15);
  --pf-correct: #34d399;
  --pf-error: #f87171;
  --pf-error-bg: rgba(248, 113, 113, 0.15);
  --pf-btn-bg: rgba(255, 255, 255, 0.08);
  --pf-btn-border: rgba(255, 255, 255, 0.12);
  --pf-btn-hover: rgba(255, 255, 255, 0.15);
  --pf-btn-text: #c9cdd4;
  --pf-key-bg: #1e293b;
  --pf-key-border: rgba(255, 255, 255, 0.1);
  --pf-key-hover: #334155;
  --pf-key-text: #e0e0e0;
  --pf-key-highlight: #1e3a5f;
  --pf-key-active: #3b82f6;
  --pf-overlay: rgba(26, 26, 46, 0.92);
  --pf-item-bg: rgba(255, 255, 255, 0.04);
  --pf-link: #86909c;
  --pf-link-hover: #fff;
  --pf-progress-track: rgba(255, 255, 255, 0.08);
  --pf-home-dot: #6b7280;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pf-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: background 0.3s ease;
}

.practice-fullscreen.pf-light {
  --pf-bg: #f0f2f5;
  --pf-surface: #ffffff;
  --pf-surface-border: rgba(0, 0, 0, 0.06);
  --pf-text: #1d2129;
  --pf-text-dim: #4e5969;
  --pf-text-muted: #86909c;
  --pf-text-faint: #c9cdd4;
  --pf-text-fainter: #e5e6eb;
  --pf-accent: #165DFF;
  --pf-accent-bg: rgba(22, 93, 255, 0.1);
  --pf-correct: #00B42A;
  --pf-error: #F53F3F;
  --pf-error-bg: rgba(245, 63, 63, 0.08);
  --pf-btn-bg: rgba(0, 0, 0, 0.04);
  --pf-btn-border: rgba(0, 0, 0, 0.1);
  --pf-btn-hover: rgba(0, 0, 0, 0.08);
  --pf-btn-text: #4e5969;
  --pf-key-bg: #f7f8fa;
  --pf-key-border: #e5e6eb;
  --pf-key-hover: #e8f3ff;
  --pf-key-text: #1d2129;
  --pf-key-highlight: #e8f3ff;
  --pf-key-active: #165DFF;
  --pf-overlay: rgba(240, 242, 245, 0.92);
  --pf-item-bg: rgba(0, 0, 0, 0.03);
  --pf-link: #86909c;
  --pf-link-hover: #165DFF;
  --pf-progress-track: #e5e6eb;
  --pf-home-dot: #86909c;
}

.pf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: var(--pf-surface);
  border-bottom: 1px solid var(--pf-surface-border);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.pf-back-link {
  color: var(--pf-link);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.pf-back-link:hover {
  color: var(--pf-link-hover);
}

.pf-topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--pf-text);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.pf-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pf-btn {
  background: var(--pf-btn-bg);
  color: var(--pf-btn-text);
  border: 1px solid var(--pf-btn-border);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-btn:hover {
  background: var(--pf-btn-hover);
  color: var(--pf-text);
}

.pf-theme-toggle {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
}

.pf-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 32px 20px;
  overflow: hidden;
  min-height: 0;
}

.pf-stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 10px 0 8px;
  flex-shrink: 0;
}

.pf-stat {
  text-align: center;
}

.pf-stat-label {
  display: block;
  font-size: 12px;
  color: var(--pf-text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pf-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--pf-text);
  font-variant-numeric: tabular-nums;
}

.pf-stat-value.pf-accent {
  color: var(--pf-accent);
}

.pf-progress {
  width: 100%;
  height: 4px;
  background: var(--pf-progress-track);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.pf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pf-accent), #a78bfa);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.pf-hint {
  text-align: center;
  font-size: 15px;
  color: var(--pf-text-muted);
  padding: 4px 0 10px;
  flex-shrink: 0;
  min-height: 28px;
}

.pf-hint strong {
  color: var(--pf-text);
}

.pf-hint-char {
  color: var(--pf-text);
}

.finger-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}

.pf-display {
  flex: 1;
  min-height: 80px;
  max-height: 240px;
  background: var(--pf-surface);
  border: 1px solid var(--pf-surface-border);
  border-radius: 12px;
  padding: 20px 28px;
  margin-bottom: 12px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 32px;
  line-height: 1.7;
  letter-spacing: 3px;
  text-align: center;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.pf-display .char-correct {
  color: var(--pf-correct);
}

.pf-display .char-error {
  color: var(--pf-error);
  background: var(--pf-error-bg);
}

.pf-display .char-current {
  color: var(--pf-accent);
  background: var(--pf-accent-bg);
  border-bottom: 3px solid var(--pf-accent);
}

.pf-display .char-pending {
  color: var(--pf-text-faint);
}

.pf-display .char-newline {
  color: var(--pf-text-muted);
}

.pf-display .line-preview {
  color: var(--pf-text-fainter);
  font-size: 24px;
}

.pf-keyboard {
  flex-shrink: 0;
}

.pf-keyboard .kb-container {
  background: var(--pf-surface);
  border: 1px solid var(--pf-surface-border);
  border-radius: 12px;
  padding: 12px 6px;
  box-shadow: none;
  margin-bottom: 0;
}

.pf-keyboard .kb-key {
  height: 3.2rem;
  background: var(--pf-key-bg);
  border: 1px solid var(--pf-key-border);
  border-radius: 6px;
}

.pf-keyboard .kb-key:hover {
  background: var(--pf-key-hover);
  border-color: var(--pf-accent);
}

.pf-keyboard .kb-key-char {
  font-size: 15px;
  color: var(--pf-key-text);
}

.pf-keyboard .kb-key-shift {
  font-size: 11px;
  color: var(--pf-text-muted);
}

.pf-keyboard .kb-home-dot {
  background: var(--pf-home-dot);
}

.pf-keyboard .kb-highlight {
  background: var(--pf-key-highlight);
  border-color: var(--pf-accent);
}

.pf-keyboard .kb-active {
  background: var(--pf-key-active) !important;
  border-color: var(--pf-accent) !important;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.4);
}

.pf-keyboard .kb-active .kb-key-char {
  color: #fff !important;
}

.pf-keyboard .kb-space .kb-key-char {
  color: var(--pf-text-muted);
}

.pf-result {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pf-overlay);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.pf-result-inner {
  background: var(--pf-surface);
  border: 1px solid var(--pf-surface-border);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.pf-result-inner h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--pf-text);
  margin-bottom: 24px;
}

.pf-result-inner h4 {
  font-size: 15px;
  color: var(--pf-text-dim);
  margin-bottom: 8px;
  margin-top: 20px;
}

.pf-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pf-result-item {
  background: var(--pf-item-bg);
  border-radius: 10px;
  padding: 16px 12px;
}

.pf-result-label {
  font-size: 12px;
  color: var(--pf-text-muted);
  margin-bottom: 4px;
}

.pf-result-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--pf-accent);
}

.pf-result-best {
  font-size: 14px;
  color: var(--pf-text-muted);
  margin-bottom: 8px;
}

.pf-result-best strong {
  color: var(--pf-accent);
}

.pf-result-actions {
  margin-top: 24px;
}

.pf-result .heatmap-key {
  border-radius: 6px;
}

.pf-result .heatmap-char {
  color: #fff;
}

.pf-result .no-errors {
  color: var(--pf-correct);
}

.pf-result .new-best {
  margin-left: 8px;
}

.hidden-input {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pf-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 24px;
  height: 36px;
  font-size: 12px;
  color: var(--pf-text-muted);
  background: var(--pf-surface);
  border-top: 1px solid var(--pf-surface-border);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.pf-footer-sep {
  color: var(--pf-text-faint);
}

.pf-footer-link {
  color: var(--pf-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.pf-footer-link:hover {
  color: var(--pf-accent);
}

@media (max-width: 768px) {
  .pf-body {
    padding: 10px 16px 12px;
  }

  .pf-stats-row {
    gap: 20px;
  }

  .pf-stat-value {
    font-size: 22px;
  }

  .pf-display {
    font-size: 24px;
    padding: 14px 18px;
    letter-spacing: 2px;
  }

  .pf-keyboard .kb-key {
    height: 2.6rem;
  }

  .pf-keyboard .kb-key-char {
    font-size: 12px;
  }

  .pf-result-inner {
    padding: 24px;
  }

  .pf-result-value {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .pf-topbar h1 {
    font-size: 15px;
  }

  .pf-stats-row {
    gap: 12px;
  }

  .pf-stat-value {
    font-size: 18px;
  }

  .pf-stat-label {
    font-size: 10px;
  }

  .pf-display {
    font-size: 20px;
    padding: 10px 14px;
    letter-spacing: 1px;
  }

  .pf-keyboard .kb-key {
    height: 2rem;
  }

  .pf-keyboard .kb-key-char {
    font-size: 10px;
  }

  .pf-result-value {
    font-size: 22px;
  }
}

/* ===== Game Fullscreen (gf-) ===== */

.gf-fullscreen .pf-body {
  padding: 10px 32px 12px;
}

.gf-canvas-wrap {
  flex: 1;
  min-height: 200px;
  background: var(--pf-surface);
  border: 1px solid var(--pf-surface-border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}

.gf-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gf-text-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 28px;
  line-height: 1.8;
  letter-spacing: 3px;
  overflow-y: auto;
  color: var(--pf-text);
  text-align: center;
}

.gf-text-area .char-correct {
  color: var(--pf-correct);
}

.gf-text-area .char-error {
  color: var(--pf-error);
  background: var(--pf-error-bg);
}

.gf-text-area .char-current {
  color: var(--pf-accent);
  background: var(--pf-accent-bg);
  border-bottom: 2px solid var(--pf-accent);
}

.gf-text-area .char-pending {
  color: var(--pf-text-faint);
}

.gf-text-area .serial-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gf-text-area .serial-line {
  padding: 8px 12px;
  border-radius: 6px;
  letter-spacing: 2px;
}

.gf-text-area .serial-done {
  color: var(--pf-correct);
  opacity: 0.6;
}

.gf-text-area .serial-current {
  background: var(--pf-item-bg);
  font-size: 20px;
}

.gf-text-area .serial-text {
  color: var(--pf-text-muted);
  font-size: 14px;
}

.gf-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pf-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

.gf-overlay h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--pf-text);
  margin-bottom: 12px;
}

.gf-overlay p {
  color: var(--pf-text-muted);
  font-size: 15px;
  margin-bottom: 24px;
  text-align: center;
  max-width: 360px;
}

.gf-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  width: 300px;
}

.gf-result-item {
  text-align: center;
  padding: 14px;
  background: var(--pf-item-bg);
  border-radius: 8px;
}

.gf-result-label {
  font-size: 12px;
  color: var(--pf-text-muted);
}

.gf-result-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--pf-accent);
}

.gf-rhythm-extra {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.gf-rhythm-stat {
  text-align: center;
  min-width: 60px;
}

.gf-rhythm-label {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.gf-rhythm-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--pf-text, #e2e8f0);
}

@media (max-width: 768px) {
  .gf-fullscreen .pf-body {
    padding: 8px 16px 10px;
  }

  .gf-text-area {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .gf-text-area {
    font-size: 18px;
    padding: 16px;
  }

  .gf-result-value {
    font-size: 22px;
  }
}

.typing-cta {
  padding: 48px 0;
  background: #f7f8fa;
}

.typing-cta .cta-card {
  background: linear-gradient(135deg, #165DFF 0%, #0E42D2 100%);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  color: #fff;
}

.typing-cta .cta-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.typing-cta .cta-card > p {
  font-size: 15px;
  opacity: 0.85;
  margin-bottom: 16px;
}

.typing-cta .cta-features {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 14px;
  opacity: 0.9;
}

.typing-cta .cta-card .btn {
  background: #fff;
  color: #165DFF;
  font-weight: 600;
}

@media (max-width: 768px) {
  .typing-cta .cta-card {
    padding: 32px 20px;
  }

  .typing-cta .cta-features {
    gap: 10px;
    font-size: 13px;
  }
}