@font-face {
  font-family: 'Minecraft';
  src: url('/fonts/Minecraft.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url('/fonts/Minecraft-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c1015;
  --panel: #151b23;
  --border: #2a3441;
  --text: #e8edf4;
  --muted: #8b98a8;
  --accent: #ffaa00;
  --mc-shadow: #3f3f3f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.page {
  width: min(1400px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.header h1 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 600;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 16px;
  font: 500 0.95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.editor:focus {
  outline: 2px solid rgba(255, 170, 0, 0.3);
  border-color: var(--accent);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hex-tool {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hex-picker {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.toolbar__actions {
  display: flex;
  gap: 8px;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font: 600 0.85rem system-ui, sans-serif;
  cursor: pointer;
  background: var(--accent);
  color: #1a1200;
}

.btn--ghost {
  background: var(--panel);
  color: var(--text);
}

.sb-stage {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #3a3a3a;
  overflow: hidden;
}

.sb-sidebar {
  position: absolute;
  top: 10px;
  left: 6px;
  right: auto;
  max-width: calc(100% - 12px);
  max-height: calc(100% - 20px);
  overflow: auto;
  padding: 6px 8px 8px;
  background: rgba(0, 0, 0, 0.35);
}

.mc-text {
  font-family: 'Minecraft', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.mc-text .mc-seg {
  text-shadow: 1px 1px 0 var(--mc-shadow);
}

.mc-text .mc-bold {
  font-weight: bold;
}

.mc-text .mc-italic {
  display: inline-block;
  transform: skewX(-14deg);
  transform-origin: left bottom;
}

.mc-text .mc-underline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.mc-text .mc-strike {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.sb-sidebar__lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.sb-sidebar__line {
  text-align: left;
  white-space: pre;
  line-height: 1.05;
}

.sb-sidebar__line--empty {
  min-height: 9px;
}
