:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #16201b;
  --muted: #5d6b64;
  --line: #dfe5e2;
  --accent: #1f9d55;
  --accent-ink: #ffffff;
  --accent-soft: #e5f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff3df;
  --bad: #c0392b;
  --bad-soft: #fdecea;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --card: #182019;
    --text: #e8efe9;
    --muted: #93a39a;
    --line: #2a352f;
    --accent: #2fb86a;
    --accent-ink: #06130b;
    --accent-soft: #163122;
    --warn: #f0b45a;
    --warn-soft: #2e2413;
    --bad: #ff7b6e;
    --bad-soft: #341a17;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 16px;
}
.brand { font-weight: 650; color: var(--text); text-decoration: none; }
.lang {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 14px;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 48px; }

h1 { font-size: 26px; line-height: 1.2; margin: 12px 0 6px; }
h2 { font-size: 18px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.back {
  display: inline-block;
  margin: 4px 0 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.back:hover { color: var(--text); }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 26px;
  font-weight: 700;
  transition: border-color .15s, transform .15s;
}
.game span { font-size: 14px; font-weight: 400; color: var(--muted); }
.game:hover { border-color: var(--accent); transform: translateY(-1px); }

.list { display: grid; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.item:hover { border-color: var(--accent); }
.item .place {
  flex: none;
  min-width: 64px;
  font-size: 13px;
  color: var(--muted);
}
.item .arrow { margin-left: auto; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.mark { font-size: 14px; color: var(--muted); white-space: nowrap; }
.mark.ok { color: var(--accent); }

.login { max-width: 420px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--muted); }
.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
}
.input:focus { border-color: var(--accent); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 8px 0 0; }

.who { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.who h1 { margin-top: 4px; }

.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.banner.ok { background: var(--accent-soft); }
.banner.warn { background: var(--warn-soft); }
.banner.bad { background: var(--bad-soft); }
.banner b { display: block; margin-bottom: 2px; }
.banner ul { margin: 6px 0 0; padding-left: 20px; }

.amount { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.words { margin: 4px 0 10px; }

.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

.example {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  margin: 4px 0 14px;
  background: #fff;
}

.drop {
  display: block;
  margin-top: 10px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.drop .muted { display: block; font-size: 13px; margin-top: 4px; }

.files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.files li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
}
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .size { color: var(--muted); white-space: nowrap; }
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}
.link.danger { color: var(--bad); }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 15px; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.saved { color: var(--accent); font-size: 14px; }

.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 10;
  cursor: zoom-out;
}
.viewer img { max-width: 100%; max-height: 100%; border-radius: 6px; }

@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .games { grid-template-columns: 1fr; }
  .game { min-height: 96px; }
  .grid3 { grid-template-columns: 1fr; }
  .amount { font-size: 26px; }
}
