:root {
  color-scheme: dark;
  --bg: #0f1018;
  --surface: #191b27;
  --surface-2: #222534;
  --text: #f7f4ea;
  --muted: #a9acba;
  --red: #ef5350;
  --red-dark: #c83e42;
  --gold: #f3c969;
  --line: rgba(255, 255, 255, 0.09);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(239, 83, 80, 0.17), transparent 34rem),
    radial-gradient(circle at 100% 50%, rgba(243, 201, 105, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
}

main { width: min(100% - 2rem, 860px); margin: 0 auto; padding: 4rem 0 2rem; }
.hero { margin-bottom: 2rem; }
.eyebrow { margin: 0 0 0.45rem; color: var(--gold); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0.55rem; font-size: clamp(2.4rem, 9vw, 4.8rem); line-height: 0.95; letter-spacing: -0.055em; }
h2 { margin-bottom: 0.4rem; font-size: 1.45rem; }
#file-name { overflow-wrap: anywhere; }
.lede, .picker > p, details p { color: var(--muted); line-height: 1.6; }
.lede { font-size: 1.08rem; }

.picker {
  padding: clamp(1.5rem, 5vw, 2.8rem);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(25, 27, 39, 0.88);
  box-shadow: var(--shadow);
  text-align: center;
}

.picker.dragging { border-color: var(--gold); background: rgba(243, 201, 105, 0.08); }
.picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.privacy { margin: 1rem 0 0 !important; font-size: 0.78rem; }

.ball { position: relative; width: 62px; height: 62px; margin: 0 auto 1.15rem; overflow: hidden; border: 4px solid #090a0f; border-radius: 50%; background: linear-gradient(var(--red) 0 46%, #090a0f 46% 54%, #eee 54%); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35); }
.ball span { position: absolute; inset: 50% auto auto 50%; width: 19px; height: 19px; border: 4px solid #090a0f; border-radius: 50%; background: white; transform: translate(-50%, -50%); }

button, .primary-button { font: inherit; }
.primary-button, .secondary-button, .ghost-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.7rem 1.1rem; border-radius: 12px; cursor: pointer; font-weight: 750; transition: transform 120ms ease, background 120ms ease; }
.primary-button { border: 0; background: var(--red); color: white; box-shadow: 0 8px 25px rgba(239, 83, 80, 0.24); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.ghost-button { min-height: 40px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.status { min-height: 1.5rem; margin: 1rem 0; color: var(--muted); text-align: center; }
.status.error { color: #ff908e; }

.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.party { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.pokemon { padding: 1.15rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(34, 37, 52, 0.94), rgba(25, 27, 39, 0.94)); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16); }
.pokemon-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; }
.pokemon h3 { margin: 0; font-size: 1.2rem; }
.level { color: var(--gold); font-weight: 800; white-space: nowrap; }
.meta { margin: 0.55rem 0 0.8rem; color: var(--muted); font-size: 0.87rem; }
.meta { overflow-wrap: anywhere; }
.moves { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.moves li { padding: 0.34rem 0.5rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.14); font-size: 0.82rem; }
.stats { margin: 0.85rem 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }
.copy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 1rem; }
details { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }
details summary { cursor: pointer; color: var(--text); font-weight: 700; }
details p { margin: 0.8rem 0 0; font-size: 0.86rem; }
footer { padding: 1.5rem; color: #737684; font-size: 0.78rem; text-align: center; }

@media (max-width: 620px) {
  main { padding-top: 2.4rem; }
  .party { grid-template-columns: 1fr; }
  .copy-actions { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (min-width: 700px) {
  main { width: min(100% - 2rem, 1100px); padding-top: 1.5rem; }
  .hero { display: grid; grid-template-columns: auto 1fr; column-gap: 1.4rem; align-items: end; margin-bottom: 1.15rem; }
  .hero .eyebrow { grid-column: 1 / -1; }
  .hero h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.2rem); }
  .hero .lede { max-width: 38rem; margin: 0 0 0.2rem; }
  .picker { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; grid-template-rows: auto auto; gap: 0.35rem 1.4rem; align-items: center; padding: 1.4rem 1.7rem; text-align: left; }
  .picker .ball { grid-row: 1 / 3; margin: 0; }
  .picker h2 { align-self: end; margin: 0; }
  .picker > p:not(.privacy) { align-self: start; margin: 0; }
  .picker .primary-button { grid-column: 3; grid-row: 1 / 3; }
  .picker .privacy { grid-column: 1 / -1; margin: 0.35rem 0 0 !important; text-align: center; }
  .party { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pokemon { min-width: 0; }
  .results-heading { margin-bottom: 0.8rem; }
}
