:root {
  --accent: #f9e19a;
  --accent2: #f6c85c;
  --bg: #000000;
  --text: #f5f5f5;
  --gray: #444;
  --error: #ff5c5c;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  padding: 40px 16px 32px;
  background: var(--bg);
  overflow-y: auto;
}

.screen.active {
  display: block;
}

.card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.logo {
  width: 260px;
  max-width: 80%;
  display: block;
  margin: 0 auto 18px;
}

h1 {
  font-size: 26px;
  margin-bottom: 12px;
}

p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 22px;
  color: #cccccc;
}

/* ── BUTTONS ── */
.btn,
.copy-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 220px;
  max-width: 100%;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
  transition: transform 0.08s ease-out, box-shadow 0.1s ease-out, opacity 0.15s, background 0.15s;
}

.btn {
  width: auto;
}

.btn-row {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.btn-primary {
  background-image: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.8);
}

.btn-disabled {
  background: #303030;
  color: #777;
  cursor: default;
  box-shadow: none;
  opacity: 0.7;
}

/* ── FORM ── */
.form-group {
  text-align: left;
  margin-bottom: 18px;
}

.label {
  display: block;
  font-size: 13px;
  color: #aaaaaa;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #333;
  background: #121212;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(249, 225, 154, 0.55);
}

.input-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 15px;
  pointer-events: none;
}

#tg-input {
  padding-left: 30px;
}

.helper {
  font-size: 12px;
  color: #777;
  margin-top: 4px;
}

.helper.error {
  color: var(--error);
}

/* ── SLOT INPUT ── */
.slot-input-wrapper {
  position: relative;
}

#slot-input {
  padding-left: 14px;
}

.slot-input-invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.6) !important;
}

.select-container {
  position: relative;
  margin-top: 6px;
}

.options {
  max-height: 230px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid #333;
  background: #101010;
  display: none;
  margin-top: 4px;
}

.options.visible {
  display: block;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #181818;
}

.option:last-child {
  border-bottom: none;
}

.option:hover,
.option.hovered {
  background: #1e1e1e;
}

.option.selected {
  background: #262626;
  color: var(--accent);
}

.option-img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #1a1a1a;
}

.option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-slot {
  margin-top: 6px;
  font-size: 13px;
}

.selected-slot.error {
  color: var(--error);
}

.selected-slot.ok {
  color: #cccccc;
}

.options::-webkit-scrollbar {
  width: 8px;
}

.options::-webkit-scrollbar-track {
  background: #111;
  border-radius: 10px;
}

.options::-webkit-scrollbar-thumb {
  background: #2e2e2e;
  border-radius: 10px;
}

.options::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* ── CONFIRM BLOCK ── */
.confirm-block {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 20px 24px;
  text-align: left;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.confirm-label {
  font-size: 13px;
  color: #777;
  white-space: nowrap;
}

.confirm-value {
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.status-text {
  min-height: 18px;
  text-align: center;
}

/* ── BACK BUTTON ── */
.back-row {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 16px;
}

.back-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #181818;
  color: #cccccc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-btn span {
  font-size: 16px;
}

.back-btn:hover {
  background: #222;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: #1f8b3a;
  color: #f5fff7;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  h1 {
    font-size: 22px;
  }

  .confirm-block {
    padding: 16px;
  }

  .confirm-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .confirm-value {
    text-align: left;
  }

  .btn,
  .copy-btn {
    min-width: 100%;
  }
}