:root {
  --leaf: #28724f;
  --moss: #7aa35a;
  --sun: #f0b64d;
  --coral: #d86b52;
  --sky: #d9edf2;
  --ink: #1f2b2a;
  --muted: #64716e;
  --paper: #fbfaf4;
  --line: rgba(31, 43, 42, 0.14);
  --shadow: 0 18px 50px rgba(33, 52, 47, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-hero {
  min-height: 460px;
  background:
    linear-gradient(90deg, rgba(28, 78, 54, 0.82), rgba(28, 78, 54, 0.42) 48%, rgba(255, 255, 255, 0.08)),
    url("assets/thumbnail-background-illustration.png") center / cover;
  color: white;
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sun);
  color: #243127;
  font-size: 0.86rem;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
}

.tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: white;
  padding: 10px 14px;
  min-width: 86px;
}

.tab.is-active {
  background: white;
  color: var(--leaf);
  font-weight: 800;
}

.hero-copy {
  width: min(1180px, calc(100% - 32px));
  margin: auto auto 46px;
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #ffd986;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.3rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 8px;
}

.hero-copy p:last-child {
  max-width: 560px;
  font-size: 1.05rem;
  line-height: 1.8;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 56px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--line);
}

.stats-strip div {
  background: white;
  padding: 22px;
}

.stats-strip span {
  font-size: 2rem;
  font-weight: 900;
}

.stats-strip small {
  color: var(--muted);
  font-weight: 800;
}

.stats-strip p {
  margin: 4px 0 0;
  color: var(--muted);
}

.view {
  display: none;
  padding-top: 34px;
}

.view.is-visible {
  display: block;
}

.layout {
  display: grid;
  gap: 22px;
}

.two-col {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(33, 52, 47, 0.08);
}

.section-title {
  margin-bottom: 20px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #31413e;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
  color: var(--ink);
  padding: 12px 13px;
  outline-color: var(--moss);
}

textarea {
  resize: vertical;
}

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

.file-pick {
  border: 1px dashed rgba(40, 114, 79, 0.4);
  border-radius: 8px;
  padding: 14px;
  background: #f5fbf5;
}

.file-pick input {
  display: none;
}

.file-pick span {
  color: var(--leaf);
}

.file-pick small {
  color: var(--muted);
  font-weight: 600;
}

.primary-action,
.quiz-option,
.mini-action {
  border: 0;
  border-radius: 8px;
  background: var(--leaf);
  color: white;
  font-weight: 900;
  min-height: 48px;
  padding: 12px 16px;
}

.primary-action {
  width: 100%;
}

.thumbnail-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(40, 114, 79, 0.18);
  border-radius: 8px;
  background: #fffef9;
  box-shadow: 0 12px 30px rgba(31, 43, 42, 0.12);
}

.thumbnail-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.tip-list,
.mission-list,
.rank-list,
.log-list {
  display: grid;
  gap: 12px;
}

.tip-item,
.mission-item,
.rank-row,
.log-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
}

.tip-item,
.mission-item,
.rank-row {
  padding: 14px;
}

.tip-list {
  margin-top: 16px;
}

.tip-item strong,
.mission-item strong {
  display: block;
  margin-bottom: 5px;
}

.tip-item p,
.mission-item p,
.reward-box p,
.empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.log-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  overflow: hidden;
}

.log-card img,
.photo-fallback {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--sky), #f5e7ba);
}

.photo-fallback {
  display: grid;
  place-items: center;
  color: var(--leaf);
  font-weight: 900;
}

.log-body {
  padding: 16px;
}

.log-meta,
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  background: #eef6ea;
  color: var(--leaf);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-question {
  font-size: 1.15rem;
  line-height: 1.7;
  font-weight: 900;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.quiz-option {
  background: #edf6ef;
  color: var(--ink);
  text-align: left;
}

.quiz-option.is-correct {
  background: var(--leaf);
  color: white;
}

.quiz-option.is-wrong {
  background: #fbe5df;
  color: #883b2b;
}

.quiz-result {
  min-height: 28px;
  color: var(--muted);
  font-weight: 800;
}

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

.mission-item.is-done {
  background: #f3f8e8;
}

.mini-action {
  min-height: 40px;
  background: var(--sun);
  color: #33250c;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1fr);
  gap: 22px;
}

.podium {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 310px;
}

.podium-step {
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #fff7de, #f0b64d);
  padding: 18px 10px;
  text-align: center;
  min-height: var(--h);
  display: grid;
  align-content: start;
  gap: 10px;
  box-shadow: var(--shadow);
}

.podium-step:first-child {
  order: 2;
}

.podium-step:nth-child(2) {
  order: 1;
}

.podium-step:nth-child(3) {
  order: 3;
}

.medal {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  color: var(--leaf);
  font-size: 1.2rem;
  font-weight: 900;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
}

.rank-no {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf6ef;
  color: var(--leaf);
  font-weight: 900;
}

.reward-box {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #fff5dc;
  border: 1px solid rgba(240, 182, 77, 0.42);
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
  text-align: center;
}

@media (max-width: 820px) {
  .app-hero {
    min-height: 560px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
  }

  .tab {
    flex: 1 0 auto;
  }

  .stats-strip,
  .two-col,
  .ranking-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip {
    border-radius: 8px;
  }

  .log-card {
    grid-template-columns: 1fr;
  }

  .podium {
    min-height: 250px;
  }
}
