@font-face {
  font-family: 'Homestead';
  font-display: auto;
  src: url('/1/public/fonts/Homestead-Regular.ttf');
}

html {
  height: 100%;
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  color: white;
  text-shadow: 0 0 2px black, 0 0 5px black;
}

body {
  background: #415353;
  padding: 0;
  margin: 0;
  font-size: 14px;
  overflow-x: hidden;
  min-height: 100%;
}

#wrapper {
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 40px;
}

h1 {
  font-size: 250%;
  margin-bottom: 5px;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h2 {
  font-size: 160%;
  margin-top: 30px;
  margin-bottom: 10px;
}

h3 {
  font-size: 120%;
  margin-top: 20px;
  margin-bottom: 8px;
}

a {
  color: #f89f34;
}

footer {
  margin: 30px auto 20px;
  color: #869886;
  text-align: center;
  width: 90%;
  max-width: 600px;
}

footer a { color: #869886; }

/* ---- Auth form ---- */

.auth-section {
  margin: 20px 0;
}

.auth-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 15px 0;
}

.auth-form input {
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 5px;
  box-sizing: border-box;
  width: 100%;
  max-width: 280px;
}

.auth-form input:focus {
  outline: 2px solid #f89f34;
}

.auth-form button {
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  background: #f89f34;
  color: black;
  text-shadow: none;
  cursor: pointer;
  transition: background 150ms;
}

.auth-form button:hover {
  background: #fbca8e;
}

.auth-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-fine-print {
  font-size: 11px;
  color: #869886;
  text-shadow: none;
  margin: 4px 0 0;
}

.auth-feedback {
  font-size: 13px;
  min-height: 20px;
  margin-top: 6px;
}

.auth-feedback.error { color: #ff6b6b; }
.auth-feedback.success { color: #69db7c; }

.auth-resend-link {
  background: none;
  border: none;
  color: #f89f34;
  cursor: pointer;
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
  margin-top: 4px;
}

.auth-resend-link:disabled {
  color: #869886;
  cursor: not-allowed;
  text-decoration: none;
}

/* ---- Profile ---- */

.profile-section {
  margin: 20px 0;
  text-align: left;
}

.profile-row {
  margin: 12px 0;
}

.profile-row label {
  display: block;
  font-size: 12px;
  color: #869886;
  text-shadow: none;
  margin-bottom: 4px;
}

.profile-row .profile-value {
  font-size: 15px;
}

.profile-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.profile-edit-row input {
  flex: 1;
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 5px;
}

.profile-edit-row button {
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  background: #f89f34;
  color: black;
  text-shadow: none;
  cursor: pointer;
  transition: background 150ms;
}

.profile-edit-row button:hover {
  background: #fbca8e;
}

.profile-edit-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Stats ---- */

.stats-section {
  margin: 30px 0;
}

.game-stats-card {
  background: rgba(127, 127, 127, 0.3);
  border-radius: 5px;
  padding: 15px;
  margin: 15px 0;
  text-align: left;
}

.game-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.game-stats-card h3 {
  margin: 0;
  flex: 1;
}

.play-now-btn {
  flex-shrink: 0;
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  background: #f89f34;
  color: black;
  text-decoration: none;
  text-shadow: none;
  transition: background 150ms;
}

.play-now-btn:hover {
  background: #fbca8e;
}

.game-stats-link {
  margin: 12px 0 0;
  font-size: 13px;
}

.game-stats-link a {
  text-decoration: underline;
}

.mode-stats {
  margin: 10px 0;
}

.mode-stats h4 {
  font-size: 100%;
  margin: 8px 0 6px;
  color: #f89f34;
  text-shadow: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 10px;
  text-align: center;
}

.stat-value {
  font-size: 22px;
  font-weight: 600;
}

.stat-label {
  font-size: 11px;
  color: #869886;
  text-shadow: none;
  margin-top: 2px;
}

/* ---- Badges ---- */

.badges-section {
  margin: 30px 0;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.badge-card {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 5px;
  padding: 12px 10px;
  text-align: center;
  transition: opacity 150ms;
}

.badge-card.locked {
  opacity: 0.35;
}

.badge-card.unlocked {
  opacity: 1;
}

.badge-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.badge-title {
  font-size: 13px;
  font-weight: 600;
}

.badge-desc {
  font-size: 11px;
  color: #869886;
  text-shadow: none;
  margin-top: 3px;
}

/* ---- Account actions ---- */

.account-actions {
  margin: 30px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-signout {
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 30px;
  border: none;
  border-radius: 5px;
  background: #f89f34;
  color: black;
  text-shadow: none;
  cursor: pointer;
  transition: background 150ms;
}

.btn-signout:hover {
  background: #fbca8e;
}

.danger-link {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}

.danger-zone {
  background: rgba(255, 80, 80, 0.15);
  border-radius: 5px;
  padding: 15px;
  margin: 10px 0;
  text-align: center;
}

.danger-zone p {
  font-size: 13px;
  margin: 8px 0;
}

.danger-zone button {
  font-family: 'Homestead', Arial, Helvetica, sans-serif;
  font-size: 13px;
  padding: 8px 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 4px;
  transition: background 150ms;
}

.btn-danger {
  background: #ff6b6b;
  color: white;
  text-shadow: none;
}

.btn-cancel {
  background: rgba(127, 127, 127, 0.5);
  color: white;
  text-shadow: none;
}

/* ---- Responsive ---- */

@media only screen and (max-width: 768px) {
  .auth-form {
    flex-direction: column;
    align-items: center;
  }

  .auth-form input {
    font-size: 16px;
    max-width: 100%;
  }

  .auth-form button {
    width: 100%;
    max-width: 280px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

[hidden] { display: none !important; }
