:root {
  --bg: #0b0f14;
  --card: #141b24;
  --border: #243041;
  --text: #e8eef5;
  --muted: #8b9bb0;
  --accent: #00c2a8;
  --accent-hover: #00e0c2;
  --danger: #ff6b6b;
  --success: #4ade80;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(ellipse at top, #122033 0%, var(--bg) 55%);
  color: var(--text);
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.connect-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px dashed rgba(0, 194, 168, 0.5);
  background: rgba(0, 194, 168, 0.06);
}

.btn-sm {
  width: auto;
  padding: 8px 14px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}

.modal-card {
  width: 100%;
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.btn-outline.btn-muted {
  font-size: 0.85rem;
  padding: 10px 16px;
  border-style: solid;
  opacity: 0.9;
}

.wc-manual {
  margin: 8px 0 12px;
  font-size: 0.82rem;
}

#wc-canvas {
  display: block;
  margin: 12px auto;
  border-radius: 12px;
}

.modal-card .btn {
  margin-top: 8px;
}

.ios-steps {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.ios-title {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--text);
}

.ios-steps ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.ios-steps li + li {
  margin-top: 6px;
}

body.mode-ios-safari .hidden-ios-safari {
  display: none !important;
}

#open-trust-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#open-trust-buttons.hidden {
  display: none !important;
}

#connect-main-btn {
  width: 100%;
  margin-top: 12px;
}

#connect-main-btn.hidden {
  display: none !important;
}

.treasury-box {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 194, 168, 0.08);
  border: 1px solid rgba(0, 194, 168, 0.25);
}

.treasury-box .label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

#treasury-address {
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--accent);
}

.btn-lg {
  font-size: 1.05rem;
  padding: 16px 20px;
}

#piggy-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wallet-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.wallet-info .label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#wallet-address {
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--accent);
}

#usdt-balance {
  font-size: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #04120f;
}

.btn-primary:not(:disabled):hover {
  background: var(--accent-hover);
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.status.info {
  background: rgba(0, 194, 168, 0.12);
  border: 1px solid rgba(0, 194, 168, 0.35);
}

.status.error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: var(--danger);
}

.status.success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.footer {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}
