/* Every other screen caps at .screen-inner's 420px so the app reads as a phone-shaped game on
   a wide desktop browser — the table screen has no such wrapper, so on a wide window it used
   to stretch the felt across the whole browser while every card/seat kept its fixed phone-sized
   pixel dimensions, making them look tiny relative to all that extra green space. Capping the
   screen itself the same way restores the proportions the felt/seat/card sizing was tuned for. */
.table-screen {
  padding: 0 !important;
  align-items: stretch !important;
  flex-direction: column;
  display: flex;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.table-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(10px + var(--safe-top)) 16px 8px;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.table-topbar .badge-info {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--gold);
  font-weight: 600;
}
.overlay[hidden] {
  display: none;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 8, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
}

.overlay-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  /* Never taller than the screen: the content list scrolls, title and button stay put. */
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.overlay-card h3,
.overlay-card .btn {
  flex-shrink: 0;
}

#handEndCommunity {
  flex-shrink: 0;
}

#handEndContent,
#tournamentEndContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.overlay-card h3 {
  margin: 0 0 10px;
  color: var(--gold);
}

/* The ad screen covers whichever screen is showing (table or Career Hub) and sits above every
   other overlay, tournament result included. */
#breakOverlay {
  position: fixed;
  z-index: 1500;
}

#breakSkipBtn {
  margin-top: 8px;
}

/* Sized like a real full-screen ad (an AdMob interstitial fills the phone screen): the card
   takes most of the screen and the ad slot fills it. */
.break-card {
  position: relative;
  width: min(94vw, 1100px);
  max-width: none;
  height: min(88vh, 900px);
}

.break-card .break-slot {
  flex: 1;
  min-height: 0;
}

/* Red close cross in the top-right corner of the screen, shown once the countdown has run out. */
.break-x {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #d32f2f;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.break-x:hover,
.break-x:focus-visible {
  background: #b71c1c;
}

.break-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 2px dashed var(--gold-dim);
  border-radius: 10px;
  /* Placeholder until a real ad network is wired in — kept clearly visible so it never reads as
     a blank, "frozen" screen. */
  background: rgba(232, 185, 35, 0.08);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.overlay-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}

.overlay-row:last-child {
  border-bottom: none;
}

.overlay-card .btn {
  margin-top: 16px;
}

.payout-breakdown {
  background: rgba(232, 185, 35, 0.1);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

.payout-breakdown .overlay-row {
  border-bottom-color: rgba(232, 185, 35, 0.25);
}

.payout-breakdown .overlay-row span:last-child {
  color: var(--gold);
  font-weight: 700;
}

/* Web: the portal's lantern button sits in the top-left corner; the table top bar leaves room for it (js/portal-back.js). */
.has-portal-back .table-topbar {
  padding-left: 52px;
}
