:root{
  --bg:#f5f1eb;
  --surface:#ffffff;
  --surface2:#fbf8f4;
  --line:#e8ddd0;

  --text:#241b15;
  --muted:#72675d;

  --primary:#c76a0d;
  --primary2:#e28a1b;
  --soft:#fff4e8;

  --success:#1f8a52;
  --success-bg:#edf9f2;

  --danger:#c54d4d;
  --danger-bg:#fff0f0;

  --shadow:0 14px 34px rgba(69,44,22,.08);

  --radius:22px;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;

  background:
    radial-gradient(
      circle at top left,
      rgba(241,173,83,.10),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      #f6f1ea,
      #f3eee7
    );

  color:var(--text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Sans",
    "Yu Gothic",
    Meiryo,
    sans-serif;
}

button,
select{
  font:inherit;
}

button{
  cursor:pointer;
}

.hidden{
  display:none!important;
}


/* HEADER */

.site-header{
  position:sticky;
  top:0;
  z-index:50;

  background:
    rgba(255,255,255,.94);

  backdrop-filter:
    blur(10px);

  border-bottom:
    1px solid var(--line);
}

.header-inner{
  max-width:1240px;

  margin:auto;

  padding:
    14px 22px;

  display:grid;

  grid-template-columns:
    auto 1fr auto;

  align-items:center;

  gap:18px;
}


.brand{
  display:flex;

  align-items:center;

  gap:14px;

  color:inherit;

  text-decoration:none;
}


.brand img{
  width:180px;

  max-width:38vw;

  height:auto;
}


.brand-text{
  display:flex;

  flex-direction:column;
}


.brand-text small{
  font-size:12px;

  color:var(--muted);
}


.brand-text strong{
  font-size:19px;
}


.main-nav{
  display:flex;

  justify-content:center;

  gap:8px;

  flex-wrap:wrap;
}


.nav-link{
  border:0;

  background:transparent;

  color:#5c5048;

  padding:
    11px 16px;

  border-radius:999px;

  font-weight:700;
}


.nav-link.active,
.nav-link:hover{
  background:var(--soft);

  color:var(--primary);
}


.user-chip{
  padding:
    9px 14px;

  border:
    1px solid #edceb0;

  background:#fffaf4;

  color:#8d5319;

  border-radius:999px;

  font-size:12px;

  font-weight:700;
}


.menu-toggle{
  display:none;

  border:
    1px solid var(--line);

  background:#fff;

  width:44px;

  height:44px;

  border-radius:12px;
}


/* PAGE */

.page-wrap{
  max-width:1240px;

  margin:auto;

  padding:
    24px 22px 50px;
}


.hero-card,
.content-card{
  background:
    rgba(255,255,255,.86);

  border:
    1px solid var(--line);

  border-radius:
    var(--radius);

  box-shadow:
    var(--shadow);
}


.hero-card{
  padding:28px;
}


.content-card{
  padding:24px;

  margin-top:18px;
}


/* HERO */

.hero-grid{
  display:grid;

  grid-template-columns:
    1.35fr .75fr;

  gap:24px;
}


.hero-copy{
  padding:
    18px 8px 10px 6px;
}


.eyebrow{
  margin:
    0 0 10px;

  color:
    var(--primary);

  letter-spacing:
    .12em;

  font-size:
    13px;

  font-weight:
    800;
}


.hero-copy h1{
  margin:
    0 0 14px;

  font-size:
    clamp(34px,5vw,62px);

  line-height:
    1.08;

  letter-spacing:
    -.03em;
}


.lead{
  margin:0;

  color:#564b43;

  font-size:17px;

  line-height:1.9;

  max-width:760px;
}


.hero-actions{
  display:flex;

  gap:12px;

  flex-wrap:wrap;

  margin-top:24px;
}


.streak-line{
  display:flex;

  gap:16px;

  flex-wrap:wrap;

  margin-top:16px;

  color:#6a5c51;

  font-size:14px;
}


.hero-visual{
  display:flex;
}


.hero-logo-card{
  width:100%;

  min-height:280px;

  background:
    linear-gradient(
      180deg,
      #fff9f2,
      #fff
    );

  border:
    1px solid #efddc9;

  border-radius:26px;

  display:flex;

  align-items:center;

  justify-content:center;

  flex-direction:column;

  text-align:center;

  padding:26px;
}


.hero-logo-card img{
  width:min(280px,70%);
}


.hero-logo-card h2{
  font-size:34px;

  line-height:1.25;

  margin:
    16px 0 8px;
}


.hero-logo-card p{
  margin:0;

  color:var(--muted);
}


/* STATS */

.stats-grid{
  margin-top:20px;

  display:grid;

  grid-template-columns:
    repeat(4,1fr);

  gap:14px;
}


.stat-card{
  background:#fff;

  border:
    1px solid var(--line);

  border-radius:18px;

  padding:
    18px 20px;
}


.stat-card span{
  display:block;

  font-size:13px;

  color:var(--muted);

  margin-bottom:10px;
}


.stat-card strong{
  display:block;

  font-size:34px;
}


.stat-card small{
  display:block;

  color:var(--muted);

  margin-top:8px;
}


/* SECTION */

.section-head{
  display:flex;

  justify-content:
    space-between;

  gap:16px;

  align-items:end;

  flex-wrap:wrap;

  margin-bottom:18px;
}


.section-head h2,
.section-head h3{
  margin:
    0 0 4px;
}


.section-head p{
  margin:0;

  color:var(--muted);

  font-size:14px;
}


.text-link{
  border:0;

  background:transparent;

  color:var(--primary);

  font-weight:800;
}


/* RECOMMEND */

.recommend-grid{
  display:grid;

  grid-template-columns:
    1.2fr .8fr;

  gap:16px;
}


.question-preview,
.explain-preview{
  border:
    1px solid var(--line);

  background:
    var(--surface2);

  border-radius:18px;

  padding:18px;
}


.badge,
.success-badge{
  display:inline-flex;

  min-height:30px;

  padding:
    0 12px;

  align-items:center;

  border-radius:999px;

  font-size:12px;

  font-weight:800;
}


.badge{
  background:var(--soft);

  color:#97530d;
}


.badge.ghost{
  background:#f3f0ec;

  color:#665a51;
}


.success-badge{
  background:var(--success-bg);

  color:var(--success);
}


.big-question{
  font-size:22px;

  line-height:1.65;
}


.preview-options{
  display:grid;

  gap:10px;
}


.preview-option{
  border:
    1px solid var(--line);

  background:#fff;

  border-radius:14px;

  padding:
    12px 14px;

  line-height:1.6;
}


.mini-points{
  line-height:1.8;

  color:#594d44;
}


/* CATEGORY */

.category-grid{
  display:grid;

  grid-template-columns:
    repeat(4,1fr);

  gap:14px;
}


.category-card{
  border:
    1px solid var(--line);

  background:#fff;

  border-radius:18px;

  padding:18px;

  text-align:left;
}


.category-card:hover{
  border-color:#ebb37a;

  transform:
    translateY(-2px);
}


.category-card .icon{
  width:52px;

  height:52px;

  border-radius:14px;

  background:var(--soft);

  display:flex;

  align-items:center;

  justify-content:center;

  font-size:26px;

  margin-bottom:14px;
}


.category-card strong{
  display:block;

  font-size:18px;
}


.category-card p{
  color:var(--muted);

  font-size:14px;

  line-height:1.6;
}


.category-card small{
  color:#8a5a29;

  font-weight:800;
}


/* MODES */

.mode-grid{
  display:grid;

  grid-template-columns:
    repeat(4,1fr);

  gap:14px;
}


.mode-card{
  border:
    1px solid var(--line);

  border-radius:18px;

  background:#fff;

  padding:20px;

  text-align:left;

  min-height:120px;
}


.mode-card strong{
  display:block;

  font-size:20px;

  margin-bottom:8px;
}


.mode-card span{
  color:var(--muted);
}


/* FILTER */

.filter-row{
  display:grid;

  grid-template-columns:
    1fr 1fr auto;

  gap:14px;

  align-items:end;
}


.filter-row label span{
  display:block;

  margin-bottom:8px;

  font-size:13px;

  color:var(--muted);

  font-weight:700;
}


.filter-row select{
  width:100%;

  min-height:50px;

  border-radius:14px;

  border:
    1px solid var(--line);

  background:#fff;

  padding:
    0 14px;
}


/* QUIZ */

.quiz-top{
  display:flex;

  justify-content:
    space-between;

  gap:16px;

  align-items:center;

  flex-wrap:wrap;
}


.quiz-meta{
  display:flex;

  gap:8px;

  flex-wrap:wrap;
}


.quiz-count{
  font-weight:800;
}


.progress-bar{
  margin:
    16px 0 22px;

  height:10px;

  background:#efe7df;

  border-radius:999px;

  overflow:hidden;
}


.progress-bar i{
  display:block;

  height:100%;

  background:
    linear-gradient(
      90deg,
      var(--primary),
      var(--primary2)
    );
}


.quiz-question{
  margin:
    0 0 22px;

  font-size:31px;

  line-height:1.55;
}


.options-list{
  display:grid;

  gap:12px;
}


.option-btn{
  border:
    1px solid var(--line);

  background:#fff;

  border-radius:16px;

  padding:
    16px 18px;

  text-align:left;

  font-size:16px;

  font-weight:700;

  line-height:1.75;
}


.option-btn.correct{
  background:#eff9f3;

  border-color:#b5dfc5;
}


.option-btn.wrong{
  background:#fff1f1;

  border-color:#efb8b8;
}


.option-btn.dim{
  opacity:.55;
}


/* ANSWER */

.answer-panel{
  margin-top:18px;

  border:
    1px solid var(--line);

  border-radius:18px;

  background:
    var(--surface2);

  overflow:hidden;
}


.answer-head{
  padding:
    17px 18px;

  font-weight:900;

  font-size:22px;

  scroll-margin-top:120px;
}


.answer-head.success{
  background:
    var(--success-bg);

  color:var(--success);
}


.answer-head.error{
  background:
    var(--danger-bg);

  color:var(--danger);
}


.answer-body{
  padding:20px;
}


.answer-block{
  margin-bottom:20px;
}


.answer-label{
  font-size:13px;

  color:#7a685b;

  font-weight:700;

  margin-bottom:6px;
}


.answer-correct{
  font-size:21px;

  font-weight:800;

  line-height:1.6;
}


.answer-block h4,
.answer-miss h4,
.choice-explain h4{
  margin:
    0 0 8px;
}


.answer-block p,
.answer-miss p{
  margin:0;

  line-height:1.9;
}


.answer-miss{
  margin-bottom:20px;

  padding:
    15px 17px;

  border-radius:14px;

  background:#fff4f4;

  border:
    1px solid #efc4c4;
}


.answer-miss h4{
  color:#a63d3d;
}


.choice-explain{
  margin-top:20px;

  padding-top:20px;

  border-top:
    1px solid var(--line);
}


.choice-row{
  margin-bottom:12px;

  padding:
    13px 15px;

  border-radius:12px;

  border:
    1px solid var(--line);
}


.choice-correct{
  background:#eff9f3;

  border-color:#b5dfc5;
}


.choice-wrong{
  background:#faf8f5;
}


.choice-title{
  font-weight:800;

  margin-bottom:6px;
}


.choice-selected{
  font-size:12px;

  color:#8a7465;
}


.choice-text{
  line-height:1.8;

  color:#4b413a;
}


.point-box{
  margin-top:18px;

  padding:
    15px 17px;

  background:#fff7ea;

  border-left:
    4px solid #eda53d;

  border-radius:
    0 14px 14px 0;
}


.point-box p{
  margin:
    6px 0 0;

  line-height:1.9;
}


.quiz-actions{
  display:flex;

  justify-content:
    space-between;

  gap:12px;

  flex-wrap:wrap;

  margin-top:22px;
}


/* HISTORY */

.history-category-list,
.wrong-question-list{
  display:grid;

  gap:12px;
}


.history-item,
.wrong-item{
  border:
    1px solid var(--line);

  border-radius:18px;

  background:#fff;

  padding:
    16px 18px;
}


.history-line{
  display:flex;

  justify-content:
    space-between;

  gap:12px;

  flex-wrap:wrap;
}


.bar{
  height:10px;

  background:#efe7df;

  border-radius:999px;

  overflow:hidden;

  margin-top:10px;
}


.bar i{
  display:block;

  height:100%;

  background:
    linear-gradient(
      90deg,
      var(--primary),
      var(--primary2)
    );
}


/* MYPAGE */

.profile-card{
  display:grid;

  grid-template-columns:
    repeat(3,1fr);

  gap:14px;
}


.profile-card > div,
.guide-box{
  border:
    1px solid var(--line);

  background:
    var(--surface2);

  border-radius:18px;

  padding:18px;
}


.mypage-actions{
  display:flex;

  gap:12px;

  flex-wrap:wrap;

  margin-top:18px;
}


.guide-box{
  margin-top:18px;
}


/* BUTTON */

.btn{
  border:0;

  min-height:50px;

  padding:
    0 18px;

  border-radius:14px;

  font-weight:800;
}


.btn.large{
  min-width:220px;
}


.btn-primary{
  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--primary2)
    );

  color:#fff;
}


.btn-secondary{
  background:#fff;

  color:var(--primary);

  border:
    1px solid #e4b181;
}


.btn-danger{
  background:#fff1f1;

  color:var(--danger);

  border:
    1px solid #efb8b8;
}


/* FOOTER */

.site-footer{
  padding:
    18px 22px 28px;
}


.footer-inner{
  max-width:1240px;

  margin:auto;

  background:
    linear-gradient(
      135deg,
      #a74d08,
      #cf6e11
    );

  color:#fff;

  border-radius:24px;

  padding:
    18px 22px;

  display:flex;

  gap:16px;

  align-items:center;

  flex-wrap:wrap;
}


.footer-inner img{
  width:170px;

  filter:
    brightness(0)
    invert(1);
}


.footer-inner strong{
  display:block;
}


.footer-inner small{
  opacity:.95;
}


/* TABLET */

@media(max-width:1080px){

  .hero-grid,
  .recommend-grid,
  .filter-row,
  .profile-card{
    grid-template-columns:1fr;
  }

  .stats-grid,
  .category-grid,
  .mode-grid{
    grid-template-columns:
      repeat(2,1fr);
  }
}


/* MOBILE */

@media(max-width:860px){

  .header-inner{
    grid-template-columns:
      auto auto auto;
  }

  .menu-toggle{
    display:block;
  }

  .main-nav{
    grid-column:1/-1;

    display:none;

    flex-direction:column;
  }

  .main-nav.open{
    display:flex;
  }

  .header-user{
    display:none;
  }

  .hero-copy h1{
    font-size:40px;
  }

  .quiz-question{
    font-size:24px;
  }
}


@media(max-width:560px){

  .page-wrap{
    padding:
      16px 14px 38px;
  }

  .brand img{
    width:150px;
  }

  .brand-text strong{
    font-size:15px;
  }

  .hero-card{
    padding:20px;
  }

  .hero-copy h1{
    font-size:34px;
  }

  .lead{
    font-size:15px;
  }

  .stats-grid,
  .category-grid,
  .mode-grid{
    grid-template-columns:1fr;
  }

  .hero-actions,
  .quiz-actions,
  .mypage-actions{
    display:grid;

    grid-template-columns:1fr;
  }

  .quiz-question{
    font-size:21px;
  }

}