* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0a1628 0%, #1a2744 50%, #0d1f3c 100%);
  color: #e8eef5;
  min-height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.kcp-announcement {
  background: linear-gradient(90deg, #7a0000 0%, #b30000 40%, #7a0000 100%);
  border-top: 2px solid #ff4444;
  border-bottom: 2px solid #ff4444;
  padding: 0.55rem 1rem;
  text-align: center;
}

.kcp-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #ffe0e0;
}

.kcp-star {
  font-size: 1.2rem;
  color: #ffcc00;
  flex-shrink: 0;
}

.kcp-text strong {
  color: #ffcc00;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #60a5fa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(96, 165, 250, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.balance-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.balance-amount {
  font-weight: 600;
  color: #60a5fa;
}

.home-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.home-link:hover {
  color: #e8eef5;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tab:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: #e8eef5;
}

.tab.active {
  background: rgba(96, 165, 250, 0.2);
  border-color: #60a5fa;
  color: #60a5fa;
}

.main {
  flex: 1;
  overflow: hidden;
  padding: 1rem 0;
}

.tab-content {
  display: none;
  height: 100%;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 500;
}

.filters select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e8eef5;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.yacht-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding-bottom: 1rem;
}

.yacht-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.yacht-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 8px 32px rgba(96, 165, 250, 0.2);
}

.yacht-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.yacht-image::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(10, 22, 40, 0.8));
}

.yacht-info {
  padding: 1rem;
}

.yacht-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #f1f5f9;
}

.yacht-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.yacht-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: #60a5fa;
}

.yacht-seller {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.creation-limit-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  max-width: 600px;
}

.creation-limit-banner.limit-ok {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #93c5fd;
}

.creation-limit-banner.limit-reached {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.list-for-sale-section {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.list-for-sale-label {
  font-size: 0.85rem;
  color: #86efac;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.list-for-sale-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.list-price-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e8eef5;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 1rem;
}

.list-price-input:focus {
  outline: none;
  border-color: #22c55e;
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.sell-form {
  max-width: 600px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e8eef5;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #60a5fa;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.image-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.image-option {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.image-option:hover {
  background: rgba(96, 165, 250, 0.2);
}

.image-option.selected {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.2);
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 100;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #1a2744;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 101;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #e8eef5;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 60px);
}

.modal-yacht-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin-bottom: 1rem;
}

.modal-yacht-details {
  margin-bottom: 1.5rem;
}

.modal-yacht-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-yacht-desc {
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.modal-yacht-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.spec-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 6px;
}

.spec-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: #e8eef5;
}

.modal-yacht-price {
  font-size: 2rem;
  font-weight: 700;
  color: #60a5fa;
  text-align: center;
  margin: 1rem 0;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  padding: 0.875rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e8eef5;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: #e8eef5;
  padding: 1rem 2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
}

.toast.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.loading {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.owned-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.yacht-card.my-listing .yacht-image::after {
  content: 'FOR SALE';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Greeting Modal Styles */
.greeting-modal .modal-header {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(96, 165, 250, 0.2));
  border-bottom: 1px solid rgba(34, 197, 94, 0.3);
}

.greeting-modal .modal-header h3 {
  font-size: 1.25rem;
  color: #22c55e;
}

.greeting-windfalls {
  margin-bottom: 1.5rem;
}

.windfall-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.windfall-icon {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.windfall-info {
  flex: 1;
}

.windfall-type {
  font-size: 0.85rem;
  color: #fbbf24;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.windfall-message {
  color: #e8eef5;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.windfall-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #22c55e;
}

.greeting-summary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.greeting-summary h4 {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.summary-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-item {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
}

.summary-item.income {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.summary-item.outgoing {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.summary-label {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.summary-item.income .summary-value {
  color: #22c55e;
}

.summary-item.outgoing .summary-value {
  color: #ef4444;
}

.transaction-list {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-desc {
  font-size: 0.9rem;
  color: #e8eef5;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 1rem;
}

.tx-amount {
  font-weight: 600;
  white-space: nowrap;
}

.tx-item.income .tx-amount {
  color: #22c55e;
}

.tx-item.outgoing .tx-amount {
  color: #ef4444;
}

.tx-more {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  padding-top: 0.5rem;
}

.greeting-actions {
  margin-top: 1rem;
}

.greeting-actions .btn {
  width: 100%;
}

/* Receipt overlay — stapled to face */
.receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.receipt-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.receipt {
  background: #f5f0e8;
  color: #1a1a1a;
  width: min(420px, 90vw);
  border-radius: 2px;
  padding: 0;
  font-family: 'Courier New', Courier, monospace;
  transform: translateY(-120vh) rotate(-2deg);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 4px 4px 0 #c8b89a;
  position: relative;
  cursor: pointer;
}

.receipt-overlay.active .receipt {
  transform: translateY(0) rotate(-1deg);
}

.receipt-staples {
  display: flex;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
}

.receipt-staple {
  width: 28px;
  height: 12px;
  background: #888;
  border-radius: 1px;
  box-shadow: inset 0 2px 0 #555, 0 2px 4px rgba(0,0,0,0.5);
  position: relative;
}

.receipt-staple::before,
.receipt-staple::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 8px;
  background: #777;
  bottom: 0;
  border-radius: 0 0 2px 2px;
}

.receipt-staple::before { left: 0; }
.receipt-staple::after  { right: 0; }

.receipt-body {
  padding: 2.5rem 1.75rem 1.5rem;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed #c0a882;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.receipt-shop {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #2a1a08;
}

.receipt-sub {
  font-size: 0.75rem;
  color: #7a6040;
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin: 0.3rem 0;
  color: #2a1a08;
}

.receipt-line.item {
  font-size: 0.95rem;
  font-weight: 600;
}

.receipt-line.total {
  border-top: 2px dashed #c0a882;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.receipt-line .label { color: #7a6040; }
.receipt-line .value { color: #2a1a08; }

.receipt-paid-stamp {
  text-align: center;
  margin: 1.25rem 0 0.5rem;
  position: relative;
}

.receipt-paid-stamp span {
  display: inline-block;
  border: 4px solid #c0392b;
  color: #c0392b;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  transform: rotate(-8deg);
  opacity: 0.85;
  text-shadow: 1px 1px 0 rgba(192,57,43,0.3);
}

.receipt-footer {
  text-align: center;
  font-size: 0.7rem;
  color: #9a7a50;
  border-top: 1px dashed #c0a882;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  line-height: 1.6;
}

.receipt-dismiss {
  text-align: center;
  font-size: 0.72rem;
  color: #b09070;
  margin-top: 0.5rem;
  padding-bottom: 1rem;
}

.receipt-tear {
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    #f5f0e8 0px,
    #f5f0e8 8px,
    transparent 8px,
    transparent 14px
  );
  border-top: 1px dashed #c0a882;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .tabs {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .tab {
    white-space: nowrap;
    padding: 0.5rem 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .yacht-grid {
    grid-template-columns: 1fr;
  }

  .image-picker {
    grid-template-columns: repeat(5, 1fr);
  }

  .summary-row {
    flex-direction: column;
  }
}
