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: 1rem;
  text-align: center;
}

#game-line { display: flex; align-items: flex-start; }
#game-line span { font-weight: bold; }
#game-line a:link { text-decoration: none; }
#game-line span a:hover { color: red; }

/* Desktop game navigation */
#game-line {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 100;
}

#game-line .game-links {
    display: inline;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-weight: bold;
    text-align: left;
}

#game-line .game-links > a {
    text-decoration: none;
    white-space: nowrap;
}

#game-line .game-links a:hover {
    color: red;
}

/* Dropdown wrapper */
.game-dropdown {
    position: relative;
    display: inline-block;
}

/* More Games trigger */
.more-games-toggle {
    font: inherit;
    font-weight: bold;
    color: inherit;
    background: transparent;
    border: none;
    padding: 4px 5px;
    cursor: pointer;
    white-space: nowrap;
}

.more-games-toggle:hover,
.more-games-toggle:focus-visible {
    color: #0066ff;
}

/* Dropdown wrapper */
.game-dropdown {
    position: relative;
    display: inline-block;
}

/* More Games trigger */
.more-games-toggle {
    font: inherit;
    font-weight: bold;
    color: inherit;
    background: transparent;
    border: none;
    padding: 4px 5px;
    cursor: pointer;
    white-space: nowrap;
}

.more-games-toggle:hover,
.more-games-toggle:focus-visible {
    color: #0066ff;
}

/* Hidden menu */
.more-games-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 175px;
    padding: 6px 0;
    background: white;
    color: #222;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    text-align: left;
}

/* Show on hover and keyboard focus */
.game-dropdown:hover .more-games-menu,
.game-dropdown:focus-within .more-games-menu {
    display: block;
}

/* Hide More Games when another floating menu is active */
#game-line:has(.other-dropdown:hover) .game-dropdown .more-games-menu,
#game-line:has(.other-dropdown:focus-within) .game-dropdown .more-games-menu {
    display: none;
}

/* Dropdown menu links */
#game-line .more-games-menu a {
    display: block;
    padding: 9px 14px;
    color: #222;
    text-decoration: none;
    white-space: nowrap;
}

#game-line .more-games-menu a:hover,
#game-line .more-games-menu a:focus-visible {
    background: #eaf4ff;
    color: #0056b3;
}






h3, h2 { font-family: 'Bagel Fat One'; display: inline-block; margin: 0 0 0 auto; }
h3, h2 a { text-decoration: none; color: inherit; }
h3:hover, h2:hover, h1:hover a:hover { color: #0066ff; }

h1 { font-family: 'Bagel Fat One'; font-size: 3em; 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;
}

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

#kitty-banner {
  position: absolute;
  top: 18px;
  left: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(241, 196, 15, 0.45);
  z-index: 400;
  font-size: 0.85rem;
}

#kitty-card-slot img {
  width: 38px;
  height: 56px;
  border-radius: 5px;
  vertical-align: middle;
  box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.6);
}

.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; }

.player-area.left div.image-player { position: absolute; top: 50%; left: -75px; }
.player-area.left div.image-player span { display: block; }

.player-area.right div.image-player { position: absolute; top: 50%; right: -60px; }
.player-area.right div.image-player span { display: block; }

.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.bottom div.image-player { position: absolute; bottom: 15%; z-index: 100; }

.player-area { position: absolute; }
.top    { top: 0px;    left: 50%; transform: translateX(-50%); }
.bottom { bottom: 15px; left: 50%; transform: translateX(-50%); }
.left   { left: 150px; top: 50%;  transform: translateY(-50%); }
.right  { right: 140px; 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: -85px; }
.hand:not(.vertical-stack) { white-space: nowrap; min-height: 110px; }
.hand:not(.vertical-stack) img { display: inline-block; margin-right: -25px; }

#hand-00 { display: none; }

.hand img { width: 65px; 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: 46px;
  padding: 3px 0 4px;
  text-align: center;
  line-height: 1;
  background: #fffbe6;
  border: 2px solid #f1c40f;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none; /* never intercepts clicks */
}
.trump-badge-icon { display: block; font-size: 1.9rem; }
.trump-badge-icon.tb-red   { color: #d11818; }
.trump-badge-icon.tb-black { color: #1a1a2e; }
.trump-badge-label { display: block; margin-top: 2px; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.08em; color: #555; }
.trump-badge.seat-0 { left: 100%; bottom: 60px; margin-left: 12px; }   /* You: right of your hand */
.trump-badge.seat-2 { left: 100%; top: 60px;    margin-left: 12px; }   /* Partner: right of hand */
.trump-badge.seat-1,
.trump-badge.seat-3 { left: 50%; top: -60px; transform: translateX(-50%); } /* West/East: above hand */

.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: 25px;
  border-radius: 12px;
  border: 3px solid darkorange;
  text-align: center;
}

/* ===== Bidding dialog ===== */
/* 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: 150px;
  height: 320px;
  background: transparent;
  pointer-events: none;
  align-items: center;
}
#bidding-modal .modal-content { pointer-events: auto; }

.bid-dialog {
  width: 400px;
  max-width: 94%;
  padding: 14px 18px;
  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.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

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

.bid-upcard { text-align: center; flex: 0 0 auto; }
.bid-upcard img { display: block; width: 56px; height: auto; border-radius: 6px; 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.65rem; font-weight: 700; text-transform: uppercase; color: #555; margin-top: 3px; }

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

#bid-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
#bid-buttons .bid-btn {
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  border: 2px solid #333;
  cursor: pointer;
  background: #fff;
  color: #111;
}
#bid-buttons .bid-btn:hover:not(:disabled) { background: #ffe9a8; }
#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 80px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; }
#bid-buttons .bid-btn-suit .sym { font-size: 1.9rem; line-height: 1; }
#bid-buttons .bid-btn-suit .nm  { font-size: 0.75rem; }
#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: 12px; color: #222; font-size: 0.85rem; font-weight: 600; }
.lone-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.bid-history { margin: 10px 0 0; min-height: 1em; font-size: 0.8rem; color: #555; }

#new-round-btn {
  position: absolute;
  bottom: 15px;
  right: 55px;
  margin-top: 15px;
  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; }
.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); }
}

#hand-container .hand img { width: 85px; height: auto; }

.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: 22%;
  left: 25%;
  border-radius: 12px;
  border: 8px solid #f1c40f;
  text-align: center;
  width: 50%;
  height: auto;
  background-color: white;
  z-index: 3000;
  display: none;
  padding-bottom: 10px;
}

#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: 4px 8px; }
#round-s-w { display: none; }

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

span#btn-close-score-modal {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border: solid brown;
  background-color: yellow;
  color: blue;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

#game-over { border: solid orange 8px; }
#game-over h3 { color: orange !important; }
#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: 6px 8px; }

span#btn-close-winners-modal {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border: solid brown;
  background-color: yellow;
  color: blue;
  font-weight: bold;
  border-radius: 5px;
  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: 10rem;
  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: 1.4rem;
  color: #f1c40f;
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px rgba(241, 196, 15, 0.8);
  display: block;
}

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

.footer h4, .footer h5 {
  margin: 0 auto;
  font-family: courier;
}

#game-statistics {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  background-color: white;
  color: #111;
  z-index: 2010;
  transform: translate(-50%, -50%);
  border: solid black 2px;
  padding: 5px;
}

#menu-toggle, #label-burger, #nav-hamburger, #mobile-status, #gdc_mobile_ad {
  display: none;
}

.gdc_ads h4 { margin: 0; }
.gdc_ads { width: 160px; height: 300px; text-align: center; }

#gdc_ads_left, #gdc_no_ads_left {
  margin-left: 40px;
  margin-top: 150px;
  float: left;
}

#gdc_ads_right, #gdc_no_ads_right {
  margin-right: 40px;
  margin-top: 150px;
  float: right;
}
