:root {
  --bg: #090706;
  --bg-soft: rgba(20, 14, 12, 0.94);
  --panel: rgba(18, 13, 12, 0.96);
  --panel-strong: rgba(10, 8, 8, 0.98);
  --border: rgba(179, 132, 73, 0.32);
  --border-strong: rgba(221, 177, 106, 0.55);
  --text: #eadfcb;
  --muted: #bca98b;
  --accent: #c99a54;
  --accent-strong: #8e3f26;
  --success: #92d38a;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(111, 57, 23, 0.16), transparent 36%),
    radial-gradient(circle at 85% 8%, rgba(129, 110, 54, 0.09), transparent 28%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.012) 0, rgba(255, 255, 255, 0.012) 1px, transparent 1px, transparent 4px),
    linear-gradient(180deg, #120d0c 0%, #080607 100%);
  color: var(--text);
  font: 13px/1.35 Tahoma, Verdana, Arial, sans-serif;
}

body,
td,
th,
input,
select,
textarea,
button {
  color: var(--text);
  font-size: 14px;
}

a {
  color: #f1ce92;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: #fff3d3;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  margin: 24px 0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

td,
th {
  padding: 5px 7px;
  border: 1px solid rgba(147, 109, 62, 0.22);
  background: rgba(13, 10, 10, 0.88);
  vertical-align: top;
}

th {
  background: linear-gradient(180deg, rgba(66, 28, 20, 0.9), rgba(28, 14, 12, 0.96));
  color: #fff2dd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

form {
  margin: 0;
}

input.text,
.textbox,
select,
textarea {
  width: auto;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  background: rgba(255, 243, 225, 0.03);
  color: var(--text);
  padding: 4px 6px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input.text:focus,
.textbox:focus,
select:focus,
textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(242, 183, 87, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

button,
input.button,
input.borderbutton,
input.noborderbutton,
.pill-link {
  display: inline-block;
  min-height: 0;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid rgba(157, 116, 66, 0.35);
  background: linear-gradient(180deg, rgba(91, 51, 28, 0.45), rgba(43, 24, 17, 0.92));
  color: #fff8ef;
  font-weight: 400;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 235, 205, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease;
}

button:hover,
input.button:hover,
input.borderbutton:hover,
input.noborderbutton:hover,
.pill-link:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(122, 66, 35, 0.55), rgba(55, 29, 18, 0.95));
}

input.noborderbutton {
  width: auto;
}

iframe {
  width: 100%;
  border: 1px solid rgba(157, 116, 66, 0.34);
  border-radius: 2px;
  background: #050405;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 201, 0.03);
}

p {
  margin: 0;
}

.a {
  color: inherit;
}

.table,
#table,
#tip {
  background: transparent;
}

.page-shell,
.dashboard-shell {
  width: min(1180px, calc(100% - 20px));
  margin: 0 auto 14px;
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(73, 39, 23, 0.14), transparent 20%),
    linear-gradient(180deg, rgba(18, 13, 12, 0.97), rgba(8, 7, 8, 0.98));
  border: 1px solid rgba(157, 116, 66, 0.36);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 229, 183, 0.04), 0 10px 24px rgba(0, 0, 0, 0.22);
  padding: 10px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(112, 80, 46, 0.2);
  pointer-events: none;
}

.hero-banner {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 10px 0;
  border: 1px solid rgba(157, 116, 66, 0.42);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(87, 43, 20, 0.18), transparent 22%),
    rgba(9, 7, 8, 0.97);
}

.hero-brand {
  text-align: center;
}

.hero-brand img {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3));
}

.hero-copy {
  flex: 1 1 360px;
  text-align: left;
}

.hero-copy h1,
.status-copy h2,
.panel h2,
.panel h3 {
  margin: 0;
  color: #fff8ee;
}

.hero-copy h1 {
  font-size: 22px;
  line-height: 1.05;
}

.hero-copy p + p,
.panel p + p {
  margin-top: 6px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.subtle {
  color: var(--muted);
}

.hero-links,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.auth-layout,
.auth-grid,
.dashboard-layout {
  display: grid;
  gap: 10px;
}

.auth-layout {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(200px, 230px);
  align-items: start;
}

.auth-grid {
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  margin-top: 10px;
}

.auth-card form {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-actions,
.utility-list {
  display: grid;
  gap: 6px;
}

.error-banner,
.notice-card,
.referral-box {
  border-radius: 8px;
  padding: 8px 10px;
}

.error-banner {
  background: rgba(132, 29, 29, 0.35);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffe9e9;
}

.notice-card {
  background: rgba(131, 79, 32, 0.22);
  border: 1px solid rgba(242, 183, 87, 0.25);
  color: #ffe8be;
}

.referral-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff0cf;
  word-break: break-all;
}

.status-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.status-copy {
  flex: 1 1 340px;
  text-align: left;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  flex: 1 1 360px;
}

.stat-chip {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-chip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dashboard-layout {
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  align-items: start;
}

.game-shell-layout {
  display: grid;
  grid-template-columns: minmax(205px, 226px) minmax(0, 1fr) minmax(238px, 262px);
  gap: 12px;
  align-items: start;
}

.menu-panel {
  position: sticky;
  top: 8px;
  overflow: visible;
}

.waystone-panel {
  margin-top: 28px;
}

.war-table-panel {
  min-width: 0;
}

.scribe-panel {
  margin-top: 52px;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 8px;
}

.menu-button {
  width: 100%;
  display: block;
  text-align: left;
  padding: 7px 8px 7px 12px;
  border-radius: 0;
  border: 1px solid rgba(157, 116, 66, 0.24);
  border-left: 4px solid rgba(121, 78, 37, 0.85);
  background: linear-gradient(90deg, rgba(54, 31, 22, 0.88), rgba(17, 12, 11, 0.96));
  color: #f0debf;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.menu-button:hover {
  border-color: var(--border-strong);
  background: linear-gradient(90deg, rgba(78, 42, 25, 0.95), rgba(20, 13, 11, 0.98));
}

.menu-button.active-panel {
  border-color: rgba(223, 178, 96, 0.45);
  border-left-color: #d4ad63;
  background: linear-gradient(90deg, rgba(100, 54, 27, 0.97), rgba(28, 16, 12, 0.98));
}

.menu-button::before,
.menu-button::after {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.menu-button::before {
  content: "";
  top: 50%;
  left: calc(100% + 3px);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid rgba(10, 12, 18, 0.98);
  transform: translateY(-50%);
}

.menu-button::after {
  content: attr(data-desc);
  top: 50%;
  left: calc(100% + 9px);
  width: 190px;
  padding: 7px 8px;
  border: 1px solid rgba(199, 156, 92, 0.3);
  border-radius: 2px;
  background: rgba(18, 12, 10, 0.98);
  color: #ead9bc;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  transform: translateY(-50%) translateX(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.menu-button:hover::before,
.menu-button:hover::after,
.menu-button:focus::before,
.menu-button:focus::after,
.menu-button.active-tip::before,
.menu-button.active-tip::after {
  opacity: 1;
  visibility: visible;
}

.menu-button:hover::after,
.menu-button:focus::after,
.menu-button.active-tip::after {
  transform: translateY(-50%) translateX(0);
}

.menu-button strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.frame-panel {
  display: grid;
  gap: 10px;
}

.frame-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(157, 116, 66, 0.24);
}

.desc-panel {
  min-height: 70px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-shell iframe {
  min-height: 380px;
}

.game-stage iframe,
.chat-panel iframe {
  display: block;
}

.game-stage {
  min-width: 0;
}

.game-stage iframe {
  min-height: 500px;
}

.chat-panel iframe {
  min-height: 420px;
}

.menu-footnote {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.4;
}

.site-footer {
  width: min(1180px, calc(100% - 20px));
  margin: 4px auto 12px;
  padding: 4px 0 10px;
  color: #9f8b6d;
  text-align: center;
}

.compact-banner {
  flex-direction: column;
}

.compact-brand,
.compact-links {
  width: 100%;
  text-align: center;
}

.compact-links {
  justify-content: center;
  margin-top: 2px;
}

.compact-topbar {
  margin-bottom: 10px;
}

.compact-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.player-title {
  display: block;
  font-size: 15px;
  color: #fff5df;
}

.compact-statline,
.compact-referral {
  margin-top: 4px;
  line-height: 1.5;
}

.referral-inline {
  color: #fff1d1;
}

.compact-actions {
  flex-shrink: 0;
}

.compact-section-header h3 {
  font-size: 14px;
}

.player-header {
  grid-template-columns: minmax(182px, 228px) minmax(340px, 1fr) minmax(220px, 264px);
}

.hero-brand-center {
  min-width: 0;
}

.hero-side {
  min-width: 0;
}

.hero-side-card {
  display: grid;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid rgba(157, 116, 66, 0.28);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(44, 27, 19, 0.55), rgba(15, 11, 10, 0.72));
}

.hero-side-card-left {
  margin-top: 14px;
}

.hero-side-card-right {
  margin-top: 30px;
}

.hero-side-title {
  color: #fff7e6;
  font-size: 15px;
  font-weight: 700;
}

.hero-side-line {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.hero-bars-card {
  gap: 6px;
}

.status-bar-row {
  display: grid;
  gap: 3px;
}

.status-bar-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f6eddd;
  font-size: 11px;
}

.status-bar-copy span {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 248, 235, 0.05);
  border: 1px solid rgba(173, 132, 76, 0.18);
}

.status-bar-track em {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.status-bar-track.hp em {
  background: linear-gradient(90deg, #5f1718, #b33b34);
}

.status-bar-track.mp em {
  background: linear-gradient(90deg, #213e5b, #4a7399);
}

.status-bar-track.xp em {
  background: linear-gradient(90deg, #6b4a18, #bc9443);
}

.chat-embed-shell {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.chat-embed-top {
  display: grid;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(157, 116, 66, 0.2);
}

.chat-utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
}

.chat-utility-links a {
  padding: 2px 6px;
  border: 1px solid rgba(157, 116, 66, 0.28);
  background: rgba(67, 41, 25, 0.28);
}

.chat-utility-links a:hover {
  background: rgba(98, 59, 34, 0.38);
}

.chat-compose {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.chat-compose-input {
  width: 100%;
}

.chat-compose select {
  min-width: 0;
}

.chat-log-shell {
  padding: 6px;
  border: 1px solid rgba(157, 116, 66, 0.24);
  background: rgba(9, 8, 10, 0.8);
}

.chat-log-frame {
  width: 100%;
  min-height: 302px;
}

.chat-notice {
  padding: 6px 8px;
}

.chat-log-body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(42, 29, 21, 0.22), transparent 22%),
    #090709;
}

.chat-log {
  display: grid;
  gap: 4px;
  padding: 6px;
}

.chat-entry {
  padding: 5px 6px;
  border: 1px solid rgba(157, 116, 66, 0.18);
  background: rgba(20, 12, 12, 0.78);
  color: #eadfcf;
  line-height: 1.35;
}

.chat-entry:nth-child(2n) {
  background: rgba(14, 10, 10, 0.9);
}

.chat-entry,
.chat-entry * {
  font-family: Tahoma, Verdana, Arial, sans-serif !important;
}

.chat-entry a {
  color: #f1cb85;
}

.chat-entry img {
  max-height: 16px;
  vertical-align: middle;
}

.chat-entry p + p {
  margin-top: 2px;
}

@media (max-width: 960px) {
  .auth-layout,
  .auth-grid,
  .dashboard-layout,
  .game-shell-layout,
  .player-header {
    grid-template-columns: 1fr;
  }

  .menu-panel {
    position: static;
  }

  .waystone-panel,
  .scribe-panel,
  .hero-side-card-left,
  .hero-side-card-right {
    margin-top: 0;
  }

  .menu-button::before {
    top: auto;
    bottom: calc(100% + 3px);
    left: 14px;
    border-top: 6px solid rgba(10, 12, 18, 0.98);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    border-bottom: 0;
    transform: none;
  }

  .menu-button::after {
    top: auto;
    bottom: calc(100% + 9px);
    left: 0;
    width: min(220px, 100%);
    transform: translateY(0);
  }

  .page-shell,
  .dashboard-shell,
  .site-footer {
    width: min(1180px, calc(100% - 12px));
  }

  .hero-banner,
  .panel {
    padding: 8px;
  }

  .compact-topline {
    flex-direction: column;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }
}