/*
 * style.css — Fairyland Online web client theme.
 *
 * Evokes the original game's whimsical cartoon look: a warm parchment/green-map
 * backdrop with wood-and-brass panels and a playful serif display face. Colors
 * are tuned to stay readable on a dark fantasy palette.
 */
:root {
  --bg:        #1a1410;          /* deep umber backdrop */
  --bg-grad-a: #243018;          /* forest green */
  --bg-grad-b: #1a1410;          /* umber */
  --panel:     #2c2017;          /* aged wood / leather */
  --panel-2:   #3a2a1d;          /* lighter wood inset */
  --parchment: #e8d8b0;          /* scroll/parchment text on dark */
  --text:      #f4e8c8;          /* warm cream body text */
  --muted:     #b8a888;          /* faded ink */
  --accent:    #d9a441;          /* brass / gold */
  --accent-2:  #6fa86f;          /* fairy green */
  --ok:        #7ec47e;
  --bad:       #e06848;
  --border:    #5a4230;          /* dark wood trim */
  --border-2:  #8a6a44;          /* brass edge */
  font-family: "Georgia", "Palatino Linotype", "Book Antiqua", serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(111,168,111,0.18), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(217,164,65,0.10), transparent 55%),
    linear-gradient(160deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 60%);
  color: var(--text);
  padding: 2rem 1.5rem 3rem;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
}
header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.9rem;
  color: var(--parchment);
  text-shadow: 0 2px 0 #000a, 0 0 18px rgba(217,164,65,0.35);
  letter-spacing: 0.5px;
}
header h1 .sub {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
}
header { text-align: center; margin-bottom: 1.5rem; }

/* wood-and-brass panel */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 40%),
    var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.35),
    inset 0 0 24px rgba(0,0,0,0.4),
    0 4px 0 #1a1008, 0 8px 20px rgba(0,0,0,0.5);
}
.card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-variant: small-caps;
  letter-spacing: 1px;
  border-bottom: 1px dotted var(--border-2);
  padding-bottom: 0.35rem;
}
.card h2 .muted { font-size: 0.8rem; font-style: italic; }

label {
  display: block;
  margin: 0.6rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}
input[type=text], input[type=password] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  background: #160f0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.6);
}
input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 1px 4px rgba(0,0,0,0.6), 0 0 0 2px rgba(217,164,65,0.3); }

button {
  margin-top: 0.85rem;
  padding: 0.6rem 1.3rem;
  background: linear-gradient(180deg, var(--accent) 0%, #b8842f 100%);
  color: #1a1008;
  border: 1px solid #6a4a1f;
  border-radius: 8px;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
  box-shadow: 0 3px 0 #4a3210, 0 5px 10px rgba(0,0,0,0.4);
  transition: transform 0.05s, filter 0.1s;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #4a3210, 0 2px 6px rgba(0,0,0,0.4); }
button:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.5); }
button.ghost {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border-2);
  text-shadow: none;
  box-shadow: 0 2px 0 #1a1008;
}

.muted { color: var(--muted); }
a { color: var(--accent-2); }
a:hover { color: var(--accent); }
code {
  background: #160f0a;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid var(--border);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  font-size: 0.8rem;
  font-family: ui-monospace, "Courier New", monospace;
}
.badge.ok, .badge.live { color: var(--ok); border-color: var(--ok); }
.badge.bad { color: var(--bad); border-color: var(--bad); }

.stat-grid { display:grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; font-size:0.9rem; }
.stat-grid b { color: var(--accent); font-family: ui-monospace, "Courier New", monospace; }
.game-log { font-family: ui-monospace, "Courier New", monospace; font-size: 0.78rem; }

pre#log {
  background: #0d0805;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  max-height: 260px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0;
  color: #d8c8a0;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 6px rgba(0,0,0,0.7);
}

/* game canvas: ornate frame */
#game-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: #0a0e14;
  border: 3px solid var(--border-2);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #000, 0 4px 14px rgba(0,0,0,0.6);
  cursor: crosshair;
  image-rendering: pixelated;
}

/* small decorative flourish under the header */
header::after {
  content: "✦  ⋆  ✦";
  display: block;
  color: var(--accent);
  letter-spacing: 1.5rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  opacity: 0.7;
}
