/* ABCPLAY · sorteper/style.css
 * Sorteper: 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.
 */

:root {
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  color: #f8f7ec;
  background: #102d25;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #256849, #102d25);
}
.wrap {
  max-width: 1050px;
  margin: auto;
  padding: 18px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
header .back {
  color: #f6d58c;
  text-decoration: none;
  font-weight: 700;
}
h1 {
  font-size: 34px;
  margin: 4px;
}
header p {
  font-size: 15px;
  color: #c6dbcd;
  margin: 4px;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  background: #f4d38d;
  color: #163629;
  font-weight: 800;
  padding: 12px 17px;
  font-size: 15px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled) {
  filter: brightness(1.08);
}
.primary {
  background: #f4d38d;
}
.hidden {
  display: none !important;
}
.panel {
  background: #ffffff14;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  padding: 20px;
  margin: 16px 0;
}
.panel h2 {
  margin-top: 0;
}
.mode,
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.options {
  flex-direction: column;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
input,
select {
  font: inherit;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #173224;
  border: 0;
  max-width: 320px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.topbar #status {
  flex: 1;
  background: #ffffff1c;
  border: 1px solid #ffffff24;
  padding: 14px;
  border-radius: 12px;
  min-height: 50px;
}
.topbar #gameCode {
  font-weight: 800;
  color: #f4d38d;
}
.small {
  padding: 10px 12px;
}
.table {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.opponents {
  display: flex;
  gap: 12px;
  justify-content: space-around;
  flex-wrap: wrap;
}
.opponent {
  background: #ffffff12;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  padding: 13px;
  min-width: 130px;
  text-align: center;
  max-width: 100%;
}
.opponent.active {
  outline: 2px solid #f4d38d;
}
.opponent.target {
  outline: 3px solid #a5e9ed;
}
.opponent .name {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}
.cards {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 70px;
}
.opponent .cards {
  gap: 0;
  max-width: 280px;
  min-height: 65px;
}
.card {
  height: 135px;
  width: 95px;
  border: 2px solid #ddd3bd;
  border-radius: 9px;
  background: linear-gradient(135deg, #fff, #f3eee1);
  color: #1d2d2b;
  box-shadow: 0 5px 12px #0005;
  position: relative;
  padding: 7px;
  font-weight: 900;
  font-size: 23px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  user-select: none;
  flex-shrink: 0;
  overflow: hidden;
}
.card.red {
  color: #c32f3d;
}
.card .symbol {
  font-size: 48px;
  text-align: center;
  line-height: 1;
}
.card.back {
  background: repeating-linear-gradient(45deg, #24538a 0 5px, #3b75b4 5px 10px);
  border: 4px solid #f5f1e7;
  color: white;
  align-items: center;
  justify-content: center;
}
.card.pick {
  cursor: pointer;
  transition: transform 0.15s;
}
.card.pick:hover,
.card.pick:focus-visible {
  transform: translateY(-9px);
  outline: 3px solid #f4d38d;
  outline-offset: 2px;
}
.opponent .card {
  width: 45px;
  height: 65px;
  margin-left: -9px;
  padding: 4px;
  font-size: 15px;
}
.opponent .card:first-child {
  margin-left: 0;
}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.discard {
  min-width: 130px;
  min-height: 105px;
  background: #ffffff15;
  border: 2px dashed #ffffff55;
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.discard strong {
  font-size: 30px;
}
#message {
  background: #ffffff1c;
  border: 1px solid #ffffff24;
  padding: 14px;
  border-radius: 12px;
  max-width: 500px;
}
.mine {
  border-top: 1px solid #ffffff40;
  padding-top: 15px;
  text-align: center;
}
.mine h2 {
  margin: 5px 0 15px;
}
.mine .cards {
  min-height: 150px;
}
.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
  text-align: center;
}
.rules {
  font-size: 13px;
  color: #c7dacc;
  line-height: 1.7;
}
.rules summary {
  cursor: pointer;
  font-weight: 700;
}
.abc-help-button {
  white-space: nowrap;
}
.abc-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000b;
  display: grid;
  place-items: center;
  padding: 15px;
}
.abc-help-backdrop[hidden] {
  display: none;
}
.abc-help-dialog {
  position: relative;
  background: #f9f6ea;
  color: #153629;
  padding: 25px;
  border-radius: 20px;
  width: min(100%, 560px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 15px 50px #0009;
}
.abc-help-dialog h2 {
  margin: 0 30px 12px 0;
}
.abc-help-dialog h3 {
  margin: 18px 0 5px;
}
.abc-help-dialog p {
  line-height: 1.5;
  margin: 4px 0;
}
.abc-help-close {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 12px;
}
.abc-help-ok {
  margin-top: 20px;
} /* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 700px) {
  .wrap {
    padding: 10px;
  }
  h1 {
    font-size: 26px;
  }
  header p {
    font-size: 12px;
  }
  .opponents {
    gap: 7px;
  }
  .opponent {
    flex: 1 1 105px;
    min-width: 0;
    padding: 8px 5px;
    font-size: 12px;
  }
  .opponent .card {
    width: 35px;
    height: 51px;
    margin-left: -10px;
    border-width: 2px;
  }
  .card {
    height: 116px;
    width: 81px;
    font-size: 20px;
  }
  .card .symbol {
    font-size: 41px;
  }
  .mine .cards {
    gap: 6px;
  }
  .center {
    gap: 10px;
    margin: 8px 0;
  }
  .discard {
    min-height: 85px;
  }
  .topbar #status {
    min-width: 150px;
  }
}

/* V3: kompakt status og roligere midtersektion */
.topbar {
  gap: 10px;
  margin: 12px 0 18px;
}
.topbar #status {
  background: #ffffff12;
  border: 1px solid #ffffff26;
  border-left: 4px solid #f4d38d;
  padding: 12px 16px;
  font-weight: 750;
  min-height: 46px;
}
.center {
  margin: 5px 0 10px;
  gap: 12px;
}
.discard {
  min-width: unset;
  min-height: unset;
  flex-direction: row;
  gap: 10px;
  padding: 10px 16px;
  background: #ffffff10;
  border: 1px solid #ffffff30;
}
.discard strong {
  font-size: 21px;
  color: #f4d38d;
}
#message {
  padding: 10px 14px;
  background: #ffffff0c;
  border-color: #ffffff1b;
  font-size: 14px;
}
.mine {
  padding-top: 18px;
}
.actions:empty {
  display: none;
}
/* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 700px) {
  .topbar #status {
    width: 100%;
    flex-basis: 100%;
  }
  .center {
    margin: 0 0 8px;
  }
  .discard {
    padding: 8px 12px;
  }
  .discard strong {
    font-size: 19px;
  }
}

/* Multiplayer lobby */
#gameCode {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
#gameCode button {
  font-size: 12px;
  padding: 7px 10px;
  background: #f4d38d;
}
.actions p {
  width: 100%;
  margin: 5px 0 10px;
}
.opponent.target {
  outline-offset: 2px;
}
