/* Hub / game picker — same sticker language as the games. */

:root {
  --cream: #fff6e9;
  --cream-deep: #ffe9c4;
  --surface: #fffdf7;
  --ink: #4a2e1e;
  --ink-soft: #6d5442;
  --tomato: #e04a2f;
  --tomato-deep: #b93a26;
  --basil: #4c9a5b;
  --cheese: #ffcf6b;
  --outline: 3px solid var(--ink);
  --shadow: 0 5px 0 var(--ink);
  --font: "Baloo 2", "Trebuchet MS", "Segoe UI", "Noto Sans Thai", "Leelawadee UI",
    system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.hub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px
    calc(18px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.hub__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lang {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 18px;
  z-index: 3;
  min-width: 56px;
  min-height: 44px;
  padding: 0 12px;
  border: var(--outline);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lang:focus-visible,
.game:focus-visible {
  outline: 4px solid var(--basil);
  outline-offset: 3px;
}

.hub__card {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 22px 18px 18px;
  border: var(--outline);
  border-radius: 32px;
  background: var(--cream);
  box-shadow: 0 8px 0 rgba(74, 46, 30, 0.3);
}

.hub__head {
  text-align: center;
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  padding: 5px 14px;
  border: var(--outline);
  border-radius: 999px;
  background: var(--cheese);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hub__title {
  margin: 0;
  font-size: clamp(1.9rem, 8vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.games {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: var(--outline);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 90ms ease, box-shadow 90ms ease;
}

.game:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.game__cover {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border: var(--outline);
  border-radius: 18px;
  background: var(--cream-deep);
  overflow: hidden;
}

.game__cover img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: none;
}

.game__cover--pizza img.board {
  width: 92%;
}
.game__cover--pizza img.sauce {
  width: 62%;
}
.game__cover--pizza img.topping {
  width: 26%;
}
.game__cover--pizza img.t1 {
  left: 38%;
  top: 40%;
}
.game__cover--pizza img.t2 {
  left: 62%;
  top: 58%;
  width: 20%;
}

.game__cover--image {
  display: grid;
  place-items: center;
}

.game__cover--image img.game__icon {
  position: static;
  transform: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
}

.game__cover--emoji {
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  background: var(--cream-deep);
}

.badge--warn {
  background: var(--tomato);
  color: #fff;
  border-color: var(--ink);
}

.game__body {
  flex: 1 1 auto;
  min-width: 0;
}

.game__name {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
}

.game__sub {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.game__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.badge {
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cheese);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge--warn {
  background: var(--tomato);
  color: #fff;
  border-color: var(--ink);
}

.chevron {
  margin-left: auto;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--tomato);
}

.hub__foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

@media (max-height: 720px) {
  .hub__card {
    padding: 18px 16px 14px;
  }

  .game {
    min-height: 84px;
  }

  .game__cover {
    width: 72px;
    height: 72px;
  }
}
