:root {
  --green: #1B8A4B;
  --green-dark: #0E5A30;
  --pink: #D81B73;
  --pink-light: #FF5FA2;
  --bg: #faf7f2;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e1d8;
  --danger: #c0392b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
main.centered { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }

h1, h2 { margin-top: 0; color: var(--green-dark); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.success { color: var(--green); background: #e8f5ec; padding: 0.5rem 0.75rem; border-radius: 6px; }
.error { color: var(--danger); background: #fdecea; padding: 0.5rem 0.75rem; border-radius: 6px; }

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  max-width: 720px;
  width: 100%;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 2px solid var(--green);
  margin-bottom: 0;
}
.topbar h1 { margin: 0; }
.inline { display: inline; }

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  background: white;
}
textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9rem; }
label { display: block; font-weight: 600; margin-top: 0.5rem; }
label.radio { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
label.radio input { width: auto; margin: 0; }

button, .btn-link {
  background: var(--green);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
button:hover { background: var(--green-dark); }
button.primary { background: var(--pink); }
button.primary:hover { background: #b3155f; }
.btn-link { background: transparent; color: var(--pink); padding: 0.25rem 0.5rem; }
.btn-link:hover { background: rgba(216, 27, 115, 0.1); }
.btn-link.danger { color: var(--danger); }
.btn-sm {
  display: inline-block; padding: 0.25rem 0.6rem; font-size: 0.85rem;
  background: #f0ede5; color: var(--ink); border-radius: 4px;
}
.btn-sm:hover { background: var(--green); color: white; text-decoration: none; }

table.codes {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
table.codes th, table.codes td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.codes th { background: #f5f2eb; font-weight: 600; color: var(--green-dark); }
table.codes tr:last-child td { border-bottom: none; }
.code { font-family: ui-monospace, monospace; font-weight: 700; color: var(--green-dark); }
.code-big { font-family: ui-monospace, monospace; color: var(--pink); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eee;
  color: #555;
}
.badge.type-image { background: #fde6f1; color: var(--pink); }
.badge.type-video { background: #e8f5ec; color: var(--green); }
.badge.type-text { background: #fff4d6; color: #8a5d00; }
.badge.type-placeholder { background: #eee; color: #888; }

.thumb {
  max-width: 80px; max-height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.fullscreen-image {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: var(--bg);
}
.fullscreen-image img {
  max-width: 100%;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.fullscreen-video {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  padding: 0;
}
.fullscreen-video video {
  max-width: 100%;
  max-height: 100vh;
  width: auto;
  height: auto;
}

.clue {
  font-size: 1.15rem;
  line-height: 1.6;
}
.clue p { margin: 0 0 1rem 0; }

ul.uploads { list-style: none; padding: 0; }
ul.uploads li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem; background: white; border: 1px solid var(--line);
  border-radius: 6px; margin-bottom: 0.4rem;
}

@media (max-width: 600px) {
  table.codes th:nth-child(4), table.codes td:nth-child(4) { display: none; }
  .topbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  h1 { font-size: 1.3rem; }
}
