﻿:root {
  font-family:system-ui,sans-serif;
  color:#24374a;
  background:#f4f8fa
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
header {
  background:#136d77;
  padding:18px 5%;
  font-weight:800;
  font-size:1.2rem
}
header a {
  color:white;
  text-decoration:none
}
main {
  max-width:1000px;
  margin:auto;
  padding:24px 18px;
  min-height:80vh
}
footer {
  text-align:center;
  padding:25px;
  color:#526675;
  font-size:.8rem
}
a {
  color:#176b78
}
h1,h2,p {
  margin:0 0 16px
}
.cards {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px
}
.card,.panel {
  background:white;
  border-radius:18px;
  padding:20px;
  box-shadow:0 3px 15px #24465b15
}
.card h2 {
  font-size:1.2rem
}
.card p {
  color:#596e7a
}
.buttons,.tabs {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:14px 0
}
button,.button {
  border:0;
  border-radius:12px;
  padding:12px 18px;
  background:#e5f1f1;
  color:#165e66;
  font:inherit;
  font-weight:700;
  cursor:pointer;
  text-decoration:none
}
button.primary,.button.primary {
  background:#087f8b;
  color:white
}
button:disabled {
  opacity:.45;
  cursor:default
}
.tabs button.active {
  background:#087f8b;
  color:white
}
.practice {
  display:grid;
  grid-template-columns:minmax(0,440px) 1fr;
  gap:24px;
  align-items:start
}
.box {
  width:100%;
  aspect-ratio:1;
  position:relative;
  background:white;
  border:2px solid #b8cbd0;
  border-radius:12px;
  overflow:hidden
}
.box:before,.box:after {
  content:'';
  position:absolute;
  pointer-events:none;
  background:#dce7e8;
  z-index:0
}
.box:before {
  width:1px;
  height:100%;
  left:50%
}
.box:after {
  height:1px;
  width:100%;
  top:50%
}
canvas,svg.drawing {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:1
}
canvas {
  touch-action:none
}
.prompt {
  font-size:1.3rem;
  line-height:1.7
}
.hint {
  color:#59727d
}
.feedback {
  min-height:2em;
  color:#a35231;
  font-weight:bold
}
.compare {
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
  max-width:1000px
}
.compare h3 {
  text-align:center
}
.mobile-toggle {
  display:none
}
.kanji-links {
  display:flex;
  gap:8px;
  flex-wrap:wrap
}
.kanji-links a {
  background:#e8f3f3;
  padding:10px;
  text-decoration:none;
  border-radius:8px;
  font-size:1.3rem
}
@media(max-width:599px) {
  .practice {
  grid-template-columns:1fr
}
.compare {
  display:block
}
.compare .comparison:not(.selected) {
  display:none
}
.mobile-toggle {
  display:flex
}
.box {
  max-width:440px;
  margin:auto
}
main {
  padding:18px 14px
}

}


.stroke-animation  {
   stroke-dasharray: 100;
   stroke-dashoffset: 100;
   animation: draw-stroke .6s linear forwards;
   
}

@keyframes draw-stroke  {
   to  {
   stroke-dashoffset: 0;
   
}
 
}


#canvas { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

.blank {
  display:inline-block;
  width:1em;
  height:1em;
  border:2px solid currentColor;
  vertical-align:-.08em
}
@media (max-width:900px), (orientation:portrait) {
  .practice {
    grid-template-columns:1fr;
    gap:12px
  }
  .practice-prompt {
    grid-row:1;
    padding:14px 18px
  }
  .practice-prompt h1 {
    font-size:1.25rem;
    margin-bottom:6px
  }
  .practice-prompt p {
    margin-bottom:6px
  }
  .prompt {
    font-size:28px;
    line-height:1.4
  }
  .practice .box {
    width:min(100%, calc(100vh - 450px));
    width:min(100%, calc(100dvh - 450px));
    max-width:none;
    margin:auto
  }
  .compare {
    grid-template-columns:repeat(2, minmax(0,1fr))
  }
  .compare #overlay {
    grid-column:1 / -1;
    width:calc((100% - 14px) / 2);
    justify-self:center
  }
}
@media (max-width:599px) {
  .compare { display:block }
  .compare .comparison:not(.selected) { display:none }
  .compare #overlay { width:100% }
  .mobile-toggle { display:flex }
  .practice .box { width:min(100%, calc(100vh - 300px)) }
}
@media (min-width:600px) {
  .compare .comparison:not(.selected) { display:block }
  .mobile-toggle { display:none }
}
