/* ABCPLAY · hearts/style.css
 * Hjerterfri: 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);
  }
}

.board {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.pile {
  min-width: 42px;
  min-height: 75px;
  flex: 1;
  position: relative;
  border: 1px dashed #ffffff60;
  border-radius: 9px;
  padding: 3px;
}
.pile .card {
  margin-top: -65px;
  position: relative;
}
.pile .card:first-child {
  margin-top: 0;
}
.pile .card.down {
  background: repeating-linear-gradient(45deg, #1e5487, #1e5487 6px, #3b79ae 6px, #3b79ae 12px);
  color: transparent;
}
.card {
  cursor: pointer;
  touch-action: manipulation;
}
.card.selected {
  outline: 3px solid #ffdc6d;
  transform: translateY(-5px);
}
.rowline {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.scroll {
  overflow-x: auto;
}
.tiny {
  font-size: 12px;
  color: #d5e7dd;
}
.seat {
  background: #ffffff14;
  padding: 10px;
  border-radius: 12px;
  min-width: 135px;
  flex: 1;
}
.seat.turn {
  outline: 2px solid #f1d58f;
}
.chips {
  font-weight: 800;
  color: #f1d58f;
}
.card.placeholder {
  background: #ffffff14;
  border: 2px dashed #ffffff80;
  color: #fff;
}
.card.placeholder .suit {
  font-size: 23px;
} /* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 550px) {
  .pile .card {
    margin-top: -48px;
  }
  .board {
    gap: 3px;
  }
  .pile {
    min-width: 0;
  }
  .board .card {
    width: clamp(30px, 10vw, 50px);
    height: clamp(45px, 14vw, 75px);
    font-size: 12px;
    padding: 2px;
  }
  .board .card .suit {
    font-size: 20px;
  }
  .seat {
    min-width: 100px;
  }
  .rowline button {
    padding: 10px;
  }
}
