/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --boy-blue: #6cb4ee;
  --boy-dark: #3a8fd8;
  --girl-pink: #f4a0c0;
  --girl-dark: #e87aa0;
  --bg: #fdf6f0;
  --card-bg: #ffffff;
  --text: #3d3d3d;
  --text-light: #777;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 16px;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

h1, h2 { font-family: 'Fredoka', sans-serif; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 50px 20px 30px;
  position: relative;
  overflow: hidden;
}

.pre-title {
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 2.6rem;
  background: linear-gradient(135deg, var(--boy-blue), var(--girl-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Sparkles */
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: float 4s ease-in-out infinite;
}
.sparkle:nth-child(1) { top: 15%; left: 8%; animation-delay: 0s; color: var(--boy-blue); }
.sparkle:nth-child(2) { top: 25%; right: 10%; animation-delay: 1s; color: var(--girl-pink); }
.sparkle:nth-child(3) { top: 60%; left: 5%; animation-delay: 2s; color: var(--girl-pink); }
.sparkle:nth-child(4) { top: 10%; right: 20%; animation-delay: 0.5s; color: var(--boy-blue); }
.sparkle:nth-child(5) { top: 70%; right: 8%; animation-delay: 1.5s; color: var(--boy-blue); }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-12px) rotate(20deg); opacity: 0.6; }
}

/* ===== Countdown ===== */
.countdown {
  margin-top: 24px;
}

.countdown-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.countdown-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 70px;
  box-shadow: var(--shadow);
  text-align: center;
}

.countdown-box span {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--boy-blue), var(--girl-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.countdown-box small {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  font-weight: 600;
}

/* ===== Stats Bar ===== */
.stats-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin: 30px 0;
  box-shadow: var(--shadow);
}

.stats-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.stats-emoji { font-size: 1.3rem; }

.stats-label strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
}

.boy-label strong { color: var(--boy-dark); }
.girl-label strong { color: var(--girl-dark); }

.stats-bar {
  flex: 1;
  height: 32px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  background: #eee;
}

.stats-fill {
  height: 100%;
  transition: width 0.6s ease;
  min-width: 0;
}

.boy-fill {
  background: linear-gradient(90deg, #8ec5f0, var(--boy-blue));
  border-radius: 16px 0 0 16px;
}

.girl-fill {
  background: linear-gradient(90deg, var(--girl-pink), #f0b0cc);
  border-radius: 0 16px 16px 0;
}

.total-votes {
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ===== Vote Section ===== */
.vote-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px 24px;
  margin: 30px 0;
  box-shadow: var(--shadow);
}

.vote-section h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.6rem;
  color: var(--text);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.optional {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.85rem;
}

input[type="text"], textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e0da;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: #fdfcfb;
}

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--boy-blue);
}

textarea { resize: vertical; }

/* Choice Cards */
.choice-group {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.choice-card {
  flex: 1;
  cursor: pointer;
}

.choice-card input { display: none; }

.choice-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border: 3px solid #e8e0da;
  border-radius: 16px;
  transition: all 0.25s;
  background: #fdfcfb;
}

.choice-icon { font-size: 2.4rem; }

.choice-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
}

.boy-card .choice-text { color: var(--boy-dark); }
.girl-card .choice-text { color: var(--girl-dark); }

.boy-card input:checked ~ .choice-content {
  border-color: var(--boy-blue);
  background: #eef5fc;
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(108, 180, 238, 0.25);
}

.girl-card input:checked ~ .choice-content {
  border-color: var(--girl-pink);
  background: #fdf0f5;
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(244, 160, 192, 0.25);
}

.choice-content:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--boy-blue), var(--girl-pink));
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(108, 180, 238, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(108, 180, 238, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-error {
  text-align: center;
  color: #d94040;
  font-weight: 600;
  margin-top: 12px;
}

.form-success {
  text-align: center;
  color: #38a169;
  font-weight: 600;
  margin-top: 12px;
  font-size: 1.05rem;
}

/* ===== Feed Section ===== */
.feed-section {
  margin: 30px 0;
}

.feed-section h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.feed-empty {
  text-align: center;
  color: var(--text-light);
  padding: 30px;
  font-style: italic;
}

.feed-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: slideIn 0.3s ease;
}

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

.feed-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.feed-badge.boy { background: #eef5fc; }
.feed-badge.girl { background: #fdf0f5; }

.feed-info { flex: 1; min-width: 0; }

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

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

.feed-choice {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 20px;
}

.feed-choice.boy {
  background: #eef5fc;
  color: var(--boy-dark);
}

.feed-choice.girl {
  background: #fdf0f5;
  color: var(--girl-dark);
}

.feed-comment {
  margin-top: 6px;
  color: var(--text);
  font-size: 0.95rem;
  word-break: break-word;
}

.feed-time {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 30px 0 10px;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
  .hero h1 { font-size: 2rem; }
  .countdown-box { min-width: 58px; padding: 10px 10px; }
  .countdown-box span { font-size: 1.4rem; }
  .stats-bar-wrapper { gap: 8px; }
  .stats-label { font-size: 0.8rem; }
  .stats-label strong { font-size: 1.1rem; }
  .choice-group { gap: 10px; }
  .choice-content { padding: 14px; }
  .choice-icon { font-size: 1.8rem; }
  .choice-text { font-size: 1.1rem; }
}

/* ===== Admin Styles ===== */
.admin-login {
  max-width: 400px;
  margin: 80px auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-login h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--boy-blue), var(--girl-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-login input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e0da;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 14px;
}

.admin-login button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--boy-blue), var(--girl-pink));
  cursor: pointer;
}

.admin-panel { display: none; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-header h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
}

.btn-logout {
  padding: 8px 20px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
}

.btn-logout:hover { border-color: #d94040; color: #d94040; }

.admin-table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  background: #f7f3ef;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-top: 1px solid #f0ebe6;
  vertical-align: top;
}

.admin-table tr:hover td { background: #fdfcfb; }

.btn-del {
  padding: 4px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #fee;
  color: #d94040;
}

.btn-del:hover { background: #fcc; }

.btn-del-comment {
  padding: 4px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #fef5e7;
  color: #c07b20;
  margin-left: 4px;
}

.btn-del-comment:hover { background: #fde8c4; }

.admin-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  text-align: center;
  flex: 1;
  min-width: 100px;
}

.admin-stat-card .stat-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.admin-stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-boy { color: var(--boy-dark); }
.stat-girl { color: var(--girl-dark); }
