* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #c9623f 100%);
  background-attachment: fixed;
  color: #e8e0f0; min-height: 100vh;
  padding: 20px; display: flex; justify-content: center;
}
.app { width: 100%; max-width: 900px; }

h1 {
  text-align: center; font-size: 36px; margin-bottom: 8px;
  background: linear-gradient(90deg, #ffd166, #f4a259, #c9623f, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { text-align: center; font-size: 14px; color: #b8a8c8; margin-bottom: 30px; }

/* ВХОД */
.auth-screen {
  max-width: 420px; margin: 60px auto 0;
  background: rgba(30, 20, 50, 0.6);
  border: 1px solid rgba(200, 160, 220, 0.3);
  border-radius: 20px; padding: 32px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.auth-screen h1 { font-size: 30px; margin-bottom: 8px; }
.auth-screen .sub { font-size: 13px; color: #b8a8c8; margin-bottom: 24px; }
.auth-screen input {
  width: 100%; padding: 14px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 160, 220, 0.3);
  border-radius: 10px; color: #e8e0f0;
  font-size: 15px; font-family: inherit;
  margin-bottom: 12px;
}
.auth-screen input:focus {
  outline: none; border-color: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.2);
}
.auth-screen button {
  width: 100%; padding: 14px;
  background: #fbbf24; color: #2a2410;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  margin-bottom: 8px;
}
.auth-screen button:hover { background: #fcd34d; }
.auth-screen button.secondary {
  background: transparent; color: #b8a8c8;
  border: 1px solid rgba(200, 160, 220, 0.3);
  font-weight: 500;
}
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ПЛИТКИ */
.games-screen { display: none; }
.games-screen.active { display: block; }
.user-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(30, 20, 50, 0.5);
  border: 1px solid rgba(200, 160, 220, 0.2);
  border-radius: 12px; padding: 12px 18px;
  margin-bottom: 24px; font-size: 14px;
}
.user-bar .nick { color: #ffd166; font-weight: 700; }
.user-bar .label { color: #b8a8c8; font-size: 12px; margin-right: 8px; }
.user-bar button {
  background: transparent; color: #b8a8c8;
  border: 1px solid rgba(200, 160, 220, 0.3);
  border-radius: 8px; padding: 6px 14px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.user-bar button:hover { background: rgba(200, 160, 220, 0.1); }

.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.tile {
  display: block;
  flex: 0 0 280px;
  max-width: 280px;
  background: rgba(30, 20, 50, 0.6);
  border: 1px solid rgba(200, 160, 220, 0.25);
  border-radius: 16px;
  padding: 28px 20px;
  text-decoration: none;
  color: #e8e0f0;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.tile:hover {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 209, 102, 0.15);
}
.tile .icon { font-size: 56px; line-height: 1; margin-bottom: 12px; display: block; }
.tile .name { font-size: 18px; font-weight: 700; color: #ffd166; margin-bottom: 6px; }
.tile .desc { font-size: 12px; color: #b8a8c8; line-height: 1.4; }

.tile.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.tile .badge {
  display: inline-block;
  font-size: 10px;
  background: #a855f7;
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rating-card {
  background: rgba(30, 20, 50, 0.5);
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 16px; padding: 16px 18px;
  margin-bottom: 24px; backdrop-filter: blur(8px);
}
.rating-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.rating-title {
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  color: #ffd166; text-transform: uppercase;
}
.rating-toggle {
  background: transparent; color: #b8a8c8;
  border: 1px solid rgba(200, 160, 220, 0.3);
  border-radius: 8px; padding: 4px 10px;
  font-size: 11px; cursor: pointer; font-family: inherit;
}
.rating-toggle:hover { background: rgba(200, 160, 220, 0.1); color: #d8c8e8; }
.rating-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 6px;
  border-left: 3px solid transparent;
}
.rating-row:last-child { margin-bottom: 0; }
.rating-row.gold { border-left-color: #ffd166; }
.rating-row.silver { border-left-color: #c0c0c0; }
.rating-row.bronze { border-left-color: #cd7f32; }
.rating-row.me {
  background: rgba(255, 209, 102, 0.12);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.15);
}
.rating-row.extra { margin-top: 6px; border-top: 1px dashed rgba(200, 160, 220, 0.2); padding-top: 10px; }
.rating-place { font-size: 18px; min-width: 32px; text-align: center; }
.rating-nick { flex: 1; font-size: 14px; font-weight: 700; color: #e8e0f0; }
.rating-row.me .rating-nick { color: #ffd166; }
.rating-you {
  font-size: 9px; font-weight: 700;
  background: #ffd166; color: #2a2410;
  padding: 2px 6px; border-radius: 6px;
  margin-left: 6px; text-transform: uppercase;
}
.rating-stats { display: flex; gap: 12px; font-size: 11px; color: #b8a8c8; flex-wrap: wrap; justify-content: flex-end; }
.rating-stat { text-align: center; min-width: 38px; }
.rating-stat .v { font-size: 13px; font-weight: 700; color: #e8e0f0; display: block; }
.rating-stat .n { font-size: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.rating-stat.gold .v { color: #ffd166; }
.rating-stat.streak .v { color: #60a5fa; }
.rating-empty { color: #8a7a9a; font-size: 12px; font-style: italic; text-align: center; padding: 8px; }
