/* Piraten-Look: Ozean außen, Seekarten-Pergament innen. Alle Grafiken sind eigene SVGs,
   Schriften von Google Fonts (SIL Open Font License).
   Der Steckbrief übernimmt nur den Aufbau klassischer Kopfgeld-Plakate, keine Originalgrafik. Keine Logos oder Figuren aus One Piece. */

:root {
  --ocean-deep: #0b2340;
  --ocean: #12406b;
  --parchment: #f4e4bf;
  --parchment-dark: #e6cf9b;
  --ink: #3b2414;
  --ink-soft: #6e4f33;
  --border: #c9a86a;
  --red: #b3261e;
  --red-dark: #8a1c16;
  --gold: #e0b03c;
  --gold-dark: #a87a12;
  --win: #2f7a3e;
  --loss: #a3281f;
  --open: #8a6a12;
  --row-hover: rgba(179, 38, 30, 0.07);
  --heading: 'Playfair Display', 'Georgia', serif;
  --body: 'Alegreya Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 17px/1.5 var(--body);
  background-color: var(--ocean-deep);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40'%3E%3Cpath d='M0 20 Q15 10 30 20 T60 20 T90 20 T120 20' fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='2'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--ocean) 0%, var(--ocean-deep) 70%);
  background-attachment: fixed;
}

/* Kopfzeile wie ein Schiffsdeck mit goldener Kante */
header.site {
  background: linear-gradient(180deg, #2a1a0e, #3d2716);
  border-bottom: 4px solid var(--gold-dark);
  box-shadow: 0 3px 0 var(--red), 0 8px 20px rgba(0, 0, 0, 0.35);
}

header.site .inner, main, footer.site .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

header.site .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}

header.site a.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--parchment);
  text-decoration: none;
  font-family: var(--heading);
  font-weight: 900;
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

header.site a.brand .brand-text span { color: var(--gold); }
header.site a.brand svg { width: 40px; height: 40px; flex: none; }

header.site nav { display: flex; align-items: center; gap: 10px; }
header.site nav a, header.site nav .note { color: var(--parchment-dark); text-decoration: none; font-size: 0.95rem; }
header.site nav a:hover { color: var(--gold); }
header.site nav button.link { color: var(--gold); }

main { padding-top: 28px; padding-bottom: 40px; }

/* Das Pergament: alle Inhalte liegen auf einer Seekarte */
.chart {
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(ellipse at top left, rgba(120, 80, 30, 0.18), transparent 45%),
    radial-gradient(ellipse at bottom right, rgba(120, 80, 30, 0.22), transparent 50%),
    var(--parchment);
  border-radius: 6px;
  padding: 24px 20px 28px;
  box-shadow: 0 0 0 2px var(--border), 0 0 0 6px rgba(0, 0, 0, 0.15), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.chart .compass {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 78px;
  height: 78px;
  opacity: 0.22;
  pointer-events: none;
}

h1, h2 { font-family: var(--heading); font-weight: 900; color: var(--ink); }
h1 { font-size: 2.4rem; line-height: 1.1; margin: 0 0 4px; padding-right: 80px; }
h2 { font-size: 1.6rem; margin: 30px 0 10px; }
h2::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--red), transparent);
}

.subtitle { color: var(--ink-soft); margin: 0 0 20px; }

a { color: var(--red-dark); }

.card {
  background: rgba(255, 250, 235, 0.55);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }

select, input, button {
  font: inherit;
  color: var(--ink);
  background: #fffaf0;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 10px;
}

button { cursor: pointer; }
button.primary {
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff8e8;
  border-color: var(--red-dark);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 0 #5c120e;
}
button.primary:hover { filter: brightness(1.08); }
button.link { border: none; background: none; color: var(--red-dark); padding: 0; font-weight: 600; }
button:disabled { opacity: 0.5; cursor: default; }

.table-wrap {
  overflow-x: auto;
  background: rgba(255, 250, 235, 0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px dashed var(--border); white-space: nowrap; }
th {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: var(--parchment);
  background: var(--ink);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--row-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.points { font-weight: 800; font-size: 1.1rem; color: var(--red-dark); }

/* Plätze 1 bis 3 als Münzen */
.place {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 15px;
  font-weight: 800;
}
.place.p1, .place.p2, .place.p3 { color: #2a1a0e; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.3); }
.place.p1 { background: radial-gradient(circle at 35% 30%, #fff1b8, var(--gold) 55%, var(--gold-dark)); }
.place.p2 { background: radial-gradient(circle at 35% 30%, #ffffff, #c4c9d1 55%, #8b919b); }
.place.p3 { background: radial-gradient(circle at 35% 30%, #ffd9b0, #c98b5b 55%, #8c5a33); }

.player-name a { color: var(--ink); text-decoration: none; font-weight: 700; }
.player-name a:hover { color: var(--red-dark); text-decoration: underline; }

.outcome { font-weight: 700; }
.outcome.win, .outcome.bye { color: var(--win); }
.outcome.loss { color: var(--loss); }
.outcome.open { color: var(--open); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: rgba(255, 250, 235, 0.6); border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.stat .label { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-family: var(--heading); font-weight: 900; font-size: 2rem; line-height: 1.1; }

.badge { display: inline-block; font-size: 0.72rem; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border); color: var(--ink-soft); background: rgba(255, 250, 235, 0.7); }

.empty, .note { color: var(--ink-soft); }
.error { color: var(--loss); font-weight: 600; }
.ok { color: var(--win); font-weight: 600; }

/* Steckbrief im Stil eines Kopfgeld-Plakats: großes WANTED, Bild fast über die
   ganze Breite, DEAD OR ALIVE, Name, Kopfgeld mit Strich am Ende, Absender unten. */
.poster {
  max-width: 380px;
  margin: 0 auto 28px;
  padding: 14px 22px 12px;
  text-align: center;
  font-family: var(--heading);
  color: #3a2a1a;
  font-variant-numeric: lining-nums;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.35), transparent 40%),
    radial-gradient(ellipse at 85% 90%, rgba(110, 70, 25, 0.28), transparent 45%),
    radial-gradient(ellipse at center, #efdcb0 0%, #e2c58c 70%, #c9a465 100%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), inset 0 0 50px rgba(110, 70, 25, 0.45);
  transform: rotate(-1deg);
}
.poster .wanted {
  font-weight: 900;
  font-size: 4.4rem;
  line-height: 0.95;
  letter-spacing: 0;
  transform: scaleY(1.12);
  margin-top: 4px;
}
.poster .frame {
  margin: 10px 0 6px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border: 3px solid #3a2a1a;
  background: #d9c08a;
  overflow: hidden;
}
.poster .frame svg { width: 100%; height: 100%; display: block; }
.poster .frame img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.3) contrast(1.05); }
.poster .doa {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.poster .doa::before, .poster .doa::after { content: ''; flex: 1; height: 3px; background: #3a2a1a; }
.poster .name {
  font-family: var(--heading);
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1.05;
  margin: 4px 0 0;
  padding: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  word-break: break-word;
}
.poster .bounty {
  margin-top: 2px;
  font-weight: 900;
  font-size: 2.3rem;
  line-height: 1.1;
  letter-spacing: 0.05em;
  font-variant-numeric: lining-nums;
}
.poster .bounty.wide { font-size: 1.85rem; }
.poster .bounty .cur { font-size: 0.85em; margin-right: 4px; }
.poster .issuer {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  opacity: 0.75;
}
.poster-caption { text-align: center; color: var(--ink-soft); margin: -12px 0 20px; }

.banner {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  margin-bottom: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(59, 36, 20, 0.3);
}

.image-slot { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.image-slot:last-child { border-bottom: none; }
.image-slot .preview { width: 140px; height: 90px; object-fit: cover; border: 1px solid var(--border); background: rgba(255, 250, 235, 0.6); }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 12px; }
.pool figure { margin: 0; }
.pool img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--border); display: block; }
.pool figcaption { font-size: 0.85rem; color: var(--ink-soft); }
.image-slot .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.dropzone {
  border: 2px dashed var(--ink-soft);
  border-radius: 6px;
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255, 250, 235, 0.35);
}
.dropzone.over { border-color: var(--red); color: var(--ink); background: rgba(179, 38, 30, 0.06); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--ink-soft); }

summary { cursor: pointer; font-weight: 600; }

footer.site {
  color: var(--parchment-dark);
  text-align: center;
  font-size: 0.85rem;
  padding: 0 0 28px;
  opacity: 0.85;
}
footer.site .waves { display: block; width: 100%; height: 28px; margin-bottom: 8px; }

.hidden { display: none !important; }
.short { display: none; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  header.site a.brand { font-size: 1.6rem; }
  header.site a.brand svg { width: 32px; height: 32px; }
  main { padding-left: 8px; padding-right: 8px; }
  .chart { padding: 18px 10px 22px; }
  .chart .compass { width: 56px; height: 56px; }
  h1 { font-size: 2rem; padding-right: 60px; }
  th, td { padding: 8px 6px; }
  td.player-name { white-space: normal; word-break: break-word; }
  .long { display: none; }
  .short { display: inline; }
  .poster { padding: 12px 14px 10px; }
  .poster .wanted { font-size: 4rem; }
  .poster .name { font-size: 2rem; }
  .poster .bounty { font-size: 1.9rem; }
  .poster .bounty.wide { font-size: 1.55rem; }
}
