:root {
  --bg-page: #0f0f1a;
  --bg-card: rgba(22, 33, 62, 0.55);
  --bg-card-hover: rgba(26, 40, 72, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --accent: #e94560;
  --accent-hover: #ff5a78;
  --accent-gold: #f8d030;
  --text-primary: #e0e0e0;
  --text-secondary: #9a9ab0;
  --text-muted: #6a6a8a;
  --radius-sm: 6px;
  --radius-md: 10px;
  --font-body: 'Inter', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
}


.app-header {
  padding: 0.65rem 1rem 0.75rem;
  width: 100%;
  z-index: 10;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-align: left;
}

.app-header__pokeball {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #2a2a3a;
  background: linear-gradient(180deg, var(--accent) 50%, #f5f5f5 50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35) inset;
  position: relative;
}
.app-header__pokeball::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2px solid #2a2a3a;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.app-header__titles { min-width: 0; }

.app-header__label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.2rem;
}

.app-header__title {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.35;
  word-break: break-all;
}

.app-header__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn--active {
  border-color: rgba(248, 208, 48, 0.55);
  color: var(--accent-gold);
  background: rgba(248, 208, 48, 0.12);
}

.btn--twitch {
  background: #9146ff;
  border-color: #9146ff;
  color: #fff;
  font-weight: 600;
}
.btn--twitch:hover {
  background: #a970ff;
  border-color: #a970ff;
  color: #fff;
}
.btn--twitch:focus-visible {
  outline-color: #a970ff;
}


.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}


.toast-container {
  position: fixed;
  z-index: 100;
  max-width: min(90vw, 22rem);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #f0f0f0;
  text-align: center;
  background: rgba(20, 20, 32, 0.92);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}


.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c73e54, var(--accent));
  transition: width 0.35s ease-out;
}


.public-login-gate {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin: 2.25rem auto 1.75rem;
  padding: 3rem 2.25rem;
  min-height: min(42vh, 380px);
  max-width: 36rem;
  width: calc(100% - 2rem);
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.public-login-gate .input-label {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  color: var(--accent-gold);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.public-login-gate .state-login-gate__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-primary);
  max-width: 28em;
}

@media (max-width: 520px) {
  .public-login-gate {
    min-height: min(30vh, 240px);
    padding: 2rem 1.25rem;
    margin: 1.5rem auto 1rem;
    gap: 1.75rem;
  }
  .public-login-gate .input-label {
    font-size: 0.62rem;
  }
  .public-login-gate .state-login-gate__text {
    font-size: 0.88rem;
  }
}


@media (max-width: 520px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .app-header__brand  { order: 1; }
  .app-header__actions {
    order: 3;
    width: 100%;
    justify-content: stretch;
    flex-direction: column;
  }
  .app-header__actions .btn {
    width: 100%;
  }
}
