/* Экраны: welcome, lobby, game. Внутриигровые доски — в games.css. */

/* ── общая шапка ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  min-height: var(--tap);
}
.topbar .title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}

/* ── welcome ─────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 26px 0 6px;
}
.hero-pet {
  font-size: 76px;
  line-height: 1;
  display: inline-block;
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 14px rgba(169, 139, 255, 0.35));
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-10px) rotate(3deg);
  }
}
.hero h1 {
  margin-top: 10px;
  background: linear-gradient(100deg, var(--p0), var(--accent) 55%, var(--p1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ava-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.ava-opt {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform var(--dur) var(--ease), border-color var(--dur);
}
.ava-opt.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
}

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.or-line::before,
.or-line::after {
  content: "";
  height: 2px;
  background: var(--line);
  flex: 1;
  border-radius: 2px;
}

/* ── код комнаты ─────────────────────────────────────────────────────────── */
.code-card {
  text-align: center;
  background: linear-gradient(140deg, var(--accent-soft), var(--p0-soft));
  border-radius: var(--r-lg);
  padding: 16px;
}
.code-value {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
  line-height: 1.1;
  user-select: all;
}

/* ── питомец ─────────────────────────────────────────────────────────────── */
.pet-card {
  display: flex;
  gap: var(--gap);
  align-items: center;
}
.pet-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--bg-blob-2), var(--bg-blob-1));
  display: grid;
  place-items: center;
  font-size: 44px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.pet-avatar:active {
  transform: scale(0.92);
}
.pet-avatar.is-poked {
  animation: wiggle 0.5s var(--ease);
}
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-14deg) scale(1.12);
  }
  75% {
    transform: rotate(14deg) scale(1.12);
  }
}
.pet-hat {
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 24px;
}
.xp-track {
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--p0), var(--accent));
  transition: width 0.5s var(--ease);
}

.hat-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.hat-opt {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 2px solid var(--line);
  background: var(--card);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hat-opt.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.hat-opt:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── садик ───────────────────────────────────────────────────────────────── */
.garden {
  border-radius: var(--r);
  background: linear-gradient(180deg, #f4fbf3 0%, #e4f6e6 100%);
  padding: 12px;
  min-height: 76px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 1px;
  align-content: flex-start;
}
.flower {
  font-size: 21px;
  line-height: 1;
  animation: sprout 0.45s var(--ease) backwards;
}
@keyframes sprout {
  from {
    transform: scale(0) translateY(8px);
    opacity: 0;
  }
}
.garden-empty {
  color: #86a98d;
  font-size: 14px;
  font-weight: 700;
  margin: auto;
}

/* ── каталог игр ─────────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-sm);
}
.game-card {
  border: none;
  text-align: left;
  background: var(--card);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--sh-1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 118px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.game-card:active {
  transform: scale(0.96);
  box-shadow: var(--sh-press);
}
.game-card .emoji {
  font-size: 30px;
  line-height: 1;
}
.game-card .name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}
.game-card .blurb {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.tag-head {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ── экран игры ──────────────────────────────────────────────────────────── */
.score-row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  justify-content: center;
}
.score-side {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--seat-soft);
  font-weight: 800;
  font-size: 14px;
  color: var(--seat-ink);
  min-width: 0;
}
.score-side .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 92px;
}
.score-side.is-turn {
  box-shadow: 0 0 0 3px var(--seat);
}

#game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.status-line {
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  min-height: 24px;
}

/* Баннер итога партии */
.result-banner {
  border-radius: var(--r);
  padding: 14px;
  text-align: center;
  background: var(--accent-soft);
  animation: pop 0.35s var(--ease);
}
.result-banner.win {
  background: linear-gradient(140deg, #fff2c6, #ffe0ef);
}
.result-banner .big {
  font-size: 24px;
  font-weight: 900;
}
@keyframes pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
}
