:root {
  --ink: #142536;
  --muted: #61717c;
  --teal: #007f70;
  --dark: #006459;
  --mint: #dff7f0;
  --coral: #ff806e;
  --yellow: #f6c345;
  --border: #dce5e9;
  --shadow: 0 12px 32px #173e4a0c;
  color: var(--ink);
  background: white;
  font: 16px/1.65 system-ui, "Hiragino Kaku Gothic ProN", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; min-height: 92px; padding: 16px max(3vw, 20px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); font-size: 23px; font-weight: 750; }
.brand > span:first-child { color: var(--teal); font-size: 34px; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
nav, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
nav button { padding: 7px 9px; }
button {
  min-height: 44px; border: 1px solid #c7d6dc; border-radius: 12px; background: white;
  color: var(--dark); font: 650 .9rem/1.4 system-ui, sans-serif; padding: 10px 15px; cursor: pointer;
}
button:hover:not(:disabled) { background: #edf9f5; border-color: #77b5a8; }
button:focus-visible, a:focus-visible { outline: 3px solid #d99b16; outline-offset: 3px; }
button:disabled { cursor: default; }
.primary, button[aria-pressed="true"] { background: var(--dark); color: white; border-color: var(--dark); }
.primary:hover:not(:disabled), button[aria-pressed="true"]:hover { background: #004e45; }
main { max-width: 1328px; margin: auto; padding: 32px 36px 60px; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; }
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px;
  padding: clamp(24px, 4vw, 48px); min-height: 285px;
  background: linear-gradient(115deg, #e3faf2, #d4f5ee); border-radius: 28px;
}
.hero h1 { font-size: clamp(28px, 4vw, 46px); }
.hero h1::after { content: ""; display: block; width: 104px; height: 5px; border-radius: 50%; background: var(--yellow); margin-top: 8px; transform: rotate(-3deg); }
.hero p, .muted { color: var(--muted); }
.tiles { display: flex; justify-content: space-evenly; align-items: center; gap: 8px; }
.tiles span, .glyph { display: grid; place-items: center; font-weight: 750; }
.tiles span { width: clamp(52px, 8vw, 106px); aspect-ratio: 1; border-radius: 22px; background: #fffefa; font-size: clamp(22px, 4vw, 48px); box-shadow: 0 7px var(--coral), 0 18px 28px #005f612d; transform: rotate(-10deg); }
.tiles span:nth-child(2) { transform: translateY(-20px) rotate(8deg); box-shadow: 0 7px var(--yellow), 0 18px 28px #005f612d; }
.tiles span:nth-child(3) { transform: rotate(12deg); box-shadow: 0 7px #2fbea0, 0 18px 28px #005f612d; }
.overview, .panel, .lesson { background: white; border: 1px solid var(--border); border-radius: 19px; box-shadow: var(--shadow); padding: 22px; }
.overview { margin: 22px 0 30px; display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.overview progress { flex: 1; min-width: 100px; }
progress { accent-color: var(--teal); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lesson { --accent: var(--coral); --tint: #fff0ea; border-bottom: 4px solid var(--accent); }
.lesson:nth-child(3n+2) { --accent: var(--yellow); --tint: #fff7db; }
.lesson:nth-child(3n) { --accent: #4dbca8; --tint: #e0f7f0; }
.glyph { width: 60px; height: 60px; border-radius: 15px; font-size: 26px; background: var(--tint); margin-bottom: 12px; }
.lesson button { text-align: start; width: 100%; margin-top: 8px; }
.panel { max-width: 720px; margin: 16px auto; text-align: center; }
.panel .actions { justify-content: center; margin-top: 18px; }
.target { font-size: clamp(34px, 8vw, 64px); margin: 12px 0; font-weight: 750; line-height: 1.2; white-space: pre-line; }
.reading { font-size: 1.5rem; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.is-correct { background: var(--mint); border-color: var(--teal); }
.is-wrong { background: #fff0ea; border-color: #c85444; color: #852e21; }
.clock { width: 132px; height: 132px; margin: 12px auto; display: block; }
#notice { max-width: 720px; margin: 0 auto; padding: 0 20px; color: #852e21; }
@media (max-width: 850px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) {
  main { padding: 18px 14px 40px; }
  .hero, .grid, .options { grid-template-columns: 1fr; }
  .tiles { margin-top: 22px; }
  nav { gap: 5px; }
}
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 290px; margin: 16px auto; }
.calendar span { color: var(--muted); background: #f4f8f8; padding: 4px 0; border-radius: 6px; }
.calendar .selected-date { background: var(--dark); color: white; font-weight: 750; }

#languages { align-items: center; gap: 12px; max-width: 100%; min-width: 0; }
.language-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.language-buttons { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.language-button {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; width: 107px; min-height: 62px;
  padding: 6px 4px; border: 1px solid var(--border); border-radius: 11px;
  background: white; color: var(--ink); font-size: 10px; line-height: 1.25;
}
.language-button img { object-fit: contain; }
.language-button[aria-pressed="true"], .language-button[aria-pressed="true"]:hover {
  background: var(--mint); color: var(--dark); border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}
.language-button[aria-pressed="true"]::after {
  content: "✓" / ""; position: absolute; top: 4px; right: 6px;
  color: var(--teal); font-size: 13px; line-height: 1;
}
@media (max-width: 580px) {
  #languages { flex-direction: column; align-items: stretch; gap: 6px; width: 100%; }
  .language-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .language-button { width: 100%; min-height: 56px; }
}
