/* ABCPLAY · yatzy/style.css
 * Yatzy: 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;
  min-height: 100vh;
  background: radial-gradient(circle at top, #22654a, #0a2821 78%);
  color: #fff8e9;
  font:
    16px system-ui,
    sans-serif;
}
main {
  max-width: 1100px;
  margin: auto;
  padding: clamp(10px, 2vw, 22px);
}
header {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
header a {
  color: #f5d998;
  text-decoration: none;
}
header h1 {
  margin: 5px 0;
  font-size: clamp(26px, 5vw, 40px);
}
header span {
  opacity: 0.75;
}
.panel {
  background: #ffffff12;
  border: 1px solid #ffffff28;
  border-radius: 18px;
  padding: clamp(12px, 2.5vw, 22px);
  margin: 15px 0;
}
h2 {
  margin: 0 0 15px;
  font-size: 23px;
}
p {
  line-height: 1.45;
}
button,
select,
input {
  font: inherit;
  border-radius: 11px;
  padding: 12px 14px;
  border: 0;
}
button {
  background: #f1d58f;
  color: #18362b;
  font-weight: 800;
  cursor: pointer;
  min-height: 46px;
}
button:hover {
  filter: brightness(1.08);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.secondary {
  background: #ffffff25;
  color: white;
  border: 1px solid #ffffff66;
}
button.danger {
  background: #c85656;
  color: white;
}
.form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form input {
  width: 205px;
  max-width: 100%;
}
.form select {
  background: #f1d58f;
  color: #18362b;
}
.form button {
  min-height: 46px;
}
hr {
  border: 0;
  border-top: 1px solid #ffffff35;
  margin: 24px 0;
}
.topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.topline p {
  margin: 0;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: start;
}
.players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 9px;
  margin-top: 18px;
}
.player {
  background: #ffffff16;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px;
}
.player.active {
  border-color: #f1d58f;
}
.player strong {
  display: block;
}
.player small {
  opacity: 0.8;
}
.message {
  color: #f1d58f;
  font-weight: 700;
}
.dice {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.die {
  width: 72px;
  height: 72px;
  border: 3px solid #fff;
  border-radius: 14px;
  background: #fffdf4;
  color: #19372d;
  font-size: 39px;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 13px #0005;
  cursor: pointer;
  position: relative;
}
.die.held {
  border-color: #f1d58f;
  background: #f1d58f;
  transform: translateY(-6px);
}
.die.held:after {
  content: "HOLD";
  position: absolute;
  bottom: -20px;
  font-size: 11px;
  color: #f1d58f;
  font-weight: 900;
}
.hint {
  opacity: 0.8;
  font-size: 13px;
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
th,
td {
  border-bottom: 1px solid #ffffff2a;
  padding: 9px;
  text-align: center;
}
th:first-child,
td:first-child {
  text-align: left;
  min-width: 135px;
}
th {
  color: #f1d58f;
}
td button {
  padding: 7px 10px;
  min-height: 35px;
}
tr.section td {
  background: #ffffff15;
  font-weight: 800;
}
tr.total td {
  font-weight: 900;
  color: #f1d58f;
}
#error {
  color: #ffd2d2;
  font-weight: 700;
  min-height: 20px;
}
footer {
  opacity: 0.65;
  text-align: center;
  font-size: 13px;
  padding: 15px;
}
[hidden] {
  display: none !important;
} /* Tilpasning til skærmstørrelse eller skærmretning. */
@media (max-width: 600px) {
  .die {
    width: 52px;
    height: 52px;
    font-size: 29px;
  }
  .dice {
    gap: 8px;
  }
  .panel {
    margin: 10px 0;
  }
  .actions button {
    padding: 9px;
    font-size: 13px;
  }
  .form label {
    width: 100%;
  }
  .form input {
    width: 100%;
  }
}

/* Valg af spiltype som i 31 og UNO */
.mode-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  background: #f1d58f;
  color: #18362b;
  font-weight: 800;
  border-radius: 12px;
  text-decoration: none;
}
.mode-button:hover {
  filter: brightness(1.09);
}
.mode-button:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}
.rules-link {
  color: #f1d58f;
}
.multi-only[hidden] {
  display: none !important;
}
body[data-mode="solo"] .multi-only {
  display: none !important;
}

/* Stable CSS-rendered dice faces, independent of platform emoji fonts */
.die {
  padding: 0;
  line-height: 1;
  flex: 0 0 auto;
  touch-action: manipulation;
}
.pips {
  position: relative;
  display: block;
  width: 72%;
  height: 72%;
  pointer-events: none;
}
.pip {
  position: absolute;
  width: 19%;
  height: 19%;
  border-radius: 50%;
  background: #17372d;
  display: none;
  transform: translate(-50%, -50%);
}
.pip-1 {
  left: 19%;
  top: 19%;
}
.pip-2 {
  left: 50%;
  top: 19%;
}
.pip-3 {
  left: 81%;
  top: 19%;
}
.pip-4 {
  left: 19%;
  top: 50%;
}
.pip-5 {
  left: 50%;
  top: 50%;
}
.pip-6 {
  left: 81%;
  top: 50%;
}
.pip-7 {
  left: 19%;
  top: 81%;
}
.pip-8 {
  left: 50%;
  top: 81%;
}
.pip-9 {
  left: 81%;
  top: 81%;
}
.face-1 .pip-5,
.face-2 .pip-1,
.face-2 .pip-9,
.face-3 .pip-1,
.face-3 .pip-5,
.face-3 .pip-9,
.face-4 .pip-1,
.face-4 .pip-3,
.face-4 .pip-7,
.face-4 .pip-9,
.face-5 .pip-1,
.face-5 .pip-3,
.face-5 .pip-5,
.face-5 .pip-7,
.face-5 .pip-9,
.face-6 .pip-1,
.face-6 .pip-3,
.face-6 .pip-4,
.face-6 .pip-6,
.face-6 .pip-7,
.face-6 .pip-9 {
  display: block;
}
