* { box-sizing: border-box; }
html {
  background: #f5f7fb;
  color: #233349;
  font-family: system-ui, -apple-system, "PingFang SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 90% 0%, #dceafb 0%, transparent 65%);
}
main {
  width: 100%;
  max-width: 1280px;
  min-height: 100svh;
  margin: auto;
  padding: max(40px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
header { margin-bottom: 32px; }
.eyebrow { color: #365f9b; font-size: 13px; font-weight: 700; letter-spacing: 4px; margin: 0 0 20px; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.heading-row .eyebrow { margin: 0; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.refresh { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #c8dbef; border-radius: 50%; background: transparent; color: #365f9b; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background .2s; }
.refresh:active { background: #e3edf9; }
.refresh.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) { .refresh:hover { background: #e9f1fb; } }
.refresh:focus-visible { outline: 3px solid #365f9b; outline-offset: 3px; }
h1 { font-size: clamp(40px, 5.4vw, 64px); line-height: 1.2; letter-spacing: -1px; margin: 0; }
.welcome-mark { display: grid; place-items: center; width: 64px; height: 64px; flex-shrink: 0; border: 1px solid #c8dbef; border-radius: 50%; color: #365f9b; font-size: 36px; }
.intro { color: #617187; font-size: 18px; line-height: 1.7; margin: 16px 0 0; }
.library-label { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: #617187; font-size: 14px; font-weight: 500; }
.library-label::after { content: ''; height: 1px; background: #dce4ef; flex: 1; }
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.game-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 28px;
  box-shadow: 0 12px 32px #243b5508;
  background: #fffdf8;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s, transform .2s;
}
.game-art {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  background: radial-gradient(circle at 50% 45%, #e9f1fb, #d5e4f4 80%);
}
.game-art img { display: block; width: 160px; height: 160px; object-fit: contain; border-radius: 36px; box-shadow: 0 16px 36px #243b5526; }
.game-details { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; flex: 1; min-width: 0; }
.category { border: 1px solid #d1dff0; border-radius: 20px; padding: 6px 12px; color: #365f9b; font-size: 13px; }
h2 { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.4; margin: 16px 0 12px; overflow-wrap: anywhere; }
.description { color: #53647b; font-size: 17px; line-height: 1.8; margin: 0; }
.hint { color: #617187; font-size: 14px; line-height: 1.6; margin: 20px 0 24px; }
.play { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 160px; padding: 14px 24px; border-radius: 16px; background: #365f9b; color: #ffffff; font-weight: 750; font-size: 17px; margin-top: auto; text-decoration: none; }
.games.single-game { grid-template-columns: minmax(0, 1fr); }
.single-game .game-card { flex-direction: row; min-height: 340px; }
.single-game .game-art { width: 38%; flex-shrink: 0; }
.single-game .game-art img { width: clamp(160px, 20vw, 240px); height: auto; aspect-ratio: 1; border-radius: 22%; }
.single-game .game-details { padding: 32px 40px; }
.game-card:focus-visible { outline: 3px solid #365f9b; outline-offset: 5px; }
.game-card:active { background: #eef3fa; transform: scale(.99); }
footer { margin-top: auto; padding-top: 28px; color: #617187; font-size: 14px; line-height: 1.7; }
noscript a { color: #365f9b; }
@media (hover: hover) and (pointer: fine) {
  .game-card:hover { transform: translateY(-3px); background: #ffffff; }
}
@media (min-width: 768px) and (orientation: portrait) {
  main { padding-top: max(56px, env(safe-area-inset-top)); }
  header { margin-bottom: 40px; }
  .single-game .game-card { flex-direction: column; }
  .single-game .game-art { width: 100%; min-height: 280px; }
  .single-game .game-art img { width: 210px; }
  .single-game .game-details { padding: 32px; }
  .single-game .play { width: 100%; }
}
@media (max-width: 767px) {
  main { padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
  .games { grid-template-columns: minmax(0, 1fr); }
  .intro { font-size: 16px; }
  .welcome-mark { width: 48px; height: 48px; font-size: 28px; }
  .single-game .game-card { flex-direction: column; }
  .single-game .game-art { width: 100%; min-height: 220px; }
  .single-game .game-art img { width: 160px; }
  .single-game .game-details, .game-details { padding: 24px; }
  .play { width: 100%; }
}
@media (max-height: 600px) and (orientation: landscape) and (min-width: 768px) {
  main { padding-top: max(24px, env(safe-area-inset-top)); }
  header { margin-bottom: 20px; }
  .eyebrow { margin-bottom: 10px; }
  h1 { font-size: 40px; }
  .single-game .game-card { min-height: 280px; }
  .single-game .game-details { padding: 24px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card { transition: none; }
  .game-card:hover, .game-card:active { transform: none; }
}
