@import url('https://fonts.googleapis.com/css2?family=Alegreya:wght@500;700;800&family=Alegreya+Sans:wght@400;500;700&display=swap');

:root {
  --sea-1: #0c3443;
  --sea-2: #1a5867;
  --sea-3: #2c7d89;
  --card: #f7ecd3;
  --card-2: #efdfbb;
  --line: #d4ba86;
  --line-strong: #b8955a;
  --ink: #3a2817;
  --muted: #7b6142;
  --accent: #a8432a;
  --accent-2: #87321c;
  --accent-ink: #fff8ea;
  --ok: #4c7a35;
  --gold: #e0b44a;
  --shadow: 0 12px 32px rgba(4, 24, 32, .38), 0 2px 6px rgba(4, 24, 32, .25);
  --font-head: 'Alegreya', Georgia, serif;
  --font-body: 'Alegreya Sans', system-ui, sans-serif;

  --grove: #4f8a3c;
  --rocks: #8e8b85;
  --shoal: #5aaed3;
  --saltflat: #ece2c6;
  --mine: #c07a3e;
  --volcano: #5a2d2a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font: 17px/1.5 var(--font-body);
  color: var(--ink);
  background-color: var(--sea-1);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='48'%3E%3Cpath d='M0 24q17.5-12 35 0t35 0 35 0 35 0' fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='2'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% -10%, var(--sea-3), var(--sea-2) 45%, var(--sea-1) 100%);
  background-attachment: fixed;
}

a { color: var(--accent); }

/* --- Шапка --- */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(6, 26, 34, .55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(224, 180, 74, .35);
  color: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}
header nav { display: flex; gap: 20px; align-items: baseline; }
header a { color: var(--card); text-decoration: none; opacity: .85; }
header a:hover { opacity: 1; }
header .logo {
  font: 800 26px/1 var(--font-head);
  color: var(--gold);
  opacity: 1;
  letter-spacing: .5px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
header .user { display: flex; gap: 14px; align-items: center; }
header button.link { color: var(--card); }

/* --- Раскладка и карточки --- */

main { max-width: 760px; margin: 32px auto; padding: 0 16px; }
main.narrow { max-width: 400px; margin-top: 10vh; }

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .28), var(--shadow);
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; }
h1 { margin: 0 0 14px; font-size: 30px; font-weight: 800; }
h2 { margin: 0 0 12px; font-size: 21px; font-weight: 700; }
h3 { margin: 18px 0 8px; font-size: 18px; }

.hero { text-align: center; color: var(--card); margin-bottom: 18px; }
.hero .title { font: 800 46px/1 var(--font-head); color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.hero .sub { opacity: .8; margin-top: 6px; }

/* --- Формы и кнопки --- */

form { display: flex; flex-direction: column; gap: 10px; }
form.row { flex-direction: row; }
form.row input { flex: 1; min-width: 0; }

input, select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffaf0;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

button {
  font: 700 16px/1.2 var(--font-body);
  padding: 10px 18px;
  border: 1px solid var(--accent-2);
  border-radius: 10px;
  background: linear-gradient(180deg, #bf5536, var(--accent));
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--accent-2), 0 3px 8px rgba(0, 0, 0, .18);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
button:hover:not(:disabled) { filter: brightness(1.06); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--accent-2); }
button:disabled { opacity: .45; cursor: default; }
button.secondary {
  background: linear-gradient(180deg, #fffaf0, #f1e3c3);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 0 2px 0 var(--line-strong), 0 3px 8px rgba(0, 0, 0, .1);
}
button.ready {
  background: linear-gradient(180deg, #5f9443, var(--ok));
  border-color: #355a24;
  box-shadow: 0 2px 0 #355a24, 0 3px 8px rgba(0, 0, 0, .18);
}
button.link { background: none; border: 0; box-shadow: none; color: var(--muted); padding: 0; font-weight: 500; text-decoration: underline; }

.error { color: #b3261e; min-height: 1.5em; margin: 4px 0 0; font-weight: 500; }
.muted { color: var(--muted); }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; padding: 4px; background: rgba(184, 149, 90, .2); border-radius: 12px; }
.tabs button { flex: 1; }
.tabs button.secondary { background: transparent; border-color: transparent; box-shadow: none; }

/* --- Списки --- */

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
}
ul.list li:first-child { border-top: 0; }

.badge {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(184, 149, 90, .28);
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: #d8e8cd; color: var(--ok); }

.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* --- Клетки местности (картинки) --- */

.terrain {
  --size: 64px;
  width: var(--size);
  height: calc(var(--size) * 1.1547);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  display: grid;
  place-items: center;
  flex: none;
  background-image: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), transparent 60%);
}
.terrain img { width: 62%; height: auto; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .3)); }
.terrain.grove { background-color: var(--grove); }
.terrain.rocks { background-color: var(--rocks); }
.terrain.shoal { background-color: var(--shoal); }
.terrain.saltflat { background-color: var(--saltflat); }
.terrain.mine { background-color: var(--mine); }
.terrain.volcano { background-color: var(--volcano); }

.terrain-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 12px 0; }
.terrain-item { display: flex; align-items: center; gap: 12px; }
.terrain-item b { font-family: var(--font-head); font-size: 18px; display: block; }
.terrain-item span { color: var(--muted); font-size: 15px; }

.ri { width: 26px; height: 26px; vertical-align: middle; }

@media (max-width: 520px) {
  header { padding: 10px 16px; }
  header .logo { font-size: 22px; }
  form.row { flex-direction: column; }
}
