:root {
  color-scheme: light;
  --ink: #243e34;
  --muted: #485b50;
  --rule: #d7d5c4;
  --paper: #f8f5ec;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font: 1.125rem/1.55 var(--sans); }
.shelf { width: min(78rem, calc(100% - 4rem)); margin: 0 auto; padding: 1.5rem 0; }
.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: clamp(12rem, 26vh, 17rem); margin: 0 0 2.1rem;
  padding: .5rem clamp(.25rem, 2.5vw, 2rem) 1.3rem; border-bottom: 1px solid var(--rule);
}
.greeting { position: relative; z-index: 1; }
h1, h2 { font: 500 1em/1.04 var(--serif); margin: 0; }
h1 { font-size: clamp(3.4rem, 6.1vw, 5.6rem); letter-spacing: -.055em; }
.welcome p { font-size: clamp(1.15rem, 1.8vw, 1.5rem); color: var(--muted); margin: .7rem 0 0 .2rem; }
.tea { width: clamp(13rem, 29%, 21rem); height: auto; mix-blend-mode: multiply; }
nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(.85rem, 1.65vw, 1.4rem); }
.game {
  --accent: #315741; color: inherit; text-decoration: none; display: flex; flex-direction: column;
  background: #fffcf5; border: 1px solid #cdcdbd; border-radius: 1.05rem; overflow: hidden;
  box-shadow: 0 3px 0 #413b2609, 0 8px 20px -13px #534f3a52;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.loop { --accent: #785728; }
.dogs { --accent: #7f493f; }
.memory { --accent: #345f62; }
.sayings { --accent:#634c38; } .numbers { --accent:#4e5f78; }
.tiles { --accent:#45624e; } .country { --accent:#684e61; } .riddles { --accent:#5c5a2c; }
.story-cover, .country-cover, .number-cover, .pair-cover, .riddle-cover { display:grid; place-items:center; background:#e8d9b9; }
.country-cover { background:#dfd7e2; } .number-cover { background:#c5d5df; }
.pair-cover { background:#cddbc8; } .riddle-cover { background:#dedcb6; }
.story-cover > img, .country-cover > img, .riddle-cover > img { width:56%; aspect-ratio:1; object-fit:cover; transform:rotate(-5deg); border:5px solid #f9f3e3; border-radius:8px; box-shadow:2px 4px 6px #57493735; }
.pair-cover > img { width:36%; aspect-ratio:1; object-fit:cover; position:absolute; top:48%; left:16%; transform:translateY(-50%) rotate(-8deg); border:4px solid #fff6e4; border-radius:8px; box-shadow:2px 4px 0 #c0b79b; }
.pair-cover > img + img { left:46%; top:55%; transform:translateY(-50%) rotate(8deg); }
.number-paper { width:55%; display:grid; grid-template-columns:repeat(4,1fr); border:1px solid #697a83; background:#fcf8e9; transform:rotate(-6deg); box-shadow:2px 4px 6px #53647645; }
.number-paper i { border:1px solid #aab2ab; display:grid; place-items:center; aspect-ratio:1; font:500 6.5cqw/1 Georgia,serif; }
.game:focus-visible { outline: 3px solid #136785; outline-offset: 4px; }
@media (hover: hover) {
  .game:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 10px 23px -12px #3e483a68; }
  .game:hover .play b { transform: translateX(3px); }
}
.details { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: clamp(1.15rem, 2vw, 1.65rem); }
h2 { font-size: clamp(1.65rem, 2.45vw, 2.25rem); letter-spacing: -.035em; }
.details p { margin: .65rem 0 1.35rem; font-size: clamp(1rem, 1.35vw, 1.125rem); line-height: 1.48; color: var(--muted); }
.play {
  display: inline-flex; align-items: center; gap: 1.3rem; margin-top: auto;
  min-height: 2.75rem; padding: .4rem 1rem; border-radius: .55rem;
  background: var(--accent); color: #fffdf7; font-weight: 650; font-size: 1.045rem;
}
.play b { font: normal 1.25em/1 var(--sans); transition: transform .15s; }
.endmark { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 2.2rem auto 0; color: #a78068; }
.endmark:before, .endmark:after { content: ""; width: 2.4rem; height: 1px; background: var(--rule); }
.endmark span { font-size: .82rem; }

/* The covers use the same letters and illustrations as the games. */
.cover { position: relative; aspect-ratio: 1.72; width: 100%; overflow: hidden; isolation: isolate; container-type: inline-size; border-bottom: 1px solid #25332417; }
.word-cover { background-color: #c4cfbb; background-image: repeating-linear-gradient(0deg, transparent 0 15px, #56715a15 15px 16px),repeating-linear-gradient(90deg, transparent 0 15px, #56715a15 15px 16px); }
.letter-paper {
  position: absolute; left: 17%; top: 8%; width: 60%; aspect-ratio: 1.03;
  display: grid; place-items: center; border-radius: 2%; background: #fcf5de;
  transform: rotate(-8deg); box-shadow: 2px 3px 0 #e3dcc4, 3px 5px 0 #b6b49a, 5px 9px 10px #3a56373d;
}
.letter-rows {
  position: relative; width: 80%; padding: 3% 0; color: #374e39; font: 600 5.4cqw/1.34 "Courier New", monospace;
  white-space: nowrap; text-align: center; letter-spacing: .42em;
}
.letter-rows span { display: block; }
.letter-rows mark { position: relative; color: inherit; background: none; }
.letter-rows mark:after {
  content: ""; position: absolute; inset: -.08em .19em -.03em -.24em;
  border: max(1.5px,.50cqw) solid #b36346; border-radius: 100vw; transform: rotate(-1deg);
}
.letter-rows span:nth-child(3) mark:after { border-color: #6c8d67; transform: rotate(1deg); }
.pencil {
  position: absolute; width: 4.2%; height: 78%; top: 8%; right: 16%; border-radius: 4px 4px 0 0;
  background: linear-gradient(to right, #a45f34 0 20%, #d48d4d 21% 48%, #f3b76b 50% 74%, #b7733d 76%);
  transform: rotate(27deg); filter: drop-shadow(2px 3px 1px #5b594e4d);
}
.pencil:before { content: ""; position: absolute; inset: 0 0 auto; height: 11%; border-radius: 2px 2px 0 0; background: linear-gradient(#bd7768 0 62%, #bbb9a4 63% 90%, #858377 91%); }
.pencil:after { content: ""; position: absolute; top: 99%; left: 0; width: 100%; height: 14%; background: linear-gradient(#e5bf8b 0 62%, #4d4135 63%); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.loop-cover { background-color: #e7cb91; background-image: radial-gradient(#89673826 .8px, transparent 1px); background-size: 8px 8px; }
.ring { position: absolute; inset: 12% 12%; border: 2px dashed #997d468a; border-radius: 50%; transform: rotate(-8deg); }
.tile, .portrait { display: block; position: absolute; object-fit: cover; box-shadow: 2px 6px 8px #594a3345; }
.tile { width: 35%; aspect-ratio: 1; padding: 1.3%; background: #fff8e9; border: 1px solid #bbab8866; border-radius: 9%; }
.flower { left: 7%; top: 24%; transform: rotate(-16deg); }
.honey { right: 7%; top: 23%; transform: rotate(15deg); }
.bee { left: 32.5%; top: 12%; transform: rotate(-3deg); }
.dog-cover { background-color: #dbb7a6; background-image: repeating-linear-gradient(44deg, transparent 0 7px, #b789771c 7px 8px); }
.portrait { width: 37%; aspect-ratio: .94; background: #fff9e9; border: 1.6cqw solid #fff8e9; border-bottom-width: 4cqw; }
.boninko { left: 14%; top: 13%; transform: rotate(-12deg); }
.kukinka { right: 14%; top: 12%; transform: rotate(10deg); }
.dog-letters { position: absolute; left: 35%; bottom: 7%; display: flex; gap: 1.1cqw; transform: rotate(-5deg); }
.dog-letters i { width: 9.3cqw; height: 9.7cqw; display: grid; place-items: center; border-radius: 10%; color: #5a4534; background: linear-gradient(135deg,#fbecd0,#edcf9f); box-shadow: 0 2px 0 #b39671,1px 4px 4px #4c382e4f; font: 600 5.4cqw/1 var(--serif); }
.memory-cover {
  background-color: #c2d6d3;
  background-image: repeating-linear-gradient(0deg, transparent 0 10px, #e7eeed52 10px 11px, transparent 11px 13px),
                    repeating-linear-gradient(90deg, transparent 0 10px, #759b9826 10px 11px, transparent 11px 13px);
}
.memory-card {
  position: absolute; top: 50%; width: 35%; aspect-ratio: .87; object-fit: contain; display: block;
  border: 1.3cqw solid #fbf3e0; border-radius: 7%; background: #f8f1e3;
  box-shadow: 1px 2px 0 #c3bda7, 3px 6px 7px #38555250;
}
.card-back { left: 10%; transform: translateY(-50%) rotate(-17deg); object-fit: cover; }
.twin-left { left: 31%; transform: translateY(-54%) rotate(-3deg); }
.twin-right { right: 10%; transform: translateY(-41%) rotate(13deg); }
@media (max-width: 1050px) {
  .shelf { width: min(100% - 2rem, 42rem); padding: .8rem 0 1rem; }
  .welcome { min-height: unset; margin-bottom: 1.2rem; padding: .5rem 0 1.2rem; }
  h1 { font-size: clamp(2.45rem, 7vw, 3.9rem); }
  .welcome p { margin-left: 0; font-size: 1.08rem; }
  .tea { width: 26%; }
  nav { grid-template-columns: 1fr; gap: .78rem; }
  .game { display: grid; grid-template-columns: minmax(6rem,29%) 1fr; border-radius: .75rem; }
  .cover { align-self: stretch; aspect-ratio: auto; height: 100%; min-height: 7.2rem; border: none; border-right: 1px solid #25332417; }
  .details { position: relative; padding: .95rem 2.8rem .95rem 1.1rem; justify-content: center; }
  h2 { font-size: clamp(1.55rem, 4.6vw, 2.05rem); }
  .details p { font-size: 1rem; margin: .35rem 0 0; line-height: 1.4; }
  .play { position: absolute; right: .6rem; top: calc(50% - .9rem); padding: 0; border-radius: 50%; min-height: 0; width: 1.8rem; height: 1.8rem; justify-content: center; }
  .play span { display: none; }
  .letter-paper { top: 50%; left: 7%; width: 74%; transform: translateY(-50%) rotate(-8deg); }
  .letter-rows { font-size: 6.6cqw; }
  .pencil { height: min(71%,60cqw); right: 13%; top: 50%; transform: translateY(-50%) rotate(23deg); }
  .tile { width: 46%; top: 50%; }
  .flower { left: 3%; transform: translateY(-40%) rotate(-17deg); } .honey { right: 2%; transform: translateY(-36%) rotate(16deg); } .bee { left: 28%; transform: translateY(-72%) rotate(-3deg); }
  .portrait { width: 48%; top: 50%; } .boninko { left: 5%; transform: translateY(-62%) rotate(-12deg); } .kukinka { right: 4%; transform: translateY(-49%) rotate(10deg); }
  .dog-letters { bottom: auto; top: calc(50% + 12cqw); left: 27%; } .dog-letters i { width: 13cqw; height: 14cqw; font-size: 8cqw; }
  .endmark { margin-top: 1.5rem; }
  .memory-card { width: 42%; }
  .card-back { left: 5%; } .twin-left { left: 26%; } .twin-right { right: 5%; }
}
@media (min-width: 690px) and (max-width: 1050px) {
  .shelf { width: min(100% - 3rem, 57rem); padding-top: 1.25rem; }
  .welcome { margin-bottom: 1.5rem; }
  .tea { width: 24%; max-width: 13.5rem; }
  nav { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
  .game { grid-template-columns: 30% 1fr; }
  .details { padding: 1.05rem; }
  h2 { font-size: clamp(1.5rem, 3.1vw, 1.95rem); }
  .details p { margin-bottom: .75rem; }
  .play { position: static; width: auto; height: auto; align-self: flex-start; gap: .45rem; border-radius: 0; background: transparent; color: var(--accent); }
  .play span { display: inline; }
}
@media (max-width: 450px) {
  .shelf { width: calc(100% - 1.35rem); }
  .welcome { gap: .4rem; }
  .welcome p { font-size: 1rem; margin-top: .4rem; }
  .details { padding: .8rem .7rem .8rem .8rem; }
  h2 { font-size: clamp(1.45rem, 6.05vw, 1.75rem); }
  .details p { font-size: .98rem; }
  .play { width: auto; height: auto; display: inline-flex; position: static; align-self: flex-start; gap: .45rem; line-height: 1.2; margin-top: .55rem; background: transparent; color: var(--accent); font-size: .98rem; }
  .play span { display: inline; }
}
@media (max-width: 450px) and (max-height: 710px) {
  .shelf { padding-top: .35rem; }
  .welcome { padding-bottom: .65rem; margin-bottom: .7rem; }
  .tea { width: 22%; }
  h1 { font-size: clamp(2rem, 9.5vw, 2.45rem); }
  nav { gap: .55rem; }
  .game { grid-template-columns: 25% 1fr; }
  .cover { min-height: 5.5rem; }
  .details { padding-block: .55rem; }
  .play { margin-top: .25rem; }
}
@media (max-width: 450px) and (max-height: 640px) {
  .details { padding-right: 1.7rem; }
  .play { position: absolute; top: 50%; right: .45rem; transform: translateY(-50%); margin: 0; color: var(--accent); }
  .play span { display: none; }
}
@media (max-width: 450px) and (max-height: 550px) {
  .cover { min-height: 4.5rem; }
  .details p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .play { position: static; transform: none; align-self: flex-start; height: auto; margin-top: .3rem; }
  .play span { display: inline; }
}
@media (min-width: 451px) and (max-width: 1050px) and (max-height: 520px) {
  .shelf { width: calc(100% - 2rem); padding-top: .5rem; }
  .welcome { padding: 0 0 .55rem; margin-bottom: .65rem; }
  h1 { font-size: 2.1rem; }
  .welcome p { margin-top: .15rem; font-size: 1rem; }
  .tea { width: 7rem; }
  nav { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
  .game { grid-template-columns: 25% 1fr; }
  .cover { min-height: 5.3rem; }
  .details { padding: .65rem; }
  h2 { font-size: clamp(1.15rem, 3.45vw, 1.7rem); }
  .details p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .play { width: auto; height: auto; position: static; align-self: flex-start; justify-content: start; margin: .35rem 0 0; gap: .4rem; background: transparent; color: var(--accent); font-size: .97rem; }
  .play span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; }
  .game:hover, .game:hover .play b { transform: none; }
}
