* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #222;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.selector-shell {
  position: relative;
  width: 600px;
  max-width: calc(100% - 32px);
  height: calc(100vh - 32px);
  margin: 16px auto;
}

.selector-page {
  width: 100%;
  height: 100%;
  padding-right: 16px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.selector-page::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.promo-banner {
  background: #f2f2f2;
  padding: 16px 28px;
  margin-bottom: 18px;
  color: #e6007e;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.3;
}

.field-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.field-row label {
  width: 80px;
  flex-shrink: 0;
  color: #333;
  font-size: 14px;
}

.field-row select {
  flex: 1;
  height: 30px;
  padding: 0 6px;
  border: 1px solid #b9b9b9;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.field-row select:focus {
  border-color: #1f6fb2;
}

.capacity-note {
  margin: -2px 0 2px;
  color: #1f6fb2;
  font-size: 12px;
  line-height: 1.4;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 6px;
  font-size: 13px;
  color: #333;
}

.summary-text b {
  font-weight: 600;
  color: #222;
}

.summary-text .remaining,
.summary-text .remaining b {
  color: #0b8a3e;
  font-weight: 700;
}

.submit-btn {
  flex-shrink: 0;
  padding: 5px 18px;
  border: none;
  border-radius: 2px;
  background: #1f6fb2;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.submit-btn:hover {
  background: #185a91;
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-warning,
.form-error {
  color: #d0021b;
  font-size: 12px;
  line-height: 1.6;
}

.form-warning {
  display: none;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid #ffb4b4;
  border-radius: 6px;
  background: #fff1f0;
  color: #d0021b;
  font-size: 13px;
  line-height: 1.6;
}

.form-error {
  margin: 0 0 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 10px 0 12px;
  font-size: 13px;
  color: #333;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #ccc;
  transition: background .2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.toggle-label input:checked + .switch {
  background: #1a1a1a;
}

.toggle-label input:checked + .switch::after {
  transform: translateX(16px);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-row > select {
  width: 100px;
  height: 30px;
  padding: 0 5px;
  border: 1px solid #b9b9b9;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 30px;
  padding: 0 8px 0 28px;
  border: 1px solid #b9b9b9;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.filter-row > select:focus,
.search-wrap input:focus {
  border-color: #1f6fb2;
}

.game-box-wrap {
  position: relative;
}

.game-scroll-track {
  display: none;
  position: absolute;
  right: 0;
  top: 2px;
  bottom: 2px;
  width: 14px;
  border-radius: 7px;
  background: #f2f4f8;
  z-index: 3;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.game-scroll-thumb {
  position: absolute;
  left: 2px;
  width: 10px;
  min-height: 36px;
  border-radius: 5px;
  background: #1f6fb2;
  pointer-events: none;
}

.game-box {
  border: 1px solid #b9b9b9;
}

.game-list {
  display: flex;
  flex-direction: column;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .15s;
}

.game-row:hover {
  background: #fafafa;
}

.game-row.selected {
  background: #e8f4ff;
}

.game-check {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid #333;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.game-check:checked {
  border-color: #222;
  background: #fff;
}

.game-check:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.game-cover {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 20px;
  font-weight: 700;
}

.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-body {
  flex: 1;
  min-width: 0;
}

.game-name {
  display: block;
  font-size: 15px;
  color: #222;
  line-height: 1.4;
  margin-bottom: 3px;
  word-break: break-word;
}

.game-cate {
  display: block;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.game-version {
  color: #999;
}

.game-size {
  flex-shrink: 0;
  font-size: 13px;
  color: #333;
}

.game-list.hide-covers .game-cover {
  display: none;
}

.game-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f5f7fa;
}

.gate-card {
  width: 380px;
  max-width: 100%;
  padding: 30px 28px;
  border: 1px solid #e8ebf0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(31, 42, 68, .08);
  text-align: center;
}

.gate-card h1 {
  margin: 0 0 18px;
  color: #222;
  font-size: 22px;
  font-weight: 700;
}

.gate-form input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 2px;
  text-align: center;
  outline: none;
}

.gate-form input:focus {
  border-color: #1f6fb2;
}

.gate-form button {
  width: 100%;
  height: 40px;
  margin-top: 12px;
  border: none;
  border-radius: 2px;
  background: #1f6fb2;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.gate-form button:hover {
  background: #185a91;
}

.gate-error {
  margin-top: 8px;
  color: #d0021b;
  font-size: 12px;
  text-align: left;
}

.success-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .45);
}

.success-modal.show {
  display: flex;
}

.success-dialog {
  width: 420px;
  max-width: 100%;
  padding: 26px 24px 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
  text-align: center;
}

.success-dialog h2 {
  margin: 0 0 16px;
  color: #222;
  font-size: 22px;
  font-weight: 700;
}

.success-key {
  padding: 14px 16px;
  border: 1px solid #e3e7ee;
  border-radius: 4px;
  background: #f6f8fb;
  color: #1f2a44;
  font-family: Consolas, "Courier New", monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  word-break: break-all;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.modal-copy,
.modal-close {
  padding: 7px 18px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.modal-copy {
  border: none;
  background: #1f6fb2;
  color: #fff;
}

.modal-copy:hover {
  background: #185a91;
}

.modal-close {
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
}

.modal-close:hover {
  background: #f5f5f5;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .selector-shell {
    width: 100%;
    max-width: none;
    height: 100vh;
    margin: 0;
  }

  .selector-page {
    width: 100%;
    height: 100%;
    padding-right: 16px;
  }

  .promo-banner {
    margin: 0 0 14px;
    padding: 14px 16px;
    font-size: 24px;
  }

  .field-row,
  .summary-row,
  .toggle-row,
  .filter-row {
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .field-row label {
    width: 74px;
    font-size: 13px;
  }

  .capacity-note {
    margin-left: 0;
    font-size: 12px;
  }

  .summary-row {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .summary-text {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .submit-btn {
    margin-left: 0;
    padding: 5px 12px;
  }

  .game-box {
    border-left: 0;
    border-right: 0;
  }

  .game-scroll-track {
    right: 0;
  }

  .search-wrap input,
  .filter-row > select,
  .field-row select {
    font-size: 16px;
  }

  .game-cover {
    width: 52px;
    height: 52px;
  }

  .game-name {
    font-size: 14px;
  }

  .success-dialog {
    padding: 22px 18px 18px;
  }

  .success-dialog h2 {
    font-size: 20px;
  }

  .success-key {
    font-size: 18px;
  }

  .gate-card {
    padding: 24px 20px;
  }

  .gate-card h1 {
    font-size: 20px;
  }
}






