@charset "UTF-8";
* {
  box-sizing: border-box;
  outline: 0px;
}

body {
  background: #c0e3e2;
}

#roll-btn {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  
  padding: 20px 40px;
  font-size: 50px;
  font-family: "Hammersmith One";
  background: blue;
  color: white;
  border-radius: 10px;
  box-shadow: rgb(44, 42, 42) 0px 0px 30px;

  white-space: nowrap;      /* prevent line breaks */
  max-width: 90vw;          /* prevent overflow on small screens */
  overflow: hidden;         /* avoid text overflow */
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}
#roll-btn:hover {
  background: rgb(4, 4, 83);
}
.hidden {
  visibility: hidden;
  display: none;
}

#player-display {
  text-align: center;
  padding: 20px 0 0 0;
}

#instructions {
  text-align: center;
  font-size: 12px;
  max-width: 90%;
  margin: 0 auto;
  word-wrap: break-word;
}

#loader {
  text-align: center;
  padding: 20px 0 0 0;
  font-size: 40pt;
}

#board-container {
  position: relative;
  max-width: 868px;
  margin: 20 auto;
}

#selection {
  position: absolute;
  bottom: 25%;
  z-index: 9999;
  width: fit-content;
  margin-inline: auto;
  background: black;
  color: white;
  padding: 20px 40px;
  font-size: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Hammersmith One";
  box-shadow: rgb(44, 42, 42) 0px 0px 30px;
  border-radius: 10px;
  white-space: pre;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none; /* optional, allows clicks to pass through */
  object-fit: cover;
}

#board {
  position: relative;
  width: 100%;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  max-width: 100%;
  font-family: "Hammersmith One";
  color: #2e464d;
}

main .table.hide {
  opacity: 0;
}

main .table.start {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) rotateX(60deg) rotateZ(55deg);
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  box-shadow: 4px 2px 10px 0px rgba(46, 70, 77, 0.2);
  transition: width 0.3s ease, height 0.3s ease;
}
main .table.rotation {
  animation-duration: 20s;
  animation-name: rotate;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes rotate {
  from {
    transform: translate(-50%, -60%) scale(0.6) rotateX(60deg) rotateZ(55deg);
    box-shadow: 4px 2px 10px 0px rgba(46, 70, 77, 0.2);
  }
  to {
    transform: translate(-50%, -60%) scale(0.6) rotateX(60deg) rotateZ(415deg);
    box-shadow: -4px 2px 10px 0px rgba(46, 70, 77, 0.2);
  }
}
.frame {
  display: grid;
  grid: 100px repeat(9, 68px) 100px/100px repeat(9, 68px) 100px;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 8px;
  grid-gap: 4px;
  border-radius: 14px;
  background: #2e464d;
}
.frame > div {
  display: block;
  position: relative;
  grid-column: span 1;
  order: var(--order);
  background: #b2e0c8;
  transition: background-color 0.3s ease;
}
.frame > div.highlight {
  /*background: #359d41;*/
  background: white !important;
}
.frame > div.status-1 {
  background: #6c6f6c;
}
.frame > div .inside {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 68px;
  height: 100px;
  padding: 4px;
  text-align: center;
}
.frame > div .inside h2, .frame > div .inside strong {
  margin: 6px auto 12px auto;
  text-align: center;
  font-size: 8.5px;
  line-height: 10px;
  text-transform: uppercase;
  font-weight: bold;
}
.frame > div .inside strong {
  position: absolute;
  left: 0px;
  bottom: 8px;
  width: 100%;
  margin: 0px;
}
.frame > div.status-1 .inside strong {
  color: rgb(246, 124, 124);
  text-shadow: rgb(54, 47, 47) 0px 0px 2px;
}
.frame > div .inside span {
  display: block;
  width: 100%;
  font-size: 34px;
  line-height: 38px;
}
.frame > div .inside:before {
  content: "";
  display: block;
  width: 100%;
  height: 20px;
  border-radius: 2px 2px 1px 1px;
}
.frame > div.brown .inside:before {
  background: #894c4b;
}
.frame > div.sky .inside:before {
  background: #46bfff;
}
.frame > div.pink .inside:before {
  background: #f89aa9;
}
.frame > div.orange .inside:before {
  background: #eda13d;
}
.frame > div.red .inside:before {
  background: #d05858;
}
.frame > div.green .inside:before {
  /*background: #079a97;*/
  background: #1c9d54;
}
.frame > div.yellow .inside:before {
  background: #e9c33d;
}
.frame > div.blue .inside:before {
  background: #4b5c99;
}
.frame > div.none .inside:before {
  display: none;
}
.frame > div.center {
  grid-row: span 9;
  grid-column: span 9;
}
.frame > div.top {
  border-radius: 1px 1px 4px 4px;
}
.frame > div.top .inside {
  transform: rotate(180deg);
  transform-origin: 34px 50px;
}
.frame > div.left {
  border-radius: 1px 4px 4px 1px;
}
.frame > div.left .inside {
  transform: rotate(90deg);
  transform-origin: 50px 50px;
}
.frame > div.right {
  border-radius: 4px 1px 1px 4px;
}
.frame > div.right .inside {
  transform: rotate(-90deg);
  transform-origin: 34px 34px;
}
.frame > div.bottom {
  border-radius: 4px 4px 1px 1px;
}
.frame > div.center {
  position: relative;
  border-radius: 4px;
  background: #95cfad;
}
.frame > div.center .logo {
  display: block;
  position: absolute;
  top: calc(50% - 60px);
  left: calc(50% - 250px);
  width: 500px;
  height: 120px;
  text-align: center;
  line-height: 120px;
  font-size: 86px;
  text-transform: uppercase;
  color: #fff;
  animation: spin-45 1ms;
  animation-play-state: paused;
  transform-origin: 50% 50%;
  border: 4px solid #d05858;
  border-radius: 10px;
  background: #d05858;
}
.frame > div.center .logo:before {
  content: "";
  display: block;
  position: absolute;
  top: 0px;
  left: 0px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border: 3px solid #fff;
  border-radius: 7px;
}
.frame > div.center .logo:after {
  content: "🎩";
  display: block;
  position: absolute;
  top: -40px;
  left: calc(50% - 40px);
  width: 80px;
  height: 80px;
  transform-origin: 50% 50%;
  font-size: 40px;
  line-height: 80px;
}
.frame > div.center .cards {
  display: block;
  position: absolute;
  width: 200px;
  height: 120px;
  text-align: center;
  line-height: 120px;
  text-transform: uppercase;
  color: rgba(46, 70, 77, 0.5);
  border: 4px dotted rgba(46, 70, 77, 0.5);
}
.frame > div.center .cards.community {
  top: 125px;
  left: 266px;
  transform: rotate(135deg);
  transform-origin: 0px 0px;
}
.frame > div.center .cards.chance {
  bottom: 182px;
  right: 40px;
  transform: rotate(-45deg);
  transform-origin: 100% 100%;
}
.frame > div.corner div {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  text-align: center;
  text-transform: uppercase;
}
.frame > div.corner div span {
  display: block;
  font-size: 30px;
}
.frame > div.corner.tl {
  border-radius: 8px 1px 4px 1px;
}
.frame > div.corner.tl div {
  top: -5px;
  right: 5px;
  animation: spin135 1ms;
  animation-play-state: paused;
}
.frame > div.corner.tr {
  border-radius: 1px 8px 1px 4px;
}
.frame > div.corner.tr div {
  top: -5px;
  left: 5px;
  animation: spin-135 1ms;
  animation-play-state: paused;
}
.frame > div.corner.bl {
  border-radius: 1px 4px 1px 8px;
}
.frame > div.corner.bl div {
  top: 5px;
  right: 5px;
  animation: spin45 1ms;
  animation-play-state: paused;
}
.frame > div.corner.br {
  border-radius: 4px 1px 8px 1px;
}
.frame > div.corner.br div {
  top: 5px;
  left: 5px;
  font-size: 30px;
  animation: spin-45 1ms;
  animation-play-state: paused;
}
.frame > div.corner.br div em {
  display: block;
  font-size: 7px;
  width: 70%;
  margin: 0px auto;
  font-style: normal;
}

@keyframes spin45 {
  0% {
    transform: rotate(45deg);
  }
}
@keyframes spin-45 {
  0% {
    transform: rotate(-45deg);
  }
}
@keyframes spin135 {
  0% {
    transform: rotate(135deg);
  }
}
@keyframes spin-135 {
  0% {
    transform: rotate(-135deg);
  }
}

/* For screens narrower than 768px (mobile) */
@media (max-width: 900px) {
  #roll-btn {
    font-size: 24px;
    padding: 12px 24px;
  }

  #selection {
    font-size: 18px;
    padding: 10px 24px;
  }

  #board-container {
    position: relative;
    max-width: 400px;
    margin: 20 auto;
  }

  .frame {
    grid: 50px repeat(9, 30px) 50px / 50px repeat(9, 30px) 50px;
    padding: 4px;
    grid-gap: 2px;
  }

  .frame > div .inside {
    width: 30px;
    height: 50px;
    padding: 2px;
  }

  .frame > div .inside:before {
    height: 10px;
  }

  .frame > div .inside h2 {
    font-size: 4px;
    margin: 3px auto 14px auto;
    line-height: 5px;
  }

  .frame > div .inside strong {
    font-size: 6px;
    bottom: 1px;
  }

  .frame > div .inside span {
    font-size: 13px;
    line-height: 0px;
  }

  .frame > div.top .inside {
    transform-origin: initial;
  }

  .frame > div.right .inside {
    transform: rotate(-90deg) translateX(38px);
  }

  .frame > div.left .inside {
    transform: rotate(90deg) translateY(50px);
  }

  .frame > div.corner div {
    font-size: 6pt;
  }

  .frame > div.corner.br div {
    top: 1px;
    left: 1px;
    font-size: 17px;
  }

  .frame > div.corner.br div em {
    font-size: 3pt;
  }

  .frame > div.corner div span {
    font-size: 8px;
  }

  .frame > div.center .logo {
    top: calc(50% - 42px);
    left: calc(50% - 156px);
    width: 315px;
    height: 80px;
    line-height: 80px;
    font-size: 50px;
  }
  .frame > div.center .logo:before {
    top: 0px;
    left: 0px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
  }
  .frame > div.center .cards {
    width: 100px;
    height: 55px;
    line-height: 50px;
    font-size: 6pt;
    border: 2px dotted rgba(46, 70, 77, 0.5);
  }
  .frame > div.center .cards.community {
    top: 50px;
    left: 120px;
  }
  .frame > div.center .cards.chance {
    bottom: 82px;
    right: 10px;
  }
}