:root {
  --bg: #fbfbfd;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #424245;
  --accent-hover: #2c2c2e;
  --border: #d2d2d7;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 4px 20px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

.hidden { display: none !important; }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 48px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}

.challenge-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 72px 56px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 56px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow 0.4s ease, transform 0.4s ease;
  animation: cardIn 0.6s ease-out both;
}

.challenge-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.challenge-text.fade,
.photographer.fade,
.date-label.fade {
  animation: fadeIn 0.45s ease-out both;
}

h1 {
  animation: cardIn 0.5s ease-out both;
}

.photographer {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 24px;
}

.challenge-text {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 auto 48px;
  letter-spacing: -0.02em;
  max-width: 640px;
}

.actions { margin-top: 32px; display: flex; justify-content: center; }

.date-label {
  font-size: 13px;
  color: var(--muted);
  margin: 32px 0 0;
  letter-spacing: 0.02em;
}

button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 980px;
  padding: 14px 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.primary:active { transform: scale(0.96); transition: transform 0.1s ease; }

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost:hover { color: var(--text); }

.custom {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

#addForm {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

input[type="text"], input[type="password"] {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}

input:focus { border-color: var(--accent); }

#customList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#customList li {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

#customList li button {
  font-size: 13px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
}

#customList li button:hover { color: #e30000; }

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

.login form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login h1 {
  text-align: center;
  margin-bottom: 16px;
}

.error {
  color: #e30000;
  font-size: 13px;
  margin: 0;
  text-align: center;
  min-height: 18px;
}

@media (max-width: 600px) {
  main { padding: 32px 16px 64px; }
  header { margin-bottom: 32px; }
  h1 { font-size: 24px; }
  .challenge-card {
    padding: 48px 24px;
    min-height: 280px;
    margin-bottom: 32px;
  }
  .challenge-text { font-size: 22px; margin-bottom: 32px; }
  .photographer { margin-bottom: 20px; font-size: 12px; }
  .custom { padding: 24px; }
  #addForm { flex-direction: column; }
  #addForm button { width: 100%; }
  button { padding: 14px 24px; }
}

@media (min-width: 1024px) {
  .challenge-text { font-size: 36px; }
  .challenge-card { padding: 88px 64px; min-height: 420px; }
}
