:root {
  --bg: #f2f2f2;
  --panel: #ffffff;
  --text: #111111;
  --border: #d6d6d8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
}

#layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
}

#canvas-area {
  padding: 16px 24px 24px;
  background: var(--bg);
}

#canvas-header {
  position: relative;
  padding-top: 4px;
}

#hero-copy {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

#page-title {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  pointer-events: none;
}

#countdown {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  margin: 0;
  font-size: 2.05rem;
  font-weight: 700;
  color: #111111;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

#saved-canvas-link,
#pump-link,
#x-link {
  position: absolute;
  top: 6px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #111111;
  border-radius: 999px;
  line-height: 1;
}

#saved-canvas-link {
  left: 0;
  top: 56px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

#pump-link {
  right: 60px;
  padding: 11px 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

#x-link {
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
}

#x-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

#canvas-shell {
  position: relative;
  margin-top: 18px;
  height: 170vh;
  min-height: 920px;
  padding: 24px;
  background:
    linear-gradient(
      135deg,
      #6d4116 0%,
      #b7792c 14%,
      #f3d08a 26%,
      #7b4818 38%,
      #d9ad62 52%,
      #8b531d 66%,
      #f2ce86 80%,
      #6a3f14 100%
    );
  border: 1px solid #7f4d1e;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 225, 153, 0.45),
    inset 0 0 0 8px rgba(107, 63, 20, 0.55),
    inset 0 0 0 12px rgba(240, 200, 118, 0.4),
    0 16px 28px rgba(58, 35, 12, 0.28);
  overflow: hidden;
}

#canvas-shell::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(117, 68, 24, 0.66);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 230, 170, 0.52);
}

#board {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #fffef9;
  border: 1px solid #e9dec7;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.04);
  touch-action: none;
  cursor: crosshair;
}

#toolbar {
  background: var(--panel);
  border-left: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 14px 8px;
  gap: 12px;
}

#pencil-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

#color-label {
  margin: 0;
  font-size: 0.7rem;
  color: #444444;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 1;
}

#colors {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 10px;
}

.color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #c7c7cc;
  background: var(--c);
  cursor: pointer;
}

.color.active {
  transform: scale(1.06);
  border-color: #111111;
  box-shadow: none;
}

#project-description {
  margin: 12px auto 0;
  max-width: 720px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #3f3f46;
}

#coin-address {
  margin: 10px auto 0;
  max-width: 720px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 8px 6px 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #111111;
}

#coin-address-label {
  font-weight: 800;
}

#coin-address-value {
  font-family: "Menlo", "SF Mono", "Consolas", monospace;
  font-weight: 600;
  font-size: 0.88rem;
}

#coin-copy-button {
  border: 1px solid #c8c8cc;
  background: #ffffff;
  color: #111111;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

#coin-copy-button.is-copied {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

@media (max-width: 760px) {
  #layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  #canvas-area {
    min-height: 0;
    padding: 12px;
  }

  #hero-copy {
    max-width: 92%;
  }

  #page-title {
    font-size: 2rem;
  }

  #countdown {
    top: 0;
    left: 0;
    font-size: 1.55rem;
  }

  #saved-canvas-link {
    top: 44px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  #x-link {
    right: 0;
    width: 34px;
    height: 34px;
  }

  #pump-link {
    right: 44px;
    padding: 10px 10px;
    font-size: 0.7rem;
  }

  #canvas-shell {
    margin-top: 12px;
    height: 135vh;
    min-height: 700px;
    padding: 16px;
  }

  #toolbar {
    border-left: 0;
    border-top: 1px solid var(--border);
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 10px;
  }

  #colors {
    grid-template-columns: repeat(8, 30px);
  }

  #project-description {
    font-size: 0.92rem;
  }

  #coin-address {
    font-size: 0.84rem;
    padding: 6px 8px 6px 10px;
    gap: 6px;
  }

  #coin-address-value {
    font-size: 0.8rem;
  }

  #coin-copy-button {
    padding: 6px 9px;
    font-size: 0.74rem;
  }
}
