.decision-layout {
  display: grid;
  gap: 24px;
}

.decision-layout.wheel-layout {
  grid-template-columns: minmax(260px, .85fr) minmax(300px, 1.15fr);
  align-items: center;
}

.decision-generator {
  max-width: 680px;
  margin: 0 auto;
}

.decision-generator[hidden],
.decision-stage[hidden] {
  display: none !important;
}

.decision-generate {
  margin-top: 16px;
}

.decision-stage {
  position: relative;
  min-height: 650px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 22px 30px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #f5f6ff 50%, #eef0ff 100%);
  overflow: hidden;
}

.stage-toolbar {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.stage-toolbar .button { margin: 0; }

.decision-stage .wheel-panel {
  width: min(68vw, 520px);
  min-width: 280px;
}

.decision-stage .decision-start {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  min-width: 116px;
  min-height: 50px;
  transform: translate(-50%, -50%);
  border: 4px solid #fff;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(45, 49, 110, .2);
}

.decision-stage.wheel-stage .decision-result {
  position: absolute;
  right: 24px;
  bottom: 22px;
  left: 24px;
  min-height: 58px;
  margin: 0;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
}

.picker-panel {
  position: relative;
  width: min(86vw, 620px);
  min-height: 290px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d8dcff;
  border-radius: 18px;
  background: linear-gradient(135deg, #202348, #3b3d83 50%, #6a5bd1);
  box-shadow: 0 20px 40px rgba(46, 50, 126, .28);
}

.picker-roller {
  position: relative;
  z-index: 2;
  width: calc(100% - 46px);
  padding: 38px 18px;
  border: 2px solid rgba(255, 255, 255, .55);
  border-radius: 12px;
  color: #fff;
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 3px 12px rgba(0, 0, 0, .26);
}

.picker-roller.is-rolling {
  animation: picker-pulse .18s ease-in-out infinite alternate;
}

.picker-halo {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  filter: blur(2px);
  animation: picker-halo 3s ease-in-out infinite;
}

.picker-stage .decision-start {
  position: static;
  transform: none;
  min-width: 150px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(91, 91, 214, .2);
}

.picker-stage .decision-result {
  width: min(86vw, 620px);
  min-height: 64px;
  margin: 0;
  background: rgba(255, 255, 255, .85);
}

.lots-stage-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.lots-stage .lots-board {
  width: min(92vw, 620px);
  margin-top: 2px;
}

.lots-stage .decision-result {
  width: min(92vw, 620px);
  min-height: 70px;
  margin: 0;
  background: rgba(255, 255, 255, .86);
}

@keyframes picker-pulse {
  from { transform: translateY(-4px) scale(.98); filter: blur(.3px); }
  to { transform: translateY(4px) scale(1.02); filter: blur(0); }
}

@keyframes picker-halo {
  0%, 100% { transform: scale(.82); opacity: .25; }
  50% { transform: scale(1.16); opacity: .55; }
}

.decision-input textarea {
  min-height: 190px;
}

.input-hint {
  margin: -12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.seat-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seat-options select {
  width: 100%;
  height: 52px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #fbfbfd;
  color: var(--text);
  font: inherit;
}

.decision-run,
.decision-reset {
  margin-top: 16px;
}

.wheel-panel {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 500px);
  margin: 0 auto;
  aspect-ratio: 1;
}

#decision-wheel {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 20px rgba(32, 36, 57, .13));
}

.wheel-pointer {
  position: absolute;
  z-index: 2;
  top: -4px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-right: 15px solid transparent;
  border-left: 15px solid transparent;
  border-top: 34px solid #ff5a36;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .18));
}

.decision-result {
  min-height: 92px;
  display: grid;
  place-items: center;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfbfd;
  color: var(--muted);
  text-align: center;
}

.decision-result strong {
  display: block;
  color: var(--primary);
  font-size: 27px;
  line-height: 1.35;
}

.decision-result small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.decision-groups,
.seat-grid,
.order-list,
.lots-board {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
}

.decision-groups { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.decision-group { padding: 12px; border-left: 3px solid var(--primary); background: var(--primary-light); animation: decision-item-in .4s ease both; }
.decision-group b { display: block; margin-bottom: 8px; color: var(--primary); }
.group-members { display: grid; gap: 6px; }
.group-member { display: block; padding: 6px 8px; border-radius: 6px; background: var(--card); animation: decision-item-in .45s ease both; animation-delay: var(--delay, 0ms); }
.seat-cell { animation: seat-flip-in .55s cubic-bezier(.2,.75,.25,1) both; animation-delay: var(--delay, 0ms); }
.order-item { animation: order-slide-in .45s ease both; animation-delay: var(--delay, 0ms); }

.lots-board { grid-template-columns: repeat(auto-fill, minmax(54px, 66px)); justify-content: center; align-items: end; max-width: 620px; min-height: 246px; margin: 0 auto 16px; padding: 16px 18px; border: 1px dashed #dfe2f2; border-radius: 18px; background: rgba(255, 255, 255, .78); }
.lot-card { min-height: 168px; display: grid; place-items: center; perspective: 700px; cursor: pointer; animation: lot-card-in .55s ease both; animation-delay: var(--delay, 0ms); }
.lot-card-face { position: relative; width: 48px; min-height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 13px 5px 10px; border: 1px solid #eadfc9; border-radius: 8px; background: linear-gradient(180deg, #f7eedf 0%, #ead8b9 100%); color: #8f7959; font-weight: 700; text-align: center; backface-visibility: hidden; box-shadow: 0 6px 12px rgba(114, 92, 55, .12); transition: .25s ease; }
.lot-card-number { font-size: 14px; line-height: 1; }
.lot-card-value { max-width: 100%; overflow: hidden; color: #856e4e; font-size: 11px; line-height: 1.25; writing-mode: vertical-rl; text-overflow: ellipsis; opacity: 0; transition: opacity .2s ease; }
.lot-card-hand { min-height: 15px; color: #ff9c2b; font-size: 15px; line-height: 1; opacity: 0; transform: translateY(3px); transition: .2s ease; }
.lot-card.is-shuffling .lot-card-face { animation: lot-shuffle .36s ease-in-out var(--delay, 0ms) 2; }
.lot-card.is-drawn .lot-card-face { border-color: #ff6b57; background: linear-gradient(180deg, #dfe8f6 0%, #b9cceb 100%); color: #b84835; box-shadow: 0 0 0 1px rgba(255, 107, 87, .3), 0 10px 20px rgba(59, 89, 145, .18); animation: lot-drawn .65s ease both; }
.lot-card.is-drawn .lot-card-number { color: #9d3f32; }
.lot-card.is-drawn .lot-card-value { color: #a94333; font-weight: 800; }
.lot-card.is-drawn .lot-card-hand { opacity: 1; transform: translateY(0); }
.lot-card:not(.is-drawn):hover .lot-card-face { transform: translateY(-6px); box-shadow: 0 12px 20px rgba(114, 92, 55, .2); }

@keyframes decision-item-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes seat-flip-in { from { opacity: 0; transform: rotateX(-70deg) translateY(-8px); } to { opacity: 1; transform: rotateX(0) translateY(0); } }
@keyframes order-slide-in { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes lot-card-in { from { opacity: 0; transform: translateY(18px) rotateX(-18deg); } to { opacity: 1; transform: translateY(0) rotateX(0); } }
@keyframes lot-shuffle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes lot-drawn { 0% { transform: scale(1); } 45% { transform: scale(1.08) rotate(-2deg); } 100% { transform: scale(1.02); } }

.seat-grid { grid-template-columns: repeat(var(--seat-columns, 4), minmax(64px, 1fr)); grid-template-rows: repeat(var(--seat-rows, 3), minmax(48px, 1fr)); }
.seat-cell { min-height: 48px; display: grid; place-items: center; padding: 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); text-align: center; }
.order-list { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); counter-reset: order; }
.order-item { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.order-item::before { counter-increment: order; content: counter(order) ". "; color: var(--primary); font-weight: 700; }

.dark .decision-result { background: #191a28; }
.dark .seat-options select { background: #191a28; }
.dark .lots-board { background: rgba(25, 26, 40, .78); border-color: #424563; }
.dark .decision-stage { background: radial-gradient(circle at 50% 42%, #292b4c 0%, #20233e 52%, #1b1d32 100%); }
.dark .decision-stage.wheel-stage .decision-result,
.dark .picker-stage .decision-result { background: rgba(25, 26, 40, .82); }

@media (max-width: 760px) {
  .decision-layout.wheel-layout { grid-template-columns: 1fr; }
  .wheel-panel { width: min(100%, 390px); }
  .decision-stage { min-height: 560px; padding-right: 12px; padding-left: 12px; }
  .decision-stage .wheel-panel { width: min(92vw, 430px); }
  .decision-stage.wheel-stage .decision-result { right: 12px; left: 12px; }
  .seat-options { grid-template-columns: 1fr; }
  .seat-grid { grid-template-columns: repeat(min(var(--seat-columns, 4), 3), minmax(64px, 1fr)); }
}
