:root {
  --forest: #2f4433;
  --forest-dark: #1e2e22;
  --amber: #c97f2b;
  --amber-dark: #a8641c;
  --cream: #f7f3e9;
  --ink: #2a2a24;
  --muted: #6b6b5f;
  --card-bg: #ffffff;
  --danger: #b3392f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--forest);
  color: white;
  padding: 14px 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: white;
  font-size: 1.4rem;
  font-weight: bold;
}
.logo:hover { text-decoration: none; }
.logo-ant {
  display: inline-block;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.main-nav a {
  color: white;
  margin-left: 20px;
  font-weight: 500;
}
.main-nav a:hover { text-decoration: underline; }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav > a { margin-left: 0; }
.nav-dropdown { position: relative; }
.nav-dropdown summary {
  color: white;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: ' ▾'; font-size: 0.8em; }
.nav-dropdown[open] summary::after { content: ' ▴'; }
.nav-dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  padding: 8px;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}
.nav-dropdown-menu a {
  display: block;
  color: var(--ink);
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
}
.nav-dropdown-menu a:hover { background: #efe9d8; text-decoration: none; }

.cart-count {
  display: inline-block;
  background: var(--amber);
  color: white;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
  margin-left: 4px;
}

main.container {
  min-height: 60vh;
  padding-top: 30px;
  padding-bottom: 60px;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}
.hero h1 { margin-bottom: 6px; }
.hero p { color: var(--muted); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--amber-dark) !important;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-hero {
  max-width: 820px;
  margin: 25px auto 48px;
  text-align: center;
}
.landing-hero h1 {
  margin: 0;
  color: #244c47;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.landing-hero .eyebrow { color: #ad5c42 !important; }
.landing-lead { max-width: 680px; margin: 22px auto; color: #596761; font-size: 1.1rem; }
.landing-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.landing-actions .btn { margin-top: 0; }
.landing-actions .btn-primary { background: #b76045; }
.landing-actions .btn-primary:hover { background: #974b35; }
.landing-actions .btn-secondary { color: #35665c; border-color: #35665c; }
.landing-actions .btn-secondary:hover { background: #35665c; color: white; }

.category-panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 42px; }
.category-panel {
  min-height: 260px;
  padding: 30px;
  border-radius: 18px;
  color: white;
  box-shadow: 0 8px 25px rgba(30,46,34,0.12);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.category-panel:hover { transform: translateY(-3px); text-decoration: none; box-shadow: 0 12px 30px rgba(30,46,34,0.18); }
.category-panel-live { background: linear-gradient(145deg, #284d47, #638178); }
.category-panel-supplies { background: linear-gradient(145deg, #8f503d, #ca8062); }
.category-panel h2 { margin: 8px 0 12px; font-size: 1.8rem; }
.category-panel p { max-width: 480px; color: rgba(255,255,255,0.86); }
.category-kicker { font-size: 0.75rem; font-weight: 750; letter-spacing: 0.13em; text-transform: uppercase; opacity: 0.8; }
.category-link { display: inline-block; margin-top: 22px; font-weight: 700; }

.ordering-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 45px 0 10px; }
.ordering-steps > div { padding: 24px; border-top: 3px solid #7d9a8d; background: #fffaf3; }
.ordering-steps span { color: #ad5c42; font-weight: 800; }
.ordering-steps h3 { margin: 6px 0; color: #294b44; }
.ordering-steps p { margin: 0; color: #626d68; }

/* Earth & Space Science public portal */
.course-logo-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 5px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 50%;
  color: #f3c86b;
  font-size: 1rem;
}
.edu-hero {
  position: relative;
  min-height: 390px;
  margin: 4px 0 24px;
  padding: 72px 54px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 24%, rgba(102,153,210,.28), transparent 24%),
    linear-gradient(135deg, #0b172b 0%, #183659 58%, #315f71 100%);
  color: white;
  box-shadow: 0 22px 55px rgba(16,35,57,.18);
}
.edu-hero::after {
  content: '';
  position: absolute;
  right: 9%;
  bottom: -92px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #d8bd84, #9a7047 45%, #533d35 72%);
  box-shadow: inset -28px -22px 50px rgba(8,18,30,.45), 0 0 80px rgba(222,188,116,.12);
}
.edu-hero .eyebrow { position: relative; z-index: 2; color: #f0c86f !important; }
.edu-hero h1 {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 8px 0 18px;
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.edu-hero h1 span { color: #bad7d0; }
.edu-hero .landing-lead { position: relative; z-index: 2; max-width: 650px; margin: 0; color: #dce6eb; font-size: 1.1rem; }
.edu-orbit { position: absolute; z-index: 1; border: 1px solid rgba(219,235,244,.18); border-radius: 50%; transform: rotate(-18deg); }
.edu-orbit-one { right: -45px; top: -55px; width: 430px; height: 250px; }
.edu-orbit-two { right: 65px; top: 38px; width: 280px; height: 155px; }
.course-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.course-choice {
  position: relative;
  min-height: 330px;
  padding: 34px;
  overflow: hidden;
  border-radius: 24px;
  color: white;
  box-shadow: 0 14px 35px rgba(28,42,48,.13);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.course-choice:hover { transform: translateY(-4px); text-decoration: none; box-shadow: 0 20px 40px rgba(28,42,48,.2); }
.course-choice-astronomy { background: linear-gradient(145deg, #101d38, #334c79); }
.course-choice-geoscience { background: linear-gradient(145deg, #415b50, #9a6f48); }
.course-choice::after { content: ''; position: absolute; right: -60px; bottom: -75px; width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.course-symbol { display: grid; width: 55px; height: 55px; margin-bottom: 42px; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(255,255,255,.08); font-size: 1.7rem; }
.course-kicker { color: rgba(255,255,255,.72); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.course-choice h2 { margin: 6px 0 10px; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.course-choice p { max-width: 430px; margin: 0; color: rgba(255,255,255,.82); }
.course-enter { position: relative; z-index: 2; display: inline-block; margin-top: 26px; font-weight: 750; }
.edu-welcome { max-width: 720px; margin: 70px auto 10px; text-align: center; }
.edu-welcome h2 { margin: 6px 0 10px; color: #1a3850; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.edu-welcome p:last-child { color: #617076; }

.course-hero { position: relative; min-height: 320px; padding: 58px; overflow: hidden; border-radius: 28px; color: white; }
.course-hero::after { content: ''; position: absolute; right: -90px; top: -110px; width: 340px; height: 340px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.04), 0 0 0 110px rgba(255,255,255,.025); }
.course-hero-astronomy { background: linear-gradient(135deg, #0c1831, #27486f 70%, #4f6684); }
.course-hero-geoscience { background: linear-gradient(135deg, #29463e, #647354 60%, #a0714d); }
.course-back { position: relative; z-index: 2; display: inline-block; margin-bottom: 60px; color: rgba(255,255,255,.76); font-weight: 650; }
.course-hero .eyebrow { position: relative; z-index: 2; color: #f1ce7c !important; }
.course-hero h1 { position: relative; z-index: 2; margin: 5px 0 12px; font-size: clamp(2.7rem, 7vw, 5rem); line-height: 1; letter-spacing: -.05em; }
.course-hero > p:last-child { position: relative; z-index: 2; max-width: 690px; margin: 0; color: rgba(255,255,255,.82); font-size: 1.08rem; }
.course-dashboard { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-top: 24px; }
.course-dashboard article { min-height: 245px; padding: 28px; border: 1px solid #dce1de; border-radius: 18px; background: #fffdf8; }
.course-dashboard-primary { grid-row: span 2; }
.dashboard-number { color: #a56f3e; font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.course-dashboard h2 { margin: 12px 0 9px; color: #1d4050; font-size: 1.6rem; }
.course-dashboard p { color: #647076; }
.coming-soon { display: inline-block; margin-top: 25px; padding: 7px 10px; border-radius: 999px; background: #e8efeb; color: #3e6558; font-size: .76rem; font-weight: 750; }
.course-topic-list { margin: 16px 0 0; padding: 0; list-style: none; }
.course-topic-list li { padding: 9px 0; border-bottom: 1px solid #e8e7df; color: #536268; }
.course-topic-list li::before { content: '•'; margin-right: 9px; color: #b67b3e; }
.edu-game-link { margin-top: 20px; background: #1f4d5b; }
.edu-game-link:hover { background: #163946; }
.resource-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.resource-card {
  display: block;
  min-height: 280px;
  padding: 28px;
  border: 1px solid #dce1de;
  border-radius: 20px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(28,48,56,.06);
}
.resource-card:hover { text-decoration: none; }
.resource-card-video { background: linear-gradient(145deg, #fffdf8, #eef3f7); }
.resource-card-game { border-color: transparent; background: linear-gradient(145deg, #243c57, #416d76); color: white; transition: transform 180ms ease; }
.resource-card-game:hover { transform: translateY(-3px); }
.resource-card-game h2, .resource-card-game p { color: white; }
.resource-card-game p { opacity: .8; }
.resource-icon { display: grid; width: 45px; height: 45px; margin-bottom: 26px; place-items: center; border-radius: 50%; background: #e8eeeb; color: #315e5d; font-size: 1.15rem; }
.resource-card-game .resource-icon { background: rgba(255,255,255,.12); color: #f2cf78; }
.resource-card h2 { margin: 7px 0 9px; color: #1d4050; font-size: 1.55rem; }
.resource-card p { max-width: 470px; margin: 0; color: #647076; }
.resource-card-link { display: inline-block; margin-top: 25px; color: #f1d58f; font-weight: 750; }
.resource-items { display: grid; gap: 9px; margin-top: 20px; }
.resource-items a { display: block; padding: 12px; border: 1px solid #dde4e1; border-radius: 11px; background: rgba(255,255,255,.7); color: #214555; }
.resource-items a:hover { border-color: #9db4ae; text-decoration: none; }
.resource-items strong, .resource-items span { display: block; }
.resource-items span { margin-top: 3px; color: #66757a; font-size: .82rem; }
.resource-image-items img { width: 100%; max-height: 150px; margin-bottom: 9px; border-radius: 8px; object-fit: cover; }
.resource-card-game .resource-items a { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: white; }
.resource-card-game .resource-items span { color: rgba(255,255,255,.7); }
.topic-shelf { display: grid; grid-template-columns: .8fr 1.2fr; gap: 45px; margin: 64px 0 10px; padding: 36px; border-top: 1px solid #cfd8d5; border-bottom: 1px solid #cfd8d5; }
.topic-shelf h2 { margin: 6px 0 0; color: #1d4050; font-size: 1.8rem; }
.topic-shelf .course-topic-list { margin: 0; }

.geoscience-overview, .curriculum-path, .additional-resources { margin-top: 58px; }
.curriculum-heading { display: grid; grid-template-columns: .9fr 1.1fr; align-items: end; gap: 45px; margin-bottom: 24px; }
.curriculum-heading h2, .additional-resources h2 { margin: 6px 0 0; color: #1d4050; font-size: clamp(1.8rem, 4vw, 2.65rem); }
.curriculum-heading > p, .additional-resources > div > p:last-child { margin: 0; color: #647076; }
.big-idea-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.big-idea-card { position: relative; min-height: 185px; padding: 26px 26px 24px 76px; overflow: hidden; border: 1px solid #d7dfd9; border-radius: 18px; background: linear-gradient(145deg, #fffdf8, #edf2ec); }
.big-idea-card > span { position: absolute; left: 23px; top: 27px; color: #a56f3e; font-size: .72rem; font-weight: 850; letter-spacing: .12em; }
.big-idea-card h3 { margin: 0 0 9px; color: #294a44; font-size: 1.25rem; line-height: 1.18; }
.big-idea-card p { margin: 0; color: #61716d; }
.science-quest { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(300px, .9fr); align-items: center; gap: 24px; margin-top: 22px; padding: 28px; border-radius: 20px; background: linear-gradient(135deg, #1d4050, #315e5d 58%, #6f704b); color: white; box-shadow: 0 12px 28px rgba(27,55,62,.14); }
.quest-emblem { display: grid; width: 70px; height: 70px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.08); color: #f2d17f; font-size: 1.8rem; }
.quest-copy .eyebrow { color: #f2d17f !important; }
.quest-copy h2 { margin: 5px 0 7px; color: white; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.quest-copy p:last-child { margin: 0; color: rgba(255,255,255,.78); }
.quest-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quest-steps li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.09); color: rgba(255,255,255,.9); font-size: .86rem; font-weight: 700; }
.quest-steps span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #f2d17f; color: #27484a; font-size: .72rem; font-weight: 900; }
.curriculum-units { display: grid; gap: 15px; }
.curriculum-unit { display: grid; grid-template-columns: 105px minmax(0, 1fr); overflow: hidden; border: 1px solid #d5ddd9; border-radius: 20px; background: #fffdf8; box-shadow: 0 7px 20px rgba(29,57,61,.05); }
.curriculum-unit-number { display: flex; min-height: 235px; align-items: center; justify-content: center; flex-direction: column; background: linear-gradient(165deg, #294b44, #516c5b); color: white; }
.curriculum-unit-number span { color: rgba(255,255,255,.67); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.curriculum-unit-number strong { margin-top: 2px; font-size: 3rem; line-height: 1; }
.curriculum-unit-body { min-width: 0; padding: 25px 28px; }
.curriculum-unit-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.curriculum-unit-title p { margin: 0 0 5px; color: #a0673b; font-size: .7rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.curriculum-unit-title h3 { margin: 0; color: #1d4050; font-size: clamp(1.45rem, 3vw, 2rem); }
.unit-title-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 8px; }
.unit-resource-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: #e7eee9; color: #46635a; font-size: .72rem; font-weight: 750; }
.unit-badge { display: flex; align-items: center; gap: 7px; color: #765c28; }
.unit-badge::before { content: '\2726'; display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #d8bd7c; border-radius: 50%; background: #fff5d8; }
.unit-badge small, .unit-badge strong { display: block; }
.unit-badge small { color: #8a8170; font-size: .58rem; font-weight: 750; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.unit-badge strong { font-size: .76rem; }
.curriculum-details { margin-top: 18px; border-top: 1px solid #e3e7e3; border-bottom: 1px solid #e3e7e3; }
.curriculum-details summary { padding: 12px 0; color: #355b55; cursor: pointer; font-weight: 750; }
.curriculum-detail-grid { display: grid; grid-template-columns: 1fr; gap: 28px; max-width: 760px; padding: 4px 0 18px; }
.curriculum-detail-grid h4 { margin: 0 0 8px; color: #294a44; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.curriculum-detail-grid ul { margin: 0; padding-left: 18px; }
.curriculum-detail-grid li, .curriculum-detail-grid p { margin: 0 0 6px; color: #647076; font-size: .88rem; }
.unit-resource-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.unit-resource-item { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 74px; padding: 9px; border: 1px solid #dce3df; border-radius: 12px; background: white; color: #1d4050; }
.unit-resource-item:hover { border-color: #95aaa2; text-decoration: none; }
.unit-resource-item > img, .unit-resource-icon { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; }
.unit-resource-icon { display: grid; place-items: center; background: #e8efeb; color: #3c665c; font-size: 1.2rem; }
.unit-resource-item > span:last-child { min-width: 0; }
.unit-resource-item small, .unit-resource-item strong, .unit-resource-item em { display: block; }
.unit-resource-item small { color: #a0673b; font-size: .61rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.unit-resource-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-resource-item em { overflow: hidden; margin-top: 2px; color: #6b777a; font-size: .76rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.unit-empty { margin: 16px 0 0; color: #7a8584; font-size: .86rem; font-style: italic; }
.additional-resources { padding: 30px; border: 1px solid #d5ddd9; border-radius: 20px; background: #f2f5f1; }
.additional-resources > div:first-child { max-width: 720px; }

.game-lab-hero { position: relative; min-height: 360px; padding: 66px 56px; overflow: hidden; border-radius: 28px; background: linear-gradient(135deg, #17273d, #315d67 58%, #886446); color: white; }
.game-lab-hero::before, .game-lab-hero::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.18); transform: rotate(28deg); }
.game-lab-hero::before { right: 70px; top: 40px; width: 150px; height: 150px; border-radius: 32px; }
.game-lab-hero::after { right: -30px; bottom: -60px; width: 250px; height: 250px; border-radius: 50%; }
.game-lab-hero .eyebrow { position: relative; z-index: 2; color: #f0cb73 !important; }
.game-lab-hero h1 { position: relative; z-index: 2; max-width: 760px; margin: 8px 0 16px; font-size: clamp(3rem, 8vw, 5.6rem); line-height: .96; letter-spacing: -.055em; }
.game-lab-hero p:last-child { position: relative; z-index: 2; max-width: 680px; margin: 0; color: rgba(255,255,255,.82); font-size: 1.08rem; }
.game-collections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 24px; }
.game-collection { min-height: 410px; padding: 34px; border-radius: 22px; color: white; box-shadow: 0 12px 30px rgba(25,45,54,.12); }
.game-collection-space { background: linear-gradient(150deg, #131f3c, #3c527b); }
.game-collection-earth { background: linear-gradient(150deg, #38564b, #9b704b); }
.game-collection h2 { margin: 12px 0; font-size: clamp(1.8rem, 4vw, 2.45rem); line-height: 1.08; }
.game-collection p, .game-collection li { color: rgba(255,255,255,.8); }
.game-collection ul { margin: 25px 0; padding-left: 20px; }
.game-collection li { margin-bottom: 8px; }
.game-collection .coming-soon { background: rgba(255,255,255,.12); color: #f6dc9d; }
.game-lab-note { display: flex; align-items: center; gap: 24px; margin: 55px 0 5px; padding: 30px; border: 1px solid #d7dfdc; border-radius: 18px; background: #fffdf8; }
.game-lab-note > span { display: grid; flex: 0 0 58px; height: 58px; place-items: center; border-radius: 50%; background: #e6eeea; color: #315e5d; font-size: 1.45rem; }
.game-lab-note h2 { margin: 0 0 5px; color: #1d4050; }
.game-lab-note p { margin: 0; color: #647076; }
.published-games { margin: 42px 0 10px; }
.published-games-heading h2 { margin: 5px 0 18px; color: #1d4050; font-size: 2rem; }
.published-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.published-game-card { display: block; min-height: 230px; padding: 25px; border-radius: 18px; background: #fffdf8; color: #1d4050; box-shadow: 0 8px 22px rgba(28,48,56,.08); }
.published-game-card:hover { transform: translateY(-2px); text-decoration: none; }
.published-game-card > span { color: #a56f3e; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.published-game-card h3 { margin: 26px 0 8px; font-size: 1.4rem; }
.published-game-card p { color: #647076; }
.published-game-card strong { display: inline-block; margin-top: 15px; color: #315e5d; }

.shop-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 22px;
}
.shop-filter label { font-weight: 600; }
.shop-filter select {
  min-width: 210px;
  padding: 9px 12px;
  border: 1px solid #c8c3b5;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.empty-stock { padding: 45px 20px; text-align: center; color: var(--muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.product-card h3 {
  font-size: 1rem;
  margin: 4px 0;
  color: var(--ink);
}

.product-card .price {
  font-weight: bold;
  color: var(--amber-dark);
  margin: 4px 0 12px;
}

.btn {
  display: inline-block;
  background: var(--forest);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
  margin-top: auto;
  text-align: center;
}
.btn:hover { background: var(--forest-dark); text-decoration: none; }
.btn:disabled { background: #999; cursor: not-allowed; }

.btn-primary { background: var(--amber); }
.btn-primary:hover { background: var(--amber-dark); }

.btn-secondary { background: transparent; color: var(--forest); border: 1px solid var(--forest); margin-left: 8px; }
.btn-secondary:hover { background: var(--forest); color: white; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8e2a22; }

.product-detail {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.product-gallery {
  width: 420px;
  max-width: 100%;
}
.gallery-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e8e2d3;
}
.product-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail-video {
  width: 100%;
  height: 100%;
  background: #152018;
}
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.gallery-thumbnail {
  position: relative;
  padding: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #e8e2d3;
  cursor: pointer;
}
.gallery-thumbnail.active { border-color: var(--amber); }
.gallery-thumbnail img,
.gallery-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.video-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(21,32,24,0.82);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
}
.product-detail-info { flex: 1; min-width: 260px; }
.product-detail-info .price { font-size: 1.4rem; color: var(--amber-dark); font-weight: bold; }
.product-detail-info .description { color: var(--ink); margin: 16px 0; }
.stock { color: var(--forest); font-weight: 500; }
.stock.out { color: var(--danger); }
.shipping-note { color: var(--muted); font-size: 0.9rem; }

.qty-row { margin-bottom: 14px; }
.qty-row input { width: 60px; padding: 6px; border-radius: 6px; border: 1px solid #ccc; margin-left: 8px; }

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-table th, .cart-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.cart-table th { background: #efe9d8; }

.cart-row-name { display: flex; align-items: center; gap: 10px; }
.cart-row-name img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

.qty-input { width: 50px; padding: 4px; border-radius: 6px; border: 1px solid #ccc; }

.remove-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
}

.cart-empty { text-align: center; padding: 40px 0; color: var(--muted); }

.order-form {
  max-width: 400px;
  margin-left: auto;
  text-align: left;
}
.order-form label { display: block; margin: 12px 0 4px; font-weight: 500; }
.order-form input, .order-form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1rem;
}
.order-form-note { color: var(--muted); font-size: 0.85rem; margin: 12px 0; }
.order-form #request-btn { width: 100%; margin-top: 4px; }

.cart-summary { margin-top: 20px; text-align: right; }
.cart-total { font-size: 1.3rem; font-weight: bold; }
.shipping-summary {
  max-width: 440px;
  margin: 12px 0 18px auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #efe9d8;
  text-align: left;
}
.shipping-summary p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

.checkout-error {
  background: #fbe4e1;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 10px 0;
  text-align: left;
}

.order-result { text-align: center; padding: 40px 0; }
.order-result.success h1 { color: var(--forest); }
.order-result.cancel h1 { color: var(--danger); }
.order-summary { max-width: 600px; margin: 20px auto; text-align: left; }

.site-footer {
  background: var(--forest-dark);
  color: #c9d3c6;
  padding: 20px 0;
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: #e8c98a; }

/* Admin */
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
.admin-table th { background: #efe9d8; }
.admin-table img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.admin-actions { display: flex; gap: 8px; }
.reorder-controls { display: flex; align-items: center; gap: 5px; }
.reorder-controls form { margin: 0; }
.reorder-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #b9b9aa;
  border-radius: 7px;
  background: white;
  color: var(--forest);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.reorder-btn:hover:not(:disabled) { background: #efe9d8; }
.reorder-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.sort-number { min-width: 1.5rem; text-align: center; font-weight: 600; color: var(--muted); }
.order-table { margin-bottom: 0; }
.inline-form { display: inline; }

.order-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.status-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  text-transform: capitalize;
}
.order-card .cart-total { text-align: right; margin: 10px 0 0; }

.form-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  max-width: 500px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.form-card label { display: block; margin: 12px 0 4px; font-weight: 500; }
.form-card input, .form-card textarea, .form-card select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
}
.form-card textarea { min-height: 100px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
.photo-fieldset { border: 1px solid #d8d2c2; border-radius: var(--radius); margin-top: 18px; padding: 16px; }
.photo-fieldset legend { font-weight: 600; padding: 0 6px; }
.photo-preview {
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: #efe9d8;
  margin-bottom: 12px;
}
.photo-picker { margin-top: 0; }
.selected-media-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.selected-media-preview img,
.selected-media-preview video {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e8e2d3;
  object-fit: cover;
}
.admin-media-section {
  max-width: 780px;
  margin-top: 30px;
}
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.admin-media-card {
  position: relative;
  padding: 12px;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.admin-media-card > img,
.admin-media-card > video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #e8e2d3;
  object-fit: cover;
}
.main-image-label,
.media-type-label {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--forest-dark);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
}
.admin-media-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.admin-media-actions form { flex: 1; }
.admin-media-actions .btn {
  width: 100%;
  margin: 0;
  padding: 8px;
}
.admin-bar-actions { display: flex; align-items: center; gap: 8px; }
.admin-content-heading { display: flex; align-items: end; justify-content: space-between; gap: 35px; margin: 28px 0 36px; }
.admin-content-heading h1 { margin: 4px 0 0; color: #1d4050; }
.admin-content-heading > p { max-width: 520px; margin: 0; color: var(--muted); }
.admin-content-section { margin: 0 0 38px; }
.admin-content-section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; border-bottom: 1px solid #d6dcd8; }
.admin-content-section-title h2 { margin: 0 0 8px; color: #1d4050; }
.admin-content-section-title span { color: var(--muted); font-size: .82rem; }
.admin-content-empty { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; border: 1px dashed #c8ceca; border-radius: 14px; }
.admin-content-empty p { margin: 0; color: var(--muted); }
.admin-content-list { display: grid; gap: 11px; }
.admin-content-card { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid #dce1de; border-radius: 15px; background: white; }
.admin-content-card.is-draft { opacity: .68; background: #f1f0eb; }
.admin-content-preview { display: grid; width: 76px; height: 66px; place-items: center; overflow: hidden; border-radius: 10px; background: #e7eeeb; color: #315e5d; font-size: 1.5rem; }
.admin-content-preview img { width: 100%; height: 100%; object-fit: cover; }
.admin-content-copy { min-width: 0; }
.admin-content-copy h3 { margin: 3px 0; color: #244958; }
.admin-content-copy > p { max-width: 620px; margin: 3px 0 0; overflow: hidden; color: #657176; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-content-copy .admin-content-topic { color: #9a693c; font-weight: 650; }
.admin-content-meta { display: flex; align-items: center; gap: 8px; font-size: .68rem; text-transform: uppercase; }
.admin-content-meta span { color: #707b7d; font-weight: 750; letter-spacing: .1em; }
.admin-content-meta strong { padding: 3px 6px; border-radius: 999px; font-size: .62rem; }
.admin-content-meta .published { background: #dcecdf; color: #28633a; }
.admin-content-meta .draft { background: #e3e1db; color: #68655d; }
.admin-content-controls { display: flex; align-items: center; gap: 7px; }
.admin-content-controls form { margin: 0; }
.admin-content-controls .btn { margin: 0; padding: 8px 10px; font-size: .76rem; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 35px; margin: 28px 0 24px; }
.results-heading h1 { margin: 4px 0 0; color: #1d4050; }
.results-heading > p { max-width: 530px; margin: 0; color: var(--muted); }
.results-search { margin-bottom: 22px; padding: 17px; border: 1px solid #d5ddda; border-radius: 13px; background: white; }
.results-search label { display: grid; gap: 7px; color: #294f5b; font-weight: 750; }
.results-filter-grid { display: grid; grid-template-columns: minmax(250px, 2fr) minmax(170px, 1fr) minmax(180px, 1fr); gap: 12px; }
.results-search input, .results-search select { min-width: 0; width: 100%; padding: 10px 12px; border: 1px solid #bfcac6; border-radius: 8px; background: white; font: inherit; }
.results-search input { text-transform: uppercase; }
.results-filter-actions { display: flex; gap: 8px; margin-top: 13px; }
.results-search .btn { margin: 0; white-space: nowrap; }
.results-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.results-summary article { padding: 16px; border: 1px solid #d7dfdb; border-radius: 13px; background: white; }
.results-summary span { display: block; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.results-summary strong { display: block; margin-top: 4px; color: #265765; font-size: 1.75rem; }
.results-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.results-table { min-width: 930px; }
.results-table tr.result-earned td:first-child { border-left: 4px solid #6e9d61; }
.badge-code-cell { color: #245d58; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.results-table small { color: var(--muted); }
.results-table .result-delete-form { margin: 0; }
.results-table .btn-small { margin: 0; padding: 7px 10px; font-size: .74rem; }
.results-cleanup { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 16px 18px; border: 1px solid #dfd4c8; border-radius: 13px; background: #fffaf3; }
.results-cleanup h2 { margin: 0 0 4px; color: #694b32; font-size: 1rem; }
.results-cleanup p { margin: 0; color: var(--muted); }
.results-cleanup form, .results-cleanup .btn { margin: 0; }
.results-cleanup .btn:disabled { cursor: not-allowed; opacity: .5; }
.results-empty { padding: 22px; border: 1px dashed #bdcac4; border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.55); }
.content-form-heading { display: flex; align-items: end; justify-content: space-between; max-width: 780px; margin-bottom: 20px; }
.content-form-heading h1 { margin: 3px 0 0; color: #1d4050; }
.content-form-card { max-width: 780px; }
.content-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.optional-label { color: var(--muted); font-size: .76rem; font-weight: 400; }
.publish-toggle { display: flex !important; align-items: flex-start; gap: 10px; margin-top: 20px !important; padding: 14px; border-radius: 10px; background: #eef3f0; cursor: pointer; }
.publish-toggle input[type='checkbox'] { width: 20px; height: 20px; margin-top: 2px; }
.publish-toggle strong, .publish-toggle small { display: block; }
.publish-toggle small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.current-content-file { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.current-content-file img { width: 150px; max-height: 110px; border-radius: 9px; object-fit: cover; }
.current-content-file > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 9px; background: #e7eeeb; font-size: 1.3rem; }
.content-file-preview { margin-bottom: 12px; }
.content-file-preview img { width: 180px; max-height: 130px; border-radius: 9px; object-fit: cover; }
.content-file-preview .document-preview { padding: 12px; border-radius: 9px; background: #e7eeeb; color: #315e5d; }
.field-help, .security-note { color: var(--muted); font-size: 0.85rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Hidden Atta texana game */
body.atta-game-open { overflow: hidden; }
.atta-game[hidden] { display: none !important; }
.atta-game {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}
.atta-game:fullscreen {
  width: 100vw;
  height: 100dvh;
  padding: 0;
  background: #17271d;
}
.atta-game:fullscreen .atta-game-panel { width: 100%; min-height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
.atta-game-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 28, 21, 0.86);
  backdrop-filter: blur(5px);
}
.atta-game-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 20px;
  background: #f6f0df;
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}
.atta-game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 15px;
  border-bottom: 1px solid #d8d0b9;
  background: linear-gradient(135deg, #244b3d, #426a50);
  color: white;
}
.atta-game-header h2 {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.atta-header-actions { display: flex; align-items: center; gap: 10px; }
.atta-codex-open {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 750;
  touch-action: manipulation;
}
.atta-codex-open:hover { background: rgba(255,255,255,.2); }
.atta-restart { border-color: rgba(244, 189, 142, .7); color: #ffe2c7; }
.atta-game-kicker {
  margin: 0;
  color: #d5e6c5;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.atta-game-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 50%;
  background: rgba(0,0,0,0.12);
  color: white;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}
.atta-game-close:hover { background: rgba(0,0,0,0.28); }
.atta-game-stats {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr .8fr 1.2fr;
  gap: 1px;
  background: #d8d0b9;
}
.atta-game-stats > div {
  padding: 12px 18px;
  background: #fffaf0;
}
.atta-game-stats span {
  display: block;
  color: #6c6a59;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.atta-game-stats strong {
  display: block;
  margin-top: 2px;
  color: #294b3c;
  font-size: 1rem;
}
.atta-game-stats strong span {
  display: inline;
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.atta-health {
  display: block !important;
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1c9bc;
}
.atta-health span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b7392f, #e28948, #79a956);
  transition: width 180ms ease;
}
.atta-progress {
  height: 8px;
  overflow: hidden;
  background: #d4ccb4;
}
.atta-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6f9a58, #d0a348);
  transition: width 300ms ease;
}
.atta-game-meta {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(240px, 1.25fr) minmax(130px, .55fr);
  align-items: center;
  gap: 14px;
  padding: 9px 18px;
  border-bottom: 1px solid #d8d0b9;
  background: #f0ead8;
  color: #4b5547;
  font-size: .78rem;
}
.atta-garden-meter { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.atta-garden-meter > span:first-child, .atta-records span { font-weight: 700; }
.atta-garden-track { height: 8px; overflow: hidden; border-radius: 999px; background: #d7c8ad; }
.atta-garden-track span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg,#8e633d,#86aa55); transition: width .2s; }
.atta-garden-track span.danger { background: linear-gradient(90deg,#8c2e2b,#d77a3e); }
.atta-event { padding: 5px 10px; border-radius: 999px; background: #dce7cc; color: #35513c; font-weight: 750; text-align: center; }
.atta-event.danger { background: #ead7e9; color: #713c72; }
.atta-event.raid { background: #efd3cb; color: #7a2f28; }
.atta-event.rare { background: #f2e2b4; color: #765016; }
.atta-records { display: flex; justify-content: space-between; gap: 8px; }
.atta-game-field-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: clamp(280px, 48vh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 18px 0;
  overflow: hidden;
  border: 4px solid #7d6546;
  border-radius: 14px;
  background: #dbe5bd;
  box-shadow: inset 0 0 24px rgba(55,71,38,0.14);
}
.atta-game-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 45 / 26;
  touch-action: none;
}
.atta-game-intro {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 34px;
  background: linear-gradient(145deg, rgba(25,48,36,.98), rgba(47,76,53,.97));
  color: white;
  text-align: center;
}
.atta-game-intro[hidden] { display: none; }
.atta-intro-card { width: min(680px, 100%); margin: auto; }
.atta-game-intro h3 { margin: 4px 0 10px; font-size: clamp(1.5rem, 4vw, 2.35rem); }
.atta-game-intro p { max-width: 630px; margin: 0 auto 18px; color: #e0ead9; line-height: 1.55; }
.atta-intro-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.48); border-radius: 50%; background: rgba(0,0,0,.16); color: white; cursor: pointer; font-size: 1.55rem; }
.atta-intro-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 0 auto 18px; }
.atta-intro-controls span { padding: 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(255,255,255,.08); color: #dce8d4; font-size: .78rem; }
.atta-intro-controls strong { display: block; color: white; font-size: .86rem; }
.atta-fact { font-style: italic; font-size: 0.85rem; color: #c9e6b9 !important; }
.atta-intro-ant { font-size: 2.4rem; }
.atta-start { margin: 0; background: #c57944; }
.atta-intro-buttons { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.atta-intro-reset { padding: 9px 12px; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; background: transparent; color: #f4e8d6; cursor: pointer; font: inherit; font-size: .82rem; }
.atta-intro-reset:hover { background: rgba(255,255,255,.1); }
.atta-start:hover { background: #a55f31; }
.atta-game-status {
  min-height: 24px;
  margin: 12px 20px 6px;
  color: #365b48;
  font-weight: 700;
  text-align: center;
}
.atta-game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 8px 20px 20px;
}
.atta-game-instructions {
  max-width: 650px;
  color: #676556;
  font-size: 0.86rem;
}
.atta-game-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.atta-game-actions .btn { margin: 0; }
.atta-attack {
  border-color: #8f492c;
  background: linear-gradient(135deg, #a94e2f, #d17b3e);
  box-shadow: 0 4px 0 #71331f;
}
.atta-attack:hover { background: linear-gradient(135deg, #8f3e27, #bd6533); }
.atta-attack:active { transform: translateY(2px); box-shadow: 0 2px 0 #71331f; }
.atta-special {
  border-color: #45684b;
  background: linear-gradient(135deg, #456b4c, #71915a);
  box-shadow: 0 4px 0 #2e4c35;
}
.atta-special:hover { background: linear-gradient(135deg, #365c40, #607f4f); }
.atta-special:disabled {
  cursor: wait;
  opacity: .68;
  box-shadow: none;
}
.atta-reset {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: #8b4939;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.atta-touch-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 20px 24px;
  touch-action: none;
}
.atta-joystick {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 132px;
  height: 128px;
  color: #48624e;
  font-size: .65rem;
  letter-spacing: .1em;
  touch-action: none;
  user-select: none;
}
.atta-joystick-base {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin-bottom: 3px;
  border: 2px solid #829788;
  border-radius: 50%;
  background: radial-gradient(circle, #eef3e9 0 35%, #d9e2d4 36% 64%, #c5d2c4 65%);
  box-shadow: inset 0 3px 10px rgba(37,67,48,.16), 0 4px 10px rgba(0,0,0,.1);
}
.atta-joystick-base::before, .atta-joystick-base::after { content: ''; position: absolute; background: rgba(59,91,69,.18); }
.atta-joystick-base::before { width: 2px; height: 78%; }
.atta-joystick-base::after { width: 78%; height: 2px; }
.atta-joystick-knob {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border: 2px solid #355a43;
  border-radius: 50%;
  background: linear-gradient(145deg,#587d60,#365b46);
  box-shadow: 0 5px 10px rgba(30,56,39,.3);
  transition: transform 60ms linear;
  pointer-events: none;
}
.atta-touch-actions { display: grid; grid-template-columns: repeat(2, minmax(84px, 1fr)); gap: 8px; }
.atta-touch-actions button {
  min-width: 0;
  border: 1px solid #67816e;
  border-radius: 15px;
  background: #edf2e5;
  color: #294b3c;
  font: inherit;
  font-weight: 750;
  touch-action: none;
  user-select: none;
}
.atta-touch-actions button:active { filter: brightness(.9); transform: translateY(1px); }
.atta-touch-actions .atta-touch-attack, .atta-touch-actions .atta-touch-special {
  height: 84px;
  color: white;
}
.atta-touch-actions .atta-touch-attack {
  border-color: #8f492c;
  background: linear-gradient(145deg, #b45431, #dd8846);
}
.atta-touch-actions .atta-touch-special {
  border-color: #45684b;
  background: linear-gradient(145deg, #456b4c, #71915a);
}
.atta-touch-actions button strong { display: block; font-size: .9rem; letter-spacing: .05em; }
.atta-touch-actions button span { display: block; margin-top: 3px; font-size: .62rem; opacity: .82; }
.atta-touch-actions .atta-touch-utility { height: 34px; border-radius: 9px; font-size: .72rem; }
.atta-touch-actions .atta-touch-special:disabled { opacity: .62; }
.atta-codex[hidden] { display: none; }
.atta-codex {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20,32,24,.84);
  backdrop-filter: blur(4px);
}
.atta-codex-card {
  width: min(760px, 100%);
  max-height: min(680px, calc(100dvh - 48px));
  overflow: auto;
  border: 1px solid #b9ae91;
  border-radius: 18px;
  background: #fbf6e8;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.atta-codex-heading { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: #294c3d; color: white; }
.atta-codex-heading p { margin: 0; color: #c9ddc1; font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.atta-codex-heading h3 { margin: 2px 0 0; }
.atta-codex-heading button { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: transparent; color: white; cursor: pointer; font-size: 1.35rem; }
.atta-codex-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 18px; }
.atta-codex-list section { padding: 16px; border: 1px solid #ddd2b8; border-radius: 12px; background: white; }
.atta-codex-list section > span { color: #8c6841; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.atta-codex-list h4 { margin: 3px 0 12px; color: #294c3d; }
.atta-codex-list article + article { margin-top: 11px; padding-top: 11px; border-top: 1px solid #e8e0cf; }
.atta-codex-list article strong { color: #563627; font-size: .85rem; }
.atta-codex-list article p { margin: 3px 0 0; color: #626052; font-size: .8rem; line-height: 1.45; }

@media (hover: none), (pointer: coarse) {
  .atta-touch-controls { display: grid; }
}

.login-card {
  background: white;
  max-width: 360px;
  margin: 60px auto;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.login-card h1 { margin-top: 0; text-align: center; font-size: 1.3rem; }
.error-msg { color: var(--danger); margin-bottom: 10px; }
.success-msg { color: var(--forest); background: #e5f1e6; padding: 10px 12px; border-radius: 7px; }

.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  background: #efe9d8;
  color: var(--ink);
}
.tabs a.active { background: var(--forest); color: white; }

@media (max-width: 700px) {
  .header-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .logo { font-size: 1.15rem; }
  .main-nav { width: 100%; justify-content: space-between; gap: 12px; }
  .main-nav a { font-size: .9rem; }
  .edu-hero { min-height: 420px; padding: 46px 26px; border-radius: 22px; }
  .edu-hero::after { right: -78px; bottom: -70px; width: 230px; height: 230px; }
  .edu-hero h1 { font-size: clamp(2.65rem, 14vw, 4rem); }
  .edu-hero .landing-lead { max-width: 88%; font-size: 1rem; }
  .course-choices { grid-template-columns: 1fr; }
  .course-choice { min-height: 300px; padding: 28px; }
  .course-symbol { margin-bottom: 30px; }
  .edu-welcome { margin-top: 48px; }
  .course-hero { min-height: 360px; padding: 36px 26px; border-radius: 22px; }
  .course-back { margin-bottom: 72px; }
  .course-dashboard { grid-template-columns: 1fr; }
  .course-dashboard-primary { grid-row: auto; }
  .resource-library, .game-collections { grid-template-columns: 1fr; }
  .resource-card { min-height: 260px; }
  .topic-shelf { grid-template-columns: 1fr; gap: 22px; margin-top: 45px; padding: 28px 8px; }
  .geoscience-overview, .curriculum-path, .additional-resources { margin-top: 42px; }
  .curriculum-heading, .big-idea-grid { grid-template-columns: 1fr; gap: 14px; }
  .science-quest { grid-template-columns: 52px minmax(0,1fr); gap: 16px; padding: 22px 18px; }
  .quest-emblem { width: 52px; height: 52px; font-size: 1.35rem; }
  .quest-steps { grid-column: 1 / -1; }
  .big-idea-card { min-height: 0; padding: 22px 20px 22px 62px; }
  .big-idea-card > span { left: 19px; top: 23px; }
  .curriculum-unit { grid-template-columns: 58px minmax(0, 1fr); border-radius: 15px; }
  .curriculum-unit-number { min-height: 0; justify-content: flex-start; padding-top: 24px; }
  .curriculum-unit-number strong { font-size: 2rem; }
  .curriculum-unit-body { padding: 21px 16px; }
  .curriculum-unit-title { align-items: flex-start; flex-direction: column; gap: 10px; }
  .unit-title-meta { align-items: flex-start; }
  .unit-badge small { text-align: left; }
  .curriculum-detail-grid, .unit-resource-list { grid-template-columns: 1fr; }
  .additional-resources { padding: 22px 16px; }
  .game-lab-hero { min-height: 390px; padding: 48px 26px; border-radius: 22px; }
  .game-collection { min-height: 380px; padding: 28px; }
  .game-lab-note { align-items: flex-start; }
  .nav-dropdown-menu { right: -70px; width: 210px; }
  .category-panels, .ordering-steps { grid-template-columns: 1fr; }
  .landing-hero { margin-top: 8px; }
  .landing-actions .btn { width: 100%; }
  .shop-filter { align-items: stretch; flex-direction: column; }
  .shop-filter select { width: 100%; }
  .product-gallery { width: 100%; }
  .gallery-thumbnails { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .selected-media-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atta-game { padding: 0; }
  .atta-game-panel {
    width: 100%;
    max-height: 100vh; max-height: 100dvh;
    min-height: 100vh; min-height: 100dvh;
    border: 0; border-radius: 0;
  }
  .atta-game-header { padding: max(10px, env(safe-area-inset-top)) 12px 8px; }
  .atta-game-header h2 { font-size: 1.12rem; }
  .atta-game-kicker { display: none; }
  .atta-header-actions { gap: 7px; }
  .atta-codex-open { padding: 7px 9px; font-size: .7rem; }
  .atta-game-close { width: 34px; height: 34px; }
  .atta-game-stats { grid-template-columns: repeat(4, 1fr); }
  .atta-game-stats > div { min-width: 0; padding: 6px 8px; }
  .atta-game-stats > div:nth-child(4) { display: none; }
  .atta-game-stats span { font-size: .58rem; letter-spacing: .035em; }
  .atta-game-stats strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
  .atta-health-stat { grid-column: auto; }
  .atta-health { margin-top: 4px; }
  .atta-progress { height: 5px; }
  .atta-game-meta { grid-template-columns: 1fr auto; gap: 7px; padding: 6px 9px; font-size: .67rem; }
  .atta-garden-meter { min-width: 0; grid-template-columns: auto minmax(55px,1fr) auto; gap: 5px; }
  .atta-event { grid-column: 1 / -1; grid-row: 2; padding: 3px 7px; }
  .atta-records { white-space: nowrap; }
  .atta-records span { display: none; }
  .atta-records strong::before { content: 'PB '; color: #77715e; font-weight: 600; }
  .atta-game-field-wrap { height: auto; min-height: 0; margin: 7px 6px 0; border-width: 3px; }
  .atta-game-intro { padding: max(56px, calc(env(safe-area-inset-top) + 44px)) 18px max(20px, env(safe-area-inset-bottom)); }
  .atta-intro-card { margin: auto; }
  .atta-game-intro p { font-size: 0.88rem; }
  .atta-intro-controls { grid-template-columns: 1fr; gap: 6px; }
  .atta-intro-controls span { padding: 7px 10px; }
  .atta-game-status { margin: 4px 10px 1px; font-size: 0.78rem; min-height: 18px; }
  .atta-game-toolbar { display: none; }
  .atta-game-instructions { display: none; }
  .atta-game-actions { width: 100%; justify-content: center; gap: 18px; }
  .atta-game-actions .atta-attack, .atta-game-actions .atta-special { display: none; }
  .atta-game-actions .btn { padding: 6px 12px; font-size: .75rem; }
  .atta-touch-controls { display: flex; min-height: 138px; padding: 3px 8px max(8px, env(safe-area-inset-bottom)); }
  .atta-codex { padding: 10px; }
  .atta-codex-card { max-height: calc(100dvh - 20px); border-radius: 13px; }
  .atta-codex-heading { padding: 13px 15px; }
  .atta-codex-list { grid-template-columns: 1fr; gap: 9px; padding: 10px; }
  .atta-codex-list section { padding: 12px; }
  .admin-bar { align-items: flex-start; gap: 12px; flex-direction: column; }
  .admin-bar-actions { width: 100%; flex-wrap: wrap; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-actions { min-width: 170px; }
  .form-card { padding: 18px; }
  .form-actions { flex-wrap: wrap; }
  .admin-content-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .results-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .results-filter-grid { grid-template-columns: 1fr; }
  .results-filter-actions { flex-wrap: wrap; }
  .results-cleanup { align-items: flex-start; flex-direction: column; gap: 12px; }
  .results-summary { grid-template-columns: 1fr; }
  .admin-content-card { grid-template-columns: 58px minmax(0,1fr); align-items: start; }
  .admin-content-preview { width: 58px; height: 58px; }
  .admin-content-controls { grid-column: 1 / -1; flex-wrap: wrap; }
  .admin-content-copy > p { white-space: normal; }
  .content-form-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .content-form-grid { grid-template-columns: 1fr; gap: 0; }
  .photo-picker { width: 100%; }
}

/* Landscape phones: wide enough to skip the max-width:700px rules above,
   but too short for the desktop toolbar's instruction text without
   squeezing the game field down to nothing. */
@media (max-height: 480px) {
  .atta-game-header { padding: 8px 16px 6px; }
  .atta-game-kicker { display: none; }
  .atta-game-header h2 { font-size: 1.1rem; }
  .atta-game-stats { display: none; }
  .atta-progress { display: none; }
  .atta-game-meta { grid-template-columns: 1fr 1.2fr auto; padding: 3px 10px; }
  .atta-event { grid-column: auto; grid-row: auto; }
  .atta-game-status { margin: 3px 12px 2px; font-size: 0.8rem; min-height: 18px; }
  .atta-game-toolbar { padding: 2px 12px 4px; }
  .atta-game-instructions { display: none; }
  .atta-touch-controls { padding-bottom: max(5px, env(safe-area-inset-bottom)); }
  .atta-game-intro p { margin-bottom: 8px; font-size: .76rem; }
  .atta-game-intro .atta-fact { display: none; }
}

@media (max-height: 480px) and (max-width: 900px) {
  .atta-game { padding: 0; }
  .atta-game-panel {
    width: 100%;
    min-height: 100vh; min-height: 100dvh;
    max-height: 100vh; max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .atta-game-header { padding: max(6px, env(safe-area-inset-top)) 12px 5px; }
  .atta-game-header h2 { font-size: 1rem; }
  .atta-codex-open { padding: 6px 9px; }
  .atta-game-close { width: 32px; height: 32px; }
  .atta-game-meta { grid-template-columns: 1fr 1.2fr auto; padding: 3px 9px; }
  .atta-event { grid-column: auto; grid-row: auto; }
  .atta-game-field-wrap { margin: 5px 310px 0 5px; border-width: 3px; }
  .atta-game-status { width: calc(100% - 310px); margin-inline: 0; padding-inline: 7px; }
  .atta-touch-controls {
    position: absolute;
    top: 93px;
    right: max(8px, env(safe-area-inset-right));
    display: flex;
    width: 282px;
    min-height: 120px;
    gap: 8px;
    padding: 0;
  }
  .atta-joystick { width: 112px; height: 118px; }
  .atta-joystick-base { width: 88px; height: 88px; }
  .atta-joystick-knob { width: 42px; height: 42px; }
  .atta-touch-actions { flex: 1; grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .atta-touch-actions .atta-touch-attack, .atta-touch-actions .atta-touch-special { height: 76px; }
  .atta-touch-actions .atta-touch-utility { height: 31px; font-size: .66rem; }
  .atta-game-toolbar { display: none; }
  .atta-game-intro { padding: 10px; }
  .atta-game-intro h3 { font-size: 1.1rem; }
  .atta-game-intro p { margin-bottom: 7px; font-size: .72rem; }
  .atta-game-intro .atta-fact { display: none; }
  .atta-intro-ant { display: none; }
}

@media (max-width: 370px) {
  .atta-touch-controls { gap: 7px; }
  .atta-joystick { width: 112px; }
  .atta-joystick-base { width: 92px; height: 92px; }
  .atta-touch-actions { grid-template-columns: repeat(2, minmax(72px, 1fr)); }
  .atta-game-stats > div { padding-inline: 5px; }
  .atta-game-intro p { margin-bottom: 10px; font-size: .78rem; }
}
