/* ABCPLAY · 500/style.css
 * 500: spillets layout, kort, knapper og skærmstørrelser. Regler længere nede kan overstyre tidligere regler.
 * .navn vælger en CSS-klasse; #navn vælger et HTML-id.
 * @media tilpasser udseendet til bestemte skærmstørrelser.
 */

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(circle at top, #22654a, #0a2821 75%);
  color: #fff8e9;
  font:
    16px system-ui,
    sans-serif;
  min-height: 100vh;
}
main {
  max-width: 980px;
  margin: auto;
  padding: 16px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
header a {
  color: #f6d894;
  text-decoration: none;
}
h1 {
  font-size: clamp(26px, 5vw, 44px);
  margin: 10px 0;
}
button,
select {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 12px 15px;
  background: #f1d58f;
  color: #18362b;
  font-weight: 750;
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.panel {
  background: #ffffff12;
  border: 1px solid #ffffff24;
  border-radius: 18px;
  padding: 16px;
  margin: 14px 0;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
.hand {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 110px;
  align-items: center;
}
.card {
  width: 72px;
  height: 105px;
  border-radius: 9px;
  border: 2px solid #d7d0bc;
  background: #fffdf5;
  color: #15221d;
  box-shadow: 0 5px 12px #0004;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
  font-size: 19px;
  font-weight: 900;
  user-select: none;
}
.card.red {
  color: #c52e39;
}
.card .suit {
  font-size: 35px;
  text-align: center;
}
.card.back {
  background: repeating-linear-gradient(45deg, #1e5487, #1e5487 7px, #3b79ae 7px, #3b79ae 14px);
  border: 5px solid #f9f6e9;
}
.card.chosen {
  outline: 4px solid #f6d58b;
  transform: translateY(-7px);
}
.card.small {
  width: 47px;
  height: 69px;
  font-size: 13px;
}
.card.small .suit {
  font-size: 22px;
}
.status {
  color: #f5d998;
  min-height: 25px;
  font-weight: 700;
}
.players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}
.player {
  background: #ffffff14;
  border-radius: 12px;
  padding: 12px;
}
.player.active {
  outline: 2px solid #f5d998;
}
.muted {
  color: #c6d9cd;
  font-size: 13px;
}
.hidden {
  display: none !important;
} /* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 520px) {
  .card {
    width: 57px;
    height: 84px;
    font-size: 16px;
  }
  .card .suit {
    font-size: 27px;
  }
  .panel {
    padding: 11px;
  }
  .card.small {
    width: 37px;
    height: 55px;
    font-size: 11px;
  }
  .card.small .suit {
    font-size: 17px;
  }
}
/* Adaptive layouts for portrait and landscape phones */
html {
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
}
main {
  width: 100%;
  max-width: 980px;
  padding: clamp(8px, 2vw, 16px);
}
header {
  gap: 8px;
}
header h1 {
  flex: 1 1 auto;
  min-width: 0;
}
button,
select {
  max-width: 100%;
  touch-action: manipulation;
}
.panel {
  max-width: 100%;
  min-width: 0;
}
.controls {
  gap: 8px;
}
.controls > * {
  flex-shrink: 0;
}
.hand {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(3px, 1.2vw, 9px);
  justify-content: center;
  align-items: center;
  max-width: 100%;
}
.players {
  grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr));
}
/* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 600px) {
  .panel {
    padding: 10px;
    margin: 9px 0;
  }
  .card {
    width: clamp(45px, 13vw, 64px);
    height: calc(clamp(45px, 13vw, 64px) * 1.45);
    font-size: clamp(13px, 3.5vw, 18px);
    flex-shrink: 0;
  }
  .card .suit {
    font-size: clamp(21px, 6vw, 31px);
  }
  .card.small {
    width: clamp(34px, 9vw, 44px);
    height: calc(clamp(34px, 9vw, 44px) * 1.45);
  }
  button,
  select {
    padding: 10px 12px;
    font-size: 14px;
  }
}
/* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 700px) and (orientation: landscape) {
  .panel {
    padding: 10px;
    margin: 8px 0;
  }
  .players {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .hand {
    justify-content: flex-start;
  }
  .card {
    width: clamp(48px, 8vw, 72px);
    height: calc(clamp(48px, 8vw, 72px) * 1.45);
  }
}

.mp-link {
  background: #f1d58f;
  color: #18362b;
  padding: 12px 15px;
  border-radius: 12px;
  font-weight: 750;
  text-decoration: none;
}
#pickup {
  max-width: 210px;
}
.card .suit {
  font-size: 24px;
}

/* ABCPLAY 500: tactile playing-card table */
body {
  background: radial-gradient(ellipse at 50% 18%, #277453 0%, #12513e 52%, #082a23 100%);
}
main {
  max-width: 1180px;
}
.panel {
  background: linear-gradient(145deg, #ffffff12, #00000016);
  border-color: #ffffff30;
  box-shadow: 0 9px 24px #0002;
}
#game > .panel:nth-child(2),
#room > .panel:nth-child(2) {
  background: radial-gradient(ellipse at 50% 35%, #297955, #115039 75%);
  border: 2px solid #9b7a493d;
  box-shadow:
    inset 0 0 36px #031e1440,
    0 12px 32px #0004;
}
.card {
  position: relative;
  isolation: isolate;
  width: 78px;
  height: 112px;
  padding: 7px;
  border: 1px solid #c6c2b5;
  border-radius: 8px;
  background: linear-gradient(155deg, #fffefb, #f1eee6);
  color: #1b2221;
  box-shadow:
    0 2px 1px #0003,
    0 7px 16px #0005;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  cursor: pointer;
}
.card.red {
  color: #b42c37;
}
.card .corner {
  font-size: 18px;
  line-height: 1;
  align-self: flex-start;
  text-align: center;
}
.card .corner small {
  display: block;
  font-size: 17px;
  margin-top: 2px;
}
.card .center-suit {
  font-size: 43px;
  line-height: 1;
  text-align: center;
  align-self: center;
}
.card .bottom-corner {
  align-self: flex-end;
  transform: rotate(180deg);
}
.card.small {
  width: 55px;
  height: 80px;
  padding: 5px;
}
.card.small .corner {
  font-size: 13px;
}
.card.small .corner small {
  font-size: 12px;
}
.card.small .center-suit {
  font-size: 29px;
}
.card.chosen,
.card.selected {
  transform: translateY(-16px) !important;
  outline: 3px solid #f5d78b;
  outline-offset: 2px;
  box-shadow: 0 16px 26px #0008;
  z-index: 5;
}
.hand {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  padding: 20px 14px 12px;
  min-height: 135px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}
.hand > .card:not(:first-child) {
  margin-left: -18px;
}
.hand > .card:hover {
  transform: translateY(-9px);
  z-index: 3;
}
.hand > .card:focus-visible {
  outline: 3px solid #f5d78b;
  z-index: 4;
}
.meld .row {
  gap: 4px;
}
.meld .card {
  flex-shrink: 0;
}
.controls {
  gap: 12px;
}
.status {
  padding: 6px 0;
}
.table-piles {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.table-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.pile-label {
  font-size: 13px;
  color: #e8e0bf;
  font-weight: 750;
}
.pile-card {
  width: 78px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 4px 12px #0005;
}
.pile-card.back {
  border: 5px solid #fff9e7;
  background: repeating-linear-gradient(45deg, #214e7c, #214e7c 7px, #3974a3 7px, #3974a3 14px);
  font-size: 28px;
}
.pile-card.empty {
  border: 2px dashed #d8e6d266;
  color: #d8e6d2a6;
}
/* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 600px) {
  .hand {
    justify-content: flex-start;
    padding-left: 8px;
    padding-right: 8px;
  }
  .hand > .card:not(:first-child) {
    margin-left: -23px;
  }
  .card {
    width: 65px;
    height: 95px;
    flex-shrink: 0;
  }
  .card .corner {
    font-size: 15px;
  }
  .card .corner small {
    font-size: 14px;
  }
  .card .center-suit {
    font-size: 35px;
  }
  .card.small {
    width: 45px;
    height: 66px;
  }
  .card.small .center-suit {
    font-size: 23px;
  }
  .table-piles {
    gap: 16px;
  }
}

/* 2026-10-16: keep the overlapping hand, fix overflowing card glyphs and vertical scrollbar. */
.card {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  line-height: 1;
  justify-content: space-between;
  align-items: stretch;
}
.card .corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  white-space: nowrap;
}
.card .corner small {
  display: block;
  line-height: 1;
  margin-top: 1px;
}
.card .center-suit {
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  line-height: 1;
  align-self: center;
}
.card .bottom-corner {
  align-self: flex-end;
  transform: rotate(180deg);
}
.card.small .center-suit {
  font-size: 26px;
}
/* Vertical overflow + horizontal scrolling created the unwanted scrollbar. */
.hand {
  overflow-y: hidden;
  overflow-x: auto;
  padding-top: 23px;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.hand::-webkit-scrollbar {
  display: none;
}
/* The face-up discard is a small card and must clip its bottom corner too. */
.controls > .card.small {
  overflow: hidden;
}
/* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 600px) {
  .card .center-suit {
    font-size: 31px;
  }
  .card.small .center-suit {
    font-size: 21px;
  }
  .card .corner {
    font-size: 14px;
  }
  .card .corner small {
    font-size: 12px;
  }
  .card.small .corner {
    font-size: 11px;
  }
  .card.small .corner small {
    font-size: 10px;
  }
}
