html { overflow-y: scroll; }

body {
  font-family: system-ui, sans-serif;
  background: linear-gradient(lightblue, white);
  background-attachment: fixed;
  margin: 0;
  color: #fff;
}

#game { width: 100%; max-width: 1000px; margin: auto; padding: 0; text-align: center; }
#game-line { display: flex; align-items: flex-start; }
#game-line span { font-weight: bold; }

h3, h2 { font-family: 'Bagel Fat One'; display: inline-block; margin: 0 0 0 auto; }
h3, h2 a { text-decoration: none; }

h1 { font-family: 'Bagel Fat One'; font-size: 1em; padding: 0; margin: 0; line-height: 1; }

#status {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

#mobile-status {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.75em;
  position: absolute;
  top: 40px;
  right: 30px;
}

.mobile-score-box {
  display: flex;
  flex-direction: column;
  color: black;
  background-color: white;
  border-radius: 4px;
  padding: 4px;
  margin: 3px;
}
.mobile-score-box span { display: inline-block; }

#table {
  position: relative;
  background: #06661e;
  border-radius: 100px;
  margin: 0 auto;
  height: 660px;
  width: 100%;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
  border: 4px solid darkorange;
}

#kitty-banner {
  position: absolute;
  top: 52px;
  left: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(241, 196, 15, 0.45);
  z-index: 400;
  font-size: 0.72rem;
  max-width: 150px;
}

#kitty-card-slot img {
  width: 32px;
  height: auto;
  border-radius: 4px;
}

.player-stats {
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #f1c40f;
  margin-left: 5px;
}

.image-player img { width: 55px; height: auto; z-index: 100; position: relative; }

.player-area.left div.image-player { position: absolute; top: 50%; left: 0; z-index: 100; }
.player-area.left div.image-player span { display: block; }
.player-area.left div.image-player span:nth-child(2) { color: black; font-weight: bold; }

.player-area.right div.image-player { position: absolute; top: 50%; right: 0; }
.player-area.right div.image-player span { display: block; }
.player-area.right div.image-player span:nth-child(2) { color: black; font-weight: bold; }

.player-area.top div.label, .player-area.top div.image-player { display: inline-block; }
.player-area.bottom div.label, .player-area.bottom div.image-player { display: inline-block; }

.player-area { position: absolute; }
.top    { top: 0;      left: 50%; transform: translateX(-50%); }
.bottom { bottom: 15px; left: 50%; transform: translateX(-50%); }
.left   { left: 0;     top: 50%;  transform: translateY(-50%); }
.right  { right: 0;    top: 50%;  transform: translateY(-50%); }

.card img, img.card {
  border-radius: 9.5px;
  overflow: hidden;
  box-shadow: 1px 2px 2px rgba(60, 60, 60, 0.75);
}

.hand.vertical-stack { width: 75px; min-height: 110px; display: block; }
.hand.vertical-stack img { display: block; margin-bottom: -80px; }
.hand:not(.vertical-stack) { white-space: nowrap; min-height: 110px; }
.hand:not(.vertical-stack) img { display: inline-block; margin-right: -40px; }

#hand-container { position: relative; margin: 0; padding: 0; z-index: 99; }
#hand-container img { margin-right: -25px; }

#hand-00 { display: none; }

.hand img { width: 60px; height: auto; position: relative; }

#trick-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  margin-left: -100px;
}

.winner-glow {
  box-shadow: 0 0 20px #f1c40f !important;
  transition: box-shadow 0.3s;
}

/* ===== Trump badge: sits beside the hand of the player who named trump ===== */
.trump-badge {
  position: absolute;
  z-index: 150;
  width: 38px;
  padding: 2px 0 3px;
  text-align: center;
  line-height: 1;
  background: #fffbe6;
  border: 2px solid #f1c40f;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none; /* never intercepts clicks */
}
.trump-badge-icon { display: block; font-size: 1.5rem; }
.trump-badge-icon.tb-red   { color: #d11818; }
.trump-badge-icon.tb-black { color: #1a1a2e; }
.trump-badge-label { display: block; margin-top: 1px; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.06em; color: #555; }
.trump-badge.seat-0 { left: 100%; bottom: 60px; margin-left: 8px; }                         /* You: right of hand */
.trump-badge.seat-2 { left: 50%; top: 100%; margin-top: 6px; transform: translateX(-50%); } /* Partner: below hand */
.trump-badge.seat-1,
.trump-badge.seat-3 { left: 50%; top: -52px; transform: translateX(-50%); }                 /* West/East: above hand */

/* Mobile scoreboard: trump shows under the team that named it */
.m-trump-row { font-weight: 600; }
.mobile-trick { color: #fff; font-weight: bold; text-align: center; margin: 2px 3px 0; }

.trick-slot {
  position: absolute;
  width: 65px;
  height: 95px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
#trick-2 { top: 0; left: 67px; }
#trick-0 { bottom: 0; left: 67px; }
#trick-1 { top: 52px; left: 0; }
#trick-3 { top: 52px; right: 0; }

.played-card {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  transition: none !important;
}

.temp-deal-card {
  width: 70px;
  height: 105px;
  border-radius: 4px;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.modal {
  position: absolute;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #F5F5DC;
  padding: 18px;
  border-radius: 12px;
  border: 3px solid darkorange;
  text-align: center;
  max-width: 90%;
}

/* ===== Bidding dialog (mobile) ===== */
/* Sits between the top hand and YOUR hand so you can see your cards while
   deciding. The container ignores clicks; only the dialog itself is clickable. */
#bidding-modal {
  top: 160px;
  height: 320px;
  background: transparent;
  pointer-events: none;
  align-items: center;
}
#bidding-modal .modal-content { pointer-events: auto; }

.bid-dialog {
  width: 340px;
  max-width: 94%;
  padding: 10px 12px;
  color: #222;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.bid-round-badge {
  display: inline-block;
  background: #228B22;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.bid-head { display: flex; align-items: center; gap: 10px; text-align: left; }
.bid-head-text { flex: 1; }
#bidding-modal h2 { color: #222; font-size: 1.05rem; margin: 0; display: block; }
.bid-sub { color: #333; margin: 3px 0 0; font-size: 0.78rem; font-weight: 600; }

.bid-upcard { text-align: center; flex: 0 0 auto; }
.bid-upcard img { display: block; width: 44px; height: auto; border-radius: 5px; box-shadow: 1px 2px 6px rgba(0,0,0,0.5); }
.bid-upcard.turned-down img { opacity: 0.45; filter: grayscale(0.7); }
.bid-upcard-caption { display: block; font-size: 0.55rem; font-weight: 700; text-transform: uppercase; color: #555; margin-top: 2px; }

.suit-red   { color: #c0392b; }
.suit-black { color: #111; }

#bid-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
#bid-buttons .bid-btn {
  padding: 9px 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 6px;
  border: 2px solid #333;
  cursor: pointer;
  background: #fff;
  color: #111;
}
#bid-buttons .bid-btn-primary { flex: 1; background: #f1c40f; }
#bid-buttons .bid-btn-pass    { flex: 1 1 100%; background: #e4e4e4; border-color: #888; }
#bid-buttons .bid-btn-primary + .bid-btn-pass { flex: 1 1 auto; }

#bid-buttons .bid-btn-suit { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; }
#bid-buttons .bid-btn-suit .sym { font-size: 1.6rem; line-height: 1; }
#bid-buttons .bid-btn-suit .nm  { font-size: 0.62rem; }
#bid-buttons .bid-btn-suit.red .sym { color: #c0392b; }
#bid-buttons .bid-btn:disabled { opacity: 0.4; cursor: not-allowed; background: #ccc; }

.lone-row { margin-top: 10px; color: #222; font-size: 0.75rem; font-weight: 600; }
.lone-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.bid-history { margin: 8px 0 0; min-height: 1em; font-size: 0.72rem; color: #555; }

#new-round-btn {
  position: absolute;
  bottom: 10px;
  right: 25px;
  padding: 10px 20px;
  background: #f1c40f;
  color: #111;
  border: none;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

.about { width: 75%; margin: 0 auto; color: black; font-size: 1em; }
.about h3 { margin-bottom: 10px; }
.about h2, .about h3, .about h4 {
  font-family: 'Bagel Fat One';
  color: #228B22;
}

@keyframes shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX(7px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX(5px); }
  75%  { transform: translateX(-3px); }
  90%  { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.shake { animation: shake 0.45s ease; }

.hand img.playable {
  transform: translateY(-10px);
  z-index: 100;
  cursor: pointer;
  filter: drop-shadow(0 0 6px #f1c40f) drop-shadow(0 0 12px rgba(241, 196, 15, 0.5));
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hand img.unplayable {
  opacity: 0.45;
  cursor: not-allowed;
  transition: opacity 0.15s ease;
}

.scores-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 12px;
  border: 8px solid #f1c40f;
  text-align: center;
  width: 75%;
  height: auto;
  background-color: white;
  z-index: 3000;
  display: none;
  transform: translate(-50%, -50%);
}

#round-s-w h3 { color: orange !important; }
#round-s-w table {
  color: black;
  width: 100%;
  border-collapse: collapse;
  margin: auto;
  border: solid black 2px;
  text-align: left;
}
#round-s-w table td { border: solid black 1px; padding: 3px 6px; }
#round-s-w { display: none; }

.no-border-bot { border-bottom: hidden !important; }

span#btn-close-score-modal {
  display: inline-block;
  margin: 6px auto;
  border: brown;
  background-color: yellow;
  color: blue;
  font-weight: bold;
  font-size: 1.2rem;
  border-radius: 2px;
  padding: 2px 10px;
  cursor: pointer;
}

#game-over h3 { color: orange !important; }
#game-over { border: solid orange 8px; }
#game-over table {
  color: black;
  width: 100%;
  border-collapse: collapse;
  margin: auto;
  border: solid black 2px;
  text-align: left;
}
#game-over table td { border: solid black 1px; padding: 4px 6px; }

span#btn-close-winners-modal {
  display: inline-block;
  margin: 6px auto;
  border: solid brown;
  background-color: yellow;
  color: blue;
  font-weight: bold;
  border-radius: 5px;
  padding: 2px 10px;
  cursor: pointer;
}

@keyframes spadesBreakFade {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

#spades-broken-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 7000;
  pointer-events: none;
  display: none;
  text-align: center;
  line-height: 1.1;
}

#spades-broken-flash.active {
  display: block;
  animation: spadesBreakFade 1.6s ease forwards;
}

#spades-broken-flash .spade-icon {
  font-size: 4rem;
  display: block;
  filter: drop-shadow(0 0 10px #f1c40f) drop-shadow(0 0 24px rgba(241, 196, 15, 0.6));
  color: #1a1a2e;
  -webkit-text-stroke: 2px #f1c40f;
}

#spades-broken-flash .spade-label {
  font-family: 'Bagel Fat One', sans-serif;
  font-size: 1rem;
  color: #f1c40f;
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px rgba(241, 196, 15, 0.8);
  display: block;
}

.footer {
  margin: 10px auto 0;
  color: black;
  width: 100%;
  text-align: center;
}

.footer h3, h4, h5 {
  margin: 0 auto;
  font-family: courier;
  color: black;
  font-size: 1em;
}

#game-line, #status { display: none; }

#menu-toggle { display: none; }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 40px;
  height: 21px;
  cursor: pointer;
  gap: 5px;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 2015;
}

.hamburger span {
  display: block;
  height: 12px;
  width: 100%;
  background-color: white;
  border-radius: 3px;
  transition: all 0.1s linear;
}

#menu-toggle:checked + .hamburger span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
#menu-toggle:checked + .hamburger span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}
#menu-toggle:checked + .hamburger span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.flyout-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: darkgreen;
  transition: left 0.1s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 2011;
  padding-top: 80px;
}

#menu-toggle:checked ~ .flyout-nav { left: 0; }

.flyout-nav ul { list-style: none; padding: 0; }
.flyout-nav a {
  display: block;
  padding: 15px 40px;
  color: white;
  text-decoration: none;
  font-size: 1.8rem;
  transition: background 0.1s;
}
.flyout-nav a:hover { background: #333; }
.flyout-nav #mobile-options { font-size: 1.8rem; color: #f1c40f; cursor: pointer; }

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: 0.1s;
  z-index: 2010;
}
#menu-toggle:checked ~ .overlay {
  opacity: 1;
  visibility: visible;
}

.flyout-nav ul li { text-align: center; }

#gdc_mobile_ad {
  width: 320px;
  height: 50px;
  margin: 5px auto 0;
}

.gdc_ads { width: 150px; height: 400px; display: none; }
.gdc_ads_no_img { width: 150px; height: 400px; text-align: center; border: dashed thin; display: none; }
#gdc_ads_left { margin-left: 10px; margin-top: 150px; float: left; }
#gdc_ads_right { margin-right: 10px; margin-top: 150px; float: right; }
