/* Shared styles for nav, breadcrumbs, content blocks, ad slots and the dice tools. */

header.landing-page-template {
  background-color: #1f1f1f;
}

header h1.header-title {
  font-size: 1.75rem;
}

@media (max-width: 767px) {
  .page header.landing-page-template .container {
    padding: 56px 0 72px;
  }
}

/* Navigation */
.site-nav .nav-link {
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 50px;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
  color: #fff;
  background-color: #3f50b5;
}

.site-nav .nav-link[aria-current="page"] {
  background-color: #3f50b5;
}

/* Breadcrumbs */
.breadcrumbs {
  background: #eff1f2;
  font-size: .875rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0 auto;
  padding: 8px 15px;
  max-width: 1140px;
}

.breadcrumbs li {
  display: inline;
}

.breadcrumbs li + li::before {
  content: "›";
  padding: 0 .5em;
  color: #6c757d;
}

/* Content blocks */
.content-block {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 15px;
}

.content-block h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
}

.content-block h3 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
}

.content-block p,
.content-block li {
  line-height: 1.65;
}

.content-block table,
.points-table {
  width: 100%;
  margin: 16px 0 24px;
  border-collapse: collapse;
  background: #fff;
}

.content-block th,
.content-block td,
.points-table th,
.points-table td {
  border: 1px solid #dee2e6;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.content-block thead th,
.points-table thead th {
  background: #eff1f2;
}

.table-scroll {
  overflow-x: auto;
}

@media (max-width: 575px) {
  .content-block th,
  .content-block td {
    padding: 6px;
    font-size: .9rem;
  }
}

.content-block p a,
.content-block li a,
.content-block td a {
  text-decoration: underline;
}

.content-block .link-cards a {
  text-decoration: none;
}

.faq h3 {
  font-size: 1.05rem;
  margin: 24px 0 6px;
}

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.link-cards li {
  background: #fff;
  border: 1px solid #e3e6e8;
  border-radius: 10px;
  padding: 14px 16px;
}

.link-cards a {
  font-weight: 500;
}

.link-cards p {
  margin: 4px 0 0;
  font-size: .925rem;
  line-height: 1.5;
}

/* The floating "to top" button must never sit on top of an ad or be clickable while invisible. */
.scroll-to-top.is-hidden,
body.ad-in-view .scroll-to-top {
  visibility: hidden;
  pointer-events: none;
}

/* Manual ad units: reserved height (no layout shift), clearly labelled. */
.ad-slot {
  max-width: 970px;
  margin: 56px auto;
  padding: 0 15px;
  text-align: center;
}

.ad-slot--end {
  margin-bottom: 150px;
}

.ad-slot__label {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6c757d;
}

.ad-slot__box {
  min-height: 280px;
}

@media (min-width: 768px) {
  .ad-slot__box {
    min-height: 250px;
  }
}

/* Single die result (start page) */
.dice-result {
  min-height: 1.6em;
  margin: 12px 0 0;
  font-size: 1.25rem;
  color: #fff;
}

/* Multi dice tool */
.dice-tool {
  max-width: 640px;
  margin: 0 auto;
  color: #fff;
}

.dice-tool__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.dice-tool__group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dice-tool__count {
  min-width: 7.5em;
  text-align: center;
}

.dice-tool__step {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 1.5rem;
  line-height: 1;
}

.dice-tool__step:disabled {
  opacity: .4;
}

.dice-tool select {
  height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  font-size: 1rem;
}

.dice-tool__dice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 12px;
  min-height: 64px;
}

/* Five 64px dice need 368px; below that they wrap to two rows, so reserve both before JS renders them. */
@media (max-width: 397.98px) {
  .dice-tool[data-count="5"] .dice-tool__dice {
    min-height: 156px;
  }
}

.die {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 8px;
  border: 3px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  cursor: pointer;
}

.die[aria-pressed="true"] {
  border-color: #ffc107;
  background: #fff3cd;
}

.die[aria-pressed="true"]::after {
  content: "Låst";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  font-size: 12px;
  color: #ffc107;
}

.die--rolling {
  animation: die-shake .45s ease-in-out;
}

@keyframes die-shake {
  0% { transform: rotate(0); }
  25% { transform: rotate(-18deg) scale(.92); }
  50% { transform: rotate(14deg) scale(1.05); }
  75% { transform: rotate(-8deg); }
  100% { transform: rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .die--rolling {
    animation: none;
  }
}

.die__pips {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: 100%;
  height: 100%;
}

.die__pip {
  width: 10px;
  height: 10px;
  margin: auto;
  border-radius: 50%;
  background: #111;
}

.die__pip--tl { grid-area: 1 / 1; }
.die__pip--tr { grid-area: 1 / 3; }
.die__pip--ml { grid-area: 2 / 1; }
.die__pip--c  { grid-area: 2 / 2; }
.die__pip--mr { grid-area: 2 / 3; }
.die__pip--bl { grid-area: 3 / 1; }
.die__pip--br { grid-area: 3 / 3; }

.die__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
}

.die__type {
  display: block;
  font-size: .7rem;
  color: #6c757d;
}

.dice-tool__roll {
  margin-top: 36px;
}

.dice-tool__result {
  min-height: 3.2em;
  margin: 16px 0 0;
  font-size: 1.25rem;
  color: #fff;
}

.dice-tool__hint {
  margin: 8px 0 0;
  font-size: .9rem;
  color: #e9ecef;
}

/* Yatzy score sheet */
.score-tool {
  max-width: 900px;
  margin: 0 auto;
  color: #111;
}

.score-tool__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 16px;
  color: #fff;
}

.score-tool__bar .btn {
  margin: 0;
}

.score-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.score-table th,
.score-table td {
  border: 1px solid #dee2e6;
  padding: 4px 6px;
  text-align: left;
  white-space: nowrap;
}

.score-table thead th {
  background: #eff1f2;
}

.score-table th[scope="row"] {
  font-weight: 400;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

.score-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.score-table__print-name {
  display: none;
}

.score-table input,
.score-table select {
  width: 100%;
  min-width: 76px;
  height: 36px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  font-size: 1rem;
}

.score-table input {
  padding: 0 6px;
  font-weight: 500;
}

.score-table .score-table__sum th,
.score-table .score-table__sum td {
  background: #f8f9fa;
  font-weight: 500;
}

.score-table .score-table__total th,
.score-table .score-table__total td {
  background: #e8eaf6;
  font-weight: 500;
  font-size: 1.05rem;
}

.score-table output {
  display: block;
  text-align: right;
  padding-right: 6px;
}

@media print {
  .no-print,
  .ad-slot,
  #nav-scroll,
  .breadcrumbs,
  footer {
    display: none !important;
  }

  header.landing-page-template {
    background: none !important;
  }

  header.landing-page-template .container {
    padding: 0 !important;
  }

  header .header-title {
    color: #111 !important;
  }

  .score-table-wrap {
    overflow: visible;
  }

  .score-table thead input {
    display: none;
  }

  .score-table__print-name {
    display: inline;
  }

  .score-table select,
  .score-table input {
    border: 0;
    -webkit-appearance: none;
    appearance: none;
  }
}
