/* The game menu (index.html): games, login, friends, chat. Base look: common.css. */
body { background: #fff3e0; color: #6d4c41; }

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
           calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
}
.topbar { display: flex; align-items: center; gap: 12px; }
.title { flex: 1; font-size: clamp(24px, 6vw, 40px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note { text-align: center; font-size: clamp(18px, 4vw, 26px); margin-top: 12px; }

.pill, .me {
  border: none;
  border-radius: 999px;
  min-height: 56px;
  padding: 8px 22px;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  color: #5d4037;
  background: #ffd54f;
  box-shadow: 0 4px 0 #f9a825;
  display: flex;
  align-items: center;
  gap: 8px;
}
.me { background: #fff; box-shadow: 0 4px 0 #ffcc80; }
.me .av { font-size: 32px; }

/* ---- Menu cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 900px;
  margin: 10px auto 0;
}
.card {
  position: relative;
  border: none;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 6px 0 #ffcc80, 0 8px 18px rgba(0, 0, 0, 0.08);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #6d4c41;
  text-decoration: none;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
}
.card:active { transform: translateY(4px); box-shadow: 0 2px 0 #ffcc80; }
.card .big { font-size: clamp(64px, 14vw, 96px); line-height: 1.1; }
.card.friends { background: #e8f5e9; box-shadow: 0 6px 0 #a5d6a7, 0 8px 18px rgba(0, 0, 0, 0.08); }

.badge {
  position: absolute;
  top: 10px;
  right: 14px;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 22px;
  line-height: 40px;
}
.badge.inline { position: static; display: inline-block; margin-left: 6px; }

/* ---- Friends ---- */
.people {
  flex: 1;
  overflow-y: auto;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.person {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 22px;
  padding: 10px 14px;
  box-shadow: 0 3px 0 #ffcc80;
}
.person .av { font-size: 48px; }
.person .name { flex: 1; font-size: clamp(20px, 4.5vw, 28px); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.person .pill { min-height: 52px; padding: 6px 18px; }
.pill.wait { background: #eceff1; color: #78909c; box-shadow: 0 4px 0 #cfd8dc; }
.pill.go { background: #81c784; color: #fff; box-shadow: 0 4px 0 #43a047; }
.pill.no { background: #eceff1; color: #78909c; box-shadow: 0 4px 0 #cfd8dc; padding: 6px 14px; }

/* ---- Chat ---- */
.msgs {
  flex: 1;
  overflow-y: auto;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: #fffaf3;
  border-radius: 22px;
}
.msg {
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-size: clamp(18px, 4vw, 24px);
  align-self: flex-start;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}
.msg.mine { align-self: flex-end; background: #ffe082; }
.msg.big { font-size: 56px; background: none; box-shadow: none; padding: 0 6px; }
.msg img { display: block; width: min(260px, 60vw); border-radius: 16px; }

.composer { display: flex; flex-direction: column; gap: 8px; }
.strip { display: flex; gap: 8px; overflow-x: auto; touch-action: pan-x; padding: 2px; }
.strip button {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  min-height: 48px;
  padding: 6px 16px;
  font-size: 20px;
  color: #6d4c41;
  font-weight: 600;
}
#emojis button { font-size: 30px; padding: 4px 10px; }
.typebar { display: flex; gap: 8px; align-items: center; }
#text-input, #name-input {
  flex: 1;
  min-width: 0;
  font-size: clamp(18px, 4.5vw, 26px);
  padding: 12px 18px;
  border: 3px solid #ffb300;
  border-radius: 999px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
}
#name-input { border-radius: 14px; text-align: center; }

/* ---- Dialogs ---- */
.avatars, .pic-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 480px; }
.avatars button { width: 56px; height: 56px; font-size: 34px; border: none; border-radius: 16px; background: #fff3e0; }
.avatars button.on { background: #ffe082; box-shadow: 0 0 0 3px #ffb300; }
.pic-grid { max-height: 50vh; overflow-y: auto; touch-action: pan-y; }
.pic-grid button { border: none; background: none; padding: 0; }
.pic-grid img { width: 120px; height: 120px; border-radius: 16px; display: block; }
