:root {
  --bg-color: #2c3e50;
  --task-color: #ef4444; /* 红色代表必须做的事情 */
  --play-color: #10b981; /* 绿色代表可以玩的东西 */
  --text-color: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.1);
}

body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans SC", sans-serif;
  background: radial-gradient(circle at center, #34495e 0%, #2c3e50 100%);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 20px 0;
}

.app-container {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  width: 90vw;
  max-width: 1000px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
  font-size: 3rem;
  margin: 0 0 10px;
  color: #f39c12;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.status-message {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 20px;
  min-height: 2em;
}

/* 菜单区块 */
.options {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.options select {
  padding: 10px;
  font-size: 1.2rem;
  border-radius: 10px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  outline: none;
}

/* 主视窗 */
.arena {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 40px;
}

.circle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 350px;
}

/* 标签 */
.title-badge {
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 20px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: 1px;
  line-height: 1.5;
}

.task-badge {
  border: 2px solid var(--task-color);
  color: #ffa0a0;
}
.play-badge {
  border: 2px solid var(--play-color);
  color: #a0ffa0;
}

/* 让大小调整时，圆圈永远居中对齐 */
.circle-boundary {
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

/* 圆圈本体 */
.circle {
  border-radius: 50%;
  transition:
    width 0.5s linear,
    height 0.5s linear,
    box-shadow 0.5s;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden; /* 防止表情符号跑出圈圈外 */
  z-index: 2; /* 确保色块盖在虚线上面 */
  flex-shrink: 0;
}

/* 虚线参考圈，提供大小对比基准 */
.reference-ring {
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1; /* 垫在色块下方 */
  pointer-events: none;
}

.task-circle {
  background: radial-gradient(circle at 30% 30%, #ff6b6b, var(--task-color));
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
  /* 初始状态很小 */
  width: 40px;
  height: 40px;
}

.play-circle {
  background: radial-gradient(circle at 30% 30%, #34d399, var(--play-color));
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
  /* 初始状态很大 (满) */
  width: 300px;
  height: 300px;
}

/* 时间数字显示 */
.time-display {
  font-size: 1.8rem;
  font-weight: 900;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  z-index: 10;
  pointer-events: none;
  transition: font-size 0.2s;
}

/* 左边事情圈在一开始很小，数字隐藏，变大后显示 */
.task-circle .time-display {
  opacity: 0;
  transition: opacity 0.5s;
}

.task-circle.show-time .time-display {
  opacity: 1;
}

/* 一闪而逝的流失图案动画 */
.loss-icon {
  position: absolute;
  font-size: 2.5rem;
  pointer-events: none;
  z-index: 5;
  /* 动画：向左上方飞出并消失 */
  animation: fadeAndFly 1.2s ease-in forwards;
}

@keyframes fadeAndFly {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
    filter: sepia(0%);
  }
  50% {
    transform: translate(-30px, -40px) scale(1.2) rotate(-15deg);
    opacity: 0.8;
  }
  100% {
    transform: translate(-80px, -100px) scale(0) rotate(-30deg);
    opacity: 0;
    filter: sepia(100%);
  }
}

/* 中间的箭头符号 */
.transfer-zone {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.5);
  animation: flash 2s infinite alternate;
}

@keyframes flash {
  0% {
    opacity: 0.3;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1.1);
    color: #f39c12;
  }
}

/* 底部按钮排版与样式 */
.controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  padding: 15px 30px;
  font-size: 1.5rem;
  font-weight: 900;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Noto Sans SC", sans-serif;
  color: #fff;
}

.btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.btn:active {
  transform: translateY(2px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-btn {
  background: #3b82f6;
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}
.success-btn {
  background: #10b981;
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}
.danger-btn {
  background: #ef4444;
  box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

/* ----- RWD 響應式排版 ----- */
@media (max-width: 768px) {
  .app-container {
    padding: 20px;
    width: 95vw;
  }
  .header h1 {
    font-size: 2rem;
  }
  .status-message {
    font-size: 1.2rem;
  }
  .options {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .circle-container {
    width: auto;
  }
}

/* 直向手機：改為上下排列 */
@media (max-width: 768px) and (orientation: portrait) {
  .arena {
    flex-direction: column;
    gap: 20px;
  }
  .transfer-zone {
    transform: rotate(90deg);
  }
}

/* 橫向小螢幕 (手機橫放)：縮小所有空隙與字體 */
@media (max-height: 600px) and (orientation: landscape) {
  .app-container {
    padding: 10px 20px;
  }
  .header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  .status-message {
    font-size: 1rem;
    margin-bottom: 10px;
    min-height: 1.5em;
  }
  .title-badge {
    padding: 5px 10px;
    font-size: 1rem;
    margin-bottom: 10px;
  }
  .arena {
    margin-bottom: 10px;
  }
  .controls {
    margin-top: 10px;
  }
  .btn {
    padding: 10px 20px;
    font-size: 1.2rem;
  }
}
