:root {
  --ink: #17231d;
  --muted: #69756e;
  --cream: #f7f5ec;
  --paper: #fffefa;
  --green: #154f3b;
  --green-dark: #0e382a;
  --lime: #dff86b;
  --line: #dfe3d9;
  --shadow: 0 18px 55px rgba(30, 47, 39, .09);
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "Atkinson Hyperlegible", Verdana, ui-sans-serif, system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 70px 0 90px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; margin-bottom: 44px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: .74rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.sparkle { display: inline-block; margin-right: 6px; color: #8cab13; }
h1 { max-width: 670px; margin: 0; font-family: inherit; font-size: clamp(3.2rem, 7.2vw, 6.2rem); font-weight: 700; letter-spacing: -.035em; line-height: .94; }
h1 em { color: var(--green); font-weight: 400; }
.intro { max-width: 610px; margin: 24px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.status-pill { flex: 0 0 auto; margin-bottom: 7px; padding: 10px 15px; border: 1px solid #d8ded4; border-radius: 99px; background: rgba(255,255,255,.52); color: #536158; font-size: .77rem; font-weight: 700; }
.status-pill span { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #67aa62; box-shadow: 0 0 0 4px rgba(103,170,98,.12); }

.workspace { display: grid; grid-template-columns: 1.18fr .82fr; min-height: 560px; overflow: visible; border: 1px solid var(--line); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.pokemon-panel { position: relative; z-index: 2; padding: 42px; border-right: 1px solid var(--line); }
.field-group label, .direct-edit label { display: block; margin-bottom: 10px; color: #47544d; font-size: .83rem; font-weight: 750; }
.combobox-wrap { position: relative; }
.combobox-wrap input { width: 100%; height: 54px; padding: 0 45px 0 45px; border: 1px solid #ccd3c9; border-radius: 14px; outline: 0; background: #fff; color: var(--ink); }
.combobox-wrap input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(21,79,59,.1); }
.search-icon { position: absolute; z-index: 2; left: 17px; top: 12px; color: #718078; font-size: 1.45rem; transform: rotate(-15deg); }
.clear-search { position: absolute; z-index: 2; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #7b8680; font-size: 1.3rem; }
.clear-search:hover { background: #f0f2ed; }
.options { position: absolute; z-index: 10; top: 61px; width: 100%; max-height: 270px; overflow-y: auto; padding: 7px; border: 1px solid #d7dcd2; border-radius: 14px; background: white; box-shadow: 0 18px 40px rgba(20,39,29,.16); }
.option { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; }
.option:hover, .option.active { background: #f1f5e9; }
.option img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.option span { margin-left: auto; color: #89928d; font-size: .74rem; }
.selection-error { min-height: 18px; margin: 6px 3px 0; color: #ad3d3d; font-size: .76rem; }

.sprite-card { position: relative; display: grid; place-items: center; height: 355px; margin-top: 12px; overflow: hidden; border-radius: 22px; background: radial-gradient(circle at 50% 48%, #fbffe4, #edf1e4 68%, #e6ebdd); }
.sprite-card::after { content: ""; position: absolute; bottom: 46px; width: 48%; height: 10%; border-radius: 50%; background: rgba(42,70,53,.12); filter: blur(9px); }
.orb { position: absolute; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; }
.orb-one { width: 250px; height: 250px; }
.orb-two { width: 315px; height: 315px; }
.empty-sprite { position: relative; z-index: 1; color: #7b887b; text-align: center; }
.empty-sprite span { display: block; color: #a1b255; font-size: 2rem; }
.empty-sprite p { margin: 10px 0 0; font-family: inherit; font-size: 1.05rem; line-height: 1.55; }
#pokemon-sprite { position: relative; z-index: 2; width: 235px; height: 235px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 14px 5px rgba(27,49,37,.16)); animation: arrive .35s ease-out; }
.pokemon-caption { position: absolute; z-index: 3; bottom: 18px; left: 20px; right: 20px; display: flex; align-items: baseline; justify-content: space-between; }
.pokemon-caption strong { font-family: inherit; font-size: 1.35rem; }
.pokemon-caption span { color: #6d796f; font-size: .78rem; font-weight: 800; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px) scale(.94); } }

.counter-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px; text-align: center; }
.counter-label { margin: 0; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
#encounter-count { display: block; margin: 14px 0 26px; font-family: inherit; font-size: clamp(5rem, 9vw, 7.5rem); font-weight: 700; letter-spacing: -.04em; line-height: .9; font-variant-numeric: tabular-nums; }
.counter-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.count-button { height: 67px; border-radius: 16px; font-size: 2rem; transition: transform .12s, background .12s; }
.count-button:active { transform: scale(.97); }
.count-button.secondary { border: 1px solid #cdd4ca; background: white; color: var(--green); }
.count-button.secondary:hover { background: #f3f5ef; }
.count-button.primary { border: 0; background: var(--green); color: white; box-shadow: 0 8px 18px rgba(21,79,59,.2); }
.count-button.primary:hover { background: var(--green-dark); }
.direct-edit { margin-top: 22px; text-align: left; }
.direct-edit input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid #d3d8cf; border-radius: 11px; outline: none; background: #fafbf7; color: var(--ink); }
.direct-edit input:focus { border-color: var(--green); }
.save-button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 54px; margin-top: 17px; padding: 0 19px; border: 0; border-radius: 13px; background: var(--lime); color: #223115; font-weight: 850; }
.save-button:hover { background: #d5f24f; }
.cancel-edit { margin: 10px auto 0; border: 0; background: transparent; color: #6a756f; font-size: .8rem; text-decoration: underline; }
.save-message { min-height: 18px; margin: 9px 0 -27px; color: var(--green); font-size: .78rem; font-weight: 700; }

.saved-section { margin-top: 70px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid #d9ddd4; }
.section-heading h2 { margin: 0; font-family: inherit; font-size: 2.35rem; font-weight: 700; letter-spacing: -.02em; }
.hunt-total { color: #69756e; font-size: .8rem; font-weight: 700; }
.hunt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
.hunt-card { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; min-width: 0; padding: 14px; border: 1px solid #dce1d7; border-radius: 18px; background: rgba(255,255,255,.62); transition: transform .15s, box-shadow .15s; }
.hunt-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(32,48,39,.07); }
.hunt-sprite { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 14px; background: #edf1e5; }
.hunt-sprite img { width: 68px; height: 68px; object-fit: contain; image-rendering: pixelated; }
.hunt-details { min-width: 0; }
.hunt-number { margin: 0 0 2px; color: #819087; font-size: .67rem; font-weight: 800; }
.hunt-details h3 { overflow: hidden; margin: 0; font-family: inherit; font-size: 1.28rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.hunt-count { margin: 7px 0 0; color: #707b75; font-size: .76rem; }
.hunt-count strong { color: var(--green); font-size: .98rem; }
.hunt-actions { display: flex; align-items: center; gap: 4px; }
.hunt-actions button { border: 0; border-radius: 8px; background: transparent; color: #607069; }
.edit-hunt { padding: 8px 10px; font-size: .76rem; font-weight: 800; }
.edit-hunt:hover { background: #e8eee2; color: var(--green); }
.delete-hunt { width: 32px; height: 32px; font-size: 1.2rem; }
.delete-hunt:hover { background: #f8e5e2; color: #a23e36; }
.empty-hunts { padding: 45px 20px; color: #7b8680; text-align: center; }
.empty-hunts span { color: #9eae59; font-size: 1.5rem; }
.empty-hunts p { margin: 8px 0; font-family: inherit; }

.site-disclaimer { max-width: 760px; margin: 65px auto 0; padding-top: 22px; border-top: 1px solid #d9ddd4; color: #758078; text-align: center; }
.site-disclaimer p { margin: 5px 0; font-size: .72rem; line-height: 1.55; }

.delete-dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(18, 31, 24, .28); }
.delete-dialog::backdrop { background: rgba(12, 24, 18, .58); backdrop-filter: blur(3px); }
.delete-dialog form { padding: 32px; text-align: center; }
.dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 17px; border-radius: 50%; background: #f8e5e2; color: #a23e36; font-size: 1.3rem; font-weight: 900; }
.delete-dialog h2 { margin: 0; font-size: 1.55rem; }
.delete-dialog p { margin: 10px auto 25px; color: var(--muted); line-height: 1.55; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions button { min-height: 48px; padding: 0 14px; border-radius: 12px; font-weight: 800; }
.dialog-cancel { border: 1px solid #ccd3c9; background: white; color: var(--green); }
.dialog-cancel:hover { background: #f1f4ed; }
.dialog-delete { border: 0; background: #a23e36; color: white; }
.dialog-delete:hover { background: #843029; }

@media (max-width: 780px) {
  .shell { padding-top: 42px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .pokemon-panel { padding: 26px; border-right: 0; border-bottom: 1px solid var(--line); }
  .counter-panel { padding: 42px 28px; }
  .hunt-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .shell { width: min(100% - 22px, 1120px); }
  .status-pill { display: none; }
  .pokemon-panel { padding: 18px; }
  .sprite-card { height: 310px; }
  .hunt-card { grid-template-columns: 76px 1fr; }
  .hunt-actions { grid-column: 2; margin-top: 6px; }
  .dialog-actions { grid-template-columns: 1fr; }
}

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