/* ========================================
   Scratch Card — Styles
   ======================================== */

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

:root {
  --scratch-blue: #4D97FF;
  --scratch-blue-dark: #3373CC;
  --scratch-green: #59C059;
  --scratch-yellow: #FFAB19;
  --scratch-orange: #FF8C1A;
  --scratch-red: #FF6680;
  --scratch-purple: #9966FF;
  --scratch-teal: #0FC5B1;
  --bg: #F0F4FF;
  --card-bg: #FFFFFF;
  --text: #1E293B;
  --text-light: #64748B;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(77, 151, 255, .15), 0 2px 8px rgba(0,0,0,.06);
}

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Floating sprites */
.floating-sprite {
  position: fixed;
  font-size: 2rem;
  opacity: .12;
  pointer-events: none;
  z-index: 0;
  animation: floatAround 18s ease-in-out infinite alternate;
}
.s1 { top: 8%; left: 5%; animation-delay: 0s; font-size: 3rem; }
.s2 { top: 15%; right: 8%; animation-delay: -3s; font-size: 2.4rem; }
.s3 { top: 45%; left: 3%; animation-delay: -6s; }
.s4 { top: 65%; right: 5%; animation-delay: -9s; font-size: 2.6rem; }
.s5 { top: 85%; left: 12%; animation-delay: -12s; }
.s6 { top: 30%; right: 20%; animation-delay: -5s; font-size: 2.2rem; opacity: .07; }

@keyframes floatAround {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-22px) rotate(8deg); }
  100% { transform: translateY(8px) rotate(-5deg); }
}

/* Page wrapper */
.page-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scratch-logo {
  flex-shrink: 0;
  animation: wiggle 3s ease-in-out infinite;
}
@keyframes wiggle {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

.site-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--scratch-blue-dark);
  line-height: 1.15;
}
.site-subtitle {
  font-size: .85rem;
  color: var(--text-light);
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 800;
  font-size: .92rem;
  border: none;
  border-radius: 12px;
  padding: 11px 22px;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.btn-save {
  background: linear-gradient(135deg, var(--scratch-green), #45B345);
  color: #fff;
  box-shadow: 0 4px 16px rgba(89,192,89,.35);
}
.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(89,192,89,.45);
}
.btn-save:active { transform: scale(.97); }

.btn-sm {
  font-size: .82rem;
  padding: 7px 14px;
  border-radius: 10px;
  font-weight: 700;
}
.btn-clear {
  background: var(--scratch-red);
  color: #fff;
}
.btn-clear:hover { opacity: .85; }

.btn-icon { font-size: 1.1rem; }

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

/* Top stripe */
.card-top-stripe {
  background: linear-gradient(135deg, var(--scratch-blue), var(--scratch-purple));
  padding: 14px 28px;
  text-align: center;
}
.card-top-stripe-inner {
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: .5px;
}
.stripe-icon { font-size: 1.3rem; }

/* Card body */
.card-body {
  padding: 28px 30px 20px;
}

/* Sections */
.card-section {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 2px dashed #E8EDF5;
}
.card-section:last-of-type { border-bottom: none; }

.section-title {
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--scratch-blue-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-icon {
  font-size: 1.2rem;
}

/* Field rows */
.field-row {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-weight: 800;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: 5px;
}
.field-input {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: 10px 14px;
  border: 2.5px solid #E2E8F0;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #FAFBFF;
  color: var(--text);
}
.field-input:focus {
  border-color: var(--scratch-blue);
  box-shadow: 0 0 0 3px rgba(77,151,255,.18);
}
.field-input::placeholder {
  color: #B0BCCF;
  font-weight: 600;
}

/* Student row */
.student-row {
  background: linear-gradient(135deg, #FFF9E6, #FFF3CC);
  border: 2.5px solid var(--scratch-yellow);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
}
.student-input {
  background: #fff !important;
  font-size: 1.05rem;
  border-color: var(--scratch-yellow) !important;
  text-align: center;
  font-weight: 800 !important;
}
.student-input:focus {
  border-color: var(--scratch-orange) !important;
  box-shadow: 0 0 0 3px rgba(255,171,25,.2) !important;
}

/* Tag group (radio) */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  cursor: pointer;
}
.tag input { display: none; }
.tag span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 10px;
  background: #F1F5FF;
  border: 2.5px solid #D6E0F5;
  font-weight: 700;
  font-size: .88rem;
  transition: all .2s;
  user-select: none;
}
.tag input:checked + span {
  background: linear-gradient(135deg, var(--scratch-blue), var(--scratch-purple));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(77,151,255,.3);
  transform: scale(1.04);
}
.tag span:hover {
  border-color: var(--scratch-blue);
}

/* Checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: #F5F7FF;
  border: 2.5px solid #E2E8F0;
  transition: all .2s;
  user-select: none;
}
.check-item input { display: none; }
.check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2.5px solid #B0BCCF;
  flex-shrink: 0;
  position: relative;
  transition: all .2s;
}
.check-box::after {
  content: '';
  position: absolute;
  top: 2px; left: 6px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .2s;
}
.check-item input:checked ~ .check-box {
  background: var(--scratch-green);
  border-color: var(--scratch-green);
}
.check-item input:checked ~ .check-box::after {
  transform: rotate(45deg) scale(1);
}
.check-item:has(input:checked) {
  background: #E8F9E8;
  border-color: var(--scratch-green);
}

/* Footer note */
.card-footer-note {
  text-align: center;
  font-weight: 800;
  font-size: .88rem;
  color: var(--scratch-purple);
  margin-top: 10px;
  padding: 10px;
  background: #F5F0FF;
  border-radius: 10px;
}

/* Site footer */
.site-footer {
  text-align: center;
  margin-top: 28px;
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-light);
}
.heart { animation: heartbeat 1.2s ease-in-out infinite; display: inline-block; }
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Responsive */
@media (max-width: 540px) {
  .page-wrapper { padding: 12px 8px 36px; }
  .card-body { padding: 20px 16px 16px; }
  .site-title { font-size: 1.2rem; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header { flex-direction: column; align-items: flex-start; }
}

/* Print / capture styles */
@media print {
  .site-header, .site-footer, .floating-sprite { display: none !important; }
  .card { box-shadow: none !important; }
}