:root {
  --green: #3d7a3e;
  --green-dark: #2f6130;
  --green-darker: #244b25;
  --green-light: #e8f3e8;
  --grey-100: #f7f8f7;
  --grey-200: #eceeed;
  --grey-300: #d8dbda;
  --grey-600: #767c78;
  --grey-900: #23262a;
  --white: #ffffff;
  --danger: #d64545;
  --warning: #e67e22;
  --success: #27ae60;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 25, 0.06);
  --shadow: 0 2px 10px rgba(20, 30, 25, 0.08);
  --shadow-lg: 0 8px 30px rgba(20, 30, 25, 0.14);
  --transition: 0.16s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--grey-900);
  background: var(--grey-100);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { text-decoration: none; }

/* Logo */
.logo { display: inline-flex; align-items: baseline; gap: 5px; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.5px; }
.logo-ebay { color: var(--green); }
.logo-better { color: var(--grey-600); font-weight: 700; font-size: 1.15rem; }
.logo-light .logo-ebay { color: #fff; }
.logo-light .logo-better { color: #d3e7d3; }
.logo-centered { margin-bottom: 1.2rem; }

/* Header (search hero) */
.search-hero {
  background: linear-gradient(135deg, #2f6130 0%, #3d7a3e 55%, #4c8f4d 100%);
  padding: 26px 20px 100px;
  box-shadow: var(--shadow);
}
.search-inner { max-width: 1100px; margin: 0 auto; }
.search-form {
  display: flex; gap: 8px; margin: 22px 0 0; flex-wrap: wrap;
  background: #fff; padding: 10px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.search-form input[type="text"] {
  flex: 1 1 260px; padding: 13px 16px; border: 1px solid var(--grey-300);
  border-radius: var(--radius); font-size: 1rem; outline: none;
  transition: border-color var(--transition);
}
.search-form input[type="text"]:focus { border-color: var(--green); }
.search-form select {
  padding: 13px 14px; border: 1px solid var(--grey-300);
  border-radius: var(--radius); background: #fff; color: var(--grey-900); outline: none;
}
.search-form .btn { padding: 13px 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-tagline { margin: 10px 0 0; color: #d3e7d3; font-size: 1.02rem; }

/* Generic header (inner pages) */
.header {
  background: var(--white); border-bottom: 1px solid var(--grey-200);
  padding: 0 16px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.header-inner .logo { font-size: 1.35rem; }
.nav { display: flex; gap: 14px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav > a:not(.btn) { color: var(--grey-600); font-weight: 600; }
.nav > a:not(.btn):hover { color: var(--green); }
.nav-msg { font-weight: 600; }
.nav-user { font-weight: 700 !important; color: var(--grey-900) !important; }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; background: transparent; color: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(61,122,62,0.3); }
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 4px 14px rgba(61,122,62,0.4); }
.btn-ghost { background: #fff; border-color: var(--grey-300); color: var(--grey-900); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-ghost-light { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,0.22); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(214,69,69,0.3); }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(39,174,96,0.3); }
.btn-success:hover { background: #219150; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.inline { display: inline; }

/* Container */
.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.muted { color: var(--grey-600); }

/* Kategorie-Pills */
.category-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-pill {
  padding: 7px 16px; background: #fff; border: 1px solid var(--grey-300);
  border-radius: 30px; font-size: 0.9rem; color: var(--grey-900); font-weight: 500;
  transition: all var(--transition);
}
.cat-pill:hover { border-color: var(--green); color: var(--green); text-decoration: none; transform: translateY(-1px); }
.cat-pill.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(61,122,62,0.3); }

/* Section-Titel */
.section-title { margin: 0 0 16px; font-size: 1.25rem; font-weight: 800; color: var(--grey-900); }

/* Listing grid */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.listing-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: transform var(--transition), box-shadow var(--transition);
}
.listing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.listing-link { display: flex; flex-direction: column; height: 100%; }
.listing-icon {
  height: 150px; background: linear-gradient(180deg, var(--grey-100), #eef2ee);
  display: flex; align-items: center; justify-content: center;
}
.item-icon { font-size: 3.4rem; }
.listing-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.listing-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--grey-900); line-height: 1.3; }
.listing-card:hover .listing-title { color: var(--green); }
.listing-meta { margin: 0; font-size: 0.8rem; color: var(--grey-600); }
.listing-price { font-weight: 800; color: var(--green); margin-top: auto; padding-top: 8px; }
.listing-price small { font-weight: 700; }

/* Detail */
.breadcrumb { margin-bottom: 16px; font-size: 0.9rem; color: var(--grey-600); }
.breadcrumb a { color: var(--green); }
.listing-detail { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.detail-icon {
  height: 240px; background: linear-gradient(180deg, var(--grey-100), #eef2ee);
  display: flex; align-items: center; justify-content: center;
}
.detail-body { padding: 28px; }
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head h1 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.detail-meta { color: var(--grey-600); font-size: 0.9rem; margin: 8px 0 0; }
.detail-price { font-size: 1.7rem; margin: 14px 0; font-weight: 700; }
.detail-price strong { color: var(--green); }
.detail-description { white-space: pre-wrap; margin: 16px 0; color: #3a3f3b; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--grey-200); }

/* Badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--grey-200); font-size: 0.75rem; font-weight: 700; }
.badge-sold { background: #fdecea; color: var(--danger); }

/* Forms */
.form-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; max-width: 720px; }
.form-card label { display: block; margin: 16px 0 6px; font-weight: 600; }
.form-card input[type="text"],
.form-card input[type="number"],
.form-card input[type="password"],
.form-card select,
.form-card textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--grey-300);
  border-radius: var(--radius); font-size: 1rem; font-family: inherit; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(61,122,62,0.12);
}
.form-card textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Icon picker */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-option input { display: none; }
.icon-option span {
  display: inline-block; padding: 8px 12px; border: 1px solid var(--grey-300);
  border-radius: var(--radius); text-align: center; cursor: pointer; font-size: 1.4rem; min-width: 74px;
}
.icon-option small { display: block; font-size: 0.7rem; color: var(--grey-600); }
.icon-option input:checked + span { border-color: var(--green); background: var(--green-light); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #e8f5ec; color: var(--success); border: 1px solid #b8e0c4; }

/* Guest */
body.guest { background: linear-gradient(135deg, #2f6130 0%, #3d7a3e 55%, #4c8f4d 100%); }
.guest-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.guest-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 36px; width: 100%; max-width: 430px; }
.guest-card label { display: block; margin: 16px 0 6px; font-weight: 600; }
.guest-card input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--grey-300);
  border-radius: var(--radius); font-size: 1rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.guest-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(61,122,62,0.12); }
.guest-card h1 { margin: 0 0 8px; font-size: 1.6rem; font-weight: 800; }
.guest-alt { text-align: center; margin-top: 18px; color: var(--grey-600); }

/* Empty state */
.empty-state { text-align: center; padding: 70px 20px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.empty-state p { color: var(--grey-600); margin-bottom: 22px; font-size: 1.05rem; }

/* Footer */
.footer {
  text-align: center; padding: 36px 20px; color: var(--grey-600); font-size: 0.85rem;
  border-top: 1px solid var(--grey-200); margin-top: 40px; background: #fff;
}
.footer p { margin: 8px 0 0; }
.footer-logo { font-size: 1.2rem; font-weight: 800; }
.footer-logo .logo-ebay { color: var(--green); }
.footer-logo .logo-better { color: var(--grey-600); font-weight: 700; }
.footer-inner { max-width: 900px; margin: 0 auto; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--grey-200); }
.table th { background: var(--grey-100); font-size: 0.85rem; }
.profile-section { margin-bottom: 32px; }

/* Conversations */
.convo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.convo-item { display: flex; gap: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.convo-item:hover { text-decoration: none; }
.convo-icon { font-size: 2.4rem; width: 56px; text-align: center; }
.convo-body { flex: 1; }
.convo-title { font-weight: 700; color: var(--grey-900); }
.convo-parties { font-size: 0.85rem; color: var(--grey-600); }
.convo-last { font-size: 0.9rem; color: var(--grey-600); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Chat */
.chat-container { max-width: 820px; }
.chat-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px 18px;
}
.chat-head-item {
  width: 56px; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--grey-100), #eef2ee);
  border-radius: 12px; overflow: hidden;
}
.chat-item-img { width: 48px; height: 48px; image-rendering: pixelated; object-fit: contain; }
.chat-head-item .custom-img { width: 100%; height: 100%; image-rendering: auto; object-fit: cover; border-radius: 12px; }
.chat-item-fallback { font-size: 1.6rem; }
.chat-close { margin-left: auto; font-size: 1.1rem; }
.chat-head-title { min-width: 0; }
.chat-head-title h1 { margin: 0; font-size: 1.3rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-title p { margin: 2px 0 0; font-size: 0.85rem; }

.chat-messages {
  background: linear-gradient(180deg, #f0f4f8 0%, #f7f9fb 100%);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 20px; height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.msg { max-width: 75%; align-self: flex-start; display: flex; gap: 10px; align-items: flex-end; }
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.95rem;
  background: linear-gradient(135deg, #5b6bc0, #3f51b5);
}
.msg.own .msg-avatar { background: linear-gradient(135deg, #4c8f4d, #2f6130); }
.msg-content {
  max-width: 100%; padding: 10px 14px; border-radius: 16px;
  background: #e8edf5; border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(30,40,60,0.06);
}
.msg.own .msg-content { background: var(--green-light); border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.msg-username { font-size: 0.72rem; color: var(--grey-600); margin-bottom: 2px; font-weight: 700; }
.msg.own .msg-username { text-align: right; }
.msg-body { word-wrap: break-word; font-size: 0.95rem; line-height: 1.45; }
.msg-system {
  align-self: center; color: var(--grey-600); font-size: 0.82rem; font-style: italic;
  text-align: center; background: var(--grey-200); padding: 6px 16px; border-radius: 20px; max-width: 90%;
}
.msg-offer .msg-content { border: 2px solid var(--warning); background: #fff6e5; }
.msg.own.msg-offer .msg-content { background: #fff6e5; }
.msg-pending { font-size: 0.78rem; color: var(--grey-600); margin-top: 6px; }
.offer-buttons { display: flex; gap: 8px; margin-top: 10px; }
.msg-status { font-size: 0.82rem; font-weight: 700; margin-top: 8px; }
.msg-status.accepted { color: var(--green); }
.msg-status.rejected { color: var(--danger); }

.chat-input {
  margin-top: 14px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px;
}
.chat-form { display: flex; gap: 10px; align-items: center; }
.chat-form input {
  flex: 1; padding: 13px 16px; border: 1px solid var(--grey-300);
  border-radius: 30px; font-size: 0.95rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(61,122,62,0.12); }
.chat-form .btn { border-radius: 30px; }
.offer-form { display: flex; gap: 8px; margin-bottom: 12px; }
.offer-form input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--warning);
  border-radius: 30px; font-size: 0.9rem; outline: none;
}
.hidden { display: none; }

@media (max-width: 600px) {
  .msg { max-width: 90%; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Item-Icons (echte Minecraft-Texturen, pixelgenau) */
.item-img {
  width: 64px; height: 64px;
  image-rendering: pixelated; object-fit: contain;
}
.item-img-sm { width: 32px; height: 32px; }
.detail-item-img { width: 96px; height: 96px; }
.custom-img { image-rendering: auto; object-fit: cover; border-radius: 6px; }
.listing-icon .custom-img { width: 100%; height: 100%; border-radius: 0; }
.listing-icon .item-img { width: 64px; height: 64px; }
.detail-icon .custom-img { width: 160px; height: 160px; }

/* Bild-Vorschau */
.image-preview { margin-top: 10px; }
.image-preview-img { max-width: 200px; max-height: 200px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Item-Suchbox */
.item-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  padding: 8px;
}
.item-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--grey-900);
}
.item-option:hover { border-color: var(--green); background: var(--green-light); }
.item-option img { width: 32px; height: 32px; image-rendering: pixelated; }
.item-option span { text-align: center; line-height: 1.2; }

.item-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: var(--radius);
}
.item-preview-img { width: 48px; height: 48px; image-rendering: pixelated; }
.item-preview-label { font-weight: 600; }

/* Kaufen-Button + Seitenkopf + Interessenten */
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219150; }

.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 1.4rem; }

.interested-list { display: flex; flex-direction: column; gap: 12px; }
.interested-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.interested-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.interested-title { font-weight: 700; color: var(--grey-900); }
.interested-buyers { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--green-light); color: var(--green);
  border: 1px solid var(--green); border-radius: 20px; font-size: 0.85rem;
}
.chip:hover { text-decoration: none; background: var(--green); color: #fff; }

/* Ungelesen-Badge */
.nav-with-badge { position: relative; }
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 10px;
  background: var(--danger); color: #fff;
  font-size: 0.7rem; font-weight: 700; line-height: 1;
  vertical-align: middle;
}
.badge-count-light { background: #e74c3c; }

/* Musik-Player */
.music-player {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  background: #fff; padding: 10px 14px; border-radius: 30px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--grey-200);
}
.music-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: var(--green); color: #fff; cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.music-btn:hover { background: var(--green-dark); transform: scale(1.05); }
.music-info { display: flex; flex-direction: column; max-width: 180px; }
.music-title { font-size: 0.8rem; font-weight: 600; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-volume { width: 80px; cursor: pointer; accent-color: var(--green); }
.music-eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; margin-top: 3px; }
.music-eq i { width: 3px; background: var(--green); border-radius: 1px; animation: musicEq 1s ease-in-out infinite; }
.music-eq i:nth-child(1) { height: 60%; animation-delay: 0s; }
.music-eq i:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.music-eq i:nth-child(3) { height: 75%; animation-delay: 0.4s; }
#music-player.muted .music-eq i { animation-play-state: paused; opacity: 0.4; }
@keyframes musicEq {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* Song-Liste */
.song-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.song-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px 14px;
}
.song-icon { font-size: 1.3rem; }
.song-name { flex: 1; font-weight: 600; color: var(--grey-900); }
.song-preview { height: 40px; }
.song-item audio { max-width: 220px; }

