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

body { font-family: Inter, sans-serif; background: #080c10; color: #e2e8f0; min-height: 100vh; }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

#loading { font-size: 18px; color: #f59e0b; display: flex; align-items: center; justify-content: center; min-height: 100vh; }

#auth-screen, #app { display: none; }

/* Auth */
.auth-box { background: #0f172a; border: 1px solid #1e293b; border-radius: 20px; padding: 36px 28px; width: 100%; max-width: 380px; }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-icon { font-size: 34px; letter-spacing: 6px; margin-bottom: 4px; }
.suit-b { color: #f1f5f9; }
.suit-r { color: #f87171; }

.logo-icon { width: 44px; height: 44px; background: #d97706; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; color: #fff; }
.auth-title { font-size: 24px; font-weight: 800; color: #f59e0b; }
.auth-sub { color: #64748b; font-size: 13px; margin-top: 4px; }
.auth-toggle { text-align: center; margin-top: 16px; font-size: 13px; color: #64748b; }

/* Form */
.field { margin-bottom: 14px; }
.field label { font-size: 11px; color: #94a3b8; font-weight: 700; letter-spacing: 1px; display: block; margin-bottom: 6px; }
input { background: #1e293b; border: 1px solid #334155; border-radius: 10px; color: #e2e8f0; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit; width: 100%; }
input:focus { border-color: #f59e0b; }

/* Buttons */
.btn { background: #065f46; color: #f59e0b; border: none; border-radius: 10px; padding: 10px 18px; cursor: pointer; font-weight: 700; font-size: 14px; font-family: inherit; white-space: nowrap; }
.btn-full { width: 100%; padding: 13px; font-size: 15px; }
.btn-gold { background: #92400e; color: #fbbf24; }
.lnk { color: #f59e0b; cursor: pointer; font-weight: 600; }

/* Messages */
.msg-err { color: #f87171; font-size: 13px; margin-top: 10px; text-align: center; }
.msg-ok  { color: #34d399; font-size: 13px; margin-top: 10px; text-align: center; }

/* App layout */
#app { flex-direction: column; align-items: center; }
.header { padding: 24px 20px 0; width: 100%; max-width: 700px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-title { font-size: 24px; font-weight: 800; color: #f59e0b; }
.logo-sub { font-size: 12px; color: #64748b; }
#btn-signout { background: none; border: none; color: #f87171; cursor: pointer; font-size: 12px; font-family: inherit; font-weight: 600; padding: 0; }

/* Nav */
.nav { display: flex; gap: 4px; padding: 16px 20px 0; overflow-x: auto; scrollbar-width: none; width: 100%; max-width: 700px; }
.navbtn { background: transparent; border: none; color: #64748b; padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
.navbtn.active { background: #065f46; color: #f59e0b; }
.content { padding: 16px; max-width: 700px; width: 100%; }

/* Cards */
.card { background: #0f172a; border: 1px solid #1e293b; border-radius: 16px; padding: 20px; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 700; color: #f1f5f9; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Stats grid */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: #1e293b; border: 1px solid #334155; border-radius: 14px; padding: 14px; text-align: center; }
.stat-icon { font-size: 26px; margin-bottom: 4px; }
.stat-val { font-size: 22px; font-weight: 800; color: #f59e0b; }
.stat-label { font-size: 11px; color: #64748b; margin-top: 2px; }

/* Player rows */
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #1e293b; }
.prow:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.pos { color: #34d399; font-weight: 700; }
.neg { color: #f87171; font-weight: 700; }
.neu { color: #94a3b8; font-weight: 700; }

/* Rankings */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 6px; background: #1e293b22; }
.rank-1 { background: #1a1200; border: 1px solid #f59e0b44; }

/* Misc */
.tag { display: inline-block; background: #1e293b; color: #94a3b8; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 2px 8px; }
.empty { text-align: center; padding: 36px 20px; color: #475569; }
.empty-icon { font-size: 48px; margin-bottom: 10px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.divider { height: 1px; background: #1e293b; margin: 12px 0; }
.sec-label { font-size: 11px; color: #64748b; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }

/* Round cards */
.rcard { background: #0f172a; border: 1px solid #1e293b; border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.rcard-header { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rcard-body { display: none; }
.rcard-body.open { display: block; }

/* Winner overlay */
#winner-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8); align-items: center; justify-content: center; z-index: 1000; }
#winner-overlay.show { display: flex; }
.winner-box { background: #0f172a; border: 2px solid #f59e0b; border-radius: 24px; padding: 40px 32px; text-align: center; max-width: 340px; width: 90%; animation: win-in .5s ease forwards, glow 2s ease infinite; }
.crown { font-size: 64px; display: inline-block; animation: spin 3s linear infinite; }
.w-label { font-size: 12px; font-weight: 700; color: #64748b; letter-spacing: 2px; margin: 12px 0 6px; }
.w-name { font-size: 30px; font-weight: 800; color: #f59e0b; }
.w-sub { color: #94a3b8; font-size: 14px; margin-top: 6px; }
.w-chips { font-size: 22px; font-weight: 800; color: #34d399; margin-top: 6px; }
.confetti-p { position: fixed; border-radius: 2px; pointer-events: none; z-index: 9999; animation: fall linear forwards; }
.chart-wrap { position: relative; height: 220px; margin-top: 8px; }

/* Animations */
@keyframes win-in {
  0%   { opacity: 0; transform: scale(.7); }
  60%  { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 30px rgba(245,158,11,.5); }
  50%       { box-shadow: 0 0 60px rgba(245,158,11,.8); }
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes fall {
  0%   { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
