*{
box-sizing:border-box;
}

:root{
--navy:#082d6b;
--blue:#1ca3ec;
--green:#76c82f;
--orange:#ff9800;
--yellow:#ffc928;
--pink:#ef4f95;

--bg:#fffdf6;
--card:#ffffff;
--text:#243048;
}

body{
margin:0;

font-family:
"Hiragino Maru Gothic ProN",
"Yu Gothic",
sans-serif;

background:

linear-gradient(
180deg,
#fefcf6 0%,
#fff7e8 100%
);

color:var(--text);
}

.app{

max-width:430px;
margin:0 auto;

background:white;

min-height:100vh;

box-shadow:
0 0 25px rgba(0,0,0,0.06);

display:flex;
flex-direction:column;

}

.hero,
.header{

background:

linear-gradient(
180deg,
#ffffff 0%,
#fff7eb 100%
);

padding:

20px 18px 24px;

text-align:center;

border-bottom:

5px solid var(--navy);

position:relative;

}

.header h1{

margin:0 0 6px;

font-size:22px;

line-height:1.25;

font-weight:900;

color:var(--navy);

white-space:nowrap;

}

@media (max-width:380px){
  .header h1{
    font-size:20px;
  }
}

.header .top-bar{

position:absolute;

top:14px;

left:14px;

}

.header .top-bar + h1{

margin-top:36px;

}

.header .back-button{

min-width:auto;

padding:7px 12px;

border:3px solid var(--navy);

border-radius:12px;

background:white;

color:var(--navy);

font-size:14px;

line-height:1.2;

font-weight:900;

box-shadow:0 3px 0 var(--navy);

}

.subtitle{

font-size:15px;

line-height:1.7;

font-weight:700;

color:var(--navy);

margin-top:8px;

}

.main{

padding:24px 18px;

}

.catch{

font-size:26px;

font-weight:900;

text-align:center;

color:var(--navy);

margin-bottom:18px;

}

.description{

font-size:15px;

line-height:1.9;

color:#444;

}

.card{

background:white;

border:

4px solid var(--navy);

border-radius:24px;

padding:20px;

margin-bottom:20px;

box-shadow:

0 6px 0 var(--navy);

}

.info-card,
.flat-card{

box-shadow:none;

}

.card-title{

font-size:18px;

font-weight:900;

color:var(--blue);

margin-bottom:10px;

}

.list li{

margin-bottom:10px;

}

.start-button,
.big-button,
.level-button,
.set-button{

display:block;

width:100%;

padding:8px;

border-radius:20px;

text-decoration:none;

text-align:flex-start;

font-size:15px;

font-weight:900;

background:

linear-gradient(
180deg,
var(--yellow),
#ffb800
);

color:var(--navy);

border:

4px solid var(--navy);

box-shadow:

0 3px 0 var(--navy);

transition:0.1s;

}

.sub-button{

display:block;

width:260px;

margin:12px auto;

padding:10px 16px;

border:3px solid var(--navy);

border-radius:14px;

background:white;

color:var(--navy);

font-size:15px;

font-weight:900;

text-align:center;

text-decoration:none;

box-shadow:0 3px 0 var(--navy);

}

.primary-sub-button{

background:

linear-gradient(
180deg,
var(--yellow),
#ffb800
);

}

.start-button:active,
.big-button:active,
.level-button:active,
.set-button:active,
.sub-button:active{

transform:

translateY(3px);

box-shadow:none;

}

.answer{

border:

4px dashed var(--blue);

background:#f9fdff;

border-radius:22px;

}

.word{

display:inline-flex;

align-items:center;
justify-content:center;

background:white;

border:3px solid var(--navy);

border-radius:12px;

padding:8px 12px;

min-height:44px;

width:auto;

max-width:140px;

font-size:16px;

font-weight:900;

color:var(--navy);

box-shadow:
0 3px 0 var(--navy);

cursor:pointer;

user-select:none;

white-space:nowrap;

}

.word:active{

transform:
translateY(3px);

box-shadow:none;

}

.check{

background:var(--green);

color:white;

}

.reset{

background:#ddd;

}

.sound{

background:var(--blue);

color:white;

}

.footer{

background:#fff8eb;

padding:20px;

font-weight:700;
text-align:center;

}

.badge-box{

background:

linear-gradient(
90deg,
var(--blue),
var(--green)
);

color:white;

padding:12px;

border-radius:999px;

text-align:center;

font-weight:800;

margin-bottom:20px;

}
.words{

display:flex;

flex-wrap:wrap;

gap:8px;

justify-content:flex-start;

align-items:flex-start;

padding:12px;

}

.word{

display:inline-flex;

align-items:center;

justify-content:center;

background:white;

border:3px solid var(--navy);

border-radius:10px;

padding:8px 12px;

min-height:42px;

width:auto;

max-width:none;

font-size:16px;

font-weight:900;

color:var(--navy);

white-space:nowrap;

box-shadow:0 3px 0 var(--navy);

flex:none;

}

.answer{

min-height:56px;

padding:10px 14px;

font-size:20px;

}
button{

border:none;

border-radius:12px;

padding:10px 18px;

font-size:18px;

font-weight:900;

cursor:pointer;

min-width:88px;

box-shadow:
0 3px 0 rgba(0,0,0,0.18);

}
button:disabled{

opacity:0.55;

cursor:not-allowed;

box-shadow:none;

}
.buttons{

display:flex;

gap:10px;

padding:10px 12px;

justify-content:center;

flex-wrap:wrap;

}
.result{

display:flex;

align-items:center;

justify-content:center;

text-align:center;

min-height:72px;

padding:16px;

font-size:36px;

font-weight:900;

color:var(--green);

text-shadow:
0 2px 0 rgba(0,0,0,0.15);

letter-spacing:1px;

}
.start-button{

width:260px;

margin:24px auto 12px;

padding:10px 16px;

border:3px solid var(--navy);

border-radius:14px;

box-shadow:0 3px 0 var(--navy);

display:flex;

justify-content:center;

align-items:center;

text-align:center;

}
.level-button{

width:260px;

margin:12px auto;

padding:12px 20px;

display:flex;

justify-content:center;

align-items:center;

text-align:center;

font-size:18px;

}
.set-button{

margin:10px auto;

}
#combo{

margin-left:auto;

font-weight:900;

padding-right:12px;

text-align:right;

}
#progress{

padding-left:12px;

}

#question{

padding-left:12px;

}

.writing-prompt-box{

margin:0 12px 12px;

padding:10px 12px;

border:3px solid var(--navy);

border-radius:12px;

background:#f9fdff;

}

.writing-prompt-label{

font-size:12px;

font-weight:900;

color:var(--blue);

margin-bottom:4px;

}

.writing-prompt-en{

font-size:15px;

line-height:1.45;

font-weight:900;

color:var(--navy);

}

.writing-prompt-ja{

margin-top:4px;

font-size:12px;

line-height:1.45;

font-weight:700;

color:#47536a;

}

#completeArea a{

display:inline-block;

margin:10px 8px 0 0;

padding:6px 14px;

border:3px solid var(--navy);

border-radius:14px;

background:white;

color:var(--navy);

font-size:14px;

font-weight:900;

text-decoration:none;

box-shadow:0 3px 0 var(--navy);

}

#completeArea a:first-of-type{

background:#e9ffe0;

}

#completeArea a:last-of-type{

background:#fff3bf;

}

#completeArea a:active{

transform:translateY(3px);

box-shadow:none;

}

/* 終了画面：ボタン下に余白 */
.finish-buttons,
.result-buttons,
.clear-buttons {
  margin-bottom: 28px;
}

/* 終了メッセージの左に余白 */
.result,
.clear-message,
.finish-message {
  padding-left: 1em;
}
/* 終了画面のボタン全体に下余白 */
main a.start-button,
main .start-button {
  margin-bottom: 12px;
}

/* Clear! と 10問クリアしました！ の左余白 */
main p,
main .description {
  padding-left: 1em;
}
#completeArea {
  padding-left: 1em;
  padding-bottom: 32px;
}

#completeArea a {
  margin-bottom: 24px;
}

.learning-stats{
  margin:16px 14px 8px 0;
  padding:14px;
  border:3px solid var(--navy);
  border-radius:18px;
  background:#f9fdff;
  box-shadow:0 4px 0 var(--navy);
}

.learning-summary{
  font-size:18px;
  font-weight:900;
  color:var(--navy);
  margin-bottom:10px;
}

.learning-stat-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.learning-stat-grid div{
  padding:9px 10px;
  border-radius:12px;
  background:white;
  font-size:14px;
  font-weight:900;
}

.learning-link{
  margin-top:12px !important;
}

.review-list{
  margin:18px 14px 10px 0;
  padding:14px;
  border:3px solid var(--navy);
  border-radius:16px;
  background:white;
}

.writing-model-answers{
  margin:18px 14px 10px 0;
  padding:14px;
  border:3px solid var(--navy);
  border-radius:16px;
  background:#f9fdff;
}

.writing-model-title{
  font-size:17px;
  font-weight:900;
  color:var(--navy);
  margin-bottom:10px;
}

.writing-model-items{
  display:grid;
  gap:10px;
}

.writing-model-item{
  padding:10px;
  border-radius:12px;
  background:white;
}

.writing-model-number{
  margin-bottom:6px;
  font-size:12px;
  font-weight:900;
  color:var(--blue);
}

.writing-model-prompt{
  font-size:14px;
  line-height:1.5;
  font-weight:900;
  color:var(--navy);
}

.writing-model-ja{
  margin-top:4px;
  font-size:13px;
  line-height:1.5;
  font-weight:700;
  color:#3f4b62;
}

.writing-model-en{
  margin-top:8px;
  padding:9px 10px;
  border-radius:10px;
  background:#fff8eb;
  font-size:14px;
  line-height:1.6;
  font-weight:900;
  color:var(--navy);
}

.review-title{
  font-size:17px;
  font-weight:900;
  color:var(--navy);
  margin-bottom:10px;
}

.review-items{
  display:grid;
  gap:10px;
}

.review-item{
  display:grid;
  grid-template-columns:38px 1fr;
  gap:8px;
  padding:10px 0;
  border-top:2px solid #e4edf7;
}

.review-item:first-child{
  border-top:none;
  padding-top:0;
}

.review-number{
  font-size:13px;
  font-weight:900;
  color:var(--blue);
}

.review-jp{
  font-size:13px;
  line-height:1.6;
  font-weight:700;
  color:#3f4b62;
}

.review-en{
  margin-top:4px;
  font-size:14px;
  line-height:1.5;
  font-weight:900;
  color:var(--navy);
}

.review-explanation{
  margin-top:6px;
  padding:8px;
  border-radius:10px;
  background:#fff8eb;
  font-size:12px;
  line-height:1.6;
  color:#47536a;
}

.dashboard-main{
  padding:10px 14px 14px;
}

.study-header{
  padding:44px 18px 12px;
}

.study-header .top-bar{
  top:10px;
}

.study-header .top-bar + h1{
  margin-top:0;
}

.study-header .level{
  font-size:13px;
  line-height:1.3;
}

.dashboard-main .card{
  padding:10px;
  margin-bottom:10px;
  border-width:3px;
  border-radius:14px;
  box-shadow:none;
}

.dashboard-main .card-title{
  font-size:15px;
  margin-bottom:6px;
}

.dashboard-main .sub-button{
  margin:6px auto;
  padding:8px 14px;
}

.dashboard-hero{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:10px;
}

.dashboard-kpi{
  min-height:64px;
  padding:7px;
  border:3px solid var(--navy);
  border-radius:14px;
  background:#fff8eb;
  box-shadow:none;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}

.dashboard-kpi.wide{
  grid-column:auto;
  background:#e9f7ff;
}

.dashboard-kpi span{
  font-size:11px;
  font-weight:900;
  color:#53627c;
  margin-bottom:4px;
}

.dashboard-kpi strong{
  font-size:24px;
  line-height:1.1;
  color:var(--navy);
}

.dashboard-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.stat-tile{
  min-height:44px;
  padding:6px 8px;
  border:2px solid #dbe8f7;
  border-radius:10px;
  background:#fbfdff;
}

.stat-tile.wide{
  grid-column:1 / -1;
}

.stat-label{
  font-size:10px;
  line-height:1.4;
  font-weight:900;
  color:#53627c;
  margin-bottom:3px;
}

.stat-value{
  font-size:15px;
  line-height:1.3;
  font-weight:900;
  color:var(--navy);
  overflow-wrap:anywhere;
}

.grade-progress-list{
  display:grid;
  gap:4px;
}

.progress-row{
  padding:2px 0;
}

.progress-head{
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  margin-bottom:3px;
  font-size:12px;
  font-weight:900;
  color:var(--navy);
}

.progress-head strong{
  white-space:nowrap;
}

.progress-bar{
  height:8px;
  border:1px solid var(--navy);
  border-radius:999px;
  background:white;
  overflow:hidden;
}

.progress-bar div{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, var(--green), var(--yellow));
}

@media (max-width:330px){
  .dashboard-hero,
  .dashboard-grid{
    grid-template-columns:1fr;
  }

  .dashboard-kpi.wide,
  .stat-tile.wide{
    grid-column:auto;
  }
}
