/* ===== DAOSHI TYPING - PIXEL ART RETRO STYLE ===== */

:root {
  --purple-dark: #1a0d24;
  --purple-deep: #2d1b3d;
  --purple-medium: #4a2d5a;
  --purple-vibrant: #9933ff;
  --purple-light: #b366ff;
  --magenta: #ff1493;
  --pink: #ff69b4;
  --gold: #ffd700;
  --gold-amber: #ffbf00;
  --text-color: #f5f5f5;
  --bg-dark: #0a0612;
  --success: #00ff88;
  --error: #ff3366;
  --warning: #ffaa00;
}

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

body {
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--purple-dark) 50%, var(--purple-deep) 100%);
  color: var(--text-color);
  height: 100vh;
  overflow: hidden;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

/* Scanlines effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(10px); }
}

/* ===== MODAL ===== */
.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple-dark));
  border: 4px solid var(--purple-vibrant);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(153, 51, 255, 0.5);
  animation: slideUp 0.4s ease;
  position: relative;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--purple-medium);
}

.modal-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 18px;
  background: linear-gradient(135deg, var(--gold), var(--purple-vibrant));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 32px;
  cursor: pointer;
  transition: all 0.3s;
  line-height: 1;
  padding: 0;
  width: 40px;
  height: 40px;
}

.modal-close:hover {
  color: var(--error);
  transform: rotate(90deg);
}

/* ===== AUTH MODAL ===== */
.auth-modal {
  max-width: 450px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: rgba(153, 51, 255, 0.2);
  border: 2px solid var(--purple-medium);
  color: var(--text-color);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.auth-tab:hover {
  border-color: var(--purple-vibrant);
  background: rgba(153, 51, 255, 0.3);
}

.auth-tab.active {
  background: var(--purple-vibrant);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(153, 51, 255, 0.6);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--gold);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(26, 13, 36, 0.8);
  border: 2px solid var(--purple-medium);
  border-radius: 10px;
  color: var(--text-color);
  font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--purple-vibrant);
  box-shadow: 0 0 20px rgba(153, 51, 255, 0.4);
}

.form-group small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--pink);
  opacity: 0.8;
}

.auth-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 11px;
}

.auth-btn.primary {
  background: linear-gradient(135deg, var(--purple-vibrant), var(--magenta));
  color: var(--text-color);
  border: 3px solid var(--gold);
  box-shadow: 0 6px 20px rgba(153, 51, 255, 0.4);
}

.auth-btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(153, 51, 255, 0.6);
}

.auth-btn.google {
  background: white;
  color: #444;
  border: 2px solid #ddd;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}

.auth-btn.google img {
  width: 20px;
  height: 20px;
}

.auth-btn.google:hover {
  background: #f8f8f8;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: var(--text-color);
  opacity: 0.5;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--purple-medium);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.auth-error {
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 51, 102, 0.2);
  border: 2px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-size: 12px;
  text-align: center;
  display: none;
}

.auth-error.show {
  display: block;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ===== HEADER ===== */
.header {
  background: rgba(26, 13, 36, 0.95);
  border-bottom: 4px solid var(--purple-vibrant);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(153, 51, 255, 0.3);
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.logo {
  font-family: 'Press Start 2P', cursive;
  font-size: 20px;
  background: linear-gradient(135deg, var(--gold), var(--purple-vibrant), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
  }
}

.tagline {
  font-size: 11px;
  color: var(--pink);
  opacity: 0.9;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(153, 51, 255, 0.2);
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--purple-vibrant);
}

.user-avatar {
  font-size: 24px;
}

.user-name {
  font-weight: 600;
  color: var(--gold);
  font-size: 14px;
}

.btn-logout {
  padding: 8px 16px;
  background: rgba(255, 51, 102, 0.2);
  border: 2px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: var(--error);
  color: white;
  transform: translateY(-2px);
}

/* ===== NAVIGATION ===== */
.nav-tabs {
  display: flex;
  gap: 15px;
  padding: 20px 40px;
  background: rgba(45, 27, 61, 0.5);
  border-bottom: 2px solid var(--purple-medium);
}

.nav-tab {
  padding: 12px 25px;
  background: rgba(153, 51, 255, 0.2);
  border: 2px solid var(--purple-medium);
  border-radius: 10px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
}

.nav-tab:hover {
  border-color: var(--purple-vibrant);
  background: rgba(153, 51, 255, 0.3);
  transform: translateY(-2px);
}

.nav-tab.active {
  background: var(--purple-vibrant);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(153, 51, 255, 0.6);
}

/* ===== APP LAYOUT ===== */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== SECTIONS ===== */
.section {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.section.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}

.section-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 18px;
  text-align: center;
  margin-bottom: 30px;
  background: linear-gradient(135deg, var(--gold), var(--purple-vibrant));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== GAME SECTION ===== */
#gameSection {
  gap: 20px;
}

/* Mode Selector */
.mode-selector {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.mode-btn {
  padding: 14px 35px;
  background: rgba(153, 51, 255, 0.1);
  border: 3px solid var(--purple-medium);
  border-radius: 12px;
  color: var(--text-color);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
}

.mode-btn:hover {
  border-color: var(--purple-vibrant);
  background: rgba(153, 51, 255, 0.2);
  transform: translateY(-2px);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--purple-vibrant), var(--magenta));
  border-color: var(--gold);
  box-shadow: 0 0 25px rgba(153, 51, 255, 0.7);
  transform: translateY(-2px) scale(1.05);
}

.time-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.time-btn {
  padding: 12px 28px;
  background: rgba(153, 51, 255, 0.15);
  border: 2px solid var(--purple-medium);
  border-radius: 10px;
  color: var(--text-color);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'JetBrains Mono', monospace;
}

.time-btn:hover {
  border-color: var(--purple-vibrant);
  background: rgba(153, 51, 255, 0.25);
  transform: scale(1.05);
}

.time-btn.active {
  background: var(--purple-vibrant);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(153, 51, 255, 0.6);
  transform: scale(1.1);
}

/* Play Button Container */
.play-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.play-container.hidden {
  display: none;
}

.btn-play {
  padding: 20px 50px;
  background: linear-gradient(135deg, var(--gold), var(--gold-amber));
  border: 4px solid var(--purple-vibrant);
  border-radius: 15px;
  color: var(--purple-dark);
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Press Start 2P', cursive;
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
  animation: pulse 2s infinite;
}

.btn-play:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.8);
}

.btn-play:active {
  transform: scale(0.95);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 8px 35px rgba(255, 215, 0, 0.9);
  }
}

.play-hint {
  font-size: 11px;
  color: var(--pink);
  opacity: 0.8;
  font-family: 'JetBrains Mono', monospace;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.stat-item {
  background: rgba(45, 27, 61, 0.5);
  border: 2px solid var(--purple-medium);
  border-radius: 12px;
  padding: 15px 25px;
  text-align: center;
  min-width: 120px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 5px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  font-family: 'Press Start 2P', cursive;
}

.stat-label {
  font-size: 11px;
  color: var(--pink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.words-container {
  background: rgba(26, 13, 36, 0.7);
  border: 3px solid var(--purple-vibrant);
  border-radius: 15px;
  padding: 30px 40px;
  max-width: 900px;
  width: 100%;
  height: 180px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  align-content: flex-start;
  justify-content: flex-start;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 8px 30px rgba(153, 51, 255, 0.25);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.word {
  display: inline-block;
  position: relative;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
}

.word.current {
  color: var(--text-color);
  text-shadow: 0 0 15px rgba(153, 51, 255, 0.8);
  transform: scale(1.1);
}

.word.correct {
  color: var(--success);
  opacity: 0.4;
}

.word.wrong {
  color: var(--error);
  text-decoration: line-through;
  opacity: 0.4;
}

.letter {
  display: inline-block;
  transition: all 0.1s;
}

.letter.correct {
  color: var(--success);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.letter.wrong {
  color: var(--error);
  background: rgba(255, 51, 102, 0.2);
  animation: wrongShake 0.3s ease;
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.input-container {
  max-width: 700px;
  width: 100%;
}

.word-input {
  width: 100%;
  padding: 18px 25px;
  background: rgba(26, 13, 36, 0.8);
  border: 3px solid var(--purple-vibrant);
  border-radius: 15px;
  color: var(--text-color);
  font-size: 24px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  transition: all 0.3s;
}

.word-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.word-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-reset {
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--purple-vibrant), var(--magenta));
  border: 3px solid var(--gold);
  border-radius: 12px;
  color: var(--text-color);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Press Start 2P', cursive;
  font-size: 11px;
  box-shadow: 0 6px 20px rgba(153, 51, 255, 0.4);
}

.btn-reset:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(153, 51, 255, 0.6);
}

/* ===== STATS SECTION ===== */
.stats-container {
  max-width: 1000px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.records-card {
  background: rgba(45, 27, 61, 0.6);
  border: 3px solid var(--purple-medium);
  border-radius: 15px;
  padding: 25px 30px 30px;
  margin-bottom: 40px;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.record-item {
  background: rgba(153, 51, 255, 0.08);
  border: 2px dashed var(--purple-medium);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.record-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 1px;
}

.record-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Press Start 2P', cursive;
}

.record-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.stats-card {
  background: rgba(45, 27, 61, 0.6);
  border: 3px solid var(--purple-medium);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s;
}

.stats-card:hover {
  border-color: var(--purple-vibrant);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(153, 51, 255, 0.4);
}

.stats-icon {
  font-size: 48px;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 10px var(--purple-vibrant));
}

.stats-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  font-family: 'Press Start 2P', cursive;
}

.stats-label {
  font-size: 13px;
  color: var(--pink);
  font-weight: 600;
  text-transform: uppercase;
}

.chart-container {
  background: rgba(45, 27, 61, 0.6);
  border: 3px solid var(--purple-medium);
  border-radius: 15px;
  padding: 30px;
}

.chart-title {
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 20px;
  text-align: center;
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
}

#progressChart {
  max-height: 300px;
}

/* ===== RANKING SECTION ===== */
.ranking-container {
  max-width: 1000px;
  margin: 0 auto;
}

.ranking-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 12px 25px;
  background: rgba(153, 51, 255, 0.2);
  border: 2px solid var(--purple-medium);
  border-radius: 10px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover {
  border-color: var(--purple-vibrant);
  background: rgba(153, 51, 255, 0.3);
}

.filter-btn.active {
  background: var(--purple-vibrant);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(153, 51, 255, 0.6);
}

.ranking-table {
  background: rgba(45, 27, 61, 0.6);
  border: 3px solid var(--purple-medium);
  border-radius: 15px;
  overflow: hidden;
}

.ranking-header {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px 120px;
  gap: 15px;
  padding: 20px 25px;
  background: var(--purple-vibrant);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ranking-list {
  max-height: 600px;
  overflow-y: auto;
}

.ranking-item {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px 120px;
  gap: 15px;
  padding: 20px 25px;
  border-bottom: 2px solid var(--purple-medium);
  transition: all 0.3s;
  align-items: center;
}

.ranking-item:hover {
  background: rgba(153, 51, 255, 0.2);
}

.ranking-item:nth-child(1) {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
}

.ranking-item:nth-child(2) {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.15), transparent);
}

.ranking-item:nth-child(3) {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.15), transparent);
}

.rank-col {
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
}

.player-col {
  font-weight: 600;
  color: var(--text-color);
}

.wpm-col {
  font-weight: 700;
  color: var(--success);
  font-size: 16px;
}

.accuracy-col {
  color: var(--pink);
  font-weight: 600;
}

.date-col {
  font-size: 12px;
  opacity: 0.7;
}

.no-data {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-color);
  opacity: 0.6;
  font-size: 16px;
}

/* ===== HISTORY SECTION ===== */
.history-container {
  max-width: 1000px;
  margin: 0 auto;
}

.history-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.btn-clear-history {
  padding: 12px 25px;
  background: rgba(255, 51, 102, 0.2);
  border: 2px solid var(--error);
  border-radius: 10px;
  color: var(--error);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-clear-history:hover {
  background: var(--error);
  color: white;
  transform: translateY(-2px);
}

.history-list {
  display: grid;
  gap: 15px;
}

.history-item {
  background: rgba(45, 27, 61, 0.6);
  border: 3px solid var(--purple-medium);
  border-radius: 15px;
  padding: 25px;
  display: grid;
  grid-template-columns: 100px 1fr 100px 100px 100px 150px;
  gap: 20px;
  align-items: center;
  transition: all 0.3s;
}

.history-item:hover {
  border-color: var(--purple-vibrant);
  transform: translateX(5px);
  box-shadow: 0 5px 20px rgba(153, 51, 255, 0.3);
}

.history-time {
  font-weight: 700;
  color: var(--gold);
  font-size: 16px;
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
}

.history-wpm {
  font-weight: 700;
  color: var(--success);
  font-size: 24px;
}

.history-accuracy {
  color: var(--pink);
  font-weight: 600;
}

.history-words {
  font-size: 14px;
  opacity: 0.8;
}

.history-date {
  font-size: 12px;
  opacity: 0.6;
}

/* ===== RESULT MODAL ===== */
.result-modal {
  max-width: 600px;
}

.result-content {
  padding: 20px 0;
}

.result-main {
  text-align: center;
  margin-bottom: 40px;
}

.result-wpm {
  background: linear-gradient(135deg, var(--purple-vibrant), var(--magenta));
  border: 4px solid var(--gold);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(153, 51, 255, 0.5);
}

.result-value {
  font-family: 'Press Start 2P', cursive;
  font-size: 64px;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  margin-bottom: 15px;
}

.result-label {
  font-size: 16px;
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.result-details {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  background: rgba(153, 51, 255, 0.2);
  border: 2px solid var(--purple-medium);
  border-radius: 10px;
}

.result-item-label {
  font-weight: 600;
  color: var(--pink);
}

.result-item-value {
  font-weight: 700;
  color: var(--gold);
}

.result-message {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(153, 51, 255, 0.15));
  border: 2px solid var(--gold);
  border-radius: 12px;
  margin-bottom: 30px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
  line-height: 2;
}

.result-actions {
  display: grid;
  gap: 12px;
}

.btn-result {
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Press Start 2P', cursive;
  font-size: 11px;
}

.btn-result.primary {
  background: linear-gradient(135deg, var(--purple-vibrant), var(--magenta));
  color: var(--text-color);
  border: 3px solid var(--gold);
  box-shadow: 0 6px 20px rgba(153, 51, 255, 0.4);
}

.btn-result.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(153, 51, 255, 0.6);
}

.btn-result.secondary {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
  border: 2px solid var(--gold);
}

.btn-result.secondary:hover {
  background: var(--gold);
  color: var(--purple-dark);
  transform: translateY(-2px);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 20px 30px;
  background: rgba(26, 13, 36, 0.98);
  border: 3px solid var(--success);
  border-radius: 12px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0, 255, 136, 0.4);
  transform: translateX(400px);
  transition: transform 0.4s ease;
  z-index: 10001;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  border-color: var(--error);
  box-shadow: 0 8px 32px rgba(255, 51, 102, 0.4);
}

.toast.warning {
  border-color: var(--warning);
  box-shadow: 0 8px 32px rgba(255, 170, 0, 0.4);
}

/* ===== LOADING STATE ===== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  font-size: 16px;
  color: var(--text-color);
  opacity: 0.7;
}

.loading::after {
  content: '...';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* ===== HIGHLIGHT USER ===== */
.ranking-item.highlight {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent);
  border: 2px solid var(--gold);
  animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-tabs {
    padding: 15px 20px;
    flex-wrap: wrap;
  }
  
  .section {
    padding: 20px;
  }
  
  .time-btn {
    padding: 12px 25px;
    font-size: 16px;
  }
  
  .game-stats {
    grid-template-columns: 1fr;
  }
  
  .words-container {
    font-size: 22px;
    padding: 25px;
  }
  
  .word-input {
    font-size: 20px;
  }
  
  .ranking-header,
  .ranking-item {
    grid-template-columns: 50px 1fr 80px;
    font-size: 12px;
  }
  
  .accuracy-col,
  .date-col {
    display: none;
  }
  
  .history-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .result-value {
    font-size: 48px;
  }
  
  .logo {
    font-size: 16px;
  }
  
  .toast {
    right: 20px;
    bottom: 20px;
    left: 20px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(153, 51, 255, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(153, 51, 255, 0.6);
}

/* Scrollbar especial para container de palavras */
.words-container::-webkit-scrollbar {
  width: 6px;
}

.words-container::-webkit-scrollbar-thumb {
  background: rgba(153, 51, 255, 0.3);
  border-radius: 3px;
}

.words-container::-webkit-scrollbar-thumb:hover {
  background: rgba(153, 51, 255, 0.5);
}
