* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #22242a;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 196, 87, 0.35), transparent 34rem),
    linear-gradient(135deg, #f6f7fb 0%, #edf5f2 52%, #fff7e5 100%);
}

button {
  font: inherit;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.status-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.status-item {
  padding: 12px 14px;
  border: 1px solid rgba(36, 38, 44, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(8px);
}

.status-label,
.summary-label {
  display: block;
  margin-bottom: 4px;
  color: #626875;
  font-size: 0.82rem;
}

.status-item strong {
  color: #0e7a5f;
}

.hero {
  padding: 26px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b44e1a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: #191b20;
  font-size: clamp(2rem, 7vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.description {
  max-width: 760px;
  margin-bottom: 0;
  color: #4d5360;
  font-size: 1rem;
  line-height: 1.8;
}

.play-area,
.panel,
.summary-card {
  border: 1px solid rgba(36, 38, 44, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 54px rgba(34, 36, 42, 0.08);
}

.play-area {
  padding: 22px;
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.small-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.button {
  min-width: 180px;
  padding: 12px 20px;
}

.button:hover:not(:disabled),
.small-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary {
  color: #ffffff;
  background: #d84040;
  box-shadow: 0 10px 24px rgba(216, 64, 64, 0.26);
}

.secondary {
  color: #173a33;
  background: #9de0c8;
  box-shadow: 0 10px 24px rgba(21, 134, 101, 0.17);
}

.small-button {
  min-height: 36px;
  padding: 8px 12px;
  color: #343944;
  background: #eef1f5;
}

.small-button.danger {
  color: #8c1f1f;
  background: #ffe2e2;
}


.machine {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.roulette-wrap {
  position: relative;
  width: min(330px, 100%);
  aspect-ratio: 1;
  margin: 18px auto 0;
  display: grid;
  place-items: center;
}

.roulette-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 5;
  width: 38px;
  height: 54px;
  transform: translateX(-50%);
  background: #1e232b;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.18));
}

.roulette-wheel {
  position: relative;
  width: 88%;
  aspect-ratio: 1;
  border: 10px solid #ffffff;
  border-radius: 50%;
  background: conic-gradient(#d84040 0deg 360deg);
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.12), 0 18px 34px rgba(34, 36, 42, 0.16);
  transform: rotate(0deg);
  transition: transform 3.8s cubic-bezier(0.12, 0.72, 0.14, 1);
}

.roulette-wheel::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.roulette-wheel.spinning {
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.12), 0 20px 42px rgba(216, 64, 64, 0.22);
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 92px;
  padding: 4px 6px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform-origin: 0 0;
}

.roulette-center {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 88px;
  aspect-ratio: 1;
  place-items: center;
  border: 7px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  background: #1e232b;
  box-shadow: 0 10px 20px rgba(34, 36, 42, 0.18);
  font-weight: 800;
}

.result-box {
  min-height: 136px;
  padding: 20px;
  border: 2px dashed #d2d8df;
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: #59616d;
  background: #fbfcfe;
}

.result-name {
  color: #1d222a;
  font-size: 1.8rem;
  font-weight: 800;
}

.rarity-badge {
  display: inline-block;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
}

.rarity-N {
  background: #6a7787;
}

.rarity-R {
  background: #3280c4;
}

.rarity-SR {
  background: #8b54c9;
}

.rarity-SSR {
  background: #d8971b;
}

.rarity-UR {
  background: #d93675;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary-card {
  padding: 18px;
}

.summary-card strong {
  font-size: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

.history-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li,
.inventory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f6f8fb;
}

.history-meta {
  color: #69717f;
  font-size: 0.82rem;
}

.inventory-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.inventory-count {
  color: #0e7a5f;
  font-weight: 800;
}

.empty-text {
  color: #727b88;
  line-height: 1.7;
}


.rate-panel {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(36, 38, 44, 0.12);
  border-radius: 8px;
  background: #fbfcfe;
}

.rate-title {
  margin-bottom: 10px;
  color: #1d222a;
  font-weight: 800;
}

.rate-list {
  display: grid;
  gap: 8px;
}

.rate-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6f8fb;
}

.rate-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rate-row span:last-child {
  color: #0e7a5f;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 22px, 1120px);
    padding-top: 14px;
  }

  .status-panel,
  .summary-grid,
  .content-grid,
  .machine {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .roulette-wrap {
    width: min(330px, 100%);
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
