@import url("https://fonts.googleapis.com/css2?family=Bungee&family=Chiron+GoRound+TC:wght@200..900&display=swap");

* {
  box-sizing: border-box;
  font-family: "Chiron GoRound TC", sans-serif;
  font-weight: 900;
  touch-action: manipulation;
}

body {
  margin: 0;
  overflow: hidden;
  background-color: #f6f3eb;
  user-select: none;
  -webkit-user-select: none;
}

#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hint {
  position: fixed;
  top: 30px;
  width: 100%;
  text-align: center;
  color: #725349;
  opacity: 0.5;
  font-size: 16px;
  letter-spacing: 1px;
  pointer-events: none;
  text-transform: uppercase;
  z-index: 10;
}
@media (max-width: 600px) {
  .hint {
    top: auto;
    bottom: 110px;
  }
}

#result-board {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 20;
}
#result-board.show {
  opacity: 1;
}
#result-text {
  font-size: 48px;
  color: #725349;
  text-shadow: 3px 3px 0 #f6f3eb, -3px -3px 0 #f6f3eb, 3px -3px 0 #f6f3eb,
    -3px 3px 0 #f6f3eb, 0px 3px 0 #f6f3eb, 3px 0px 0 #f6f3eb, 0px -3px 0 #f6f3eb,
    -3px 0px 0 #f6f3eb;
}

.top-left-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  pointer-events: auto;
  z-index: 100;
}
.back-btn {
  display: block;
  padding: 12px 16px;
  background: #e6be9154;
  border-radius: 100px;
  color: #752f11;
  font-size: 16px;
  text-decoration: none;
}
.back-btn:hover {
  background: #e6be917a;
}
.back-btn i {
  margin-right: 8px;
}

.bottom-right-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  align-items: flex-end;
}

.circle-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 5px solid #725349;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 #72534935;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #725349;
  background: #f2c94c;
  transition: all 0.2s;
}
.circle-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.circle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.circle-btn.spin-btn {
  width: 80px;
  height: 80px;
}
.circle-btn.spin-btn.start {
  background: #e05a47;
  color: white;
}
.circle-btn.spin-btn.stop {
  background: #4d9bea;
  color: white;
  border-color: #2c5d8f;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(114, 83, 73, 0.5) 25%,
    rgba(130, 97, 87, 0.5) 0,
    rgba(130, 97, 87, 0.5) 50%,
    rgba(114, 83, 73, 0.5) 0,
    rgba(114, 83, 73, 0.5) 75%,
    rgba(130, 97, 87, 0.5) 0
  );
  background-size: 120px 120px;
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0s 0.2s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s, visibility 0s;
}

.modal-content {
  background: #f6f3eb;
  border: 5px solid #725349;
  border-radius: 20px;
  width: 380px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}
.modal-content.large {
  height: 550px;
}

.tabs-header {
  display: flex;
  border-bottom: 5px solid #725349;
}
.tab-btn {
  flex: 1;
  padding: 16px 12px;
  cursor: pointer;
  color: #725349;
  background: #fff;
  border: none;
  font-size: 18px;
}
.tab-btn.active {
  background: #f2c94c;
}
.tab-btn:first-child {
  border-right: 5px solid #725349;
}

.tabs-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  height: 100%;
  flex-direction: column;
}
.tab-pane.active {
  display: flex;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
.item-list li {
  padding: 10px 12px;
  border-bottom: 2px dashed #72534944;
  color: #725349;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
}
.item-prob {
  font-size: 14px;
  color: #72534999;
  background: #72534915;
  padding: 4px 10px;
  border-radius: 20px;
}
.item-tag {
  font-size: 10px;
  color: #fff;
  background: #e05a47;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 5px;
  vertical-align: middle;
}

textarea {
  background: #fff;
  border: 5px solid #725349;
  border-radius: 10px;
  padding: 10px;
  font-size: 16px;
  resize: none;
  flex: 1;
  width: 100%;
  outline: none;
  color: #725349;
  line-height: 1.5;
  margin-bottom: 12px;
}

.input-hint {
  font-size: 16px;
  color: #72534999;
  margin-bottom: 12px;
}
.input-hint i {
  margin-right: 8px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 5px solid #725349;
  display: flex;
  gap: 12px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  border: 5px solid #725349;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
.action-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}
.btn-close {
  background: #fff;
  color: #725349;
}
.btn-restart {
  background: #e05a47;
  color: white;
}
