@import 'shared.css';

.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ——— Login ——— */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  padding: 2.5rem 2rem;
  animation: rise-in 0.5s ease both;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--lime) 0%, var(--lime-dim) 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.login-brand h1 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.login-brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink-border);
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.login-footer a {
  margin: 0 0.4rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  animation: rise-in 0.3s ease both;
}

.alert-error {
  background: rgba(255, 92, 122, 0.1);
  border: 1px solid rgba(255, 92, 122, 0.3);
  color: var(--danger);
}

/* ——— Dashboard ——— */

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  animation: rise-in 0.4s ease both;
}

.dashboard-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.dashboard-header .subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.header-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.header-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ink-border);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.panel {
  padding: 1.5rem;
  animation: rise-in 0.5s ease both;
}

.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }
.panel:nth-child(5) { animation-delay: 0.2s; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  font-size: 1.1rem;
}

.panel-wide {
  grid-column: 1 / -1;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat {
  flex: 1;
  min-width: 100px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ink-border);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.field {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--lime);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inline-form .input {
  flex: 1;
  min-width: 140px;
}

.inline-form select {
  width: auto;
  min-width: 110px;
}

.data-block {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--ink-border);
  font-size: 0.78rem;
  overflow-x: auto;
  max-height: 180px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.twitch-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  font-size: 0.88rem;
}

.twitch-line + .twitch-line {
  border-top: 1px solid var(--ink-border);
}

.wordlist-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.35rem;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ink-border);
  list-style: none;
}

.wordlist-preview li {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ink-border);
  font-size: 0.88rem;
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-list .rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-dim);
}

.leaderboard-list li:nth-child(1) .rank { color: #ffd700; }
.leaderboard-list li:nth-child(2) .rank { color: #c8c8c8; }
.leaderboard-list li:nth-child(3) .rank { color: #cd7f32; }

.leaderboard-list .pts {
  color: var(--lime);
  font-weight: 600;
}

.empty-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
}

.file-input {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-border-strong);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 220px;
}

.file-input:hover {
  border-color: var(--lime-dim);
  background: rgba(0, 0, 0, 0.45);
}

.file-input input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-input-btn {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  background: rgba(200, 245, 66, 0.12);
  border: 1px solid rgba(200, 245, 66, 0.25);
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.file-input-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.template-info {
  margin-bottom: 1rem;
}

.template-hint {
  margin: 0.5rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
