:root {
  color-scheme: light;
  --cream: #fdf8f3;
  --ink: #19222c;
  --muted: #686b70;
  --blue: #69b3d1;
  --blue-ink: #397e9e;
  --green: #4caf50;
  --green-button: #37803b;
  --green-dark: #2f6e33;
  --paper: #fffefb;
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
a { color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
.page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.announcement { padding: 7px 12px; background: #e9f4fb; color: var(--blue-ink); text-align: center; font-size: 9px; line-height: 1.3; font-weight: 600; letter-spacing: 1.8px; }
.site-header { display: flex; justify-content: center; padding: 18px 16px 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--blue); }
.brand-mark { width: 43px; height: 43px; }
.brand-type { display: flex; flex-direction: column; align-items: center; }
.brand-name { font-family: "Dancing Script", "Segoe Script", cursive; font-size: 40px; line-height: 1.03; font-weight: 600; padding: 0 3px 2px; border-bottom: 1px solid #a8d3e4; }
.brand-description { margin-top: 4px; padding-left: 3px; font-size: 8px; line-height: 1.2; font-weight: 700; letter-spacing: 3px; }
.main { width: min(100% - 30px, 488px); margin: 0 auto; padding-bottom: 24px; }
.intro { text-align: center; margin: 0 auto 22px; }
h1 { margin: 0; font-size: clamp(26px, 6.9vw, 35px); line-height: 1.2; font-weight: 700; letter-spacing: -.9px; }
h1 span { color: var(--blue-ink); }
.intro p { margin: 11px auto 0; max-width: 330px; font-size: 13px; line-height: 1.65; color: var(--muted); }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0; font-size: 14px; line-height: 1.4; font-weight: 700; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: #e3f0f5; color: var(--blue-ink); font-size: 11px; }
.step-help { text-align: center; color: var(--muted); margin: 5px 0 14px; font-size: 11px; line-height: 1.5; }
.portrait-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.portrait-card { position: relative; display: block; min-width: 0; cursor: pointer; touch-action: manipulation; }
.portrait-card input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.card-content { display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border: 1px solid #e3ddd5; border-radius: 9px; transition: border-color 140ms, box-shadow 140ms, transform 140ms; box-shadow: 0 2px 5px #42321d05; }
.portrait-frame { display: block; position: relative; overflow: hidden; aspect-ratio: 1; background: #f5f3ed; }
.portrait-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 43%; transition: transform 220ms ease; }
.card-caption { display: flex; justify-content: center; align-items: center; gap: 3px; min-height: 28px; padding: 5px 1px; font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.zodiac-symbol { color: var(--blue-ink); font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif; font-size: 12px; line-height: 1; }
.selection-check { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; border-radius: 50%; background: var(--green); box-shadow: 0 1px 4px #20392126; opacity: 0; transform: scale(.65); transition: opacity 140ms, transform 140ms; }
.selection-check::after { content: ""; display: block; position: absolute; width: 8px; height: 4px; left: 5px; top: 6px; border-left: 1.8px solid white; border-bottom: 1.8px solid white; transform: rotate(-45deg); }
.portrait-card input:checked + .card-content { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.portrait-card input:checked + .card-content .card-caption { background: #ecf7ec; color: #286e2d; }
.portrait-card input:checked + .card-content .zodiac-symbol { color: #286e2d; }
.portrait-card input:checked + .card-content .selection-check { opacity: 1; transform: scale(1); }
.portrait-card input:focus-visible + .card-content { outline: 3px solid var(--blue-ink); outline-offset: 3px; }
.continue-area { text-align: center; margin-top: 15px; }
.selection-note { min-height: 17px; margin: 0 0 8px; color: var(--blue-ink); font-size: 10px; line-height: 1.5; }
.continue-button { width: 100%; min-height: 51px; border: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 14px 14px; background: var(--green-button); color: white; font-size: 15px; font-weight: 700; line-height: 1.3; box-shadow: 0 4px 10px #347f3a18; cursor: pointer; transition: background-color 160ms, transform 160ms, opacity 160ms; }
.continue-button:disabled { opacity: .61; cursor: default; box-shadow: none; }
.continue-button:not(:disabled):active { transform: translateY(1px); }
.continue-button:focus-visible, .brand:focus-visible, .footer-links a:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 4px; }
.button-sparkle { width: 21px; height: 21px; flex: 0 0 21px; }
.button-arrow { width: 18px; height: 18px; margin-left: 3px; flex: 0 0 18px; }
.continue-note { display: block; margin-top: 8px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.site-footer { position: relative; margin-top: auto; padding: 23px 16px 16px; text-align: center; background: #fff; color: #73767a; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -17px; height: 18px; background: url("assets/page-wave.svg") center bottom / 100% 100% no-repeat; pointer-events: none; }
.illustration-note { margin: 0 0 9px; font-size: 9px; line-height: 1.5; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 11px; font-size: 10px; line-height: 1.5; }
.footer-links a { text-decoration: none; text-underline-offset: 3px; }
.footer-links a:hover { text-decoration: underline; color: var(--blue-ink); }
.copyright { margin: 8px 0 0; font-size: 9px; }
.skip-link { position: fixed; z-index: 10; top: 4px; left: 8px; padding: 8px 12px; transform: translateY(-150%); background: #fff; color: var(--ink); border: 2px solid var(--blue-ink); border-radius: 5px; }
.skip-link:focus { transform: translateY(0); }
.noscript-message { font-size: 13px; text-align: center; }

@media (hover: hover) {
  .portrait-card:hover .card-content { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 4px 12px #39495512; }
  .portrait-card:hover img { transform: scale(1.035); }
  .continue-button:not(:disabled):hover { background: var(--green-dark); }
}

@media (min-width: 600px) {
  .announcement { font-size: 10px; padding: 8px; }
  .site-header { padding-top: 21px; padding-bottom: 21px; }
  .brand-name { font-size: 43px; }
  .brand-mark { width: 47px; height: 47px; }
  .intro { margin-bottom: 23px; }
  .intro p { font-size: 14px; }
  .portrait-grid { gap: 12px; }
  .card-caption { font-size: 12px; min-height: 31px; gap: 5px; }
  .zodiac-symbol { font-size: 13px; }
  legend { font-size: 15px; }
  .step-help { font-size: 12px; margin-bottom: 16px; }
  .continue-area { margin-top: 16px; }
  .selection-note, .continue-note { font-size: 11px; }
  .continue-button { min-height: 53px; font-size: 16px; }
  .site-footer { padding-top: 24px; }
}

@media (max-width: 350px) {
  .main { width: calc(100% - 22px); }
  .site-header { padding: 15px 12px 16px; }
  .brand-name { font-size: 36px; }
  .brand-mark { width: 39px; height: 39px; }
  .portrait-grid { gap: 8px 6px; }
  .card-caption { font-size: 10.5px; min-height: 27px; }
  .zodiac-symbol { display: none; }
  .intro { margin-bottom: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
