:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-deep: #e8e1d5;
  --ink: #1c2521;
  --muted: #69716b;
  --line: rgba(28, 37, 33, 0.13);
  --green: #1c4a36;
  --lime: #d9ff58;
  --white: #fffdf8;
  --orange: #ef6a3a;
  --shadow: 0 18px 50px rgba(26, 39, 31, 0.12);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 94% 2%, rgba(217, 255, 88, 0.32), transparent 24rem),
    var(--paper);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  max-width: 680px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  position: relative;
}

.topbar {
  height: calc(68px + env(safe-area-inset-top));
  padding: calc(14px + env(safe-area-inset-top)) 22px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.brand-mark,
.mini-logo {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px 9px 9px 2px;
  color: var(--lime);
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
}

.icon-button,
.close-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.66);
  font-size: 20px;
}

main {
  padding: 12px 20px calc(120px + env(safe-area-inset-bottom));
}

.view[hidden] {
  display: none;
}

.intro {
  padding: 30px 4px 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.intro h1,
.section-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 11vw, 57px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.intro h1 em {
  display: block;
  color: var(--green);
  font-size: 0.82em;
  font-weight: 400;
  white-space: nowrap;
}

.intro > p:last-child,
.section-heading > p:last-child {
  max-width: 32rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.focus-card {
  overflow: hidden;
  border-radius: 28px;
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow);
}

.focus-card-top {
  padding: 24px 24px 20px;
  position: relative;
}

.sport-label,
.date-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
}

.date-label {
  margin-left: 5px;
}

.focus-card h2 {
  margin: 34px 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  line-height: 1;
}

.cue-stack {
  display: grid;
  gap: 9px;
}

.cue-line {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.45;
}

.cue-number {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.focus-drill {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.focus-drill strong {
  color: var(--lime);
}

.focus-actions {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  background: rgba(0, 0, 0, 0.12);
}

.start-button,
.finish-button {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  color: var(--green);
  background: var(--lime);
  font-weight: 900;
}

.card-menu-button {
  width: 54px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-size: 20px;
}

.queue-heading {
  margin: 28px 2px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-heading h3 {
  margin: 0;
  font-size: 14px;
}

.queue-heading span {
  color: var(--muted);
  font-size: 12px;
}

.mini-card,
.library-card,
.settings-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.76);
}

.mini-card + .mini-card,
.library-card + .library-card,
.settings-card + .settings-card {
  margin-top: 10px;
}

.mini-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.sport-dot {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--paper-deep);
}

.mini-card strong,
.library-card h3 {
  display: block;
  margin: 0 0 5px;
  font-size: 15px;
}

.mini-card p,
.library-card p,
.settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.mini-start {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--green);
  background: var(--lime);
  font-weight: 900;
}

.empty-state {
  padding: 42px 25px;
  border: 1px dashed rgba(28, 74, 54, 0.28);
  border-radius: 26px;
  text-align: center;
  background: rgba(255, 253, 248, 0.54);
}

.empty-symbol {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 22px 22px 22px 6px;
  color: var(--green);
  background: var(--lime);
  font-size: 28px;
}

.empty-state h2 {
  margin: 0 0 9px;
  font-family: Georgia, serif;
  font-size: 26px;
}

.empty-state p {
  margin: 0 auto 20px;
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.small-primary,
.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  color: var(--white);
  background: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.section-heading {
  padding: 28px 4px 22px;
}

.section-heading h1 {
  font-size: clamp(38px, 10vw, 50px);
}

.search-box {
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--white);
}

.search-box span {
  color: var(--muted);
  font-size: 24px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.filter-row {
  margin: 14px -20px 18px;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 38px;
  padding: 0 14px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip.active {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.library-card {
  position: relative;
}

.library-card-head {
  padding-right: 42px;
}

.library-card .sport-label {
  margin-bottom: 13px;
  color: var(--green);
  background: rgba(28, 74, 54, 0.08);
}

.library-card h3 {
  font-family: Georgia, "Apple SD Gothic Neo", serif;
  font-size: 22px;
}

.library-cues {
  margin: 14px 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--paper);
}

.library-cues p + p {
  margin-top: 6px;
}

.library-cues p::before {
  content: "— ";
  color: var(--green);
  font-weight: 900;
}

.library-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.library-actions {
  margin-top: 15px;
  display: flex;
  gap: 7px;
}

.library-actions button,
.library-actions a {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.library-actions button:first-child {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.library-actions .danger-button {
  margin-left: auto;
  color: #9d342b;
}

.done-badge {
  color: var(--green);
  font-weight: 900;
}

.settings-card {
  padding: 22px;
}

.settings-card strong {
  font-size: 16px;
}

.settings-card p {
  margin-top: 7px;
}

.settings-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
}

.secondary-button {
  color: var(--green);
  background: var(--paper-deep);
}

.install-card > button {
  margin-top: 18px;
}

.privacy-note {
  margin-top: 20px;
  padding: 16px 4px;
  display: flex;
  gap: 12px;
  color: var(--muted);
}

.privacy-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.privacy-note strong {
  color: var(--ink);
}

.bottom-nav {
  width: min(calc(100% - 24px), 656px);
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 8px 12px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: 1fr 1fr 72px 1fr;
  position: fixed;
  z-index: 20;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  background: rgba(24, 34, 29, 0.96);
  box-shadow: 0 14px 45px rgba(20, 30, 25, 0.25);
  backdrop-filter: blur(18px);
}

.nav-item {
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  font-size: 10px;
}

.nav-item.active {
  color: var(--lime);
}

.nav-icon {
  font-size: 19px;
}

.capture-button {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 22;
  bottom: calc(38px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid var(--paper);
  border-radius: 50%;
  color: var(--green);
  background: var(--lime);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  font-size: 32px;
  font-weight: 400;
}

dialog {
  border: 0;
}

dialog::backdrop {
  background: rgba(11, 20, 16, 0.58);
  backdrop-filter: blur(4px);
}

.sheet {
  width: min(100%, 680px);
  max-width: none;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: var(--paper);
}

.sheet form {
  padding: 8px 20px calc(28px + env(safe-area-inset-bottom));
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 2px auto 18px;
  border-radius: 99px;
  background: rgba(28, 37, 33, 0.17);
}

.sheet-header {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sheet-header h2,
.message-dialog h2 {
  margin: 0;
  font-family: Georgia, "Apple SD Gothic Neo", serif;
  font-size: 29px;
}

.close-button {
  border: 0;
  background: var(--paper-deep);
  font-size: 26px;
}

.sport-picker {
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  border: 0;
}

.sport-picker legend,
.field > span {
  width: 100%;
  margin-bottom: 8px;
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.field b {
  color: var(--orange);
  font-size: 9px;
}

.sport-picker label input {
  position: absolute;
  opacity: 0;
}

.sport-picker label span {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.sport-picker label input:checked + span {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.field {
  margin-bottom: 17px;
  display: block;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
}

.field input {
  height: 50px;
  padding: 0 14px;
}

.field textarea {
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(28, 74, 54, 0.1);
}

.field small {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.form-error {
  min-height: 18px;
  margin: 0 0 8px;
  color: #a83d31;
  font-size: 12px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  color: var(--white);
  background: var(--green);
  font-weight: 900;
}

.practice-sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--white);
  background: var(--green);
}

.practice-layout {
  width: min(100%, 680px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 22px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

.practice-topbar {
  min-height: 66px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 800;
}

.practice-topbar span:last-child {
  text-align: right;
}

.practice-close {
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, 0.64);
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
}

.practice-main {
  flex: 1;
  padding: 38px 2px 24px;
}

.practice-main .eyebrow {
  color: var(--lime);
}

.practice-main h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Apple SD Gothic Neo", serif;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 1;
}

.source-link {
  display: none;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.source-link.visible {
  display: inline-block;
}

.practice-cues {
  margin-top: 48px;
  display: grid;
  gap: 12px;
}

.practice-cue {
  min-height: 68px;
  padding: 15px 17px;
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
  line-height: 1.35;
}

.practice-cue input {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: var(--lime);
}

.practice-cue:has(input:checked) {
  border-color: var(--lime);
  color: var(--green);
  background: var(--lime);
}

.practice-drill {
  margin-top: 20px;
  padding: 16px;
  display: none;
  border-left: 3px solid var(--lime);
  color: rgba(255, 255, 255, 0.74);
  background: rgba(0, 0, 0, 0.1);
  font-size: 13px;
  line-height: 1.55;
}

.practice-drill.visible {
  display: block;
}

.practice-footer {
  padding: 18px 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.dark-field > span {
  color: rgba(255, 255, 255, 0.7);
}

.dark-field textarea {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.dark-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.finish-button {
  width: 100%;
}

.message-dialog {
  width: min(calc(100% - 36px), 400px);
  padding: 28px;
  border-radius: 26px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.message-dialog ol {
  margin: 22px 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.message-dialog li + li {
  margin-top: 5px;
}

.install-visual {
  width: 96px;
  height: 142px;
  margin: 0 auto 25px;
  padding-top: 24px;
  display: grid;
  place-items: center;
  position: relative;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
}

.phone-notch {
  width: 35px;
  height: 6px;
  position: absolute;
  top: 6px;
  border-radius: 99px;
  background: var(--ink);
}

.install-visual .mini-logo {
  width: 48px;
  height: 48px;
  font-size: 27px;
}

.toast {
  max-width: calc(100% - 40px);
  padding: 12px 17px;
  position: fixed;
  z-index: 60;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 18px);
  border-radius: 13px;
  color: var(--white);
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 48px);
    border: 1px solid var(--line);
    border-radius: 34px;
    background: rgba(245, 241, 232, 0.82);
    box-shadow: var(--shadow);
  }

  .bottom-nav {
    bottom: 20px;
  }
}

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