body.hp--inner .hp-banner-inner--page { display: none; }
body.hp { overflow-x: hidden; }
.fun-page { color: #243044; padding-bottom: 2rem; max-width: 100%; }
.fun-page h1 { margin: 0 0 .35rem; color: #1a5c36; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.fun-lede { margin: 0 0 1.1rem; max-width: 42rem; line-height: 1.45; }
.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 0 0 1.4rem;
}
a.fun-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 3px solid #1a5c36;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 0 #d7eadc;
  min-width: 0;
  color: #243044;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
a.fun-card:hover,
a.fun-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 0 #b7d8c4;
  text-decoration: none;
}
a.fun-card:focus-visible { outline: 3px solid #0b6b3a; outline-offset: 3px; }
.fun-card--soon { border-color: #8a6a12; box-shadow: 0 6px 0 #f3e4b0; }
.fun-card img, .fun-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #12351f;
  display: block;
}
.fun-card h2 { margin: .7rem .85rem .25rem; font-size: 1.15rem; color: #1a5c36; }
.fun-card p { margin: 0 .85rem .8rem; flex: 1; line-height: 1.4; color: #243044; }
.fun-play {
  margin: 0 .85rem .85rem;
  align-self: flex-start;
  background: #1a5c36;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: .55rem 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
a.fun-card:hover .fun-play,
a.fun-card:focus-visible .fun-play { background: #144a2b; }
.fun-note { margin: 0; color: #3a4a58; }
.fun-section { margin: 1.4rem 0 .6rem; color: #1a5c36; }

.knight-wrap, .ribbon-wrap { max-width: 760px; }
.knight-help, .ribbon-help { line-height: 1.45; }
.knight-score { font-size: 1.25rem; font-weight: 800; color: #1a5c36; }
.knight-msg { min-height: 1.4em; font-weight: 700; }
.knight-actions, .ribbon-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.knight-actions button, .ribbon-actions button, .ribbon-levels button {
  min-height: 44px;
  min-width: 44px;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 2px solid #1a5c36;
  background: #fff;
  color: #1a5c36;
  font-weight: 700;
}
.knight-actions button, .ribbon-actions button { background: #1a5c36; color: #fff; }
.ribbon-levels button.is-on { background: #1a5c36; color: #fff; }
.knight-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(96vw, 520px);
  gap: 3px;
  padding: 3px;
  background: #24160c;
  border: 4px solid #24160c;
  box-sizing: border-box;
  touch-action: manipulation;
}
.knight-board button {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  min-height: 0;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(36, 22, 12, .45);
}
.knight-board img { width: 70%; height: 70%; object-fit: contain; pointer-events: none; }
.sq-a { background: #e6c99a; }
.sq-b { background: #8a5a2b; }
.sq-a.sq-been { background: linear-gradient(rgba(232, 70, 160, .42), rgba(232, 70, 160, .42)), #e6c99a; }
.sq-b.sq-been { background: linear-gradient(rgba(232, 70, 160, .5), rgba(232, 70, 160, .5)), #8a5a2b; }
.sq-now { box-shadow: inset 0 0 0 3px #1a5c36; }

.fun-page { overflow-x: clip; }
.ribbon-back { margin: 0 0 .4rem; }
.ribbon-help {
  max-width: 36rem;
  margin: 0 0 .7rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.ribbon-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .7rem;
  margin: 0 0 .2rem;
}
.ribbon-bar button {
  min-height: 36px;
  padding: .3rem .75rem;
  border-radius: 999px;
  border: 2px solid #1a5c36;
  background: #1a5c36;
  color: #fff;
  font-weight: 700;
}
.ribbon-status { font-weight: 800; color: #1a5c36; }
.score-save, .score-board { max-width: 28rem; margin: .6rem 0 1rem; }
.score-save { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.score-save[hidden] { display: none; }
.score-save p, .score-board h2 { margin: 0; }
.score-board h2 { color: #1a5c36; font-size: 1.05rem; }
.score-save input { min-height: 36px; padding: .3rem .5rem; border: 2px solid #1a5c36; border-radius: 8px; }
.score-save button { min-height: 36px; padding: .3rem .75rem; border-radius: 999px; border: 2px solid #1a5c36; background: #1a5c36; color: #fff; font-weight: 700; }
.score-board ol { margin: .3rem 0 0; padding-left: 1.2rem; }
.ribbon-stage {
  width: min(92vw, 680px);
  height: min(92vw, 680px);
  margin: 1.2rem auto 2.2rem;
  perspective: 1100px;
  touch-action: none;
}
.ribbon-scene { width: 100%; height: 100%; display: grid; place-items: center; }
.ribbon-cube {
  width: var(--face);
  height: var(--face);
  --face: min(78vw, 460px);
  position: relative;
  transform-style: preserve-3d;
}
.ribbon-face {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  backface-visibility: hidden;
  overflow: visible;
}
.ribbon-draw { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ribbon-hits {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}
.ribbon-hits button { width: 100%; height: 100%; border: 0; background: transparent; padding: 0; min-height: 0; cursor: pointer; }
.face-F { background: linear-gradient(160deg, #ffffff, #f4f4f2); transform: translateZ(calc(var(--face) / 2)); }
.face-R { background: linear-gradient(160deg, #f7f7f5, #e7e7e4); transform: rotateY(90deg) translateZ(calc(var(--face) / 2)); }
.face-B { background: linear-gradient(160deg, #f3f3f1, #e3e3e0); transform: rotateY(180deg) translateZ(calc(var(--face) / 2)); }
.face-L { background: linear-gradient(160deg, #f6f6f4, #e6e6e3); transform: rotateY(-90deg) translateZ(calc(var(--face) / 2)); }
.face-U { background: linear-gradient(160deg, #ffffff, #f7f7f5); transform: rotateX(90deg) translateZ(calc(var(--face) / 2)); }
.face-D { background: linear-gradient(160deg, #efefed, #e2e2df); transform: rotateX(-90deg) translateZ(calc(var(--face) / 2)); }

