[data-page="wallet"] {
  display: block;
  min-height: 100vh;
}

.wallet-page {
  min-height: 100vh;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  color: #111827;
  background: #f9fafb;
}

.wallet-page button {
  color: inherit;
}

.wallet-page--loading {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  color: #6b7280;
}

.wallet-page--loading p {
  margin: 0;
}

.wallet-spinner {
  width: 2rem;
  height: 2rem;
  color: #10b981;
}

.wallet-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid #f3f4f6;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.wallet-header__inner {
  width: min(28rem, 100%);
  height: 4rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
}

.wallet-header h1 {
  margin: 0 0 0 0.5rem;
  font-family: Poppins, sans-serif;
  font-size: 1.125rem;
  color: #111827;
}

.wallet-icon-button {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.wallet-icon-button:hover {
  background: #f3f4f6;
}

.wallet-icon-button .ps-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #4b5563;
}

.wallet-container {
  width: min(28rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.wallet-balance-card {
  margin-bottom: 1.5rem;
  padding: 2rem;
  border: 1px solid #f3f4f6;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
  text-align: center;
}

.wallet-balance-card > p {
  margin: 0 0 0.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.wallet-balance-card > strong {
  display: block;
  margin-bottom: 1rem;
  color: #111827;
  font-size: clamp(3.2rem, 15vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.wallet-status {
  width: fit-content;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.wallet-status .ps-icon {
  width: 1rem;
  height: 1rem;
}

.wallet-status--ready {
  color: #047857;
  background: #ecfdf5;
}

.wallet-status--pending {
  color: #b45309;
  background: #fffbeb;
}

.wallet-empty-copy {
  color: #9ca3af;
  font-size: 0.875rem;
}

.wallet-actions {
  margin-bottom: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.wallet-action {
  width: 100%;
  min-height: 6rem;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 3rem 1fr 1.5rem;
  align-items: center;
  gap: 1rem;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  background: #fff;
  text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}

.wallet-action:hover:not(:disabled) {
  background: #f9fafb;
}

.wallet-action:hover:not(:disabled) .wallet-action__chevron {
  transform: translateX(0.25rem);
}

.wallet-action:disabled {
  color: #9ca3af;
  background: #f3f4f6;
}

.wallet-action--primary,
.wallet-action--deposit {
  border-color: transparent;
  color: #fff;
  background: #10b981;
}

.wallet-action--deposit {
  background: linear-gradient(90deg, #10b981, #22c55e);
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.16);
}

.wallet-action--primary:hover:not(:disabled),
.wallet-action--deposit:hover:not(:disabled) {
  background: #059669;
}

.wallet-action__icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  color: #3b82f6;
  background: #eff6ff;
}

.wallet-action--primary .wallet-action__icon,
.wallet-action--deposit .wallet-action__icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.wallet-action:nth-child(4) .wallet-action__icon {
  color: #f59e0b;
  background: #fffbeb;
}

.wallet-action:nth-last-child(1) .wallet-action__icon {
  color: #a855f7;
  background: #faf5ff;
}

.wallet-action__icon .ps-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.wallet-action__copy {
  min-width: 0;
}

.wallet-action__copy strong,
.wallet-action__copy small {
  display: block;
}

.wallet-action__copy strong {
  font-size: 1.0625rem;
}

.wallet-action__copy small {
  margin-top: 0.1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.wallet-action--primary .wallet-action__copy small,
.wallet-action--deposit .wallet-action__copy small {
  color: #d1fae5;
}

.wallet-action__chevron {
  width: 1.5rem;
  height: 1.5rem;
  color: #9ca3af;
  transition: transform 160ms ease;
}

.wallet-action--primary .wallet-action__chevron,
.wallet-action--deposit .wallet-action__chevron {
  color: #fff;
}

.wallet-action__spinner {
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
}

.wallet-setup,
.wallet-complete {
  padding: 1.25rem;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  background: #fff;
}

.wallet-setup header {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.wallet-setup header span {
  color: #059669;
  font-weight: 600;
}

.wallet-progress {
  height: 0.5rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: #f3f4f6;
}

.wallet-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width 500ms ease;
}

.wallet-setup__steps {
  display: grid;
  gap: 0.25rem;
}

.wallet-setup-step {
  width: 100%;
  min-height: 2rem;
  padding: 0.25rem 0;
  display: grid;
  grid-template-columns: 1.25rem 1fr 1rem;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #374151;
  text-align: left;
}

.wallet-setup-step:not(:disabled):hover {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  background: #f9fafb;
}

.wallet-setup-step .ps-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.wallet-setup-step.is-done {
  color: #6b7280;
  text-decoration: line-through;
}

.wallet-setup-step.is-done .ps-icon {
  color: #10b981;
}

.wallet-setup-step__empty {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 999px;
}

.wallet-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #047857;
  border-color: #d1fae5;
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
}

.wallet-complete .ps-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.5rem;
  color: #10b981;
}

.wallet-complete span {
  font-size: 0.875rem;
}

.wallet-modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  padding: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.wallet-modal {
  width: min(28rem, 100%);
  max-height: 85vh;
  padding: 1.5rem;
  overflow: auto;
  border-radius: 1.5rem 1.5rem 0 0;
  color: #111827;
  background: #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  animation: wallet-modal-in 200ms ease-out;
}

.wallet-modal > header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet-modal > header h2 {
  margin: 0;
  color: #111827;
  font-family: Poppins, sans-serif;
  font-size: 1.25rem;
}

.wallet-quick-amounts {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.wallet-quick-amounts button {
  padding: 0.75rem 0.25rem;
  border: 0;
  border-radius: 0.75rem;
  color: #374151;
  background: #f3f4f6;
  font-weight: 600;
}

.wallet-quick-amounts button.is-active {
  color: #fff;
  background: #10b981;
}

.wallet-amount-label {
  display: block;
  color: #6b7280;
  font-size: 0.875rem;
}

.wallet-amount-input {
  position: relative;
  margin-top: 0.5rem;
  display: block;
}

.wallet-amount-input b {
  position: absolute;
  top: 50%;
  left: 1rem;
  color: #9ca3af;
  font-size: 1.5rem;
  transform: translateY(-50%);
}

.wallet-amount-input input {
  width: 100%;
  padding: 1rem 1rem 1rem 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  color: #111827;
  background: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  outline: none;
}

.wallet-amount-input input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.17);
}

.wallet-amount-label > small {
  margin-top: 0.5rem;
  display: block;
  color: #9ca3af;
}

.wallet-instant-option {
  margin: 1.5rem 0;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  background: #f9fafb;
}

.wallet-instant-option input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #10b981;
}

.wallet-instant-option > span {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: center;
  gap: 0 0.5rem;
}

.wallet-instant-option .ps-icon {
  width: 1rem;
  height: 1rem;
  color: #f59e0b;
}

.wallet-instant-option small {
  grid-column: 1 / -1;
  margin-left: 1.6rem;
  color: #6b7280;
}

.wallet-modal-submit {
  width: 100%;
  min-height: 3.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.75rem;
  color: #fff;
  background: #10b981;
  font-size: 1.05rem;
  font-weight: 600;
}

.wallet-modal-submit:hover:not(:disabled) {
  background: #059669;
}

.wallet-modal-submit:disabled {
  opacity: 0.55;
}

.wallet-modal-submit .ps-icon,
.wallet-modal-submit .ps-spinner {
  width: 1.25rem;
  height: 1.25rem;
}

.wallet-modal--history {
  padding: 0;
}

.wallet-modal--history > header {
  margin: 0;
  padding: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.wallet-history-list {
  padding: 1.5rem;
  overflow: auto;
}

.wallet-transaction {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  border-radius: 0.75rem;
  background: #f9fafb;
}

.wallet-transaction__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f3f4f6;
}

.wallet-transaction__icon .ps-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.wallet-transaction--prize_won .wallet-transaction__icon,
.wallet-transaction--deposit .wallet-transaction__icon {
  color: #059669;
  background: #d1fae5;
}

.wallet-transaction--entry_fee .wallet-transaction__icon {
  color: #dc2626;
  background: #fee2e2;
}

.wallet-transaction--payout .wallet-transaction__icon {
  color: #2563eb;
  background: #dbeafe;
}

.wallet-transaction__copy {
  min-width: 0;
}

.wallet-transaction__copy strong,
.wallet-transaction__copy small {
  display: block;
}

.wallet-transaction__copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-transaction__copy small {
  color: #6b7280;
}

.wallet-transaction > b.is-credit {
  color: #059669;
}

.wallet-history-empty {
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #9ca3af;
  text-align: center;
}

.wallet-history-empty .ps-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  color: #d1d5db;
}

.wallet-history-empty strong {
  color: #6b7280;
}

.wallet-history-empty span {
  font-size: 0.875rem;
}

@keyframes wallet-modal-in {
  from { opacity: 0; transform: translateY(1.25rem); }
}

@media (min-width: 640px) {
  .wallet-modal-backdrop { align-items: center; }
  .wallet-modal { border-radius: 1.5rem; }
}

@media (max-width: 380px) {
  .wallet-action { padding: 1rem; grid-template-columns: 2.75rem 1fr 1.25rem; gap: 0.75rem; }
  .wallet-action__icon { width: 2.75rem; height: 2.75rem; }
  .wallet-quick-amounts { grid-template-columns: repeat(2, 1fr); }
}
