#game-shell { position: relative; width: 100%; height: 100%; min-width: 1100px; min-height: 650px; overflow: hidden; background: #82937a; }

#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

#world-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(15, 25, 20, .28);
  transition: background-color 1.4s ease;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
}

.screen.active { display: flex; }

.panel-screen { align-items: center; justify-content: center; padding: 28px; background: rgba(18, 27, 23, .68); }

.panel-sheet {
  position: relative;
  width: min(1280px, calc(100vw - 56px));
  height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(23,34,30,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(23,34,30,.035) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid rgba(255,255,255,.38);
  box-shadow: 14px 18px 0 rgba(12,18,15,.35), 0 28px 80px rgba(8,12,10,.42);
}

.compact-sheet { width: min(780px, calc(100vw - 80px)); height: auto; max-height: calc(100vh - 80px); padding-bottom: 22px; }

.wide-sheet { width: min(1040px, calc(100vw - 80px)); }

.sheet-header {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 22px;
  padding: 18px 24px;
  border-bottom: 2px solid var(--ink);
}

.sheet-header h2 { margin: 0; font-size: clamp(28px, 3vw, 44px); line-height: .9; letter-spacing: -.055em; }

.close-button {
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 2px solid var(--ink);
  background: transparent;
  font-size: 28px;
  line-height: 1;
  transition: color .15s ease, background .15s ease, transform .1s ease;
}

.close-button:hover { color: var(--paper-light); background: var(--ink); }
.close-button:active { transform: translateY(2px); }

.header-balance { margin-left: auto; padding-right: 14px; text-align: right; }
.header-balance span { display: block; color: var(--muted-ink); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.header-balance strong { font-size: 24px; }

.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 0; }

.line-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .16s ease, color .16s ease;
}

.line-button:hover, .line-button.active { color: var(--paper-light); background: var(--ink); }

.paper-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  font-weight: 850;
  text-align: left;
  transition: color .18s ease, transform .1s ease;
}

.paper-button::before { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--ink); transform: translateX(-102%); transition: transform .2s ease; }
.paper-button > * { position: relative; z-index: 1; }
.paper-button:hover { color: var(--paper-light); }
.paper-button:hover::before { transform: translateX(0); }
.paper-button:active { transform: translateY(2px); }
.paper-button.danger:hover::before { background: #8d3028; }
