@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playpen+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-gradient: linear-gradient(135deg, #fef6f0 0%, #eef5fc 50%, #f6f0fa 100%);
  --primary-color: #a78bfa; /* Pastel Purple */
  --primary-hover: #8b5cf6;
  --secondary-color: #fda4af; /* Pastel Pink/Rose */
  --accent-color: #93c5fd; /* Pastel Blue */
  --success-color: #86efac; /* Pastel Green */
  --success-text: #166534;
  --warning-color: #fde047; /* Pastel Yellow */
  --danger-color: #fca5a5; /* Pastel Red */
  
  --text-dark: #374151;
  --text-muted: #6b7280;
  
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: 1px solid rgba(255, 255, 255, 0.6);
  --card-shadow: 0 10px 30px rgba(165, 180, 252, 0.15);
  
  --font-main: 'Outfit', sans-serif;
  --font-fun: 'Playpen Sans', cursive;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 10px;
  overflow-x: hidden;
  touch-action: pan-x pan-y;
}

/* Base Container & Glass Card */
.container {
  width: 100%;
  max-width: 500px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--card-border);
  border-radius: 30px;
  padding: 30px 24px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  animation: floatUp 0.8s ease-out;
}

.container:hover {
  box-shadow: 0 15px 40px rgba(165, 180, 252, 0.25);
}

/* Animations */
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(167, 139, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header Styles */
header {
  text-align: center;
  margin-bottom: 4px;
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 2rem;
  animation: bounce 3s infinite ease-in-out;
}

h1 {
  font-family: var(--font-fun);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(45deg, #a78bfa, #fda4af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* Match Card */
.match-card {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.vs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-logo {
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.team-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.vs-badge {
  font-family: var(--font-fun);
  background: linear-gradient(135deg, #fbcfe8 0%, #e0f2fe 100%);
  color: #6b7280;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Countdown & Deadline Banner */
.deadline-banner {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.countdown-timer {
  font-family: var(--font-fun);
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.time-segment {
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(165, 180, 252, 0.08);
  font-weight: 700;
  color: var(--primary-color);
  min-width: 40px;
  text-align: center;
  font-size: 1rem;
}

.time-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
  text-transform: uppercase;
  margin-top: 2px;
}

.status-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
  margin-top: 8px;
}

.status-badge.expired {
  background: var(--danger-color);
  color: #7f1d1d;
}

.status-badge.active {
  background: var(--success-color);
  color: var(--success-text);
  animation: pulse-glow 2s infinite;
}

/* Input Fields & Form */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.input-container {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 14px 16px 14px 40px;
  border-radius: 16px;
  border: 1.5px solid rgba(167, 139, 250, 0.2);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15);
  background: #ffffff;
}

/* Score Selectors */
.score-selector-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.score-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.score-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  touch-action: manipulation;
}

.score-btn.minus {
  background: var(--danger-color);
  color: #7f1d1d;
}

.score-btn.plus {
  background: var(--success-color);
  color: var(--success-text);
}

.score-btn:hover {
  transform: scale(1.1);
}

.score-btn:active {
  transform: scale(0.9);
}

.score-value {
  font-family: var(--font-fun);
  font-size: 2.2rem;
  font-weight: 700;
  width: 50px;
  text-align: center;
  color: var(--text-dark);
}

.score-separator {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-muted);
}

/* Instagram Follow Gate */
.follow-gate {
  background: linear-gradient(135deg, rgba(253, 164, 189, 0.15) 0%, rgba(147, 197, 253, 0.15) 100%);
  border: 1.5px dashed rgba(253, 164, 189, 0.4);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 22px;
  text-align: center;
}

.follow-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #be185d;
  margin-bottom: 6px;
}

.follow-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.btn-ig-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(220, 39, 67, 0.2);
  transition: var(--transition);
  margin-bottom: 12px;
  border: none;
  cursor: pointer;
}

.btn-ig-follow:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(220, 39, 67, 0.3);
}

.verify-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--primary-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.custom-checkbox i {
  font-size: 0.7rem;
  color: white;
  display: none;
}

.verify-checkbox-container input {
  display: none;
}

.verify-checkbox-container input:checked + .custom-checkbox {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.verify-checkbox-container input:checked + .custom-checkbox i {
  display: block;
}

.verify-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* Action Button */
.btn-submit {
  width: 100%;
  background: linear-gradient(45deg, var(--primary-color) 0%, #c084fc 100%);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 14px;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.25);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(167, 139, 250, 0.35);
  background: linear-gradient(45deg, #9061f9 0%, #a855f7 100%);
}

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

.btn-submit:disabled {
  background: #d1d5db;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
}

/* Alerts and Response Cards */
.alert {
  padding: 15px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: floatUp 0.3s ease-out;
}

.alert-success {
  background: var(--success-color);
  color: var(--success-text);
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.alert-danger {
  background: var(--danger-color);
  color: #7f1d1d;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.spinner-dark {
  border-color: rgba(167, 139, 250, 0.2);
  border-top-color: var(--primary-color);
}

/* Success State Screen */
.success-screen {
  text-align: center;
  padding: 20px 10px;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 2.5s infinite ease-in-out;
}

.success-title {
  font-family: var(--font-fun);
  font-size: 1.4rem;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 10px;
}

.success-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.guess-receipt {
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--primary-color);
  border-radius: 18px;
  padding: 15px;
  margin-bottom: 20px;
  display: inline-block;
  width: 100%;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.receipt-row:last-child {
  margin-bottom: 0;
}

.receipt-label {
  color: var(--text-muted);
  font-weight: 500;
}

.receipt-val {
  font-weight: 700;
  color: var(--text-dark);
}

/* Footer styling */
footer {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

footer a:hover {
  text-decoration: underline;
}

/* --- ADMIN PANEL SPECIFIC STYLES --- */
.admin-card {
  max-width: 750px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.4);
  padding: 5px;
  border-radius: 14px;
}

.admin-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.admin-tab.active {
  background: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(165, 180, 252, 0.08);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-dark);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: var(--primary-color);
}

.btn-danger {
  background: var(--danger-color);
  color: #7f1d1d;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: #fca5a5ee;
  transform: translateY(-1px);
}

.winner-banner {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  border: 1px solid #eab308;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  animation: floatUp 0.5s ease-out;
}

.winner-banner-title {
  font-family: var(--font-fun);
  color: #854d0e;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.winner-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(254, 240, 138, 0.5);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.winner-rank {
  font-family: var(--font-fun);
  width: 28px;
  height: 28px;
  background: #fef08a;
  color: #854d0e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
}

.winner-info {
  flex: 1;
  text-align: left;
  margin-left: 12px;
}

.winner-username {
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
}

.winner-username:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.winner-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.winner-badge {
  background: var(--success-color);
  color: var(--success-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Tables for predictions */
.table-container {
  overflow-x: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.1);
  margin-top: 15px;
  max-height: 400px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1.5px solid #edf2f7;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #edf2f7;
  color: var(--text-dark);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafafa;
}

.admin-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.search-bar {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(167, 139, 250, 0.2);
  outline: none;
  font-size: 0.85rem;
  width: 200px;
  transition: var(--transition);
}

.search-bar:focus {
  border-color: var(--primary-color);
  width: 250px;
}

/* Modal password */
.password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(246, 240, 250, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.password-box {
  background: #ffffff;
  border-radius: 24px;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 15px 40px rgba(167, 139, 250, 0.15);
  text-align: center;
  border: 1px solid rgba(167, 139, 250, 0.1);
}

/* Extra responsive tweaks */
@media (max-width: 480px) {
  .container {
    padding: 24px 18px;
    border-radius: 24px;
  }
  h1 {
    font-size: 1.5rem;
  }
  .score-value {
    font-size: 1.8rem;
  }
  .admin-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@keyframes modalFloatIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.participant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(167, 139, 250, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.015);
  font-family: var(--font-main), sans-serif;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.participant-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(167, 139, 250, 0.05);
}

.participant-row .time-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .participant-row {
    padding: 8px 10px;
    border-radius: 10px;
    gap: 6px;
  }
  
  .participant-row .time-text {
    font-size: 0.65rem;
    text-align: right;
  }
  
  .participant-row .username-text {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }
  
  .deadline-banner {
    font-size: 0.72rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
  }
  
  .subtitle {
    font-size: 0.72rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
    margin-top: 2px;
  }
}
