
:root {
  --bg: #fff6d9;
  --ink: #2a1f14;
  --card: #ffffff;
  --pink: #ff5d8f;
  --blue: #2d9cff;
  --yellow: #ffd23f;
  --green: #3ddc97;
  --line: #2a1f14;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1730;
    --ink: #fff3d6;
    --card: #2b2347;
    --line: #fff3d6;
  }
}

:root[data-theme="dark"] {
  --bg: #1d1730;
  --ink: #fff3d6;
  --card: #2b2347;
  --line: #fff3d6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  font-weight: 500;
  line-height: 1.8;
  background-image: radial-gradient(var(--line) 1px, transparent 1.5px);
  background-size: 22px 22px;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 10;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  border: 3px solid var(--line);
  background: var(--card);
  padding: 4px 14px;
  border-radius: 99px;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.1s;
}

nav a:hover {
  transform: translate(-2px, -2px) rotate(-3deg);
}

h1,
h2 {
  font-family: "Dela Gothic One", "Zen Maru Gothic", sans-serif;
  font-weight: 400;
  margin: 0;
}

.hero {
  text-align: center;
  padding: 26px 10px 10px;
}

.hero h1 {
  font-size: clamp(52px, 17vw, 110px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--pink);
  -webkit-text-stroke: 3px var(--line);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--yellow);
}

.hero h1 span {
  display: inline-block;
  animation: wob 2.4s ease-in-out infinite;
}

.hero h1 span:nth-child(2) {
  animation-delay: -0.4s;
  color: var(--blue);
}

.hero h1 span:nth-child(3) {
  animation-delay: -0.8s;
  color: var(--green);
}

.hero h1 span:nth-child(4) {
  animation-delay: -1.2s;
}

.hero h1 span:nth-child(5) {
  animation-delay: -1.6s;
  color: var(--blue);
}

@keyframes wob {
  0%,
  100% {
    transform: rotate(-6deg) translateY(0);
  }

  50% {
    transform: rotate(6deg) translateY(-8px);
  }
}

.tag {
  display: inline-block;
  margin-top: 10px;
  background: var(--yellow);
  color: #2a1f14;
  border: 3px solid var(--line);
  padding: 2px 16px;
  border-radius: 8px;
  font-weight: 700;
  transform: rotate(-2deg);
}

.card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--line);
  padding: 20px 22px;
  margin: 26px 0;
}

.card h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.quote {
  position: relative;
  font-size: 17px;
}

.quote::before {
  content: "“";
  position: absolute;
  top: -34px;
  left: 10px;
  font: 84px/1 "Dela Gothic One", serif;
  color: var(--pink);
}

.quote p {
  margin: 0.7em 0;
}

.quote b {
  background: linear-gradient(transparent 60%, var(--yellow) 60%);
  color: inherit;
}

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 14px 0 4px;
  justify-content: center;
}

.link {
  width: 46px;
  height: 26px;
  border: 5px solid var(--line);
  border-radius: 16px;
  margin-left: -8px;
  background: transparent;
}

.link:first-child {
  margin-left: 0;
}

.link.broken {
  border-color: var(--pink);
  border-right-color: transparent;
  transform: rotate(25deg) translateY(-6px);
  margin-right: 10px;
  animation: wob 1.6s infinite;
}

.link.broken + .link {
  transform: rotate(-12deg) translateY(4px);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.mini {
  border: 3px dashed var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--bg);
}

.mini h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.mini p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
}

.tl {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 5px solid var(--pink);
  margin-left: 8px;
}

.tl li {
  padding: 6px 0 14px 18px;
  position: relative;
}

.tl li::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 12px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--line);
}

.tl time {
  font-weight: 700;
  color: var(--blue);
  display: block;
  font-size: 13px;
}

.tl strong {
  font-size: 16.5px;
}

.tl small {
  display: block;
  opacity: 0.85;
}

.meter {
  text-align: center;
}

.big {
  font: clamp(48px, 14vw, 84px)/1 "Dela Gothic One", sans-serif;
  color: var(--blue);
  margin: 6px 0;
}

button {
  font: 700 18px "Zen Maru Gothic", sans-serif;
  color: #2a1f14;
  background: var(--pink);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 10px 26px;
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
}

button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--line);
}

.bar {
  height: 22px;
  border: 3px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0 14px;
  background: var(--bg);
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(
    45deg,
    var(--yellow) 0 10px,
    var(--pink) 10px 20px
  );
  transition: width 0.25s;
}

#msg {
  min-height: 3.4em;
  font-weight: 700;
}

.shake {
  animation: sh 0.35s;
}

@keyframes sh {
  0%,
  100% {
    transform: none;
  }

  20% {
    transform: translate(-6px, 3px) rotate(-1deg);
  }

  40% {
    transform: translate(6px, -4px) rotate(1deg);
  }

  60% {
    transform: translate(-4px, -3px);
  }

  80% {
    transform: translate(4px, 4px);
  }
}

footer {
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
  margin-top: 30px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
