:root {
  color-scheme: light;
  --ink: #2e3131;
  --muted: #6e7473;
  --mint: #62ad98;
  --mint-dark: #347a68;
  --mint-soft: #e9f6f1;
  --coral: #e68b78;
  --amber: #e8b94f;
  --line: #e4e9df;
  --surface: #ffffff;
  --page: #fffefd;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--mint-dark); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p, dl, dd { overflow-wrap: anywhere; }

.site-header, .site-footer, .game-page {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 20px;
}

.site-brand { color: var(--mint-dark); font-size: 13px; font-weight: 800; }
.site-nav, .site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}
.game-page { margin-bottom: 64px; }

.game-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  min-height: 430px;
  padding: 72px 0 64px;
}
.game-intro-copy { max-width: 620px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
h1 { margin: 0; font-size: 48px; line-height: 1.15; letter-spacing: 0; }
h1 span { display: block; }
.lead { max-width: 620px; margin: 24px 0 0; color: var(--muted); font-size: 17px; }

.typing-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 270px;
}
.typing-visual::before {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: var(--mint-soft);
  content: "";
}
.typing-keyboard {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, 26px);
  gap: 7px;
  width: 205px;
  padding: 18px 17px 15px;
  border: 3px solid var(--mint);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(57, 106, 91, 0.16);
  transform: rotate(-7deg);
}
.typing-keyboard span {
  display: block;
  width: 26px;
  height: 23px;
  border: 1px solid #c3ddd4;
  border-radius: 4px;
  background: #f6fbf8;
}
.typing-keyboard-wide { grid-column: span 2; }
.typing-keyboard-space { grid-column: span 4; }
.typing-orb {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(53, 89, 78, 0.2);
}
.typing-orb-one { top: 34px; left: 19%; background: var(--coral); transform: rotate(-8deg); }
.typing-orb-two { top: 9px; right: 14%; background: var(--amber); transform: rotate(8deg); }
.typing-orb-three { right: 19%; bottom: 34px; background: #5ca9c6; transform: rotate(10deg); }
.typing-spark {
  position: absolute;
  z-index: 4;
  color: var(--mint-dark);
  font-size: 28px;
  font-style: normal;
  font-weight: 900;
}
.typing-spark-one { left: 17%; bottom: 53px; }
.typing-spark-two { top: 73px; right: 7%; color: var(--coral); font-size: 23px; }

.game-shell {
  padding: 24px 32px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(83, 75, 34, 0.12);
}
.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 960px;
  margin: 0 auto 14px;
}
.game-toolbar p, .game-note { margin: 0; color: var(--muted); font-size: 14px; }
.device-label { margin-right: 0.7em; color: #b84f42; font-weight: 800; }
.fullscreen-button, .primary-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 17px;
  border: 1px solid #b8ddd2;
  border-radius: 8px;
  color: var(--mint-dark);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.primary-button { border-color: var(--mint-dark); color: #fff; background: var(--mint-dark); }
.fullscreen-button:hover:not(:disabled), .fullscreen-button:focus-visible { border-color: var(--mint); background: var(--mint-soft); }
.primary-button:hover, .primary-button:focus-visible { border-color: #276451; background: #276451; transform: translateY(-1px); outline: none; }
.fullscreen-button:disabled, .primary-button:disabled { cursor: wait; opacity: 0.55; }
.fullscreen-icon { font-size: 18px; line-height: 1; }

.unity-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 8 / 5;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #1e2222;
  border-radius: 4px;
  background: #000;
}
#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#unity-canvas:focus-visible { outline: 3px solid var(--mint); outline-offset: -3px; }
.unity-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: #fff;
  background: #111515;
  text-align: center;
}
.unity-loading[hidden], .loading-progress-wrap[hidden] { display: none; }
.loading-title { margin: 0 0 8px; color: #fff; font-size: 28px; font-weight: 900; letter-spacing: 0.04em; }
.loading-copy { margin: 0 0 20px; color: #d9e3df; font-size: 14px; }
.loading-progress-wrap { width: min(340px, 72%); margin-top: 20px; }
.loading-track { width: 100%; height: 8px; overflow: hidden; border: 1px solid #5f6b68; border-radius: 4px; background: #28302e; }
.loading-progress { width: 0; height: 100%; background: var(--mint); transition: width 120ms linear; }
.loading-text { margin: 12px 0 0; color: #d9e3df; font-size: 13px; }
.unity-warning { position: absolute; inset: 12px 12px auto; z-index: 5; display: grid; gap: 8px; pointer-events: none; }
.unity-warning p { margin: 0; padding: 10px 14px; border: 1px solid #dfbb5a; border-radius: 4px; color: #493a16; background: #fff5cf; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); font-size: 13px; }
.unity-warning p.error { border-color: #c55b50; color: #5d1914; background: #ffe2dd; }
.game-note { max-width: 960px; margin: 14px auto 0; }

.description-section { padding: 82px 0 12px; }
.description-section h2 { margin: 0 0 22px; font-size: 32px; line-height: 1.3; }
.description-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  min-height: 170px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--mint);
  border-radius: 8px;
  background: var(--surface);
}
.description-block + .description-block { margin-top: 0; padding-top: 0; padding-left: 30px; border-top: 0; border-left: 1px solid var(--line); }
.description-block h3 { margin: 0 0 12px; color: var(--ink); font-size: 20px; line-height: 1.4; }
.guide-list { display: grid; gap: 0; margin: 0; }
.guide-list > div { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0eb; }
.guide-list > div:last-child { border-bottom: 0; }
.guide-list dt { color: var(--mint-dark); font-weight: 800; }
.guide-list dd { margin: 0; color: #545d5b; }
.asset-credit { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.asset-credit a { color: var(--mint-dark); font-weight: 700; }

.game-comment-section { padding: 44px 0 10px; }
.game-comment-note, .app-comment-note { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.app-comment-note { margin-top: -10px; }
.app-comments, .app-comment-form { margin: 1rem auto; padding: 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.app-comments h2 { margin: 0 0 1rem; font-size: 26px; line-height: 1.35; }
.app-comments-empty { margin: 0; color: var(--muted); }
.app-comment-form { display: grid; gap: 0.85rem; }
.app-comment-form fieldset { display: grid; gap: 0.85rem; margin: 0; padding: 0; border: 0; }
.app-comment-form label { display: grid; gap: 0.35rem; }
.app-comment-form input, .app-comment-form select, .app-comment-form textarea { width: 100%; padding: 0.55rem 0.65rem; border: 1px solid #d5ded9; border-radius: 5px; background: #fff; }
.app-comment-form textarea { min-height: 8rem; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 0 38px;
  border-top: 1px solid #eef0ec;
  color: var(--muted);
  font-size: 14px;
}
.footer-brand { color: var(--ink); font-weight: 700; }

@media (max-width: 820px) {
  .site-header, .site-footer, .game-page { width: min(100% - 32px, 1120px); }
  .game-intro { grid-template-columns: 1fr; min-height: auto; padding: 54px 0 46px; }
  .game-intro-copy { max-width: 680px; }
  h1 { font-size: 40px; }
  .typing-visual { min-height: 240px; }
  .game-shell { padding: 18px; }
  .description-panel { grid-template-columns: 1fr; }
  .description-block + .description-block { margin-top: 24px; padding-top: 24px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .site-footer { align-items: flex-start; }
}

@media (max-width: 600px) {
  .site-header { align-items: flex-start; padding: 17px 0; }
  .site-nav { gap: 14px; font-size: 12px; }
  .game-intro { padding-top: 40px; }
  h1 { font-size: 34px; }
  .lead { font-size: 15px; }
  .typing-visual { min-height: 210px; transform: scale(0.88); }
  .game-toolbar { align-items: flex-start; }
  .game-toolbar p { max-width: 220px; }
  .fullscreen-button { width: 42px; min-width: 42px; padding-inline: 0; }
  .fullscreen-button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .game-shell { width: calc(100% + 32px); margin-left: -16px; border-right: 0; border-left: 0; border-radius: 0; }
  .description-section { padding-top: 64px; }
  .description-section h2 { font-size: 27px; }
  .description-panel { padding: 22px 20px; }
  .guide-list > div { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
  .game-comment-section { padding-top: 44px; }
  .site-footer, .site-footer nav { flex-direction: column; gap: 10px; }
  .site-footer nav { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
