/* ------------------------------
   Global Theme
------------------------------ */

:root {
  --bg-cream: #fff8ef;
  --bg-light: #fff3e0;
  --bg-card: #ffffff;
  --text-dark: #3a2f28;
  --text-muted: #8a7f78;

  --accent-orange: #ff9b5e;
  --accent-orange-dark: #e56f2d;
  --accent-gold: #ffd86b;

  --border-soft: #f1e2d2;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --shadow-soft: 0 6px 18px rgba(0,0,0,0.08);
  --shadow-strong: 0 12px 28px rgba(0,0,0,0.12);
}

* {
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-cream), var(--bg-light));
  color: var(--text-dark);
  padding-bottom: 80px;
}

/* ------------------------------
   Layout
------------------------------ */

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

/* ------------------------------
   Header
------------------------------ */

.app-header {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  background: var(--accent-gold);
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: #5a3d00;
  box-shadow: var(--shadow-soft);
}

.app-header h1 {
  margin: 0.6rem 0 0.3rem;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-orange-dark);
}

.app-header p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ------------------------------
   Cards
------------------------------ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-top: 1.2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-light);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
}

/* ------------------------------
   Forms
------------------------------ */

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

.field input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: #fffdf9;
  font-size: 1rem;
  transition: border 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.btn-primary {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
  color: white;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-strong);
  transition: transform 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.96);
}

/* ------------------------------
   Leaderboard
------------------------------ */

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

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  background: #fffdf9;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.leaderboard-item:hover {
  background: var(--bg-light);
}

.leaderboard-item:active {
  transform: scale(0.97);
}

.rank-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #5a3d00;
  margin-right: 0.7rem;
}

.rank-1 { background: linear-gradient(135deg, #ffe27a, #ffb347); }
.rank-2 { background: linear-gradient(135deg, #e0e0e0, #bdbdbd); }
.rank-3 { background: linear-gradient(135deg, #f6d365, #fda085); }

.bun-name {
  font-weight: 700;
  font-size: 1rem;
}

.bun-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lb-score {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-orange-dark);
}

.btn-share {
  background: var(--bg-light);
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--accent-orange-dark);
}

/* ------------------------------
   Modal
------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-strong);
  animation: pop 0.2s ease-out;
}

@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-emoji {
  font-size: 1.6rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-row {
  display: flex;
  justify-content: space-between;
  margin: 0.4rem 0;
}

.big-score .modal-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-orange-dark);
}

.btn-share-inline {
  background: var(--bg-light);
  border: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--accent-orange-dark);
  font-weight: 600;
}

/* ------------------------------
   Floating Admin Shield
------------------------------ */

.admin-shield {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: white;
  font-size: 1.8rem;
  border: none;
  box-shadow: var(--shadow-strong);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
  z-index: 200;
}

.admin-shield:active {
  transform: scale(0.92);
}
