:root{
  --sand: #E8D9C2;
  --paper: #F1E5D1;
  --ink: #241D17;
  --terracotta: #B0532A;
  --terracotta-deep: #8A4222;
  --clay: #6E5640;
  --hairline: #CDB48C;
  --glow: #E0A876;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:"Microsoft YaHei", "Inter", sans-serif;
  background:var(--sand);
  display:flex;
  flex-direction:column;
  min-height:100vh;
  color:var(--ink);
  position:relative;
  overflow-x:hidden;
}

/* paper grain texture, matches the rest of the cozy theme */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:0.4;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* 主结构 */
.main{
  flex:1;
  display:flex;
  min-height:100vh;
  position:relative;
  z-index:1;
}

/* 左 */
.left{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  position:relative;
  padding:20px;
}

.wheel-stage{
  position:relative;
  width:500px;
  height:500px;
  max-width:100%;
}

/* 右（名单，可滑） */
.right{
  width:260px;
  background:var(--paper);
  color:var(--ink);
  padding:18px 14px;
  border-left:1px solid var(--hairline);

  height:100vh;
  overflow-y:auto;
  overflow-x:hidden;

  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.right h3{
  font-family:'Fraunces', "Microsoft YaHei", serif;
  font-weight:600;
  font-size:1.1rem;
  margin:0 0 14px;
  color:var(--terracotta-deep);
}

/* 滚动条美化 */
.right::-webkit-scrollbar{ width:6px; }
.right::-webkit-scrollbar-thumb{
  background:var(--hairline);
  border-radius:10px;
}

/* 名单 */
.entry{
  padding:8px 6px;
  border-bottom:1px solid var(--hairline);
  font-size:13.5px;
  border-radius:6px;
  transition: background 0.2s ease;
}

.active{
  background:var(--terracotta);
  color:var(--paper);
  font-weight:600;
}

/* 转盘 */
#wheel{
  width:500px;
  height:500px;
  border-radius:50%;
  max-width:100%;
  box-shadow: 0 10px 40px -10px rgba(46,38,32,0.35);
}

/* 按钮 */
#spinBtn{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:90px;
  height:90px;
  border-radius:50%;
  background:var(--paper);
  border:3px solid var(--terracotta);
  color:var(--terracotta-deep);
  cursor:pointer;
  font-weight:700;
  font-size:14px;
  letter-spacing:0.04em;
  transition: transform 0.2s ease, background 0.2s ease;
}

#spinBtn:hover{
  background:var(--terracotta);
  color:var(--paper);
  transform:translate(-50%,-50%) scale(1.05);
}

#spinBtn:disabled{
  cursor:not-allowed;
  opacity:0.7;
}

/* 指针 */
.pointer{
  position:absolute;
  left: calc(50% + 250px - 5px);
  top:50%;
  transform:translateY(-50%);
  border-top:18px solid transparent;
  border-bottom:18px solid transparent;
  border-right:30px solid var(--terracotta);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  z-index:2;
}

/* 结果 */
#result{
  margin-top:18px;
  color:var(--terracotta-deep);
  font-weight:600;
  font-size:1.1rem;
  min-height:1.4em;
}

/* 弹窗 */
#popup{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(36,29,23,0.55);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:100;
}

.card{
  background:var(--paper);
  padding:36px 40px;
  border-radius:22px;
  text-align:center;
  border:1px solid var(--hairline);
  box-shadow: 0 20px 50px -10px rgba(46,38,32,0.4);
  animation:pop 0.4s ease;
}

.card h2{
  font-family:'Fraunces', "Microsoft YaHei", serif;
  font-weight:600;
  color:var(--ink);
  margin-bottom:6px;
}

.card p{
  font-size:24px;
  font-weight:700;
  color:var(--terracotta-deep);
  margin:8px 0 4px;
}

.card button{
  margin-top:14px;
  padding:10px 26px;
  border:none;
  background:var(--terracotta);
  color:var(--paper);
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  font-size:14px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.card button:hover{
  background:var(--terracotta-deep);
  transform:translateY(-1px);
}

@keyframes pop{
  from{transform:scale(0.5);opacity:0;}
  to{transform:scale(1);opacity:1;}
}

/* footer */
footer{
  background:var(--paper);
  color:var(--clay);
  text-align:center;
  padding:14px 10px;
  border-top:1px solid var(--hairline);
  font-size:13px;
  position:relative;
  z-index:1;
}

footer p{ margin:4px 0; }

footer a{
  color:var(--terracotta-deep);
  text-decoration:none;
  font-weight:600;
}

footer a:hover{
  text-decoration:underline;
  color:var(--terracotta);
}

@media (max-width:800px){
  .main{ flex-direction:column; }
  .right{ width:100%; height:auto; max-height:260px; border-left:none; border-top:1px solid var(--hairline); }
  .left{ padding:30px 10px; }
}
