.sidebar-gacha { display: none; }
.sidebar-gacha__title-icon,
.sidebar-gacha__title-mobile,
.sidebar-gacha__description-mobile { display: none; }

@media (min-width: 1000px) {
  .sidebar-gacha { display: block; margin-bottom: 18px; }
  .sidebar-gacha__description { margin: 7px 0 6px; color: #555; font-size: 12px; line-height: 1.4; text-align: center; }
  .sidebar-gacha__view { position: relative; padding-bottom: 5px; overflow: hidden; }
  .sidebar-gacha__pair { display: flex; justify-content: center; gap: 10px; }
  .sidebar-gacha__machine { flex: 0 0 140px; width: 140px; text-align: center; }
  .sidebar-gacha__label { --gacha-bubble-border: #c9cdd1; position: relative; box-sizing: border-box; width: max-content; max-width: 100%; margin: 0 auto 7px; padding: 4px 8px; border: 1px solid var(--gacha-bubble-border); border-radius: 4px; background: #fff; color: #333; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; cursor: default; }
  .sidebar-gacha__label::after { content: ''; position: absolute; bottom: -5px; left: 50%; width: 8px; height: 8px; border-right: 1px solid var(--gacha-bubble-border); border-bottom: 1px solid var(--gacha-bubble-border); background: inherit; transform: translateX(-50%) rotate(45deg); }
  .sidebar-gacha__label--ssr { --gacha-bubble-border: #d4c5a2; background: #fffaf0; color: #443927; }
  .sidebar-gacha__image { display: block; width: 140px; height: 140px; object-fit: contain; }
  .sidebar-gacha__image.gacha-sold-out { filter: grayscale(1); }
  .sidebar-gacha__button { box-sizing: border-box; display: block; width: 100%; min-height: 36px; margin-top: 5px; padding: 6px 2px; border: 1px solid #a12836; border-radius: 5px; background: #ff6b95; box-shadow: 0 4px 0 #a12836, inset 0 2px 0 rgb(255 255 255 / 32%); color: #fff; font: inherit; font-size: 12px; font-weight: 700; line-height: 1.25; white-space: nowrap; cursor: pointer; transition: transform 90ms ease, box-shadow 90ms ease; }
  .sidebar-gacha__button--ssr { border-color: #a56a17; background: #e9b94c; box-shadow: 0 4px 0 #a56a17, inset 0 2px 0 rgb(255 255 255 / 35%); color: #33230b; }
  .sidebar-gacha__button:not(:disabled):hover { transform: translateY(2px); box-shadow: 0 2px 0 #a12836, inset 0 2px 0 rgb(255 255 255 / 32%); }
  .sidebar-gacha__button--ssr:not(:disabled):hover { box-shadow: 0 2px 0 #a56a17, inset 0 2px 0 rgb(255 255 255 / 35%); }
  .sidebar-gacha__button:not(:disabled):active { transform: translateY(4px); box-shadow: 0 0 0 #a12836, inset 0 1px 0 rgb(255 255 255 / 20%); }
  .sidebar-gacha__button--ssr:not(:disabled):active { box-shadow: 0 0 0 #a56a17, inset 0 1px 0 rgb(255 255 255 / 20%); }
  .sidebar-gacha__button:focus-visible { outline: 2px solid #30343a; outline-offset: 5px; }
  .sidebar-gacha__button:disabled { opacity: .65; cursor: default; }
  .sidebar-gacha__button[data-gacha-used="true"] { height: 36px; padding: 3px 2px; font-size: 11px; line-height: 1.2; white-space: normal; cursor: not-allowed; }
  .sidebar-gacha__error { margin: 4px 0 0; color: #b00020; font-size: 11px; }
  .sidebar-gacha__image.gacha-shake { animation: sidebar-gacha-shake 125ms steps(1, end) 4; }
  .sidebar-gacha__image.gacha-handle-shake { animation: sidebar-gacha-handle-shake 80ms steps(1, end) 2; }
}

@keyframes sidebar-gacha-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes sidebar-gacha-handle-shake { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) {
  .sidebar-gacha__image.gacha-shake,
  .sidebar-gacha__image.gacha-handle-shake { animation: none; }
}

/* The same two machines move into the page on phones; no second set of controls is rendered. */
@media (max-width: 999.98px) {
  .sidebar-gacha { display: block; margin-bottom: 18px; }
  .sidebar-gacha__description { margin: 7px 0 6px; color: #555; font-size: 12px; line-height: 1.4; text-align: center; }
  .sidebar-gacha__view { position: relative; padding-bottom: 5px; overflow: hidden; }
  .sidebar-gacha__pair { display: flex; justify-content: center; gap: 8px; }
  .sidebar-gacha__machine { flex: 0 1 90px; min-width: 0; text-align: center; }
  .sidebar-gacha__label { --gacha-bubble-border: #c9cdd1; position: relative; box-sizing: border-box; max-width: 100%; min-height: 37px; margin: 0 auto 7px; padding: 4px 5px; border: 1px solid var(--gacha-bubble-border); border-radius: 4px; background: #fff; color: #333; font-size: 10px; font-weight: 600; line-height: 1.25; cursor: default; }
  .sidebar-gacha__label::after { content: ''; position: absolute; bottom: -5px; left: 50%; width: 8px; height: 8px; border-right: 1px solid var(--gacha-bubble-border); border-bottom: 1px solid var(--gacha-bubble-border); background: inherit; transform: translateX(-50%) rotate(45deg); }
  .sidebar-gacha__label--ssr { --gacha-bubble-border: #d4c5a2; background: #fffaf0; color: #443927; }
  .sidebar-gacha__image { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
  .sidebar-gacha__image.gacha-sold-out { filter: grayscale(1); }
  .sidebar-gacha__button { box-sizing: border-box; display: block; width: 100%; min-height: 44px; margin-top: 5px; padding: 5px 3px; border: 1px solid #a12836; border-radius: 5px; background: #ff6b95; box-shadow: 0 4px 0 #a12836, inset 0 2px 0 rgb(255 255 255 / 32%); color: #fff; font: inherit; font-size: 11px; font-weight: 700; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; cursor: pointer; transition: transform 90ms ease, box-shadow 90ms ease; }
  .sidebar-gacha__button--ssr { border-color: #a56a17; background: #e9b94c; box-shadow: 0 4px 0 #a56a17, inset 0 2px 0 rgb(255 255 255 / 35%); color: #33230b; }
  .sidebar-gacha__button:not(:disabled):hover { transform: translateY(2px); box-shadow: 0 2px 0 #a12836, inset 0 2px 0 rgb(255 255 255 / 32%); }
  .sidebar-gacha__button--ssr:not(:disabled):hover { box-shadow: 0 2px 0 #a56a17, inset 0 2px 0 rgb(255 255 255 / 35%); }
  .sidebar-gacha__button:not(:disabled):active { transform: translateY(4px); box-shadow: 0 0 0 #a12836, inset 0 1px 0 rgb(255 255 255 / 20%); }
  .sidebar-gacha__button--ssr:not(:disabled):active { box-shadow: 0 0 0 #a56a17, inset 0 1px 0 rgb(255 255 255 / 20%); }
  .sidebar-gacha__button:focus-visible { outline: 2px solid #30343a; outline-offset: 5px; }
  .sidebar-gacha__button:disabled { opacity: .65; cursor: default; }
  .sidebar-gacha__button[data-gacha-used="true"] { cursor: not-allowed; }
  .sidebar-gacha__error { margin: 4px 0 0; color: #b00020; font-size: 11px; }
  .sidebar-gacha__image.gacha-shake { animation: sidebar-gacha-shake 125ms steps(1, end) 4; }
  .sidebar-gacha__image.gacha-handle-shake { animation: sidebar-gacha-handle-shake 80ms steps(1, end) 2; }
}

@media (min-width: 717px) and (max-width: 999.98px) {
  .sidebar-gacha__description { font-size: 11px; white-space: nowrap; }
  .sidebar-gacha__machine { flex: 0 1 110px; }
  .sidebar-gacha__label { display: flex; align-items: center; justify-content: center; min-height: 38px; text-align: center; }
  .sidebar-gacha__label--random { flex-direction: column; }
  .sidebar-gacha__button:not([data-gacha-used="true"]) { font-size: 10px; letter-spacing: -.01em; white-space: nowrap; }
}

@media (max-width: 716px) {
  .sidebar-right { overflow-x: clip; }
  .sidebar-gacha[data-gacha-location="mobile"] { display: block; box-sizing: border-box; width: 100%; min-width: 0; margin: 0; padding: 14px 12px 22px; border-top: 1px solid #ececef; }
  .sidebar-gacha[data-gacha-location="mobile"] > .sidebar-block__title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0; border: 0; background: transparent; color: #34363a; font-size: 15px; font-weight: 700; line-height: 1.45; }
  .sidebar-gacha[data-gacha-location="mobile"] .sidebar-gacha__title-desktop,
  .sidebar-gacha[data-gacha-location="mobile"] .sidebar-gacha__description-desktop { display: none; }
  .sidebar-gacha[data-gacha-location="mobile"] .sidebar-gacha__title-icon { display: block; flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: #d94f77; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .sidebar-gacha[data-gacha-location="mobile"] .sidebar-gacha__title-mobile,
  .sidebar-gacha[data-gacha-location="mobile"] .sidebar-gacha__description-mobile { display: inline; }
  .sidebar-gacha[data-gacha-location="mobile"] .sidebar-gacha__description { margin: 0 0 6px; }
  .sidebar-gacha__pair { gap: 12px; }
  .sidebar-gacha__machine { flex-basis: min(140px, calc((100% - 12px) / 2)); }
  .sidebar-gacha__label { min-height: 0; font-size: 10px; }
  .sidebar-gacha__button { font-size: 11px; }
}

@media (max-width: 999.98px) and (prefers-reduced-motion: reduce) {
  .sidebar-gacha__image.gacha-shake,
  .sidebar-gacha__image.gacha-handle-shake { animation: none; }
}
