* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #fbfaf6;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

button {
  display: block;
  margin: 0 auto;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font: inherit;
  cursor: pointer;
}

button:hover {
  background: #f3f0e8;
}

button:disabled {
  cursor: wait;
  color: #999;
  border-color: #999;
  background: #f7f7f7;
}

.game {
  width: 330px;
  margin: 58px auto 0;
  text-align: center;
}

h1 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: normal;
  letter-spacing: 0;
}

p {
  margin: 0;
  line-height: 1.45;
}

#statusText {
  margin-bottom: 4px;
}

.goal-box,
.run-box {
  min-height: 18px;
  color: #333;
  font-size: 12px;
}

.run-box {
  margin-bottom: 6px;
  color: #666;
  font-size: 11px;
}

.dice-stage {
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}

.die-visual {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #111;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  transform: translateY(5px) scale(0.9);
}

.die-visual.show {
  animation: dieFade 520ms ease-out forwards;
}

.cooldown-text {
  min-height: 18px;
  margin-bottom: 8px;
  color: #777;
  font-size: 11px;
}

.roll-button {
  width: 138px;
  height: 44px;
  margin-bottom: 11px;
  font-size: 13px;
}

.menu-button {
  width: 92px;
  height: 29px;
  margin-bottom: 13px;
  font-size: 12px;
}

#flavorText {
  color: #333;
}

.roll-line {
  min-height: 19px;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
}

.hidden {
  display: none;
}

.upgrades {
  width: 260px;
  margin: 20px auto 0;
  padding: 12px 10px 10px;
  border: 1px solid #111;
  background: #fff;
  text-align: center;
}

.upgrade-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

.text-button {
  display: inline-block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 2px 6px;
  border: 1px solid #111;
  font-size: 11px;
}

.upgrade-list {
  max-height: 310px;
  margin-bottom: 9px;
  overflow-y: auto;
  padding-right: 2px;
}

.upgrade-button {
  width: 210px;
  min-height: 27px;
  margin-bottom: 7px;
  padding: 4px 8px;
  text-align: left;
}

.upgrade-button span {
  display: block;
  margin-top: 2px;
  color: #555;
  font-size: 10px;
}

.upgrade-button.locked {
  color: #777;
  border-color: #777;
  background: #fbfaf6;
}

.more-buttons {
  width: 220px;
  margin: 12px auto 0;
  padding-top: 9px;
  border-top: 1px solid #ccc;
}

.tiny-button {
  display: inline-block;
  min-width: 70px;
  min-height: 24px;
  margin: 3px;
  padding: 3px 7px;
  font-size: 12px;
}

.system-box {
  min-height: 34px;
  margin: 11px auto 0;
  color: #333;
  font-size: 12px;
}

.action-panel {
  width: 230px;
  margin: 9px auto 0;
  padding: 8px;
  border: 1px solid #111;
  background: #fbfaf6;
  text-align: left;
  font-size: 11px;
}

.event-panel,
.pack-reveal {
  width: 230px;
  margin: 9px auto 0;
  padding: 8px;
  border: 1px solid #111;
  background: #fff;
  text-align: left;
  font-size: 11px;
}

.action-title {
  margin-bottom: 5px;
  text-align: center;
  font-size: 12px;
}

.action-note {
  margin-bottom: 7px;
  color: #555;
  text-align: center;
}

.buy-row {
  width: 100%;
  min-height: 30px;
  margin: 5px 0 0;
  padding: 4px 6px;
  text-align: left;
}

.buy-row span {
  display: block;
  color: #666;
  font-size: 10px;
}

.buy-row.locked {
  color: #777;
  border-color: #777;
  background: #fbfaf6;
}

.reveal-card {
  margin-top: 5px;
  padding: 5px 6px;
  border: 1px solid #aaa;
  background: #fbfaf6;
  animation: revealIn 260ms ease-out both;
}

.reveal-card strong {
  display: block;
  font-size: 11px;
}

.reveal-card span {
  color: #666;
  font-size: 10px;
}

.empire-box {
  margin: 8px auto 0;
  color: #555;
  font-size: 11px;
}

.log {
  margin-top: 8px;
  color: #777;
  font-size: 11px;
}

.log-entry {
  margin-top: 4px;
}

.log-entry.good {
  color: #333;
}

.log-entry.bad {
  color: #777;
}

@media (max-width: 390px) {
  .game {
    width: calc(100vw - 28px);
  }

  .upgrades {
    width: 100%;
  }
}

@keyframes dieFade {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.85);
  }

  25% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }

  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
