:root {
  color-scheme: dark;
  --mind-bg: #04020a;
  --mind-panel: #151022;
  --mind-panel-soft: #201733;
  --mind-border: #7352c7;
  --mind-border-soft: rgba(174, 126, 255, .28);
  --mind-heading: #ff5da8;
  --mind-heading-2: #62d8ff;
  --mind-link: #fff37a;
  --mind-link-visited: #ff9ad6;
  --mind-text: #f7f2ff;
  --mind-muted: #c9badf;
  --mind-good: #62ff9a;
  --mind-bad: #61b9ff;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -6rem, rgba(255, 93, 168, .3), transparent 34rem),
    linear-gradient(180deg, #080414 0, var(--mind-bg) 26rem, #000 78rem);
  color: var(--mind-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.78;
  overflow-x: hidden;
  text-size-adjust: 100%;
}

a {
  color: var(--mind-link);
  text-decoration-thickness: .08em;
  text-underline-offset: .2em;
}

a:visited { color: var(--mind-link-visited); }
a:active { color: #ff5d5d; }

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

body > div[align="center"]:first-of-type,
body > center:first-of-type {
  max-width: 840px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

body > div[align="center"]:first-of-type img {
  width: 170px;
  image-rendering: pixelated;
}

body > center:nth-of-type(2) {
  width: min(100% - 24px, 840px);
  margin: 0 auto 12px;
  padding: 0 16px;
}

body > center:nth-of-type(2) font {
  color: var(--mind-heading);
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.3;
}

body > center:nth-of-type(3),
body > center:only-child {
  display: block;
  width: min(100% - 24px, 860px);
  margin: 0 auto 32px;
}

body > center:only-child,
body > font > center {
  padding: clamp(28px, 10vw, 72px) 18px;
}

body > center:only-child font,
body > font > center {
  display: inline-block;
  color: var(--mind-link);
  font-size: clamp(2rem, 12vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 0 18px rgba(255, 93, 168, .38);
}

body > font > center font {
  font-size: inherit;
  line-height: inherit;
}

body > center:only-child a,
body > font > center a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: .55rem 1rem;
  border: 1px solid var(--mind-border-soft);
  border-radius: 999px;
  background: rgba(32, 23, 51, .86);
  color: var(--mind-link);
  font-size: clamp(1rem, 4vw, 1.35rem);
  text-decoration: none;
}

.mind-entry-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.mind-entry {
  padding: clamp(28px, 10vw, 72px) 18px;
  color: var(--mind-link);
  text-align: center;
}

.mind-entry-title {
  margin: 0;
  font-size: clamp(2rem, 12vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  writing-mode: vertical-rl;
  text-orientation: upright;
  text-shadow: 0 0 18px rgba(255, 93, 168, .38);
}

.mind-entry a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: .55rem 1rem;
  border: 1px solid var(--mind-border-soft);
  border-radius: 999px;
  background: rgba(32, 23, 51, .86);
  color: var(--mind-link);
  font-size: clamp(1rem, 4vw, 1.35rem);
  text-decoration: none;
}

.mind-site-header {
  max-width: 840px;
  margin: 0 auto;
  padding: 20px 16px 0;
  text-align: center;
}

.mind-site-header img {
  width: 170px;
  image-rendering: pixelated;
}

.mind-page-title {
  width: min(100% - 24px, 840px);
  margin: 0 auto 12px;
  padding: 0 16px;
  color: var(--mind-heading);
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 93, 168, .38);
}

.mind-content-shell {
  width: min(100% - 24px, 840px);
  margin: 0 auto 22px;
  border: 1px solid var(--mind-border-soft);
  border-radius: 16px;
  background: rgba(21, 16, 34, .96);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 93, 168, .1) inset;
  overflow: hidden;
}

.mind-article {
  padding: clamp(18px, 4vw, 34px);
  overflow-wrap: anywhere;
}

.mind-copy {
  display: grid;
  gap: .85rem;
  margin: 0;
}

.mind-copy p {
  margin: 0;
}

.mind-section {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.mind-section-title {
  margin: 0;
  color: var(--mind-heading);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.35;
}

.mind-note {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid rgba(255, 93, 168, .62);
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}

.mind-note > :first-child {
  margin-top: 0;
}

.mind-note > :last-child {
  margin-bottom: 0;
}

.mind-feature-card {
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid rgba(174, 126, 255, .5);
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
}

.mind-feature-card-title {
  margin: 0;
  color: var(--mind-heading-2);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
}

.mind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.5rem 0 0;
}

.mind-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .45rem .8rem;
  border: 1px solid rgba(255, 243, 122, .68);
  border-radius: 8px;
  background: rgba(255, 243, 122, .1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset;
  text-decoration: none;
}

.mind-f-sm { font-size: .9rem; }
.mind-f-md { font-size: 1.1rem; }
.mind-f-lg {
  font-size: 1.7rem;
  font-weight: 800;
}

.mind-c-green { color: #00ff60; }
.mind-c-yellow { color: #ffff56; }
.mind-c-blue { color: #62d8ff; }
.mind-c-pink { color: #ff9ad6; }
.mind-c-red { color: #ff5d5d; }

.mind-game-panel {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.mind-check-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem .125rem;
  width: min(100%, 23.875rem);
  margin-inline: auto;
}

.mind-check-strip img {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.mind-check-strip img:nth-child(5n + 1) {
  margin-left: .5rem;
}

.mind-check-strip img:first-child,
.mind-check-strip img:nth-child(20n + 1) {
  margin-left: 0;
}

.mind-main-title {
  display: grid;
  justify-items: center;
  gap: .35rem;
  margin: 0;
  line-height: 1.08;
}

.mind-main-title img {
  image-rendering: pixelated;
}

.mind-main-title-kick,
.mind-main-title-sub {
  font-weight: 900;
}

.mind-main-title-kick {
  color: #ff0000;
  font-size: clamp(2.4rem, 11vw, 4rem);
}

.mind-main-title-sub {
  color: #ffaaff;
  font-size: clamp(2rem, 9vw, 3.2rem);
}

.mind-main-intro {
  margin-top: 1.5rem;
}

.mind-main-sections {
  display: grid;
  gap: .8rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.mind-main-sections a {
  display: block;
  padding: .8rem 1rem;
  border: 1px solid var(--mind-border-soft);
  border-radius: 8px;
  background: rgba(32, 23, 51, .72);
  font-size: 1.1rem;
  text-decoration: none;
}

.mind-main-sections span {
  display: block;
  color: #ffaaaa;
  font-size: .9rem;
  font-weight: 800;
}

.mind-footer-nav {
  width: min(100% - 24px, 760px);
  margin: 16px auto 28px;
}

.mind-footer-nav ul {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mind-footer-nav a {
  display: grid;
  min-height: 56px;
  place-items: center;
  gap: .18rem;
  padding: .35rem;
  border: 1px solid var(--mind-border-soft);
  border-radius: 8px;
  background: rgba(21, 16, 34, .72);
  color: var(--mind-link);
  font-size: .72rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.mind-footer-nav img {
  width: auto;
  height: 24px;
  image-rendering: pixelated;
}

.mind-footer-nav a:hover,
.mind-footer-nav a:focus {
  border-color: rgba(255, 243, 122, .55);
  outline: 2px solid var(--mind-link);
  outline-offset: 2px;
}

.mind-prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0;
}

.mind-prev-next a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .45rem .8rem;
  border: 1px solid rgba(255, 243, 122, .68);
  border-radius: 8px;
  background: rgba(255, 243, 122, .1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset;
  text-decoration: none;
}

.mind-actions a:hover,
.mind-actions a:focus-visible,
.mind-prev-next a:hover,
.mind-prev-next a:focus-visible {
  border-color: var(--mind-link);
  background: rgba(255, 243, 122, .18);
}

.mind-link-cards {
  display: grid;
  gap: .85rem;
  width: min(100%, 620px);
  margin: 1.5rem auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.mind-link-card {
  display: grid;
  grid-template-columns: minmax(10rem, .7fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--mind-border-soft);
  border-radius: 10px;
  background: rgba(32, 23, 51, .72);
}

.mind-link-card-title {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: .8rem;
  background: rgba(21, 16, 34, .82);
  color: var(--mind-link);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.mind-link-card-body {
  padding: .85rem 1rem;
  background: rgba(255, 255, 255, .055);
  color: var(--mind-text);
}

.mind-link-card-note {
  grid-column: 1 / -1;
  padding: .9rem 1rem;
  background: rgba(255, 93, 168, .12);
  color: var(--mind-text);
}

.mind-link-card.is-ending .mind-link-card-title,
.mind-link-card.is-ending .mind-link-card-body {
  background: rgba(115, 82, 199, .28);
  color: var(--mind-text);
}

.mind-link-card.is-ending-alt .mind-link-card-title,
.mind-link-card.is-ending-alt .mind-link-card-body {
  background: rgba(255, 93, 168, .14);
  color: var(--mind-text);
}

.mind-message-list {
  display: grid;
  gap: 1rem;
  width: min(100%, 680px);
  margin: 1.5rem auto;
}

.mind-message-card {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: var(--mind-text);
  text-align: left;
}

.mind-message-card.is-level-1 { background-color: #8282ca; }
.mind-message-card.is-level-2 { background-color: #7878c5; }
.mind-message-card.is-level-3 { background-color: #6f6fc1; }
.mind-message-card.is-level-4 { background-color: #6464bd; }
.mind-message-card.is-level-5 { background-color: #5a5ab8; }
.mind-message-card.is-level-6 { background-color: #5050b4; }
.mind-message-card.is-level-7 { background-color: #4747a5; }
.mind-message-card.is-level-8 { background-color: #3c3c8c; }
.mind-message-card.is-level-9 { background-color: #323276; }
.mind-message-card.is-level-10 { background-color: #28285e; }

.mind-message-card-title {
  margin: 0 0 .7rem;
  color: var(--mind-good);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.45;
}

.mind-message-card blockquote {
  margin-bottom: 0;
}

.mind-message-card blockquote p {
  margin: 0;
}

body > center > table[border="1"] {
  display: block;
  width: min(100%, 840px) !important;
  margin: 0 auto 22px;
  border: 1px solid var(--mind-border-soft) !important;
  border-radius: 16px;
  border-spacing: 0;
  background: rgba(21, 16, 34, .96);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 93, 168, .1) inset;
  overflow: hidden;
}

body > center > table[border="1"] > tbody,
body > center > table[border="1"] > tbody > tr,
body > center > table[border="1"] > tr {
  display: block;
  width: 100%;
}

body > center > table[border="1"] > tbody > tr > td,
body > center > table[border="1"] > tr > td {
  display: block;
  width: 100%;
  padding: clamp(18px, 4vw, 34px) !important;
  border: 0;
}

body > center > table:not([border="1"]) {
  width: min(100%, 760px) !important;
  margin: 16px auto 28px;
}

font {
  max-width: 100%;
  line-height: 1.55;
}

font[size="+4"],
font[size="7"] {
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.15;
}

font[size="+3"],
font[size="6"],
font[size="5"] {
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.35;
}

font[size="+2"],
font[size="4"] {
  font-size: clamp(1.08rem, 3.7vw, 1.35rem);
}

hr {
  width: min(100%, 680px) !important;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 243, 122, .42), transparent);
}

blockquote {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid rgba(255, 93, 168, .62);
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}

.legacy-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mind-blink {
  animation: mind-blink 1s steps(1, end) infinite;
}

@keyframes mind-blink {
  50% { opacity: 0; }
}

table {
  max-width: 100%;
  border-collapse: separate;
}

td {
  max-width: 100%;
  overflow-wrap: anywhere;
}

td[bgcolor] {
  border-radius: 8px;
}

td[bgcolor="#FEFEE0" i],
td[bgcolor="#FFFFFF" i],
td[bgcolor="#C0C0C0" i] {
  color: #130f1d;
}

td[bgcolor="#FEFEE0" i] *,
td[bgcolor="#FFFFFF" i] *,
td[bgcolor="#C0C0C0" i] * {
  color: inherit;
}

form { margin: 0; }

input[type="button"],
button {
  min-height: 44px;
  padding: .6rem 1.1rem;
  border: 1px solid rgba(255, 243, 122, .55);
  border-radius: 999px;
  background: linear-gradient(180deg, #3d285f, #211630);
  color: var(--mind-link);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

input[type="button"]:hover,
input[type="button"]:focus,
button:hover,
button:focus {
  outline: 2px solid var(--mind-link);
  outline-offset: 3px;
}

img[name^="lamp"],
img[name="lamp"],
img[name^="check"] {
  image-rendering: pixelated;
}

img[name^="check"] {
  margin: 2px;
}

.mind-lamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 56px);
  gap: 2px;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
  border: 5px outset #7f7f7f;
  background: #000;
}

.mind-lamp-choice {
  display: grid;
  position: relative;
  width: 56px;
  height: 56px;
  min-height: 0;
  place-items: center;
  padding: 5px;
  border: 5px outset #7f7f7f;
  border-radius: 0;
  background: #050505;
  cursor: pointer;
}

.mind-lamp-choice:hover,
.mind-lamp-choice:focus {
  z-index: 1;
  outline: 2px solid var(--mind-link);
  outline-offset: 2px;
}

.mind-lamp-choice img {
  width: 32px;
  height: 32px;
}

.mind-game-result {
  width: min(100%, 560px);
  min-height: 5.2rem;
  margin: 1.35rem auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--mind-border-soft);
  border-radius: 12px;
  background: rgba(8, 4, 20, .82);
  color: var(--mind-text);
  text-align: left;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.mind-game-result strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--mind-link);
  font-size: 1.05rem;
}

.mind-game-result p {
  margin: .35rem 0 0;
}

.mind-game-result.is-good {
  border-color: rgba(98, 255, 154, .55);
  box-shadow: 0 0 0 1px rgba(98, 255, 154, .12), 0 12px 28px rgba(0, 0, 0, .28);
}

.mind-toushi-game {
  width: min(100%, 900px);
  margin: 0 auto;
}

.mind-toushi-board {
  container-type: inline-size;
  --toushi-card-w: clamp(42px, 11cqw, 84px);
  --toushi-card-h: calc(var(--toushi-card-w) * 169 / 113);
  position: relative;
  min-height: clamp(230px, 48cqw, 360px);
  overflow: hidden;
  border: 16px ridge #e7e7e7;
  border-bottom-color: #d6d6d6;
  background: #000;
  box-shadow: inset 0 0 0 3px #111, 0 12px 28px rgba(0, 0, 0, .32);
}

.mind-toushi-flying-card {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: calc(100% - var(--toushi-card-w) - 28px);
  width: var(--toushi-card-w);
  height: var(--toushi-card-h);
  opacity: 1;
  transform: translate(0, 0);
  transform-origin: center;
  transition: transform .18s ease-in, opacity .45s ease, filter .18s ease;
}

.mind-toushi-flying-card.is-hidden {
  opacity: 0;
}

.mind-toushi-flying-card img,
.mind-toushi-card img {
  display: block;
  width: 100%;
  height: 100%;
}

.mind-toushi-choices {
  position: absolute;
  right: clamp(10px, 5cqw, 42px);
  bottom: clamp(18px, 8cqw, 38px);
  left: clamp(10px, 5cqw, 42px);
  display: grid;
  grid-template-columns: repeat(5, var(--toushi-card-w));
  gap: clamp(8px, 4cqw, 32px);
  justify-content: center;
  align-items: end;
}

.mind-toushi-card {
  position: relative;
  width: var(--toushi-card-w);
  height: var(--toushi-card-h);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform-origin: center;
  transition: transform .18s ease-in, opacity .45s ease, filter .18s ease;
}

.mind-toushi-card:disabled {
  cursor: default;
  filter: none;
}

.mind-toushi-card:not(:disabled):hover,
.mind-toushi-card:not(:disabled):focus {
  outline: 3px solid var(--mind-link);
  outline-offset: 5px;
}

.mind-toushi-flying-card.is-flipping-out {
  transform: scaleX(.04);
}

.mind-toushi-flying-card.is-flipping-in {
  transform: scaleX(1);
}

.mind-toushi-flying-card.is-hit {
  filter: drop-shadow(0 0 10px rgba(255, 243, 122, .9));
}

.mind-toushi-flying-card.is-miss {
  filter: grayscale(.2) drop-shadow(0 0 10px rgba(97, 185, 255, .75));
}

.mind-toushi-flying-card.is-leaving {
  opacity: 0;
  transform: translate(-150%, -110%) scale(.8);
  transition: transform .46s linear, opacity .46s linear, filter .18s ease;
}

.mind-toushi-status {
  min-height: 1.8rem;
  margin: .9rem 0 .55rem;
  color: var(--mind-link);
  font-weight: 800;
  text-align: center;
}

.mind-flash {
  animation: mind-flash .9s steps(1, end) 3;
}

@keyframes mind-flash {
  0%, 100% { background-color: var(--mind-bg); }
  33% { background-color: #240014; }
  66% { background-color: #031a24; }
}

.mind-ending-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #000;
  color: #fff;
}

.mind-ending-stage {
  width: min(100%, 760px);
  min-height: 240px;
  display: grid;
  place-items: center;
  container-type: inline-size;
  text-align: center;
}

.mind-ending-message {
  width: 100%;
  min-height: 8rem;
  font-size: clamp(.7rem, 3.9cqw, 2rem);
  line-height: 1.9;
  transition: color .18s linear;
}

.mind-ending-message p {
  margin: 0 0 1.1rem;
}

.mind-ending-message p:last-child {
  margin-bottom: 0;
}

.mind-ending-image {
  width: 100px;
  opacity: 0;
  image-rendering: pixelated;
  transition: opacity 2.4s ease-in;
}

.mind-ending-image.is-visible {
  opacity: 1;
}

.mind-ending-image-visible {
  width: 100px;
  height: auto;
  image-rendering: pixelated;
}

.mind-ending-poem {
  margin-bottom: 2rem;
  font-size: clamp(1.1rem, 4vw, 1.55rem);
}

.mind-ending-actions {
  margin-top: 2rem;
}

.mind-ending-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .5rem 1rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 640px) {
  .mind-ending-page {
    padding-inline: 12px;
  }

  .mind-footer-nav ul {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  }

  .mind-check-strip {
    width: min(100%, 11.625rem);
  }

  .mind-check-strip img:nth-child(10n + 1) {
    margin-left: 0;
  }

  .mind-prev-next {
    flex-direction: column;
  }

  .mind-link-card {
    grid-template-columns: 1fr;
  }

  body > center > table[border="1"] > tbody > tr > td,
  body > center > table[border="1"] > tr > td {
    padding: 18px 14px !important;
  }

  body > center > table:not([border="1"]) td {
    display: block;
    width: 100%;
    padding: .35rem;
  }

  table[cols],
  table[width="80%"],
  table[width="250"]:not(.mind-keep-layout) {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mind-lamp-grid {
    grid-template-columns: repeat(5, 44px);
    gap: 2px;
  }

  .mind-lamp-choice {
    width: 44px;
    height: 44px;
    padding: 3px;
  }

  .mind-toushi-board {
    border-width: 10px;
  }

  .mind-toushi-choices {
    gap: clamp(5px, 2.1vw, 12px);
  }
}
