:root {
  color-scheme: light;
  --ivory: #faf0e6;
  --paper: #fffcf7;
  --ink: #333333;
  --muted: #535d56;
  --eucalyptus: #718879;
  --green: #354c40;
  --soft-green: #e9eee7;
  --line: #dadad0;
  --secondary: #b5aeab;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--ivory);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 48% 25%, #fdf8f0 0, var(--ivory) 74%);
}
button, select { font: inherit; }
a { color: var(--green); }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a, select { touch-action: manipulation; }
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
svg { display: block; flex: none; }
.shell { width: min(100% - 36px, 896px); margin-inline: auto; }
.site-header { border-bottom: 1px solid #ded6ca; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 12px;
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  color: var(--green);
  font: bold 28px/1 Georgia, serif;
  letter-spacing: -0.6px;
  text-decoration: none;
}
.wordmark span {
  padding-inline-start: 9px;
  border-inline-start: 1px solid var(--secondary);
  font: 600 14px/1.2 system-ui, sans-serif;
  letter-spacing: 0;
}
.language {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
}
.language a {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.language [aria-current] { color: var(--paper); background: var(--green); }
.content {
  max-width: 530px;
  padding-block: clamp(24px, 5vw, 58px) 36px;
}
.heading { margin-block-end: 20px; }
h1, h2 {
  color: var(--green);
  font-family: Georgia, serif;
  font-weight: 400;
  margin: 0;
}
h1 { font-size: clamp(31px, 4.3vw, 46px); line-height: 1.06; letter-spacing: -0.035em; }
.heading p, .guide p {
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.44;
}
.entry-card {
  padding: clamp(13px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background-color: var(--paper);
  box-shadow: 0 10px 32px #5749380c;
}
.notice, .connection {
  margin: 0 0 14px;
  border-inline-start: 3px solid var(--eucalyptus);
  padding: 8px 10px;
  background: #f2f0e8;
  font-size: 14px;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
fieldset + fieldset { margin-top: 10px; }
legend {
  padding: 0;
  margin-block-end: 5px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.slot-grid, .select-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(5px, 1.6vw, 9px);
}
.slot {
  display: grid;
  min-height: 46px;
  padding: 3px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f5ef;
}
.slot[aria-pressed="true"] {
  border: 2px solid var(--eucalyptus);
  padding: 2px;
  background: var(--soft-green);
}
.slot-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  font-size: 21px;
}
.slot-symbol svg { width: 27px; height: 27px; color: var(--ink); }
.input-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block: 3px 5px;
}
.progress { color: var(--muted); font-size: 13px; }
.undo {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  padding: 0 5px;
  background: none;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}
.undo:disabled { color: #68716a; }
.undo svg { width: 16px; height: 16px; }
.palette {
  background: #f4f2eb;
  border-radius: 16px;
  padding: 7px;
}
.palette-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}
.palette-switch button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding-inline: 6px;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
}
.palette-switch [aria-pressed="true"] {
  background: var(--soft-green);
  border-color: #becbc1;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  animation: palette-in 120ms ease-out both;
}
.palette-key {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 61px;
  padding: 3px 2px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 550;
  overflow-wrap: anywhere;
  transition: background-color 80ms ease-out, transform 80ms ease-out;
}
.palette-key svg { width: 26px; height: 26px; }
.palette-key:active, .slot:active { color: var(--ink); background: var(--soft-green); }
.palette-key:active { transform: scale(0.96); }
.open-message {
  margin-top: 14px;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--green);
  border-radius: 14px;
  background: var(--green);
  color: var(--paper);
  font-weight: 650;
}
.open-message svg { width: 19px; height: 19px; }
.open-message:disabled { color: #56645a; background: #e5e8e1; border-color: #d2d9d1; }
.connection { margin: 10px 0 0; }
.select-grid label {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.select-grid select {
  width: 100%;
  min-height: 44px;
  padding-inline: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
}
.guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(136px, 0.55fr);
  align-items: start;
  gap: 12px 20px;
  margin-top: 23px;
  padding-top: 16px;
  border-top: 1px solid var(--secondary);
}
.guide h2 { font-size: 23px; line-height: 1.12; }
.guide p { font-size: 14px; }
.example {
  margin: 0;
  padding: 8px;
  color: var(--muted);
  background: #ffffff63;
  border-radius: 11px;
  text-align: center;
}
.example-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  color: var(--ink);
}
.example-grid span {
  display: grid;
  min-height: 22px;
  place-items: center;
}
.example-grid svg { width: 18px; height: 18px; }
.example figcaption { margin-top: 5px; font-size: 11px; line-height: 1.3; }
.visually-hidden {
  position: absolute;
  overflow: hidden;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  white-space: nowrap;
}
@media (max-width: 465px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 59px; }
  .heading { margin-block-end: 14px; }
  .entry-card { border-radius: 20px; }
  .guide { grid-template-columns: 1fr; }
  .example { max-width: 200px; }
  .select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sign-flash svg { animation: sign-in 155ms ease-out both; }
.sign-flash[data-shown="heart"] svg { animation: pulse 175ms ease-out; }
.sign-flash[data-shown="star"] svg { animation: sparkle 185ms ease-out; }
.sign-flash[data-shown="sun"] .symbol-detail { transform-origin: center; animation: rays 180ms ease-out; }
.sign-flash[data-shown="moon"] .symbol-glint { animation: glint 190ms ease-out; }
.sign-flash[data-shown="cloud"] svg { animation: drift 170ms ease-out; }
.sign-flash[data-shown="note"] svg { animation: swing 180ms ease-out; }
.sign-flash[data-shown="balloon"] svg { animation: rise 180ms ease-out; }
.sign-flash:is([data-shown="wave"],[data-shown="house"],[data-shown="bolt"],[data-shown="plus"],[data-shown="triangle"]) .symbol-detail {
  stroke-dasharray: 1;
  animation: trace 195ms ease-out;
}
@keyframes palette-in { from { opacity: 0.65; } to { opacity: 1; } }
@keyframes sign-in { from { opacity: 0.45; scale: 0.88; } to { opacity: 1; scale: 1; } }
@keyframes pulse { 45% { scale: 1.12; } }
@keyframes sparkle { 50% { scale: 1.12; rotate: 9deg; } }
@keyframes rays { from { scale: 0.72; } }
@keyframes glint { 48% { opacity: 0.65; } }
@keyframes drift { from { translate: -4px 0; } }
@keyframes swing { 33% { rotate: -10deg; } 75% { rotate: 5deg; } }
@keyframes rise { from { translate: 0 4px; } }
@keyframes trace { from { stroke-dashoffset: 0.85; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .palette-grid, .sign-flash svg, .sign-flash .symbol-detail, .sign-flash .symbol-glint {
    animation: none !important;
  }
  .palette-key { transition: none; }
  .palette-key:active { transform: none; }
}

.shop-link { margin: 1.5rem 0 0; }
.site-footer {
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid var(--line);
  padding-block: 8px 16px;
  font-size: 13px;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
