:root {
  color-scheme: light;
  --field: #0b5a38;
  --field-deep: #073821;
  --line: rgba(255, 255, 255, 0.78);
  --paper: #fbfff8;
  --mint: #dff6d8;
  --ink: #122017;
  --muted: #607065;
  --accent: #f7d154;
  --danger: #c74235;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(135deg, var(--field), var(--field-deep));
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.app-shell {
  width: min(100%, 430px);
  max-width: 430px;
  height: calc(100dvh - 78px);
  min-height: 0;
  min-width: 0;
  margin-inline: auto;
  overflow-y: auto;
  padding: 18px 12px 28px;
}

.field-mark {
  width: 92px;
  height: 42px;
  margin: 0 auto 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 48%, var(--line) 49%, var(--line) 51%, transparent 52%),
    radial-gradient(circle at 50% 50%, transparent 0 13px, var(--line) 14px 16px, transparent 17px),
    linear-gradient(135deg, var(--field), var(--field-deep));
  box-shadow: 0 10px 24px rgba(7, 56, 33, 0.2);
  opacity: 0.9;
}

.panel,
.card,
.modal {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel * {
  min-width: 0;
}

.card {
  margin: 10px 0;
  padding: 14px;
}

.eyebrow {
  color: #e8ffe5;
  font-weight: 900;
  margin: 0 0 4px;
}

.panel .eyebrow {
  color: var(--field);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: #fff;
  font-size: 30px;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

.panel h1 {
  color: var(--ink);
  text-shadow: none;
}

.stack {
  display: grid;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #c9d8c9;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
  background: #fff;
}

.primary {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  background: var(--accent);
  color: #241d00;
}

.secondary {
  min-height: 40px;
  background: var(--mint);
  color: #14381f;
}

.danger {
  background: var(--danger);
  color: #fff;
}

.ghost {
  background: transparent;
  color: var(--field);
  text-decoration: underline;
}

.message {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff8d6;
  font-weight: 800;
}

.error {
  background: #ffe5df;
  color: #7c1e13;
}

.tabs,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs button,
.actions button {
  min-height: 38px;
  padding: 0 12px;
}

.rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.profile-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--mint);
  color: var(--field);
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 34px;
  height: 34px;
}

.avatar-large {
  width: 74px;
  height: 74px;
  font-size: 28px;
}

.dad-picker {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x mandatory;
}

.dad-card {
  position: relative;
  scroll-snap-align: start;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 132px;
  padding: 12px 8px;
  border: 1px solid #c9d8c9;
  border-radius: 8px;
  background: #fff;
}

.dad-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.dad-card:has(input:checked) {
  border-color: var(--field);
  box-shadow: 0 0 0 3px rgba(11, 90, 56, 0.16);
}

.dad-card:focus-within {
  outline: 3px solid rgba(247, 209, 84, 0.65);
  outline-offset: 2px;
}

.dad-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}

.profile-form .profile-preview {
  display: grid;
  justify-content: center;
}

.profile-form .actions .primary {
  flex: 1 1 100%;
}

.bottom-nav {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(calc(100% - 24px), 430px);
  min-width: 0;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: rgba(251, 255, 248, 0.96);
  border: 1px solid #cbd9c6;
  border-radius: 8px;
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.18);
  z-index: 10;
}

.bottom-nav.is-hidden {
  display: none;
}

.bottom-nav button {
  min-height: 44px;
  min-width: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--field);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav button.active {
  background: var(--field);
  color: #fff;
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 28px;
  }
}

@media (max-width: 800px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .bottom-nav button {
    font-size: 12px;
    padding-right: 2px;
    padding-left: 2px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100%, 390px);
  }

  .bottom-nav {
    width: min(calc(100% - 20px), 390px);
  }
}
