/* -----------------------------------------------------------------------
   Base
----------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #1a1a2e url("/images/bg.png") no-repeat top left;
  color: #e0e0e0;
}

a { color: #7ec8e3; }

/* -----------------------------------------------------------------------
   Navigation bar
----------------------------------------------------------------------- */
nav {
  background: rgba(0,0,0,0.6);
  padding: 6px 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.flash.notice { color: #4caf50; padding: 6px 12px; background: rgba(0,80,0,0.4); }
.flash.alert  { color: #f44336; padding: 6px 12px; background: rgba(80,0,0,0.4); }

/* -----------------------------------------------------------------------
   Game layout: status bar across top, board + sidebar
----------------------------------------------------------------------- */
#game {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 34px);
}

#status_bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.875rem;
  flex-shrink: 0;
}
#status_bar strong { color: #f5c518; }

#game-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* -----------------------------------------------------------------------
   Board: isometric absolutely-positioned sprites
----------------------------------------------------------------------- */
#board {
  flex: 1;
  position: relative;
  overflow: hidden;
  /* extra room so 255px-tall sprites don't clip */
  min-height: 600px;
}

/* Each isometric square tile — matches legacy 65×255 */
.squares {
  position: absolute;
  width: 65px;
  height: 255px;
  cursor: pointer;
}
.squares img {
  display: block;
  width: 65px;
  height: 255px;
}
.squares a { display: block; }

.halo {
  position: absolute;
  width: 65px;
  height: 255px;
  pointer-events: none;
  z-index: 5;
}
.halo img { display: block; width: 65px; height: 255px; }

/* Hover: show halo, hide on mouseout via JS */
.squares:hover + .halo { display: block !important; }

/* Player vehicle */
#avatar {
  position: absolute;
  z-index: 10;
  pointer-events: none;
}
#avatar img { display: block; }

/* Other players' vehicles */
.others {
  position: absolute;
  z-index: 9;
}

/* Property info bubble */
.bubble {
  position: absolute;
  background: rgba(10, 20, 40, 0.92);
  border: 1px solid #7ec8e3;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #e0e0e0;
  z-index: 20;
  min-width: 160px;
  pointer-events: none;
}

/* -----------------------------------------------------------------------
   Sidebar
----------------------------------------------------------------------- */
#sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.5);
  overflow-y: auto;
  border-left: 1px solid rgba(255,255,255,0.08);
}

/* Die */
#die {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.die { display: flex; justify-content: center; align-items: center; }
.die img { display: block; }
.die-value { font-size: 2.5rem; font-weight: bold; color: #f5c518; }

/* Messages */
#messages { font-size: 0.82rem; }
.game-message {
  margin: 4px 0;
  padding-left: 8px;
  border-left: 3px solid #e94560;
  line-height: 1.4;
}

/* Bot controls */
.bot-controls { display: inline-flex; }
.btn-bot, .btn-bot input[type="submit"] {
  background: #4a90d9 !important;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.875rem;
}
.btn-bot:hover, .btn-bot input[type="submit"]:hover { background: #357abd !important; }

/* Roll button */
#roll_button, button, input[type="submit"] {
  background: #e94560;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.875rem;
  transition: background 0.15s;
}
#roll_button:hover, button:hover, input[type="submit"]:hover { background: #c73652; }

/* Balance */
#balance { color: #f5c518; font-weight: bold; font-size: 1.1rem; }

/* Inventory bar */
.inventory-bar { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; }
.inventory-item {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.1);
}
.inventory-item.active { border-color: #f5c518; }
.inventory-item button { padding: 3px 10px; font-size: 0.75rem; margin-left: 6px; }

/* God message */
#god_message { font-style: italic; font-size: 0.8rem; color: #aaa; }

/* Buy panel */
@keyframes buy-pulse {
  0%, 100% { border-color: #f5c518; box-shadow: 0 0 6px rgba(245,197,24,0.4); }
  50%       { border-color: #fff;    box-shadow: 0 0 12px rgba(245,197,24,0.8); }
}
.buy-panel {
  background: rgba(245, 197, 24, 0.08);
  border: 2px solid #f5c518;
  border-radius: 4px;
  padding: 10px;
  font-size: 0.8rem;
  animation: buy-pulse 1.5s ease-in-out 3;
}
.buy-panel h3 { color: #f5c518; margin: 0 0 6px; font-size: 0.95rem; }
.buy-panel p  { margin: 0 0 8px; color: #aaa; }
.property-option {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  margin-bottom: 6px;
  background: rgba(0,0,0,0.3);
}
.property-option summary {
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.property-option summary::-webkit-details-marker { display: none; }
.property-option[open] summary { border-bottom: 1px solid rgba(255,255,255,0.1); }
.property-option form { padding: 8px 10px; }
.property-option select { width: 100%; margin: 4px 0 8px; }

/* -----------------------------------------------------------------------
   Generic pages (instances, deeds, etc.)
----------------------------------------------------------------------- */
.page { max-width: 900px; margin: 20px auto; padding: 16px; background: rgba(0,0,0,0.55); border-radius: 4px; }
h1, h2 { color: #7ec8e3; }

/* Auth forms (login, join, password reset) */
.auth-page { max-width: 400px; margin: 40px auto; padding: 24px; background: rgba(0,0,0,0.55); border-radius: 4px; }
.auth-page input[type="email"],
.auth-page input[type="password"],
.auth-page input[type="text"] { width: 100%; max-width: 300px; }

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 4px; font-size: 0.85rem; color: #aaa; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea, select {
  background: #16213e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  padding: 7px 10px;
  border-radius: 4px;
  width: 100%;
  font-size: 0.9rem;
}

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #0f3460; font-size: 0.85rem; }
th { color: #7ec8e3; font-weight: 600; }

ul { list-style: none; padding: 0; }
ul li { padding: 6px 0; border-bottom: 1px solid #0f3460; }

/* Deed detail page */
.deed-stats { width: auto; margin-bottom: 20px; }
.deed-stats th { color: #aaa; font-weight: normal; padding-right: 24px; }
.deed-stats td { color: #e0e0e0; }
.narrow-form input[type="text"],
.narrow-form select { width: auto; }
.narrow-form { margin-bottom: 20px; }

/* -----------------------------------------------------------------------
   Landing page — 20th Anniversary
----------------------------------------------------------------------- */
.landing { position: relative; }

/* Hero */
.landing-hero {
  min-height: calc(100vh - 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 30, 0.65);
  z-index: 0;
}
.landing-hero > * { position: relative; z-index: 1; }

/* Anniversary badge */
.landing-badge {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f5c518;
  padding: 6px 18px;
  border: 1px solid rgba(245,197,24,0.45);
  border-radius: 20px;
  background: rgba(245,197,24,0.07);
  margin-bottom: 24px;
  animation: badge-pulse 2.8s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 6px rgba(245,197,24,0.2); border-color: rgba(245,197,24,0.45); }
  50%      { box-shadow: 0 0 18px rgba(245,197,24,0.5); border-color: rgba(245,197,24,0.85); }
}

/* Main logo */
.landing-logo {
  font-size: clamp(3.5rem, 15vw, 11rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #7ec8e3;
  margin: 0;
  line-height: 1;
  animation: logo-glow 3s ease-in-out infinite alternate;
}
@keyframes logo-glow {
  from { text-shadow: 0 0 20px rgba(126,200,227,0.4), 0 0 50px rgba(126,200,227,0.2); }
  to   { text-shadow: 0 0 50px rgba(126,200,227,0.9), 0 0 100px rgba(126,200,227,0.5), 0 0 160px rgba(126,200,227,0.2); }
}

.landing-sub {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: #d0d0d0;
  margin: 20px 0 6px;
  letter-spacing: 0.06em;
}
.landing-years {
  font-size: 0.85rem;
  color: rgba(126,200,227,0.6);
  letter-spacing: 0.25em;
  margin-bottom: 36px;
}

/* CTA buttons */
.landing-cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.btn-landing-primary {
  background: #e94560;
  color: #fff;
  padding: 13px 30px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  letter-spacing: 0.03em;
  display: inline-block;
  transition: background 0.15s, transform 0.15s;
}
.btn-landing-primary:hover { background: #c73652; transform: translateY(-2px); color: #fff; }
.btn-landing-primary.btn-large { padding: 16px 40px; font-size: 1.1rem; }

.btn-landing-secondary {
  color: #7ec8e3;
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid rgba(126,200,227,0.3);
  padding: 13px 22px;
  border-radius: 4px;
  display: inline-block;
  transition: border-color 0.15s, background 0.15s;
}
.btn-landing-secondary:hover { border-color: #7ec8e3; background: rgba(126,200,227,0.06); color: #7ec8e3; }

/* Content sections */
.landing-section { padding: 64px 20px; }

.landing-content {
  max-width: 820px;
  margin: 0 auto;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 40px 48px;
}
.landing-content h2 { color: #7ec8e3; margin-top: 0; font-size: 1.4rem; }
.landing-content p  { color: #b8b8c8; line-height: 1.75; margin-bottom: 0.75rem; }
.landing-content p:last-child { margin-bottom: 0; }

/* Timeline */
.landing-timeline {
  display: flex;
  align-items: flex-start;
  margin-top: 32px;
  gap: 0;
}
.timeline-node { flex: 1; text-align: center; padding: 0 12px; }
.timeline-year {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 900;
  color: #f5c518;
  margin-bottom: 10px;
}
.timeline-node p { font-size: 0.82rem; color: #999; line-height: 1.5; margin: 0; }
.timeline-connector { flex-shrink: 0; display: flex; align-items: flex-start; padding-top: 22px; }
.timeline-line {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, rgba(126,200,227,0.15), rgba(126,200,227,0.5), rgba(126,200,227,0.15));
}

/* Features grid */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.landing-feature {
  text-align: center;
  padding: 24px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  transition: border-color 0.2s;
}
.landing-feature:hover { border-color: rgba(126,200,227,0.3); }
.feature-icon   { font-size: 2rem; margin-bottom: 12px; }
.landing-feature h3 { color: #7ec8e3; margin: 0 0 8px; font-size: 0.95rem; font-weight: 600; }
.landing-feature p  { font-size: 0.82rem; color: #888; margin: 0; line-height: 1.55; }

/* Final CTA section */
.landing-final {
  text-align: center;
  padding: 80px 20px 100px;
  background: rgba(0,0,0,0.3);
}
.landing-final-quote {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: rgba(224,224,224,0.75);
  font-style: italic;
  letter-spacing: 0.03em;
  margin-bottom: 36px;
}

/* Music toggle button */
.music-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(10,15,35,0.85);
  border: 1px solid rgba(126,200,227,0.25);
  color: #7ec8e3;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  z-index: 200;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(4px);
}
.music-btn:hover  { border-color: #7ec8e3; background: rgba(10,15,35,0.95); }
.music-btn.active { border-color: #7ec8e3; box-shadow: 0 0 10px rgba(126,200,227,0.3); }

@media (max-width: 640px) {
  .landing-features   { grid-template-columns: 1fr; }
  .landing-timeline   { flex-direction: column; align-items: center; gap: 24px; }
  .timeline-connector { display: none; }
  .landing-content    { padding: 28px 20px; }
}
