/* A hand a card showed my player (View Hand), in a popup like the level warning: a row of the hand's card faces for
   each hand seen, closed with OK, a click outside it or Escape */
.RevealedHands {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.RevealedHands .box {
  max-width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  margin: 16px;
  padding: 24px 28px;
  border-radius: 12px;
  background: #2a2140;
  color: white;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.RevealedHands h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.RevealedHands .cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}

.RevealedHands p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.7);
}

.RevealedHands button {
  min-width: 100px;
}

/* Popup (the deck's and the map's): over everything (the header too), a box in the middle of a dimmed page, its
   content scrolling */
.Popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.7);
  color: white;
}

.Popup .box {
  box-sizing: border-box;
  width: 100%;
  max-width: 1100px;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgb(18, 18, 24);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.Popup .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.Popup h2 {
  margin: 0;
}

.Popup h2 .by {
  font-size: 16px;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.7);
}

.Popup .close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.Popup .close:hover,
.Popup .closeBottom:hover {
  background: rgba(255, 255, 255, 0.3);
}

.Popup .bottom {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.Popup .closeBottom {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Set Your Nickname (joining without one): a small box with the message, then the nickname field and Save and Join in
   one row, like the main page's */
.NicknamePopup .box {
  max-width: 460px;
}

.NicknamePopup p {
  margin: 20px 0 16px;
  font-size: 16px;
}

.NicknamePopup .nicknameForm {
  display: flex;
}

.NicknamePopup .nicknameForm input {
  flex: 1 1 auto;
  min-width: 0;
}

.NicknamePopup .nicknameForm button {
  flex: 0 0 auto;
}

.NicknamePopup .nicknameForm button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* The editors' Discard Draft and Unpublish ask first */
.DiscardDraftPopup .box,
.UnpublishPopup .box {
  max-width: 460px;
}

.DiscardDraftPopup p,
.UnpublishPopup p {
  margin: 20px 0 16px;
  font-size: 16px;
}

.DiscardDraftPopup .buttons,
.UnpublishPopup .buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* View Deck: the card faces are the shared .HandCard styles (hand-and-cards.css), wrapping to the width, each with its copy count under it */
.DeckPopup .deckCharacter {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.DeckPopup .who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.DeckPopup .who img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.DeckPopup .characterName {
  font-size: 20px;
  font-weight: bold;
}

.DeckPopup .stats {
  color: rgba(255, 255, 255, 0.7);
}

.DeckPopup .cards {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
}

.DeckPopup .copies {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.DeckPopup .count {
  font-weight: bold;
}

/* A new map's popup: its whole picture, as large as fits under the title and above the Close button */
/* Nearly the whole window, unlike the deck's (the frame's 1100px max) */
.MapPopup .box {
  width: 100%;
  max-width: none;
}

/* The map (the game's .MapArea fills it, scrolling, with its controls in the corner) */
.MapPopup .mapFrame {
  position: relative;
  height: calc(100vh - 220px);
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: black;
}

/* Banners (Toasts, app/helpers/banners.ts): bands across the whole middle of the screen, stacked, over everything */
.Toastify__toast-container.Banners {
  top: 50%;
  left: 0;
  width: 100%;
  padding: 0;
  transform: translateY(-50%);
  align-items: stretch;
  pointer-events: none;
}

.Toastify__toast-container.Banners .Toastify__toast {
  width: 100%;
  min-height: 0;
  margin: 0 0 6px 0;
  padding: 18px 24px;
  border-radius: 0;
  justify-content: center;
  background: rgba(42, 33, 64, 0.92);
  border-top: 2px solid #9370db;
  border-bottom: 2px solid #9370db;
  color: white;
  font-family: 'Roboto', sans-serif;
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* An attack's banner is red */
.Toastify__toast-container.Banners .Toastify__toast.attack {
  background: rgba(96, 18, 18, 0.92);
  border-top-color: #e04848;
  border-bottom-color: #e04848;
}

.bannerFadeOut {
  animation-name: bannerFadeOut;
}

@keyframes bannerFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Hovering a log entry shows the cards it names to its left (LoggedCardPopup, fixed and rendered into the body so the
   log's scrolling doesn't clip it; the mouse passes through it so it can't flicker) */
.LoggedCardPopup {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  background: black;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px;
}

.LoggedCardPopup .HandCard {
  margin: 0;
}

.LoggedCardPopup .versus {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.8);
}
