@import url("https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&family=Nunito:wght@300;400;600;700&display=swap");

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

/* -------------------------------------------------------
   SOLID BACKGROUND (IOS-SAFE, NO GRADIENTS)
--------------------------------------------------------*/

html {
  background-color: #3c0505 !important;
  color-scheme: dark;
  height: 100%;
  min-height: 100dvh;
  position: relative;
}

body {
  background: transparent !important;
  min-height: 100dvh;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: #f9f2e8;
  overflow-x: hidden;

  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

@supports (-webkit-touch-callout: none) {
  html, body {
    height: -webkit-fill-available;
    min-height: -webkit-fill-available;
  }
}

/* -------------------------------------------------------
   APP LAYOUT
--------------------------------------------------------*/

.app-shell {
  min-height: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 1.2rem 0.8rem 4rem;
}

.app-header {
  text-align: center;
  padding: 0.4rem 0.2rem 0.8rem;
}

.title {
  font-family: "Mountains of Christmas", cursive;
  font-size: 2.1rem;
  color: #ffe8a3;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  color: #f7dfcd;
}

/* -------------------------------------------------------
   PRALINES LIST
--------------------------------------------------------*/

.praline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.6rem;
}

.praline-card {
  background: #122103;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.65);
  border: 1px solid rgba(255,234,199,0.2);
}

.praline-image {
  overflow: hidden;
  max-height: 275px;
}

.praline-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.praline-title {
  font-family: "Mountains of Christmas", cursive;
  color: #ffe9c8;
  font-size: 1.7rem;
  margin: 0.15rem 0 0.55rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.praline-body {
  padding: 0.9rem 1.1rem 1.1rem;
}

/* -------------------------------------------------------
   RATING
--------------------------------------------------------*/

.rating-panel {
  margin-top: 0.9rem;
  padding: 0.75rem 0.7rem;
  border-radius: 1.2rem;
  background: #2a0505;
  border: 1px solid rgba(255,215,160,0.28);
}

.stars {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.star-btn {
  font-size: 1.7rem;
  background: none;
  border: none;
  padding: 0.05rem;
  cursor: pointer;
  color: #777;
  transition: transform 0.08s ease, color 0.15s ease;
}

.star-btn:hover,
.star-btn:active {
  transform: scale(1.15);
}

.star-btn.active {
  color: #ffcc4a;
  text-shadow: 0 0 10px rgba(255,204,74,0.8);
}

/* -------------------------------------------------------
   FOOTER + BUTTONS
--------------------------------------------------------*/

.app-footer {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.admin-link {
  font-size: 0.8rem;
  text-decoration: none;
  color: #ffe8a3;
  opacity: 0.8;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-primary {
  background: #ff9c2e;
  color: #3a0902;
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
  width: 100%;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255,229,189,0.6);
  color: #ffe8c0;
}

/* Full-width bigger confirm button */
.confirm-btn {
  width: 100%;
  padding-block: 1.1rem;
  padding-inline: 1.2rem;
  font-size: 0.9rem;
}

.confirm-btn:disabled {
  opacity: 0.4;
}

/* -------------------------------------------------------
   LOGIN + ADMIN
--------------------------------------------------------*/

.login-section,
.leaderboard-section {
  position: relative;
}

.login-card {
  margin-top: 0.8rem;
  padding: 1.1rem 1.2rem 1.3rem;
  background: #122103;
  border-radius: 1.3rem;
  border: 1px solid rgba(255,217,173,0.35);
  box-shadow: 0 8px 18px rgba(0,0,0,0.7);
}

.login-card h2 {
  margin: 0 0 0.8rem;
  font-family: "Mountains of Christmas", cursive;
  color: #ffe9b4;
}

.field {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}

.field span {
  margin-bottom: 0.25rem;
}

.field input {
  border-radius: 0.7rem;
  border: 1px solid rgba(255,234,200,0.5);
  padding: 0.45rem 0.6rem;
  background: #200202;
  color: #fff3dd;
  font-size: 0.95rem;
}

.field input:focus {
  outline: 2px solid rgba(255,219,160,0.7);
}

.error-msg {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #ffb3b3;
}

.hidden {
  display: none;
}

/* -------------------------------------------------------
   LEADERBOARD
--------------------------------------------------------*/

.leaderboard-header {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-family: "Mountains of Christmas", cursive;
  color: #ffe7a5;
}

.leaderboard-list {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.leaderboard-card {
  padding: 0.75rem 0.95rem;
  background: #122103;
  border-radius: 1.2rem;
  border: 1px solid rgba(255,224,189,0.3);
  box-shadow: 0 8px 16px rgba(0,0,0,0.7);
}

.leaderboard-top-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-name {
  font-family: "Mountains of Christmas", cursive;
  font-size: 1.15rem;
  color: #fff0d9;
}

.leaderboard-rank {
  font-size: 0.95rem;
  color: rgba(255,236,194,0.7);
}

.score-row {
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.score-main {
  font-size: 1.5rem;
  font-weight: 700;
}

.score-main span {
  font-size: 0.9rem;
  opacity: 0.9;
}

.score-votes {
  font-size: 0.85rem;
  opacity: 0.85;
}

.score-bar {
  margin-top: 0.45rem;
  height: 7px;
  border-radius: 999px;
  background: #2a0505;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffbe3c, #ff7a3c);
}

/* -------------------------------------------------------
   THANK YOU PAGE + FEEDBACK
--------------------------------------------------------*/

.rated-card {
  padding: 1.4rem 1.2rem;
}

.rated-heading {
  margin: 0 0 0.6rem;
  font-family: "Mountains of Christmas", cursive;
  font-size: 1.25rem;
  color: #ffe9c4;
  text-align: center;
}

.rated-text {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #ffefe1;
}

.rated-text.muted {
  opacity: 0.85;
}

/* Feedback textarea */
.feedback-textarea {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(255,234,200,0.5);
  padding: 0.6rem 0.7rem;
  background: #200202;
  color: #fff3dd;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 120px;
}

.feedback-textarea::placeholder {
  color: rgba(255,240,220,0.6);
}

.feedback-textarea:focus {
  outline: 2px solid rgba(255,219,160,0.7);
}

/* Feedback shown in admin voter details */
.voter-feedback {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255,220,180,0.4);
}

.voter-feedback-label {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.2rem;
  color: #ffd89a;
}

.voter-feedback-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ffeede;
}

/* -------------------------------------------------------
   WELCOME IMAGE
--------------------------------------------------------*/

.app-header .welcome-icon {
  width: 350px !important;
  height: 271px !important;
  object-fit: contain;
  margin: 0 auto 0.6rem;
}

/* -------------------------------------------------------
   ADMIN — VOTER LIST
--------------------------------------------------------*/

.voter-card {
  cursor: default;
}

.voter-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.voter-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.voter-meta {
  font-size: 0.75rem;
  opacity: 0.75;
  white-space: nowrap;
}

.voter-toggle {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
}

.voter-details {
  margin-top: 0.5rem;
  display: none;
}

.leaderboard-card.open .voter-details {
  display: block;
}

.voter-praline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.voter-praline-name {
  font-size: 0.85rem;
}

.voter-stars .star-btn {
  font-size: 1.1rem;
  cursor: default;
  pointer-events: none;
}

.voter-empty {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* -------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------*/

@media (max-width: 768px) {
  html {
    background-attachment: scroll;
  }
}

@media (min-width: 500px) {
  .app-shell {
    max-width: 520px;
  }
}
