

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #F9F6EE;
  --black:       #1A1A1A;
  --white:       #FFFFFF;
  --mascot-yellow: #FCE278;
  --mascot-peach:  #F7C1A3;
  --gtd:         #FFB5E8;
  --wl:          #BFFCC6;
  --loss:        #FF9AA2;
  --radius-lg:   24px;
  --radius-md:   16px;
  --font-display: 'Fredoka', sans-serif;
  --font-body:    'Inter', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 16px;
  min-height: 100vh;
  padding-top: 80px;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--mascot-yellow);
  color: var(--black);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: .85rem 2.5rem;
  border: 3px solid var(--black);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 4px 4px 0px var(--black);
  transition: transform .1s, box-shadow .1s;
}
.btn-primary:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--black);
}
.btn-primary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--black);
}
.btn-primary:disabled {
  background: #EAEAEA;
  color: #A1A1A1;
  cursor: not-allowed;
  box-shadow: 2px 2px 0px var(--black);
}

.btn-ghost {
  display: inline-block;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-display);
  font-size: 1rem;
  border: 3px solid var(--black);
  padding: .75rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 3px 3px 0px var(--black);
}

/* ── HEADER ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 3px solid var(--black);
}

.header-inner {
  max-width: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border: 3px solid var(--black);
  border-radius: 50%;
  background: var(--mascot-yellow);
  flex-shrink: 0;
}

.logo span {
  background: var(--mascot-yellow);
  padding: 0 6px;
  border-radius: 8px;
  margin-left: 2px;
}

.supply-tag {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--mascot-peach);
  border: 3px solid var(--black);
  padding: .35rem .85rem;
  border-radius: var(--radius-lg);
  white-space: nowrap;
}

/* ── MAIN LAYOUT ── */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.apply-section {
  text-align: center;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 1rem;
}
.section-desc {
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: #4A4A4A;
}

/* ── STEP BLOCKS ── */
.step-block {
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: var(--radius-lg);
  padding: 2rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 6px 6px 0px rgba(0,0,0,0.05);
}
.step-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .9rem; font-weight: 700;
  background: var(--bg);
  border: 3px solid var(--black);
  padding: .4rem 1.2rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.step-desc {
  font-size: 1rem;
  color: #4A4A4A;
  line-height: 1.6;
  padding: 0.5rem 0.5rem 1rem;
  font-weight: 700;
}

/* ── PLAYFUL FATE CARDS ── */
.cards-row {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: nowrap;
  margin-bottom: 1.5rem;
}
.fate-card {
  width: 180px;
  height: 260px;
  perspective: 1000px;
  cursor: pointer;
  flex-shrink: 0;
}
.card-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.34,1.56,.64,1);
}
.fate-card.flipped .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  border: 3px solid var(--black);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}

.card-front {
  background: #FFF;
  box-shadow: 4px 4px 0px var(--black);
  transition: transform .2s;
  padding: 12px;
}
.fate-card:hover:not(.flipped) .card-front {
  transform: translateY(-6px) scale(1.02);
}
.card-front-img-wrap {
  width: 100%;
  height: 160px;
  border: 3px solid var(--black);
  border-radius: 10px;
  overflow: hidden;
  background: var(--mascot-yellow);
  margin-bottom: 10px;
}
.card-front-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-front-label {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  color: var(--black);
}

.card-back {
  background: var(--white);
  transform: rotateY(180deg);
  padding: 0.75rem;
  gap: 0.5rem;
}
.card-back-badge {
  font-size: 3.5rem;
  margin-bottom: .5rem;
  line-height: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  flex: 1;
  min-height: 0;
}
.card-back-badge img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 8px;
}
.card-result-label {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
}

.card-hint {
  font-family: var(--font-display);
  font-size: 0.95rem; color: #666;
}

/* ── POPUPS ── */
.result-popup {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,26,26,0.4);
  backdrop-filter: blur(4px);
  padding: 1rem;
}
.result-popup.hidden { display: none; }
.result-popup-inner {
  background: var(--white);
  border: 4px solid var(--black);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 8px 8px 0px var(--black);
}
.result-popup-icon { font-size: 4rem; margin-bottom: 1rem; }
.result-popup-tag {
  font-family: var(--font-display);
  font-weight: 700; padding: .4rem 1.2rem;
  display: inline-block; border-radius: 100px;
  border: 3px solid var(--black);
  margin-bottom: 1rem;
}
.result-popup-tag.tag-gtd { background: var(--gtd); }
.result-popup-tag.tag-wl { background: var(--wl); }
.result-popup-tag.tag-loss { background: var(--loss); }

.result-popup-title { font-family: var(--font-display); font-size: 2rem; margin-bottom: 1rem; }
.result-popup-body { margin-bottom: 1.5rem; color: #444; line-height: 1.6; font-size: 0.95rem; }
.popup-close { margin-top: 1rem; display: block; width: 100%; }

/* ── SOCIAL & INPUTS ── */
.tasks-list {
  display: flex; flex-direction: column; gap: 1rem;
  max-width: 400px; margin: 0 auto 2rem;
}
.task-item {
  display: flex; align-items: center; gap: 1rem;
  cursor: pointer; padding: .85rem 1rem;
  border: 3px solid var(--black);
  border-radius: var(--radius-md);
  background: var(--bg);
  text-align: left;
}
.task-item input { display: none; }
.task-box {
  width: 24px; height: 24px; border: 3px solid var(--black);
  border-radius: 6px; background: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.task-link {
  color: var(--black);
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
}
.task-link:hover { color: #D4006A; }

#proof-container {
  animation: fieldSlide 0.3s ease-out;
}
@keyframes fieldSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.task-item input:checked + .task-box { background: var(--mascot-yellow); }
.task-item input:checked + .task-box::after { content: '✓'; font-weight: 800; }

.input-group {
  max-width: 400px;
  margin: 0 auto 1.5rem;
  text-align: left;
  width: 100%;
}
.input-label {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: .5rem;
  display: block;
}
.input-wrap { display: flex; }
.input-prefix {
  background: var(--mascot-peach); border: 3px solid var(--black);
  border-right: none; padding: 0 1rem; display: flex; align-items: center;
  font-family: var(--font-display); font-weight: 700;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  flex-shrink: 0;
}
.text-input {
  border: 3px solid var(--black); padding: .75rem 1rem;
  font-family: var(--font-body); font-size: 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  flex: 1;
  outline: none;
  min-width: 0;
}
.text-input.full-width {
  border-radius: var(--radius-md);
  width: 100%;
}

/* ── RESULT BADGE ── */
.result-badge {
  display: inline-block; font-family: var(--font-display);
  font-weight: 700; padding: .5rem 1.5rem;
  border: 3px solid var(--black); border-radius: 100px;
  margin-bottom: 1.5rem;
}
.result-badge.badge-gtd { background: var(--gtd); }
.result-badge.badge-wl { background: var(--wl); }

/* ── SUCCESS SCREEN ── */
.success-screen {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.success-inner.step-block {
  max-width: 480px;
  width: 100%;
  margin-bottom: 0;
  box-shadow: 8px 8px 0px var(--black);
  text-align: center;
  animation: popupPop 0.4s cubic-bezier(.34,1.56,.64,1);
}
.success-tag {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--black);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.success-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1.5rem;
  line-height: 1.1;
}
.success-detail {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--black);
  background: var(--bg);
  border: 2px dashed var(--black);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-top: 0.5rem;
  word-break: break-all;
}

@keyframes popupPop {
  0% { transform: scale(0.9) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── LOCKED CARDS ── */
.fate-card.blocked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
  transition: all 0.3s ease;
}

/* ── ERROR MODAL ── */
.result-popup-tag.tag-error {
  background: var(--loss);
  color: var(--black);
}

/* ── LOCKED CHECKBOXES ── */
.task-check:disabled + .task-box {
  background-color: #EAEAEA;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── FOOTER ── */
.site-footer {
  border-top: 3px solid var(--black);
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--white);
}
.footer-logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem;}
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem;}
.footer-links a { color: var(--black); font-weight: 600; }
.footer-copy { font-size: .85rem; color: #666; }

.hidden { display: none !important; }

/* ══════════════════════════════════════════
   MOBILE — max 600px
══════════════════════════════════════════ */
@media (max-width: 600px) {

  body { padding-top: 70px; }

  /* Header */
  .header-inner { padding: 0.75rem 1rem; }
  .logo { font-size: 1.3rem; gap: 8px; }
  .brand-logo { width: 32px; height: 32px; border-width: 2px; }
  .supply-tag { font-size: 0.75rem; padding: .3rem .65rem; border-width: 2px; }

  /* Main */
  .main-container { padding: 1rem 0.85rem; }
  .section-desc { font-size: 0.95rem; margin-bottom: 1.5rem; }

  /* Step blocks */
  .step-block { padding: 1.5rem 1rem; border-radius: 18px; }

  /* Cards — shrink to fit 3 on one row */
  .cards-row {
    gap: 0.6rem;
    flex-wrap: nowrap;
    justify-content: center;
  }
  .fate-card {
    width: calc(33vw - 1.2rem);
    max-width: 120px;
    height: calc((33vw - 1.2rem) * 1.45);
    max-height: 174px;
  }
  .card-front { padding: 6px; }
  .card-front-img-wrap {
    height: calc((33vw - 1.2rem) * 0.82);
    max-height: 98px;
    margin-bottom: 6px;
    border-width: 2px;
  }
  .card-front-label { font-size: 0.8rem; }
  .card-back { padding: 0.5rem; gap: 0.35rem; }
  .card-back-badge { font-size: 2.2rem; border-radius: 6px; }
  .card-result-label { font-size: 0.8rem; }

  /* Input groups */
  .input-group { max-width: 100%; }
  .input-wrap { width: 100%; }
  .text-input { font-size: 0.95rem; padding: .65rem .75rem; }

  /* Tasks */
  .tasks-list { max-width: 100%; }
  .task-item { padding: .75rem; font-size: 0.9rem; }

  /* Popup */
  .result-popup-inner {
    padding: 1.75rem 1.25rem;
    border-radius: 18px;
  }
  .result-popup-title { font-size: 1.7rem; }
  .result-popup-body { font-size: 0.9rem; }

  /* Buttons */
  .btn-primary { font-size: 1rem; padding: .8rem 1.5rem; width: 100%; }
  .btn-ghost { font-size: 0.95rem; padding: .7rem 1.5rem; width: 100%; }

  /* Footer */
  .site-footer { padding: 2rem 1rem; }
}

/* ══════════════════════════════════════════
   SMALL MOBILE — max 380px
══════════════════════════════════════════ */
@media (max-width: 380px) {
  .logo { font-size: 1.15rem; }
  .supply-tag { font-size: 0.7rem; padding: .25rem .55rem; }
  .fate-card { width: calc(30vw); max-width: 105px; }
}
